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
Today's 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
It is measured with automatic metrics such as BLEU, ROUGE or perplexity, though all have limits—they correlate poorly with human judgment and do not capture coherence well—so human evaluation remains the reference. And the risks deserve naming: hallucinations (fluent but false or unsupported statements), biases inherited from the data, and the potential for disinformation at scale.
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)
- Gemma 4 12B: Google's Multimodal Model That Runs on Your Laptop (2026-07-11)
- Anthropic launches Claude 3.5 Sonnet, more capable than Opus and cheaper (2024-06-20)
- OpenAI upgrades GPT-4 Turbo and cuts API prices with new embeddings (2024-01-25)
- Artificial Intelligence Innovations at CES 2024: A Diverse Panorama (2024-01-11)
- Deciphering the "Black Box" of AI (2024-01-01)
- What is Grok? (2023-12-01)
This article was produced with artificial intelligence under human editorial oversight.