Text Generation
Text generation, or natural language generation, automatically produces human text from an input. We explain how today's models do it—autoregressively, with sampling strategies—what it is for, how it is evaluated, and its risks, such as hallucinations and bias.
Text generation, or natural language generation, is the task of automatically producing text in human language from an input, which may be a prompt, structured data or another text. It is the counterpart of language understanding: while the latter starts from a text to extract its meaning, generation starts from an intention or a context and decides how to express it in words.
How it works today
Many current systems are based on the Transformer architecture and generate text autoregressively: they predict the next token—a word or a fragment—one at a time, conditioned on everything before. At each step, the model produces a probability distribution over the next token, and one must decide which to choose. Strategies range from greedy decoding (always taking the most probable) to sampling methods that control diversity: temperature, which flattens or concentrates the distribution, and top-k and top-p (nucleus) sampling, which restrict the choice to the most probable candidates.
What it is for
Text generation is behind summarization, translation, question answering, chatbots, assisted writing, code generation and the drafting of reports from data.
How it is evaluated, and its risks
Next-token probability does not measure whether a claim is true. Text can be fluent yet still contain false or unsupported details; checking it against external sources remains necessary.
Pieces using this term
- Microsoft Unveils Its Strategy Against Deepfakes: Combining Watermarks, Digital Signatures, and Metadata (2026-07-18)
- DeepMind releases DiffusionGemma, a text model up to 4x faster (2026-07-18)
- Anthropic launches Claude 3.5 Sonnet, more capable than Opus and cheaper (2024-06-20)
- Apple brings generative AI to iPhone, opens Siri to ChatGPT (2024-06-10)
- Mistral unveils Codestral, a 22-billion-parameter coding model (2024-05-29)
- PaLM 2 was not the product: Google turned it into a layer (2023-05-10)
- GPT-2 and GPT-3: What Changes When a Text Predictor Scales (2023-05-09)
- What BERT changed and what reading in both directions really means (2023-05-09)
This article was produced with artificial intelligence under human editorial oversight.