Skip to content

Qwen3.8-Flash-Next Hallucinates. I Fixed It With One Sparse Attention Setting

Review of Qwen 3.8 Flash Next model focusing on sparse attention, hallucination issues, and a fix using attention window adjustment.

Ask about this video. Answers come from its transcript only — with the timestamp, so you can check them.

Generated from the transcript and can be wrong — check the timestamp.

Key Takeaways

  • Qwen 3.8 Flash Next is a fast, efficient model with strong coding capabilities.
  • Sparse attention improves speed but can lead to hallucinations in tasks requiring large context.
  • Hallucination issues were identified during cybersecurity benchmarks with real-world data.
  • Increasing the sparse attention window size can mitigate hallucinations effectively.
  • The Pi Golx benchmark is no longer sufficient to differentiate current top models.

What the video covers

  • Introduction to Qwen 3.8 Flash Next, a mixture of experts model with new Qwen 4 architecture and sparse attention.
  • Explanation of the N-gram mechanism allowing efficient token referencing without heavy computation.
  • Model fits in 96 GB VRAM with N-gram parameters offloaded to system RAM.
  • Discussion of the Pi Golx coding benchmark, which is now saturated due to improved model capabilities.
  • Qwen 3.8 Flash Next outperforms Qwen 3.8 27B in speed and coding accuracy.
  • Highlight of hallucination problems during a cybersecurity capture-the-flag challenge using Splunk data queries.
  • Sparse attention mechanism compresses context but can cause hallucinations in complex tasks like cybersecurity.
  • Comparison with DeepSeek V4 Flash showing high false positive rates possibly linked to sparse attention.
  • Explanation of sparse attention benefits: maintaining token generation speed even with large context windows.
  • Solution proposed: increasing the sparse attention window size from 2048 to 4096 tokens to reduce hallucinations.

Answers

Questions about this video

What is sparse attention and why does it cause hallucinations?

Sparse attention compresses the context window by focusing only on important tokens, which improves speed but can cause the model to miss critical information, leading to hallucinations in complex tasks.

How does the N-gram mechanism help the Qwen 3.8 Flash Next model?

N-gram acts like a lookup table for commonly used tokens, allowing the model to reference them efficiently without heavy computation, enabling it to fit in smaller VRAM while maintaining performance.

What solution was proposed to reduce hallucinations in Qwen 3.8 Flash Next?

The solution involves increasing the sparse attention window size from 2048 to 4096 tokens, allowing the model to consider a larger context and thereby reducing hallucination rates.

Full Transcript — Download SRT & Markdown

00:01
Speaker A
Hey everyone. Today, we are going to be talking about Qwen 3.8 Flash Next. Next Flash?
00:10
Speaker A
Okay, Flash Next. It just dropped today. It is a mixture of expert model using their new Qwen 4 architecture, which includes a sparse attention mechanism, as well as a new thing called N-gram.
00:27
Speaker A
And we're going to talk about it all. Fair warning, I'm going to try and keep it simple, but I do want to go a little bit more into the weeds, specifically talking about sparse attention and hallucinations.
00:38
Speaker A
But if you just want the headline, this model is fast and it's an amazing coder.
00:44
Speaker A
We've seen so many amazing releases today. We saw GLM 5.3 Flash. And frankly, the personal benchmark I use, the Pi Golx engine, has become so saturated that I'm going to have to retire it and come up with something
00:57
Speaker A
new. It has served me well, but at this point, it is just too easy for the current gen of models.
01:05
Speaker A
And you're definitely going to want to stick around because I solved this model's hallucination problems.
01:13
Speaker A
I'm Eric. I work in Big Tech, former Google, former FireEye Mandiant, and I have a huge passion for AI, especially open weights and open source.
01:23
Speaker A
Let's jump right in. Everything will be linked in the description down below, including the model card.
01:32
Speaker A
Now, the headlines here, besides being a mixture of experts model, is a new architecture that uses something called N-gram.
01:41
Speaker A
And this can live in system RAM because it does not require heavy computations. You can think of N-gram as a lookup table or a cheat sheet of commonly used tokens that the model can reference at any time without computational craziness.
01:58
Speaker A
The exciting thing is, despite its size, thanks to N-gram and a quantization of the model itself, you can fit this in 96 GB of VRAM with the N-gram parameters offloaded to RAM.
02:13
Speaker A
But, big dog Luke himself pushed this quant, pushed this checkpoint that when you look at the total size of 110 GB with N-gram on RAM, again, this will fit on 96 GB of VRAM.
02:27
Speaker A
Very exciting. It's not quite ready yet, but I'm looking forward to running this on my 3090 server.
02:33
Speaker A
Stick around and I'll talk about hallucinations with this model and how I solved them, but first, my Pi goal extension benchmark.
02:42
Speaker A
If you're new here, this has been a long-running benchmark of mine where I had Claude Fable create a really comprehensive plan for a Pi coding harness extension for a {slash} goal command.
02:55
Speaker A
It is a really long, comprehensive, detailed, thorough plan which a model and harness have to implement, and then it's graded by a mix of deterministic checks, static code analysis, and LLM AI as judge.
03:10
Speaker A
This has served me well for a really long time because it was a good representation of my day-to-day work.
03:16
Speaker A
And up until a few months ago, models were not that great at completing what should have been an easy task, just go ahead and like finish a plan.
03:25
Speaker A
As you're going to see, I have to retire this benchmark. It is saturated, and it's not because of bench maxing, it's because these models have gotten so good at coding and verifying their work and making sure the plan is
03:38
Speaker A
implemented that yeah, look at this. GLM 5.3, Qwen 3.8 next, Qwen 3.8 27B, high 3, DeepSeek V4 flash, GLM 5.2. At this point, the only thing I'll use this benchmark for is to rule a model out, but it's no longer useful to
04:00
Speaker A
compare models because it's just too close. Now, the headline here, of course, Qwen 3.8 next Flash Flash next. I don't know, I'll get it. But, yeah, it scored higher than Qwen 3.8 27B and it was faster as well.
04:18
Speaker A
This had me very, very excited. Unfortunately, that excitement faded real quick. We are going to go over here to the Splunk cybersecurity capture-the-flag challenge I like to give.
04:36
Speaker A
This is not just a test of a model's agentic capabilities, but to see if it's going to hallucinate because the answer is not actually in the data. It can query a Splunk database, go back and forth over and over analyzing and
04:49
Speaker A
writing more queries, but it eventually needs to come to the conclusion that there is a pointer to the data, a web link in GitHub, but it cannot actually access it. So, it needs to tell me about that link, but it needs
05:02
Speaker A
to admit it doesn't know the answer. So, when a model hallucinates here, I cannot trust it for some of my use cases, especially as a cybersecurity professional.
05:14
Speaker A
And here is where we ran into problems. Two runs completely hallucinated different answers both times.
05:25
Speaker A
This is the same thing that happened with DeepSeek-V4-Flash, and it had me really, really disappointed.
05:33
Speaker A
Artificial analysis benchmark shows DeepSeek-V4-Flash having one of the highest hallucination rates out there, but rather than show that again, I want to show you a cybersecurity benchmark that's very relevant to this kind of work.
05:46
Speaker A
This is Aikido. They have a suite of cybersecurity tools and they're big on artificial intelligence.
05:52
Speaker A
And this chart I want to show is on false positives. You can see all the way at the right here. This is DeepSeek V4.
06:01
Speaker A
This is effectively saying one in three findings are false positives. This may or may not be hallucinations, but it is definitely related to sparse attention.
06:11
Speaker A
I suspect if they ran the same test with Qwen 3.8 next flash flash next they'd probably see the same thing.
06:23
Speaker A
So, what is sparse attention? You can think of your agentic session as having context and every turn it grows.
06:33
Speaker A
So, this is your context growing. A dense attention model predicts its next tokens based on the entire context.
06:44
Speaker A
What sparse attention does is it uses some mechanism, some algorithm, some function to determine what it thinks is important in that context window. And so, now it compresses effectively your giant context into one smaller area.
07:01
Speaker A
Each model has a different mechanism. There's Minimax sparse attention, DeepSeek sparse attention, Qwen sparse attention, Kimmy Delta attention.
07:11
Speaker A
They all do it a little differently, but it's effectively doing the same thing. And if you think about it, there are a lot of use cases where this is not great.
07:21
Speaker A
The cybersecurity use cases I mentioned where it needs to have more context to make accurate decisions about what is a true or a false positive.
07:30
Speaker A
And it's not something I do, but I've seen some other people mention role-playing as another use case where when it drops the attention it's not following the thread of whatever they're role-playing.
07:41
Speaker A
I don't even want to know. But, given the hallucinations I've seen on my Fiber CTF challenge, I started thinking that sparse attention might be the reason for the hallucinations, 'cause this did not happen with the Qwen dense models, or even the previous mixture of
07:57
Speaker A
experts models, only this new QSA architecture, as well as with the DeepSeek V4 flash, which of course has DeepSeek sparse attention.
08:05
Speaker A
That being said, sparse attention and compressed attention has a lot of value. It is why we see so much context being able to fit in such a small size.
08:16
Speaker A
It is why we see decode speed, or tokens generated per second, staying consistent even at large context windows.
08:26
Speaker A
If we draw it out, here's my not-straight chart. But, this is context window growing, and this is your token speed slowly dropping as the context window increases.
08:45
Speaker A
It has to run calculations on a lot more data. When you can run those same calculations on a consistent, compressed, sparse attention block, that speed stays persistent. So, now your token generation stays right there the whole time.
09:04
Speaker A
Now, this got me thinking, can I somehow increase the size of the attention window to reduce hallucinations?
09:11
Speaker A
You might be thinking, "Eric, that's nonsense." It turns out it's not. SG Lang has this wonderful little flag for indexer budget that works with Qwen sparse attention.
09:25
Speaker A
Now, the default attention window is this right here. Effectively, for each Qwen sparse attention layer, it is 2,048 tokens.
09:36
Speaker A
And I'll go back to the model card to show you, but this is a Qwen sparse attention layer.
09:41
Speaker A
By passing this command, I have doubled it so that each layer is now 4,096 tokens.
09:49
Speaker A
Now, I want to be upfront about something. I have not thoroughly tested this.
10:03
Speaker A
But 6% is not a lot, especially considering how fast the model is. Easily seeing speeds over 200 tokens per second.
10:11
Speaker A
And now, armed with this bigger attention span, we come up here, and we see it did not hallucinate. It did not lie to me. It did not make up an answer.
10:24
Speaker A
It straight-up admits the value does not appear in the logs. And it tells me exactly where it is.
10:33
Speaker A
This link right here, if you go to it, has the leaked key. And this was a second run confirming what the first one also did.
10:40
Speaker A
Bam! Evidence not found. Along with the correct pointer to the GitHub commit. And just like that, I'm excited again.
10:52
Speaker A
And I also need to go back and see if DeepSeek-V4-Flash has any similar mechanism because that would also make it a lot more usable for me and many other people if it has a bigger attention span.
11:05
Speaker A
If you're still here, thank you so much for watching. I thought it was going to be a nice chill week where I could catch up, but no, we get this model and GLM-5.3-Flash dropped on the same day.
11:17
Speaker A
So much to do, so little time. I need to come up with a new benchmark to put models through their paces. If you have any ideas, drop some comments below, and I'll see you in the next one.
Topics:Qwen 3.8 Flash Nextsparse attentionN-gramhallucinationsAI coding modelscybersecurity AImodel benchmarksDeepSeek V4 Flashattention windowAI model optimization

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries, speaker detection, and unlimited transcriptions.

Or transcribe another YouTube video here →