AI GLOSSARY · AI CONCEPTS

Text generation

Markdown version

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.

Terms that mention Text generation

8 terms mention this one

Guides that mention Text generation

More in AI concepts

Next steps

  1. What Is an LLM? The Facts Agent Users Need The long-form guide.
  2. faithful-summary-writer A skill that exercises it.
  3. Large language model (LLM) Related term.
  4. Token Related term.
  5. All glossary terms A to Z and by family.

Sources

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.