Hacker News new | ask | show | jobs
by littlestymaar 26 days ago
> Does this translate into a similar reduction in compute?

No, quite the opposite actually. Like with speculative decoding this model will compute more tokens and discard the invalid ones.

> What's the catch?

LLMs[1] are limited by memory latency and not by compute[2]: because they process tokens one at a time, you spend more time loading and unloading the weights on the GPU registers from VRAM than waiting for compute to happen. Techniques like these allow to process multiple tokens in parallel instead of one by one, and as such exploit better the compute of your graphic card. They do so by predicting which tokens are likely to occur and then verifying that the guess was correct.

For instance if the previous token is “hello”.

A regular autoregressive LLM will compute:

“hello” => “! ”,

then “hello! ” => “how ”,

“hello! how ” => “are ”,

“hello! how are ” => “you”.

and finally “hello! how are you” => “?<end>”

One at a time. Loading and unloading every weights 5 times from the GPU memory to its compute units.

With speculative decoding (I'd say this one isn't strictly speculative decoding, but it's a variant of the same principle), you have something that guesses that the whole sentence is going to be “how are you today?”, so the LLM can generate

“hello” => “! ”,

“hello! ” => “how ”,

“hello! how ” => “are ”,

“hello! how are ” => “you”.

“hello! how are you” => “?<end>”

“hello! how are you today” => “?<end>”

In parallel. So each weight would have been loaded only once from the VRAM instead of 5.

The last token will be discarded though, as the prefix “how are you today” doesn't match what has actually been generated. So in that particular example, you'd have gotten your 5 tokens 5 times faster than with pure autoregressive inference, but at the expense of a 6th token being generated and discarded immediately. So 5 times more token throughtput, but 20% compute cost increase per token.

[1]: autoregressive LLMs, that is. Which are the ones everybody uses because they are the most performant.

[2]: at least when run at low batch size, on your own computer for your personal use. On a datacenter, with many concurrent users, GPUs are actually compute-bound.

2 comments

Minor nit re[2]: for agentic workloads that are actually worth money - i.e., claude code and similar, things are either prefill-bound - which this does not help - or more importantly tps/user bound (at 150k+ context windows) - you want your big magic model to emit 200 tps/user. This is why Nvidia bought Groq (now LPU) and what Cerebras is trying to do, etc, etc. So for the stuff that makes money in the field - GPUs are not really compute bound once context lengths are large - but still memory transfer bound (may be KV-cache transfer, may be HBM->SRAM-on-chip, etc..)
> i.e., claude code and similar, things are either prefill-bound

When accounting for prefix caching, this greatly accelerates each turn. Barring large file reads, prefill still isn't the bottleneck vs. decoding reasoning tokens. Script-writing too.

This is especially true during exploration phases when traversing through directory trees and grepping files, you're talking about a few hundred tokens/turn.

Fantastic results. Well done. ...So this is built into the way the model works.. if I'm understanding it correctly.

I was wondering what would be involved in getting it to work with GGUF files, rather than safetensor files...

Just to get it into a GGUF file would be fairly trivial. But using that GGUF file would need a bunch of additional things. One would need to create a new architecture derived from Qwen3, and then probably adapt the speculative decoding functionality.

At the moment not even MTP is merged into llama.cpp, so I wouldn't quite hold my breath for it.

I thought that might be the case. I naively wondered. I'll see if I can understand the paper :-)

Hope the paper gets lots of references and the technique gets a lot of use to save power and time.

There's been several potential big changes for LLM inference efficiency over the last few months. There's been Attention Sequencing (I think it's called..?) Turbo Quant and this one.

Interesting times.

MTP merged today, a couple of hours after your post by the looks of things.
By the looks of it, it will take a couple more follow up PRs to clean things up a bit and get the most performance from MTP. I hope that by that point it will be easier to add more spec decoding types.

In the meantime I've benchmarked Orthrus some more and got some quite promising results. So I'd be glad if my prediction that it may take some time until it lands in llama.cpp turns out to be wrong.