← Back to LLMs Mind Map
⚡Flashcard Drill➔
⚡ LLMsID: decoding-strategies

Decoding Strategies

解码策略
🎯Core Definition
Decoding strategies decide how to pick the next token from the vocabulary distribution during generation. Greedy takes the argmax; beam search keeps the top-BB paths; temperature rescales the logits (T→0T \to 0 recovers greedy, T>1T > 1 flattens the distribution for more randomness); top-k samples only among the kk highest-probability tokens; top-p (nucleus) samples from the smallest set whose cumulative probability exceeds pp. Standard order: temperature on the logits first, then top-p truncation, then sampling.
💡Use Cases
conversational and creative generation wants diversity and fluency — sampling (top-p + temperature + top-k); translation, summarization, code want deterministic output — greedy or a small beam; to suppress low-probability tokens while keeping randomness, top-p adaptively truncates by distribution shape.
⚡Key Problems Solved
greedy argmax tends to repeat and loop with little diversity; pure sampling picks low-probability tokens, producing ungrammatical or factually wrong output. top-p adapts the candidate set to the distribution shape (large when flat, small when peaked), temperature controls logit sharpness, and the pair balances quality vs diversity; beam's BB parallel paths mitigate greedy myopia.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Decoding Strategies.
Use Cases
In production engineering, what are the primary use cases for Decoding Strategies and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Role of temperature; what do T=0 and T→∞ degenerate to?
2
top-p vs top-k? Why is top-p more adaptive?
3
Why temperature before top-p? What if the order is swapped?
4
Drawbacks of greedy and beam? Effects of beam size?
5
Sampling vs deterministic decoding: suitable tasks and the trade-off?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Decoding Strategies"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
← Previous CardPadding & PackingNext Card →Speculative Decoding (cross-module)

🔗 More LLMs Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/LLM/card/decoding-strategies