← 🧠 Foundations of LLMs & GenAINEXT IN FOUNDATIONS OF LLMS & GENAIConstrained and Structured Decoding→
Core
Temperature and Sampling
At each step a model outputs a probability distribution over the next token; how you pick from it is decoding. Temperature reshapes the distribution (low sharpens toward the most likely token, high flattens it), while top-k and top-p (nucleus) truncate the tail before sampling. The choice sets the trade-off between deterministic, focused output and diverse, creative output. Applied-AI interviews probe it because the right decoding settings differ sharply between factual/extraction tasks and creative ones, and because reproducibility depends on them.
a free account unlocks the core curriculum tier · no card
RELATED CONCEPTS
PRACTICE THIS IN REAL QUESTIONS
LLM & GenAI FundamentalsExplain temperature, top-k, and top-p (nucleus) sampling. When do you use greedy vs sampling?→LLM & GenAI FundamentalsCompare LLM decoding strategies: greedy, beam search, temperature, top-k, top-p, and repetition penalties.→LLM & GenAI FundamentalsYour model repeats phrases and gets stuck in loops on long generations. How do you fix degeneration?→Coding & DSAImplement top-k and top-p (nucleus) sampling from a model's next-token logits.→LLM & GenAI FundamentalsHow do you design stopping criteria and stop sequences for an LLM in production?→System Design for AI in ProductionDesign a text-to-SQL feature: let users ask questions in natural language over a real database.→
COMPANIES THAT ASSUME THIS
