14 ms·
Accelerating Gemma 4: faster inference with multi-token prediction drafters
- mchusma 5mo agoI find it puzzling Google doesn’t actively promote its own cloud for inference of Gemma 4. Open source is great, love it. But shouldn’t Google want me to be able to use and pay for it through Gemini and vertex?
- deleted 5mo ago[deleted]
- Farmadupe 5mo agoI wonder if for a model that small with a permissive license it might not be worth their time to host a commercial grade inference stack? Might be easier to chuck it over the fence and let other providers handle it as it'll run in almost any commercial grade card? Also speculating, but I wonder if it might also create a bit of a pricing problem relative to Gemini flashlight depending on serving cost and quality of outputs? As a comparison, despite being SotA for their size, the smallest qwen models on openrouter (27b and 35b) are not at all worth using, as there are way bigger and better models for less oricemon a per token basis
- disiplus 5mo agoi dont know what are you talking about, i replaced an older gpt4o with a finetuned qwen. there is a huge amount of "AI, that can be done with those models, or partly by those models." Huge amount of people would not notice the difference. And if you prepare the context correctly, even bigger slice of people would not notice.
- dakolli 5mo agoGenuinely curious, what are you "fine tuning" these smaller models to do reliably? I hear this talked about a lot but very few people actually cough up examples, and I'd love to actually hear of one.
- disiplus 5mo agodepends, a super small one finetuned to do function calling instead sending it to big model and waiting, instead, you ask for a revenue in last month, i do a small llm function call -> show results. some bigger ones, analysis, summary, classification. what is great with smaller ones, and im looking at 2b, 4b is you can get a huge throughput with just vllm and a couple of consumer gpus. what i usually do is basically distillation of a big one onto smaller one.
- Farmadupe 5mo agoIf it helps, I mean it in a really literal sense. qwen3.6 27b is currently $3.20 per million tokens on openrouter right now which is way overpriced. As good as the 27b is, kimi k2.5 $3.00 and it's just in another league in terms of capability. There's no reason to spend money on it. And even alibaba's own qwen3.6-plus is $1.95, so it's kinda easy to come to a conclusion that alibaba (nor anyone else) is really interested in hosting that model. And don't get me wrong, I fully agree with you, qwen3.6 27b is an amazing model. I run it on my own hardware and every day I'm constantly surprised with what it can zero shot.
- mchusma 5mo agoIf you were to believe a lot of metrics Gemma 31B it’s much better than flash lite. It seems like I should be able to pay Google to use it and that should be at least a secretary, called action how I can do that but it’s missing from both the blog post entirely.
- seamossfet 5mo ago[dead]
- Havoc 5mo agoThere is a decent yt here going through what google's logic with gemma overall might be https://www.youtube.com/watch?v=sXgZhGzqPmU https://www.youtube.com/watch?v=sXgZhGzqPmU As for why cloud offer it - think it's just an effort to promote the brand. The gemmas are pretty small so they can host it without it being a major drain on the company. They have the infra anyway
- nolist_policy 5mo agoWhat do you mean? It just works with Google AI Studio.
- mchusma 5mo agoPart of the issue is Google complex web of products. There’s vertex Gemini Google AI studio Google edge. But I literally had trouble finding how to use this in my existing paid Gemini API account.
- WarmWash 5mo agoA key thing to understand about Google is that under the hood is a collection of extremely powerful fiefdoms (many of which would stand as their own fortune 500, hell 100) that are all trying to act in their own interest. It's almost closer to a conglomerate than a company, where Google needs to bid internally against external players for resources. If Gemma 4 is less lucrative than Claude to the Google Cloud kingdom, the Cloud kingdom will want you using Claude.
- anthonypasq 5mo agointeresting. presumably this is why google is selling TPUs externally instead of hoarding them for deepmind.
- whoahwio 5mo agoMakes me wonder about the partnership with apple to use gemini. safe to assume apple has a preference for on-device, and the best open model (for consumer hardware at least) is a google property with an apache 2 license. Interesting dynamic and seemingly a bright spot in the market
- fomoz 5mo agoYou can use it for free with Google AI studio (free tier or paid tier accounts with different limits). Or use the paid version from Vertex AI which is around 3x cheaper than Gemini 3 Flash. I'm using Gemma 4 31B in my app with 5 agents, 1.5k requests per day, each.
- djyde 5mo agoI'm curious what tasks you use this model for?
- fomoz 5mo agoI use it on my LLM trading bot platform: https://vtxmacro.com https://vtxmacro.com You can use it for free, forever, if you just run the bot in your browser (client mode). Server mode is premium, but you don't need it to run the bots. I posted about it in this comment: https://news.ycombinator.com/item?id=48085993#48088468 https://news.ycombinator.com/item?id=48085993#48088468
- these 5mo agoHas anyone managed to get this to work in LM Studio? They've got a option in the UI, but it never seems to allow me to enable it.
- dvt 5mo agoIt's not implemented in mlx[1] yet (or llama.cpp[2]), so it may take a while. [1] https://github.com/ml-explore/mlx-lm/pull/990 https://github.com/ml-explore/mlx-lm/pull/990 [2] https://github.com/ggml-org/llama.cpp/pull/22673 https://github.com/ggml-org/llama.cpp/pull/22673
- svachalek 5mo agoI've gotten it to work with other models. They've got to be perfectly aligned usually, in terms of provider, quantization etc. Might be a bit before you can get a matched set.
- Havoc 5mo agoNormally when LM Studio doesn't like it it's because of the presence of mmproj files in the folder. Sometimes removing them helps it show up. They're somehow connected to vision & block speculative decode...don't ask me how/why though For gemma specifically had more luck with speculative using the llama-server route than lm studio
- AlphaSite 5mo agoYes. Make sure you’re not using the Gemma sparse models since they don’t have a small model to use. Also I removed all the image models from the workspace.
- adrian_b 5mo agoI do not know what you mean by sparse models. All 4 gemma-4-*-it models, regardless whether they are dense models or MoE models, have associated small models for MTP, whose names are obtained by adding the "-assistant" suffix. https://huggingface.co/google/gemma-4-E2B-it-assistant https://huggingface.co/google/gemma-4-E2B-it-assistant https://huggingface.co/google/gemma-4-E4B-it-assistant https://huggingface.co/google/gemma-4-E4B-it-assistant https://huggingface.co/google/gemma-4-26B-A4B-it-assistant https://huggingface.co/google/gemma-4-26B-A4B-it-assistant https://huggingface.co/google/gemma-4-31B-it-assistant https://huggingface.co/google/gemma-4-31B-it-assistant
- disiplus 5mo agonice, will run it later agains qwen3.6 27b, the speed was one of the reasons why in was running qwen and not gemma. the difference was big, there is some magic that happpens when you have more then 100tps.
- zdw 5mo agoMTP support is being addedto llama.cpp, at least for the Qwen models ( https://github.com/ggml-org/llama.cpp/pull/20533 https://github.com/ggml-org/llama.cpp/pull/20533) and I'd imagine Gemma 4 will come soon. The performance uplift on local/self-hosted models in both quality and speed has been amazing in the last few months.
- dakolli 5mo agoyet, still mostly useless.
- EGreg 5mo agoHow does this get added in practice?
- flakiness 5mo agoAccording to the linked PR, the original model does come with MTP which is another "head" (=output path) in the same model and (supposedly) runs faster. The current implementation ignores that head but the PR let the tool recognize it, plus does proper integration (run the MTP while running the slower main path then compare the result, I believe.)
- flebron 5mo agoThe standard way of doing MTP is to run the drafter autoregressively for k steps, and then (not concurrently) use the larger model as a verifier for those k tokens at the same time. The larger model can then accept a prefix of those k tokens, and in any case generates one more token (which is needed in case you accepted zero tokens from the drafter). The larger model can effectively use this k as a "batch" dimension, reducing the penalty of large weight loading. Meanwhile the drafter is much smaller, so it's fine for _it_ to be autoregressive, as long as the main model is parallel.
- WhitneyLand 5mo agoYeah important conceptually to remember MTP is kind of just more weights, but speculative decoding is the runtime algorithm that’s a significant add to whatever code is serving the model.
- skybrian 5mo agoWatching the computer write text sort of reminds me of using a modem to call a BBS in the old days. This seems like going from 300 baud to 1200 - a significant improvement, but still pretty slow, and someday we will wonder how we put up with it.
- macNchz 5mo agoThis is something I've been thinking about for a while...the current state of things really does feel kind of like the dialup era, wondering what the "broadband" era could look like. Watching tokens stream in is reminiscent of watching a jpeg load a few rows of pixels at a time, and the various different loading and connecting animations that applications implemented before things got fast enough to make them less relevant. Some of the work in that direction like Cerebras or Taalas have been doing is an interesting glimpse of what might be possible. In the meantime it's a fun thought experiment to wonder about what might be possible if even current state of the art models were available at like, a million tokens per second at a very low cost.
- gavmor 5mo agoTake a look at https://chatjimmy.ai/ https://chatjimmy.ai/ -- it's running against Taalas' "hardcore" silicon model, ie a dedicated, ASIC-like chip.
- bikelang 5mo agoWow - actually pretty astonishing how fast their inference is. So fast it feels fake?
- qingcharles 5mo agoYeah, when you find fast inference like that it almost feels like the answer arrives before you hit return. Now imagine it running locally with no server round-trip.
- jiggawatts 5mo ago
- shay_ker 5mo agocurious that they are doing speculative decoding and not baking MTP into the model, like Nemotron https://docs.nvidia.com/megatron-core/developer-guide/0.15.0/api-guide/multi_token_prediction.html https://docs.nvidia.com/megatron-core/developer-guide/0.15.0...
- zargon 5mo agoThey're using the term speculative decoding but doing MTP. It's the same thing as Nemotron, but Google removed the MTP heads from the original safetensora release. (They were not removed from the LiteRM format.)
- nalinidash 5mo agotechnical details are here: https://x.com/googlegemma/status/2051694045869879749 https://x.com/googlegemma/status/2051694045869879749
- pu_pe 5mo agoSo much faster inference with no quality degradation? All that for just some small memory overhead (drafter models are <1B it seems)?
- tarruda 5mo agoThey also published draft models for E4B and E2B. For those, the draft models are only 78m parameters: https://huggingface.co/google/gemma-4-E4B-it-assistant https://huggingface.co/google/gemma-4-E4B-it-assistant
- coder543 5mo agoMTP requires a separate KV cache, so there is more memory overhead than just the weights of the MTP model, but it's a manageable amount.
- a_e_k 5mo agoFrom the linked post, it didn't read like a separate KV cache was needed: > The draft models seamlessly utilize the target model's activations and share its KV cache, meaning they don't have to waste time recalculating context the larger model has already figured out.
- coder543 5mo agoThat's great news. That has not been the case with other MTP implementations like Qwen3.5, but I see the section in the article saying Google introduced some architectural optimizations to make this possible.
- furyofantares 5mo agoIs it really no quality degradation? I'm curious where my understanding is wrong, but I didn't think you necessarily got the exact same output with how I understand speculative decoding to be used. I thought that if the small model produces tokens that are "good enough", meaning within the top few tokens the larger model produces, they're accepted. I thought it doesn't necessarily have to produce the exact same token the larger model would have produced to be accepted (and that requiring this would reduce the hit rate by a lot.) Just one the top model could have produced with whatever top-k and temperature settings.
- christina97 5mo agoI recently set up the 26B A4B model up on vLLM on an RTX3090 (4-bit) after a hiatus from local models. Just completely blown away by the speed and quality you can get now for sub-$1k investment. I tried first with Qwen but it was unstable and had ridiculously long thinning traces!
- jszymborski 5mo agoThe A4B model is blazing fast and the model is super good at general inquiries. Notably worse than Qwen 3.6 for coding tasks but that says more about the Qwen model.
- 2ndorderthought 5mo agoSome of the early quants for qwen3.6 were broken. It's still finicky but with a little hand holding it's crazy. Local models are the future it's awesome
- aimxhaisse 5mo agoIt even fits on a 3060 with turboquant / Q4 at decent speed (40T/s) for ~200$ (:
- moffkalast 5mo agoThe 31B is surprisingly fast too, for a dense model. Runs tg at least twice as fast as it ought to on my machine when compared to other 30B, probably due to the hybrid attention I guess. Ingestion is somewhat slower though.
- deskamess 5mo agoDid DeepSeek come up with MTP? It was listed prominently in their recent paper as being carried forward from the previous release.
- logickkk1 5mo agoi think this is mixing two separate ideas. MTP is the training-side piece. speculative decoding is the inference trick. DeepSeek V3 used MTP as an auxiliary loss. the 2022 Google paper is speculative decoding. now Google is combining them. https://arxiv.org/abs/2404.19737 https://arxiv.org/abs/2404.19737
- deskamess 5mo agoOh... so MTP is not speculative decoding? The (T)oken (P)rediction made me think it was on the inference side. I shall read the paper. Edit: Ok, I understand now. You are saying that MTP has two aspects. 1) The training (for the mini-models to generate tokens), and 2) The actual speculative decoding implementation on the inference side (which uses those trained mini-models).
- brcmthrowaway 5mo agoIs Google's local model strategy tuned to pegging down big AI cloud labs a notch?
- whoahwio 5mo agodumping money into Gemma and shorting new data center buildouts is a level of Corporate Vision that ends up in an HBS case study
- m3kw9 5mo agook so? Anyone got a verdict/review?
- recsv-heredoc 5mo agoCloudFlare offers excellent service for many of the open-weights models. It's fast, cheap and simple to set up. Can highly suggest as an LLM provider. They serve gemma-4-26b-a4b-it.
- andruby 5mo agoThey do indeed. See https://developers.cloudflare.com/workers-ai/models/ https://developers.cloudflare.com/workers-ai/models/ They seem to allow some free usage without user account. Do they list limits anywhere?
- brikym 5mo agoIt doesn't seem that compelling to me. I can get the gpt-oss models cheaper from the openrouter nitro providers like groq and cerebras. The model you mention on Cloudflare infra is the same price through open router or directly.
- julianlam 5mo agoReally excited to try this once it is merged into llama.cpp. Gemma 4 26B-A4B is much quicker on my setup vs Qwen3.6-35B-A3B (by about 3x), so the thought of a 1.5 speedup is tantalizing. Have tried draft models to limited success (the smaller 3B draft model in addition to a dense 14B Ministral model introduced too much overhead already)
- VHRanger 5mo agoOn vllm with a 5090 I get 120-180TPS with the awq 4 bit quant + MTP speculative decoding For gemma4 26B, same quantization, I get >200TPS. Also note that qwen is extremely inefficient in reasoning; the reasoning chains are ~3x longer than gemma on average
- msp26 5mo agoGoogle is singlehandedly carrying western open source models. Gemma 4 31B is fantastic. However, it is a little painful to try to fit the best possible version into 24GB vram with vision + this drafter soon. My build doesn't support any more GPUs and I believe I would want another 4090 (overpriced) for best performance or otherwise just replace it altogether.
- ActorNightly 5mo agoQwen is still better that Gemma though. Also you can tune it more for different tasks, which means that you can prioritize thinking and accuracy versus inference speed.
- 2ndorderthought 5mo agoYes I would just go with qwen.
- SwellJoe 5mo agoQwen is better at some things (code, in particular), but Gemma has better prose and better vision. At least, it feels that way to me.
- zobzu 5mo agogemma is also just way faster. i dont wanna wait 10min to get a 5-10% better answer (and sometimes, actually worse answer). best is to use your own model router atm, depending on the task
- SwellJoe 5mo agoI'm pretty sure Qwen is faster? The MoE version of Qwen is 3B active, while Gemma 4 is 4B active. Similarly, the dense Qwen is 27B while Gemma is 31B. All else being equal (though I know all else isn't equal), Qwen should be faster in both cases. I haven't actually measured with any precision, but on my AMD hardware (Strix Halo or dual Radeon Pro V620) they seem quite similar in both cases...both MoE models are fast enough for interactive use, both dense models are notably smarter but much slower, long time to first response and single-digit tokens per second once it starts talking.
- AbuAssar 5mo agothese are the updated models: google/gemma-4-31B-it-assistant google/gemma-4-26B-A4B-it-assistant google/gemma-4-E4B-it-assistant google/gemma-4-E2B-it-assistant
- sigmar 5mo agofor anyone wanting a glossary to explain the naming scheme here: E4B = 4B effective parameters (using per-layer embeddings) E2B = 2B (like above) it = instruction tuned (rlhf and all that jazz) assistant = Multi-token drafters (the new 2x speed up)
- qiine 5mo ago> assistant naming still hard I see
- satellite2 5mo agoYes they should have stick with the naming convention. google/gemma-4-31B-it-ass
- sigmar 5mo agoI wonder if they hadn't decided to call it a drafter when they named the files and were using assistant internally? google being google...
- ActorNightly 5mo agoI found that Gemma 4:26b makes way more mistakes compared to Qwen and Gemma 3. Gemma3 27b QAT was my goto for some time as this was quite fast. Qwen is still king for a balance of accuracy and inference speed. Gemma:31b was more accurate but speed was horrendous.
- Patrick_Devine 5mo agoIn my testing the Gemma 4 31b model had the biggest speed boost in Ollama w/ the MLX runner for coding tasks (at about 2x). Unfortunately you'll need a pretty beefy Mac to run it because quantization really hurts the acceptance rate. The three other smaller models didn't perform as well because the validation time of the draft model ate up most of the performance gains. I'm still trying to tune things to see if I can get better performance. You can try it out with Ollama 0.23.1 by running `ollama run gemma4:31b-coding-mtp-bf16`.
- vhiremath4 5mo agoSo this is like branch prediction for operating systems? Except we have probability baked into the model itself so it’s even more reliable.
- Lihh27 5mo agosimilar idea, but the failure mode is better. a branch mispredict burns cycles. a bad guess here usually just means no bonus tokens. https://arxiv.org/abs/2211.17192 https://arxiv.org/abs/2211.17192
- TOMDM 5mo agoAs long as you're not bound on parallelism or bandwidth then it's "free", but if you're constrained on either resource then your lighter predictor model just needs to save you more cycles than it congests on average.
- dchftcs 5mo agoA bad guess still costs cycles, but the penalty is smaller compared to branch mispredict in the current state. But if we have some kind of pipelining, like if we have something that assumed the speculative decode is correct, then it'll be expensive again.
- rahimnathwani 5mo ago[dead]
- WarmWash 5mo agoI don't see it talked about much, but Gemma (and gemini) use enormously less tokens per output than other models, while still staying within arms reach of top benchmark performance. It's not uncommon to see a gemma vs qwen comparison, where qwen does a bit better, but spent 22 minutes on the task, while gemma aligned the buttons wrong, but only spent 4 minutes on the same prompt. So taken at face value, gemma is now under performing leading open models by 5-10%, but doing it in 1/10th the time.
- rjh29 5mo agoAnecdotally the 15/month basic Gemini plan allows coding all day. I'm not hitting the limits or needing to upgrade to 100/month plans like other people are doing with Claude or Codex. Caveat: Gemini has been dumbed down a few times over the last year. Rate limits tightened up too. So it might not be this good in the future.
- Zarathruster 5mo agoWhere are you using it? Is Gemini CLI at a usable state? It was a frustrating, miserable experience last time I gave it a shot. Antigravity seems significantly better in comparison, but with lower usage limits. If I run out, I usually don't bother switching to Gemini CLI.
- freedomben 5mo agoAs long as you force it to use the pro model and not flash, it is pretty usable. If you go with the default settings though, it will use flash aggressively which results in pretty bad code. I only use it with pro exclusively now. Even with pro, I have caught it going off the rails a few times. The most frustrating was when I asked it to do translations, and it decided there were too many to do so it wrote a python script that ran locally and used some terrible library to do literal translations, and some of them were downright offensive and sexual in nature. For translations though, Gemini is the best but you have to have it do a sentence or two at a time. If you provide the context around the text, it really knocks it out of the park
- sigmar 5mo ago>try them directly on Google AI Edge Gallery for Android or iOS. I'm not seeing any update to the app on my android phone... maybe later today? >We’ve published an in-depth technical explainer I was expected a pdf link, but this goes to a brief article on twitter/X. lol, okay...
- nolist_policy 5mo agoIt's up on GitHub: https://github.com/google-ai-edge/gallery/releases https://github.com/google-ai-edge/gallery/releases
- franze 5mo agoif someone wants to work with gemma and dont deal with ollama or configs - there is (my baby) https://airplane-ai.franzai.com/ https://airplane-ai.franzai.com/ Beta but useable
- franze 5mo agobiggest pain is currently waiting for apple for the next release with updates mac os app store screenshots
- CharlesW 5mo agoLM Studio (for example) is free, can you pitch me on your USP vs. it?
- franze 5mo agoeasiness of install (one download), zero configuration, zero online access by design - there will never we websearch, never any kind of tracking, your prompts stay on your device - you can totally put in user data, confident contracts, ... plus over time the harness - coming version has a hotkey for screen capture, next release will have support for native excel, docx export there is value in being offline by design
- CharlesW 5mo agoLM Studio's tagline is literally "local AI on your computer" and has commensurate benefits, as do similar choices like Unsloth Studio and Ollama's desktop app. The differentiators you have planned sound like they'll help you establish a unique value prop. Good luck!
- aleksiy123 5mo agoI’m starting to think that googles strategy is a bit different then the other frontier providers. Focusing more on performance to compute efficiency over pure performance. And maybe that’s why Gemini is (seemingly) lagging behind? Other providers hitting capacity and hitting the limits subsidising their inference. Google strategy seems to be about scaling and distributing these models to their existing billions of users.
- leecommamichael 5mo agoIsn't that where everyone's strategy is shifting?
- aleksiy123 5mo agoYes, but I think Google was playing that strategy from essentially day 1 or very early in this AI race, where as the others are there now because of their lack of access of compute. The general narrative I would read on HN/others, was that Google would be able to outlast/outcompete OpenAI and Anthropic because Google had both more money and more compute. Playing the game of subsidizing their most capable models to capture market share longer than the VCs could. But instead I feel like Google opted out of that much earlier. Shifting their focus on efficiency and scaling much much earlier. Flash and Gemma being where Google was actually ahead of the competition while everyone was focused on bigger more capable models. In the last month the environment has changed, compute is constrained, costs for consumers are way higher than expected. Copilot pretty much imploded, and I'm guessing both Anthropic and OpenAI are starting to feel the squeeze. My personal opinion was this was necessary because integrating AI into products like AI overview, search meant scaling to billions of users was a requirement right out of the gate. And theres not enough money/compute no matter who you are to use frontier models for that.
- scottyah 5mo agoThey also just have the resources- both in $$ to spend time optimizing, but the people like Jeff Dean who have already been focused on AI efficiency for a long time.
- simianwords 5mo agoGemma 4 is really a beast. The 31B version is totally usable like for cases when I'm bored without internet
- regexorcist 5mo agoSounds like a game changer if I see that kind of speed up on my hardware. So far I've prefered Qwen 3.6 because of its better tool handling, even though Gemma 4 is faster, but I saw they've updated the model template and that's supposed to be better now. Looking forward to trying this with llama.cpp.
- ch_sm 5mo agogemma4 has a specific problem with toolcalls that affects most runtimes. fixes for ollama and vllm are being worked on right now
- apexalpha 5mo agoI read somewhere you need to drop temp to 0.1 on gemma for tools. Not sure why (too amateur sorry). Though I think qwen was natively trained on toolcalling.
- adrian_b 5mo agoThe chat templates of all Gemma 4 models have been updated 7 days ago, to fix some bugs related to invoking tools. So any tests done with models that have not been updated during the last days are no longer relevant and they must be repeated after updating the models and regenerating any other file formats, like GGUF files.
- julianlam 5mo agoDoes this mean there will be new Gemma 4 models released with MTP, or are they already available in existing models + quants?
- adrian_b 5mo agoFor each of the 4 gemma-4-*-it models there has been published an associated small model gemma-4-*-it-assistant, to be used for MTP. If a GGUF file is generated for MTP, it must include both the big model and the small model. There was a reference in another comment to a PR for llama.cpp, which also included updates for the Python program used for conversion from the safetensors files, which presumably can handle the combining of the two paired Gemma 4 models.
- jug 5mo agoThey have now been released on e.g Hugging Face with model suffixes "-assistant".
- netdur 5mo agoI am getting 21 t/s on Fold 7, 21 x 1.8 = 37.8 t/s compared to M1 Max's 54 t/s, that is impressive
- tannhaeuser 5mo agoTested gemma4 26 MoE 4bit quantisized gguf on llama.cpp following these guides with mmap'd I/O on a 16GB MBP and it was unbearably slow (0.0 t/s).
- el_isma 5mo agoHow is this different from the speculative decoding that we had before? You could pair a big and small model like qwen 32b with qwen 4b and had that same dynamic of the small model generating tokens and the big one "certifiying" them. The blog says something about re-using the big model's data?
- OneDeuxTriSeiGo 5mo agoAs far as I can tell MTP is unique from regular speculative decode because the small model is trained to consume and operate on the big model's hidden state for prediction.
- adrian_b 5mo agoMulti token prediction is the same thing as speculative decoding. This is mentioned in the Google pages describing their MTP implementation. Google has now provided small models for each of the previous Gemma 4 models, e.g. "gemma-4-26B-A4B-it-assistant" for "gemma-4-26B-A4B-it". The difference vs. Qwen is that here each small model is not some general-purpose smaller model, but a model that has been optimized specifically for this task, to predict the output of the bigger model with which it is paired. This specialization and optimization of the Google "gemma-4-*-assistant" models ensures that they are much smaller and thus much faster than general-purpose small models.
- julianlam 5mo agoSo then these models could be used by llama.cpp today with the -md switch? Interesting, must try tomorrow.
- fulafel 5mo agoMulti-token prediction is a refined form of speculative decoding. Researchers at Google came up with Speculative decoding in 2022: https://research.google/blog/looking-back-at-speculative-decoding/ https://research.google/blog/looking-back-at-speculative-dec... (Fast Inference from Transformers via Speculative Decoding - Yaniv Leviathan, Matan Kalman, Yossi Matias) Researchers at Meta came up with MTP, a smarter way of doing speculative decoding in 2024: https://arxiv.org/abs/2404.19737 https://arxiv.org/abs/2404.19737 (Better & Faster Large Language Models via Multi-token Prediction Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Rozière, David Lopez-Paz, Gabriel Synnaeve) DeepSeek V3 shipped MTP in a product first, in 2024: https://arxiv.org/abs/2412.19437 https://arxiv.org/abs/2412.19437 (DeepSeek-V3 Technical Report, 100+ authors)
- noashavit 5mo agoGemma4:e4b is a huge upgrade
- joakleaf 5mo agoSeems like a pull request for vLLM was just approved a few minutes ago: https://github.com/vllm-project/vllm/pull/41745 https://github.com/vllm-project/vllm/pull/41745 ("Add Gemma4 MTP speculative decoding support")
- larnon 5mo agoAnyone tried this with vLLM yet? I am confused on how to turn this on tbh.
- nolist_policy 5mo agoWorks great in the latest version of Google AI Edge Gallery: https://github.com/google-ai-edge/gallery/releases https://github.com/google-ai-edge/gallery/releases
- Gormers 5mo ago[flagged]
- brikym 5mo agoI wonder what latency and tok/s this model on Groq or Cerebras would be capable of. I have a couple LLM driven games [1][2] where speed is really important to the experience. Currently the best performance I can get is the gpt-oss models on Groq or Cerebras but they need quite a bit of extra context and tools to correct for mistakes. I'm making a bet I'll be able to get the same performance much cheaper in the next few months. [1] https://sleuththetruth.com https://sleuththetruth.com [2] https://lextension.net/ https://lextension.net/
- wrxd 5mo agoI'm not sure I understand how this work https://huggingface.co/google/gemma-4-E4B-it-assistant https://huggingface.co/google/gemma-4-E4B-it-assistant has 78.8M parameters while the standard variant https://huggingface.co/google/gemma-4-E4B-it https://huggingface.co/google/gemma-4-E4B-it has 8B parameters. Is gemma-4-E4B-it-assistant a model I can use stand-alone or a model I need to use in combination with gemma-4-E4B-it?
- gunalx 5mo agoYou need the regular gemma model as well. You can think of this as a really small distillation of the original. Useless by its own because it often is wrong, but it is fifth more than not. And because verifying a transformer model can be done faster than running it. We can effectively speed up by using this draft model and only doing the compute where it was wrong. This is a oversimplification, but tldr you need both yes.
- wrxd 5mo agoThank you! I already played with Gemma4 on oMLX a while ago. When I have some time I'll check if it supports running MTP models and play a bit more
- ThouYS 5mo agodon't know about this guy, but qwen3.6:27b with the UD 4bit quant and little-coder/pi has been amazing. the first local LLM experience that can do actual meaningful work
- brcmthrowaway 5mo agoWhat is UD?
- ac29 5mo agoUnsloth Dynamic, just some branding from Unsloth for their quants (other people use similar techniques)
- momo26 5mo ago[flagged]
- imrozim 5mo ago3x faster inference means cheaper api costs tooo. For solo dev building ai this matters a lot
- ydj 5mo agoNot necessarily. Servers serving the model likely has enough traffic that they are batching decodes already. MTP reduces latency and increase efficiency only when the server can’t batch enough concurrent streams to be compute bound rather than memory bound.
- imrozim 5mo agoFair didn't think about batching makes more sense for self hosted models then.
- libraryofbabel 5mo agoSpeculative decoding is an amazingly clever invention, almost seems-too-good-to-be-true (faster interference with zero degradation from the quality of the main model). The core idea is: if you can find a way to generate a small run of draft next tokens with a smaller model that have a reasonable likelihood of being correct, it's fast to check that they are actually correct with the main model because you can run the checks in parallel. And if you think about it, a lot of next tokens are pretty obvious in certain situations (e.g. it doesn't take a frontier model to guess the likely next token in "United States of...", and a lot of code is boilerplate and easy to predict from previous code sections). I always encourage folks who are interested in LLM internals to read up on speculative decoding (both the basic version and the more advanced MTP), and if you have time, try and implement your own version of it (writing the core without a coding agent, to begin with!)
- deleted 5mo ago[deleted]
- mungoman2 5mo agoNaively it seems odd that running multiple checks in parallel is faster than just running the autoregressive model multiple times in series. It’s the same amount of compute right? But I think the key is that in the standard autoregressive case we get memory bandwidth bound, so there are tons of idle compute resources. And so checking multiple tokens is cheap because we can batch and thus reuse the read weights for multiple tokens. The verification step is similar to a prefill with a small batch size. The difference is what we do with the generated logits.
- libraryofbabel 5mo agoThat’s correct, and yes - not less compute total on the main model (actually slightly more, since checking failed draft tokens costs you compute), but faster because inference is memory-bandwidth bound. And like you I also think of it as like a “mini prefill” (but on top of the existing KV cache, of course); the code is very similar to prefill if you implement a simple toy version yourself. Most of the complexity in implementing a simple toy version comes from having to get the KV cache back into a good state for the next cycle (e.g. if only the first half of your draft tokens were correct).
- Alonski 5mo agoThis is sort of similar to Ethereum and maybe a bit of zero knowledge proofs but with the LLM handling both sides.
- great_psy 5mo agoThis might be silly, but … since the assistant models are so much smaller than the full models. What if we just use those smaller models? Any idea how much worse they will be ? Or is the issue that their error will really diverge as you accept more of their tokens?
- zozbot234 5mo agoI assume these are just output layers that are trained on the hidden state from the larger model - that's how MTP works. It's not a separate drafting model.
- amdivia 5mo agoI think they'll be extremely worse on their own Predicting "America" in "The United States of ..." Is a different task from predicting the whole sentence. So the small model is laying the blocks, and the bigger model would be cementing them in place or kicking them down. The bigger model's course correction is what keeps the smaller models predictions relatively on track
- WASDx 5mo agogemma-4-31B-it-assistant is a 0.5B model. So it's performance would likely be comparable to other models of such size.
- OliverSmith34 5mo agoThe best IOS inferencing model comes from Google..
- fulafel 5mo agoLooks like DeepSeek did this as well since V3: https://deepwiki.com/deepseek-ai/DeepSeek-V3/4.4-multi-token-prediction-(mtp) https://deepwiki.com/deepseek-ai/DeepSeek-V3/4.4-multi-token... Credit for the MTP technique is due to https://arxiv.org/abs/2404.19737 https://arxiv.org/abs/2404.19737 from 2024: Better & Faster Large Language Models via Multi-token Prediction Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Rozière, David Lopez-Paz, Gabriel Synnaeve
- zkmon 5mo agoThe "how to get started" asks you to read "documentation" which turns out to be a sales blurb. Am I missing something?
- danborn26 5mo agoMulti-token prediction is exactly what we need for practical local inference. The speedup makes running these models on edge devices much more viable.
- woadwarrior01 5mo agoThe Qwen 3.5, 3.6 and Kimi 2.5, 2.6 models also have multi-token prediction heads baked into their model weights.
- sporkland 5mo agoIs there any current research on as agents w/tools start dominating LLM use, if making making models smaller / less single-shot, more like efficient engines that can process a lot of context, and feeding a lot more into context windows is going to be more of a path forward vs trying to memory the world? Like smaller models that show effectiveness on problems with verifiable rewards when run in a loop with external grounding context?
- DoctorOetker 5mo agoWhy is a separate MTP model even necessary? An LLM forward inference doesn't just predict token vectors for the new last token: In diagrams the forward pass is typically depicted as taking input tokens vectors <t1, t2, t3, ... t98, t99, t100> (here native context being 100 for didactic purposes) and generating output token vectors <t2, t2, t4, ..., t99, t100, t101>. As far as I understand that is didactically only semi correct, it correctly depicts the locations of tokens in the input and output string, but actually the token vector at the t2 output position is NOT identical to the t2 vector from the input, but a token vector which after softmax gives P(t2 | t1). And output token position t5 actually corresponds to P(t5 | t1,t2,t3,t4). I.e. the forward inference is modelling the statistical conditional N-gram function from inputs to outputs, from the bigram conditional probability P(t2 | t1) all the way up to P(t101 | t1, t2, t3, ..., t98, t99, t100). Suppose you want to take bigger steps, nothing prevents one from calculating the forward function by sliding a fixed (committed output string) to the left not 1 position but say 10 positions, and then using the last 10 predictions as the new output prediction. That doesn't need a new MTP model. Perhaps it would take some careful modification to ensure the same original output distributions as if the tokens were generated one at a time, but this hints at the possibility. One could also slide to the left 5 positions twice, not committing to all 10 new tokens at once but only commiting to the 5 oldest values of the 10 new values, and using the noncommited 5 last values as input vectors for the next invocation, so the model can push the new 5 vectors towards its final commited output vector value in 2 steps for better convergence... Is there any reason multitoken prediction doesn't work this way, or is there some aspect of the conditional N-gram interpretation of LLM models that I am miscomprehending?