Skip to the document
Madhuopen lab
Outcome School · Other AI topics19 min read

by Amit Shekhar · 13 September 2026

N-gram Speculation in LLMs

N-gram Speculation in LLMs, a simple trick that makes a language model write its answer faster by guessing the next few words from the text it has already seen. We will also see how an LLM writes one token at a time, why that is slow, what Speculative Decoding is, what an n-gram is, how N-gram Speculation guesses the next tokens by looking up the prompt, how the model verifies those guesses without changing the final answer, and where it works well and where it fails.

3,644 words#llm#ai#system-design4 recall cards

N-gram Speculation in LLMs
Read on Outcome School ↗then come back to lock it in
Before you read, guess

What is the technique that involves quickly guessing subsequent tokens and then verifying them in a single pass?

Ten seconds, a guess, then read — a wrong guess still makes the answer stick.

Before you go

In one sentence, what was this chapter about?

From memory, without scrolling up. Writing it is what makes it yours; the grade is only to show you what you had.

How sure?