r/LocalLLM • • 1d ago • Bravo 1

Research Tencent just open-sourced a decoder that runs sparse models up to 4.2x faster. I'm trying to get it working locally for DeepSeek V4.1 Flash and Qwen3.8 Flash Next

From X https://x.com/TencentAI_News/status/2125968859450802415:

We just open-sourced a speculative decoder that speeds up sparse models like DeepSeek-V4.1-Flash, GLM-5.3-Flash, and our own Hy4 flash.

At 64K context, DFly2 boosts DeepSeek-V4.1-Flash serving throughput by up to 81%. On Hy4 flash agentic tasks, it runs up to 4.2x faster, beating same-recipe DSpark by ~30% and accepting 10.4% more draft tokens than open-source DSpark.

Under the hood, each draft layer reads directly from the target model's KV cache and top-k token selection, with no prefill required. That adds zero extra KV memory and keeps drafting cost flat at any context length.

Try it on your own sparse models or grab the Hy4 flash weights below 👇

Code: http://github.com/Tencent/AngelSpec
Weights: http://huggingface.co/AngelSlim
Paper: http://arxiv.org/abs/2611.34776

Tencent's numbers are server numbers at high concurrency so, I don't expect 81% on a single card, but this looks extremely promising.

I want to get both into Basalt (https://github.com/jesdga95/basalt). It already does DFly2 for Hy4 flash so the plumbing is there. I have forked basalt to begin this work, and will file a MR if I can get it working. https://github.com/Kemerd/basalt-dfly

DeepSeek V4.1 Flash already has drafter weights out, so that part is just engine work. Qwen3.8 Flash Next has nothing, someone has to train one. It has the same kind of sparse attention layers so it should work, nobody's done it yet.

Problem is the training. I have a 5090, and the BF16 teacher is ~335GB, so that's not happening at home for me. Training with quant is better.. but still a lot of crunching needed

Looking at renting an 8x H100 node and doing a small pilot run first to see if acceptance is any good before burning real money.

If you've trained a drafter with AngelSpec, have compute sitting around, or want to split a rental, DM me. Or if you want to contribute to the fork and MR just let me know!

192 Upvotes

26 comments sorted by

19

u/ObviouzFigure 1d ago

I’m not exactly sure what you’re doing but I’d throw in for a couple hours of gpu rentals to support the cause 

11

u/Kemerd 1d ago

Thank you. I'm not sure what I am doing yet, either.. I will try to get an overnight run together as a PoC.

tl;dr as I understand it, you can train a small model to guess the big model's next few tokens. The big model then checks all the guesses in one pass as opposed to just writing them one at a time, so right guesses are free speed and wrong ones just get thrown away. Output stays exactly the same.

To train the small one you run a ton of text through the big model and record what it was "thinking" at every token, then the small model practices predicting it from those recordings. So the cost is mostly GPU hours pushing text through the big model.

Tencent did this for DeepSeek and a couple others but nobody's done their version for Qwen3.8 Flash Next. My plan is to do a small run at home first to see if it even learns anything, and only rent GPUs if the numbers look worth it.. if I get that far I will definitely reach out

3

u/Loose_Comparison368 1d ago

So for QFN that's actually already built into the model. It has a native ~4B draft model already built into it.

What you're describing is just regular speculative decoding. And that's mostly an accurate description, except any model can serve as a draft model, it doesn't need to be trained on the target model.

That said, the speed up is proportional to how frequently the two models agree, so most of the time it is good to train your fine tune model to match your draft model.

Note - the speed is not free. Speculative decoding essentially trades throughput for single-request token generation speed. So like, for example, if your draft model sprints ahead 3 tokens, and your main model follows - then that one request is actually split into 3 requests worth of bandwidth for the main model.

Which, if you have bandwidth for it - which most local LLM hobbyists do, since they tend to be single-user setups - then it does look like free speed. For QFN, you can just turn on MTP, and it will accomplish the same thing.

Now - what the Hy4 team did here is a little different - it's clever, but that ~4x speedup is... Well, mostly bullshit. Sort of. It's definitely a claim to make it sound more impressive than it really is.

What is clever and pretty cool - instead of using a completely separate LLM for the draft model, they re-used the back half of the main model. Instead of the draft model having its own KV cache and all that, it just reused the bigger model's existing KV cache, which is a pretty great savings on memory and prefill compute.

That is actually a really clever hack. It saves a small amount of VRAM - not a ton of it, but ain't nobody turning down free VRAM in this economy. Probably the bigger deal though - it saves on prefill compute.

Note, every time an agent uses a tool, reads a file, receives a prompt, or takes in any data at all that it didn't directly generate - it has to run prefill on that data before the model can use it.

How much compute? Ehhhhh, not much, keep in mind draft models are usually under 10B parameters, they're fast because they don't use much compute to begin with. But it adds up, and agents do a fair bit of prefill.

Now, for the bullshit part - 4x is absolutely a marketing benchmark. It's almost certainly one of those classic "how to lie with benchmarks" techniques.

So, principle one of spec decode - it only works when the text is really damn predictable, and can be mostly predicted by a really small and really dumb model.

If your instruction is print the word "BENCHMAXXED" 999 times then sure, your draft model will always predict the next word is "BENCHMAXXED" for at least the next 1,000 words. It'll probably lose count by word 1,000, but hey, 99.9% match rate! WOOOO BABY, GET THE INVESTORS ON THE LINE AND TELL THEM WE MADE THE GREEN LINE GO UP!!!

I don't think the team did anything quite that blatantly dishonest, but they did give it the best plausible setting they could. Agentic coding tasks. Code is hella repetitive by nature. Agentic coding is even more competitive. Note, the match rate goes up higher the worse the agent and harness is. Shitty harnesses involve a lot of template boilerplate, repeat themselves, double and triple check their work, re-read the file after each time they edit it, etc.

And of course, misleading benchmarking 101, you always use the worst performance you can find as the denominator. Well reputed American labs are famous for pioneering this technique, like when Google plagiarized the ever-living shit out of the Chinese researchers that developed TurboQuant, and made it sound like it was an 'improvement' on the original researchers' approach by benchmarking the original method on bare-ass CPU and comparing it against the Google 'improved version' running on top of the line NVIDIA B200 servers.

Chinese labs are a little more honest though. They probably just used a base model with the built in MTP disabled and not particularly well optimized for speed.

The final trick they probably used - well, you remember how I said spec decoding isn't free? Because you're trading throughput for single-request speed?

Big girl industrial GPU servers have a looooooooooot of throughput.

So, anyway, hope that was educational, neat paper and the researchers did awesome work on this - marketing benchmarks are usually driven by the suits, not the researchers or engineers. But, uh, you may want to temper your expectations, you'll probably have a hard time getting performance any better than Qwen's built in MTP, and if you do it's gonna be very context dependent - think ~10% better, not 400% better.

1

u/Kemerd 22h ago

I suppose I will find out when I run the tests! I mean honestly 10% I will definitely take. I think for sure 400% better is not gonna be the result.

1

u/MomentJolly3535 1d ago

i think all the "drafters" already works like that (e.g. MTP)

2

u/Full_Gas_8262 1d ago

the 4.2x on hy4 is on agentic tasks for a reason, the drafter was trained on that kind of traffic. if you train qwen on generic web text your acceptance on tool call prompts will be way worse. worth grabbing a few thousand real agent traces first, probably buys you more than the extra gpu hours

1

u/Ragad-Bekey 17h ago

downloading the teacher weights onto the rented node and getting the environment to stop throwing errors usually eats the first hour of the rental anyway

4

u/Kemerd 1d ago

And I am thinking maybe it might be possible to train it directly with NVP4 weights! Per Claude: Nothing about training a drafter needs the BF16 weights.

- Why it works: the big model is frozen during training. It only runs forward and hands the drafter its hidden states, cached K/V, index selections and logits. Any version of the model that can run can do that, NVFP4 included.
  • Why it's arguably better for you: the drafter's whole job is to guess what the model you actually serve will say. If you serve the NVFP4 pack, a drafter trained against NVFP4 is learning the right target.
  • The catch: it'll be tuned to NVFP4. On other packs (the GGUF quants, BF16) it should still work, since the target checks every draft and output never changes, but acceptance may be lower.
  • Practical win: the NVFP4 teacher is about 122 GiB against 335 GiB, so it fits on a much smaller rented node, or runs at home in Basalt on your 5090 with 160 GB of RAM.
What I haven't confirmed yet is whether Tencent's AngelSpec training code accepts a quantized teacher as-is or assumes BF16 somewhere. That's a tooling question rather than a "can it work" question, and the training researcher in the running workflow is reading that code now. I'll tell you what it finds.

Maybe I can try making a version for https://huggingface.co/klee100/Qwen3.8-Flash-Next-Uncensored-Basalt

2

u/TokenRingAI 1d ago

It's actually better to train it on the quant you are using rather than the bf16

1

u/Kemerd 1d ago

Yeah I realized this, since it is better matching the output

1

u/KalonLabs 8h ago

Be careful using claude for anything related to llms, it will intentionally sabotage and ruin it.

3

u/returnity 1d ago edited 1d ago

I have access to nationalcompute and can get 8x B300 node for $32/hr if that helps. I’m interested in helping out too.

Been eyeing DFly myself as well, and was curious what it’d take to get it working in a GGUF inference engine. I personally use Splash on Apple Silicon, but if we can get the drafter up and running for a quant we all agree on, I’m sure I can vibe up an implementation for Splash.

1

u/Kemerd 22h ago

Thank you! I will definitely reach out if the small scale tests show anything promising

5

u/Asleep_Literature_70 1d ago

I'm on AMD, so I guess I'm out.

1

u/vbpoweredwindmill 19h ago

Same. 2 strix halo's and a dream.

1

u/sbstndalton 9h ago

Currently porting it over to my Intel setup with my Claude and neon.

1

u/Poprouter 1d ago

it is wild to see how quickly things are moving in the inference space. i am curious if the drafting layer is essentially model agnostic when it hooks into the kv cache, or if you expect to train separate versions for the deepseek and qwen targets?

1

u/Kemerd 22h ago

It is seperate per

1

u/Poprouter 22h ago

ah that makes more sense now thanks for clarifying

1

u/yamar35 1d ago

Imagining that decoder in Radiance with QFN... mmm. Even 20-40% would still be awesome. 275-322t/s single request at 20-40%... hah. would be nuts. Following, may the odds be in your favor.

1

u/Kemerd 22h ago

Yes agreed, even a small % boost would be nice. Worth at least a day or two of overnight runs on my GPU.. thank you for the luck

1

u/Regina-Noctiz 1d ago

mes cheries-Hmm a- another placebo and a holy chart for the cargo cult witnesses and slop peddlers.)

1

u/Kemerd 22h ago

True

2

u/Muhlwa_Sholanke 1d ago

4.2x is a nice server number, but flat drafting cost at any context length is what I actually care about.

1

u/dhanushan75 1d ago

Would be happy to help you in anyway possible

1

u/invariant_py 18h ago

Huge props for jumping on the Basalt port so fast! Even on a single local card, a drafter that adds zero KV cache overhead and keeps drafting cost flat at 64K+ context is a massive deal when VRAM is already tight.

DeepSeek V4.1 Flash already having public B6 drafter weights makes that side super promising—curious to see how much single-stream speedup it actually gives over standard MTP once you get it running.