# Text Generation

> Making new text with a model. It adds one word at a time to a prompt.

**Field:** Artificial Intelligence  
**Category:** NLP & Language  
**Also known as:** AI Text Generation, Automatic Text Generation

## Think of it like

It is like a story game. Each player adds the next word.

## Definition

Text generation is the task of making new text with a model. The model is given a start, such as a question or a few lines, and adds words one at a time. Each new word is picked based on the words before it. Chat replies, emails, stories and code are all made this way. The text can sound right and still be wrong, so it needs checking.

## Example

Lucy asks a model for a short thank-you note to her team. It writes four warm lines in two seconds.

## Why it matters

It is what most people mean when they say they used AI. Almost every chat tool runs on it.

## Common mistake

Thinking the model looks its answer up. It writes the most likely words, which is why it can make things up.

## Three principles

- **One word at a time.** Each word depends on the ones before.
- **From a prompt.** The start shapes the rest.
- **Check it.** Fluent is not always true.

## Related terms

- [Natural Language Generation (NLG)](https://learn.benibix.com/term/ai/natural-language-generation)
- [Next-Token Prediction](https://learn.benibix.com/term/ai/next-token-prediction)
- [Large Language Model (LLM)](https://learn.benibix.com/term/ai/large-language-model)
- [Prompt (AI)](https://learn.benibix.com/term/ai/prompt)
- [Hallucination (AI)](https://learn.benibix.com/term/ai/hallucination)
- [LLM Sampling](https://learn.benibix.com/term/ai/sampling)

![Two panels. On the left, a prompt is followed by new words added one by one. On the right, a question and a short passage lead to one answer, with the line it came from marked in the passage.](https://learn.benibix.com/diagrams/ai5-qa-generation.svg)

---

Source: https://learn.benibix.com/term/ai/text-generation
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
