AI GLOSSARY · AI CONCEPTS
Text generation
Definition
Text generation is producing written language with a computer model. Today it usually means a large language model predicting one token, a chunk of text often part of a word, at a time from a prompt and its earlier output.
Also called: AI text generation, text generation model, text generation models.
In plain language
Text generation is what happens when you type a request into an AI assistant and it writes back. In a common autoregressive workflow, the model builds a reply token by token from the input retained for that call and its generated continuation. Generation is not simply a database lookup, but a model can reproduce memorized training text; not every displayed message comes from new model output. Settings such as how adventurous the choice is change how varied the result looks. The output can read smoothly and still contain mistakes, so important facts and figures need checking against a trusted source.
Technical definition
Hugging Face's Transformers tutorial describes autoregressive generation: predicting a next token from supplied input and earlier generated tokens until a limit or stopping condition is reached. The generate() API handles this. Its generic configuration uses greedy decoding when num_beams=1 and do_sample=False; beam search and sampling use other configurations, and model-specific generation settings can override defaults. IBM defines natural language generation as the use of AI to create natural language outputs, and as a subcategory of natural language processing. Stanford's SLP3 text covers decoding and sampling in its chapter on Transformers and pretraining.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Guide · Illustrative, not executed
What Is an LLM? The Facts Agent Users Need
- What you see
- A guide contrasting an autoregressive Transformer decoder with BERT's masked pretraining, and distinguishing model parameters from application state and runtime context.
- Why it exercises the concept
- Its decoder example illustrates one common generation mechanism without making every language model or application message autoregressive. Illustrative reading, not an executed generation test.
Guide · Illustrative, not executed
AI Hallucination: What to Check in Agent Output
- What you see
- A guide defining an AI hallucination and giving a checklist for reviewing agent output: claims, quotes, sources and figures before you rely on them.
- Why it exercises the concept
- Fluent generated text can still be wrong. The guide gives a way to check output rather than trust how smooth it reads.
Skill by Skill Almanac · Illustrative, not executed
faithful-summary-writer 55/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- The skill is described as summarizing one document so every sentence traces to the source, then checking the summary for invented or altered facts.
- Why it exercises the concept
- Summarising is one text generation task. The skill adds a check on the generated text against its source, which is a safeguard rather than part of generation itself.
Skill by Skill Almanac · Illustrative, not executed
prompt-writing 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- The skill is described as writing and linting LLM prompts with a fixed structure, injection rules and a numeric test plan.
- Why it exercises the concept
- The prompt is the input to generation. Its wording and structure change what the model continues with.
How it shows up when you use agents
Model-written replies in coding assistants illustrate text generation, but tools, retrieved passages and application errors can supply displayed text too. In a common autoregressive workflow, the model generates tokens from the input retained for that call, which need not contain the entire conversation. Other methods exist, including masked diffusion generation. A coding agent's code edit or proposed shell command is generated text too, which is why it deserves review.
Treating generation as retrieval causes trouble. A model is not reading an answer from a table, so a confident sentence is not evidence that it is true. This is the root of hallucination. The Hugging Face documentation also notes that decoding choices matter: greedy search works well for input-grounded tasks such as transcription and translation, and is not optimal for creative uses like story writing and chat.
When output looks wrong, change one thing at a time: the prompt, the settings the product exposes, or the surrounding material. Check facts in generated text against a source you trust, as the hallucination guide suggests. Related ideas are large language models, tokens and inference.
Common confusions
- Text generation versus natural language generation. IBM defines natural language generation as AI creating natural language outputs and places it within natural language processing.
- Generation versus understanding. Reading and classifying text is a different task from writing it, though one model can do both.
- Fluent versus correct. Smooth wording is not a check on accuracy.
- Myth. Generation always produces novel wording. Autoregressive generation predicts tokens rather than simply looking up a saved reply, but Carlini et al. recovered verbatim GPT-2 training sequences. Generated output can reproduce memorized text.
Related terms
Terms that mention Text generation
Guides that mention Text generation
More in AI concepts
Sources
- Text generation (Transformers documentation), Hugging Face (accessed 2026-11-24)
- What is natural language generation (NLG)?, IBM (accessed 2026-11-24)
- Speech and Language Processing (3rd edition draft), Jurafsky and Martin, Stanford University (accessed 2026-11-24)
- Large Language Diffusion Models, Nie et al. (arXiv) (accessed 2026-11-25)
- Extracting Training Data from Large Language Models, Carlini et al. (arXiv) (accessed 2026-11-25)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude (original draft); OpenAI Codex (bounded factual repairs); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .
Change log (5)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
- : First version.
- : Verifier pass: applied verifier corrections to unsupported claims and aliases.
- : Bounded source repairs: Scoped autoregressive generation and retained context; separated application/tool text, corrected guide scope and acknowledged memorized verbatim outputs. Pending independent re-review.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.