AI and Large Language Model (LLM) content generation has transformed how we create text, code, images, audio, and video. These systems leverage transformer architectures and massive training datasets to produce human-quality outputs across multiple modalities. Understanding generation parameters, prompting techniques, and deployment strategies is essential for practitioners building production applications—from chatbots to code assistants to creative tools. The key to effective LLM use lies in mastering the balance between creativity and control through proper configuration, prompt engineering, and inference optimization.
What This Cheat Sheet Covers
This topic spans 19 focused tables and 196 indexed concepts, 195 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Core Generation Parameters
These parameters are the primary knobs for tuning LLM output quality, style, and length; most are available across all major APIs (OpenAI, Anthropic, Google). Getting comfortable with temperature and top-p first covers 80% of real-world tuning needs.
| Parameter | Example | Description | |
|---|---|---|---|
temperature=0.7 | • Controls randomness of outputs • 0.0 = deterministic/focused, 1.0+ = creative/diverse• directly scales probability distribution before sampling | ||
top_p=0.9 | • Samples from smallest set of tokens whose cumulative probability exceeds P • dynamically adjusts vocabulary size based on confidence distribution | ||
max_tokens=2048 | • Maximum number of tokens to generate in response • controls output length and prevents runaway generation | ||
stop=["###", "\n\n"] | • Custom strings that halt generation when encountered • used to control output boundaries in structured formats | ||
frequency_penalty=0.5 | • Reduces likelihood of repeating tokens based on their frequency • discourages repetitive content proportionally to occurrence count | ||
presence_penalty=0.6 | • Reduces likelihood of repeating any token that has appeared • encourages topic diversity with binary penalty | ||
top_k=50 | • Restricts sampling to K most probable tokens at each step • fixed vocabulary cutoff regardless of probability distribution | ||
repetition_penalty=1.2 | • Penalizes previously generated tokens to reduce looping • >1 discourages repeats; values above 1.5 can degrade fluency | ||
min_p=0.05 | • Filters tokens below minimum probability threshold relative to top token • adaptive cutoff that scales with confidence | ||
logit_bias={15043: -100} | • Directly adjusts pre-softmax scores for specific token IDs • used to ban or boost specific tokens regardless of context | ||
reasoning_effort="medium" | • Controls hidden chain-of-thought token budget on reasoning models (o-series, Claude) • low/medium/high trades cost and latency against logic accuracy | ||
seed=42 | • Fixes random state for reproducible outputs across identical requests • essential for testing and debugging |