---
title: "Hidden inside Gemma 4 — the inference trick from 2022 #AI #GoogleAI"
source_url: https://youtube.com/shorts/LEEucshktFg
captured_at: 2026-05-11
author: "DIY Smart Code"
contributor: "ชิดชนก"
platform: youtube
---
# Hidden inside Gemma 4 — the inference trick from 2022 #AI #GoogleAI

youtube video by **DIY Smart Code**, 2m52s, uploaded 2026-05-11. URL: https://youtube.com/shorts/LEEucshktFg
Tags: ai, ai coding, artificial intelligence

## Shared in LINE Note+
- 2026-05-11 18:24 by ชิดชนก

## Description
Speculative decoding makes LLM inference 2-3× faster with identical output — the trick has been public since 2022, and Google just baked it into Gemma 4 as architecture (MTP drafter). Here is how two language models running side by side beat one running alone.

----
🚀 Want to learn agentic coding with live daily events and workshops?
Check out Dynamous AI: 
Get 10% off here 👉 
----

What you get in 2:34:
- Why standard LLM decoding is slow — one full forward pass per token, every token costs the same compute
- The insight: most tokens (boilerplate, common phrases, math constants) don't need a 70B model to predict
- Speculative decoding explained — small fast draft model speculates k tokens ahead; big target model verifies all of them in one parallel forward pass
- Accept / reject mechanics — match the draft, accept; disagree, reject from that point and let the target correct
- The numbers — best case k+1 tokens per round, worst case still 1, average 2-3× faster, identical output distribution (proved on T5-XXL in arXiv 2211.17192)
- When it wins (math, code, boilerplate) vs when it collapses (creative writing, open prose where the draft guesses wrong)
- The Gemma 4 callback — Google
