# Greedy Decoding

- **Canonical URL:** https://getaimath.com/dictionary/greedy-decoding/
- **Topics:** [LLM Inference: Prefill & Decode](https://getaimath.com/dictionary/category/llm-inference-prefill-and-decode/)
- **Last updated:** 2026-11-25

## What is Greedy Decoding?

**In one sentence:** Greedy decoding always picks the single most likely next token at every step.

It is simple, fast and repeatable, but can be boring or get stuck repeating itself, because it never takes a chance on a less likely but better word.

![How an AI Replies: 1. Read Your Question → 2. Type the Answer — Simple two-step cartoon: Step 1 (Prefill) shows the AI scanning your entire question in one flash (causing the brief pause before it starts talking); Step 2 (Decode) shows it typing out the reply one word at a time.](https://getaimath.com/diagrams/llm-inference-prefill-and-decode.png)
*Napkin Diagram (LLM Inference: Prefill & Decode): Every AI reply has two halves: gulping down your whole prompt at once, then speaking the answer one word at a time.*

## What is an example of Greedy Decoding?

With greedy decoding, after "The weather is," the model always picks its top word, like "nice."

## Why does Greedy Decoding matter?

It is good for tasks with one correct answer, like math or data extraction.

## Related Concepts

- [Target Model](https://getaimath.com/dictionary/target-model/): The target model is the large, high-quality model that checks and accepts the draft model's guesses in speculative decoding.
- [Beam Search](https://getaimath.com/dictionary/beam-search/): Beam search keeps several possible sentences going at once and picks the one with the best overall score at the end.
- [Draft Model](https://getaimath.com/dictionary/draft-model/): A draft model is the small, fast model that proposes tokens in speculative decoding.
- [Sampling](https://getaimath.com/dictionary/sampling/): Sampling is how a model picks the next token from its list of possible options, using their probabilities.
- [Parallel Decoding](https://getaimath.com/dictionary/parallel-decoding/): Parallel decoding is any method that produces or checks several tokens at the same time instead of strictly one by one.
- [Throughput](https://getaimath.com/dictionary/throughput/): Throughput is the total amount of work a system completes over time, like the number of tokens or requests per second across all users.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/greedy-decoding/)
