# Greedy decoding

> Greedy decoding: Always picking the single most likely next token. Deterministic, but prone to repetition.

Canonical: https://llmdojo.dev/glossary/greedy-decoding

Always picking the single most likely next token. Deterministic, but prone to repetition.

Learn it in the lesson: [Greedy decoding and repetition](https://llmdojo.dev/learn/model-foundations/sampling/greedy-decoding) (Model Foundations · Next-Token Prediction and Sampling).

## Interview questions about Greedy decoding

- [Greedy decoding on a small model gives fluent text that soon repeats itself word for word. Why does that happen?](https://llmdojo.dev/interview/q/greedy-decoding-on-a-small-model-gives-fluent-text-that-soon-repeats)
- [Write beam search that returns each sentence with its probability. How does it differ from greedy decoding?](https://llmdojo.dev/interview/q/write-beam-search-that-returns-each-sentence-with-its-probability-how-does)
- [Your LLM gives different answers to the same input. How would you make inference reproducible, and how many repeated runs would you need for a stable score?](https://llmdojo.dev/interview/q/your-llm-gives-different-answers-to-the-same-input-how-would-you)

## Related
- [Logit](https://llmdojo.dev/glossary/logit)
- [LM head](https://llmdojo.dev/glossary/lm-head)
- [Autoregressive generation](https://llmdojo.dev/glossary/autoregressive)
- [Temperature](https://llmdojo.dev/glossary/temperature)
- [Top-k](https://llmdojo.dev/glossary/top-k)
- [Top-p (nucleus sampling)](https://llmdojo.dev/glossary/top-p)
- [Seed](https://llmdojo.dev/glossary/seed)
- [Logprob](https://llmdojo.dev/glossary/logprob)
- [Glossary of every term](https://llmdojo.dev/glossary)
