Skip to content

Large Language Model

A very large Transformer trained to predict the next token on vast amounts of text, then tuned to follow instructions. The engine behind chat assistants.

Also LLM · foundation model · language model

Fig. / How it works
thethecatcatsatsatononthethematmatONE TOKEN AT A TIME, EACH READING ALL BEFORE IT
Role · kind
Models and algorithmsFamily
Level
Intermediate

Someone who has read a giant library and became amazingly good at guessing what word comes next. Guessing well enough turns out to require knowing grammar, facts and even some reasoning.

Where it fits

Not shown: 2 more kinds and parts, 18 more it builds on. See the full list below.

+All relationships as a list

See it on the full map

How it works

A large language model is, at heart, a next-token predictor. Given some text, it outputs a probability for every possible next token. Pick one (see sampling), append it, repeat, and the model writes.

How it is built:

  1. Pretraining. A decoder-only Transformer reads trillions of tokens of text and code and learns to predict each next token. This is self-supervised: the text provides its own answers. To predict well, the model has to absorb grammar, facts, styles and patterns of reasoning.
  2. Instruction tuning. The raw model continues text but does not follow instructions well. Fine-tuning on examples of good assistant answers teaches the format.
  3. Preference tuning. Methods like RLHF train the model toward answers that people (or AI feedback guided by principles) rate as helpful, honest and harmless.

“Large” matters: as models, data and compute grow, the loss falls smoothly and predictably, and new abilities show up, such as following complex instructions or writing working code.

Limits to remember: the model generates plausible text, which is usually but not always true. It also only knows what was in its training data. Retrieval-augmented generation and tool use address both.

Everyday use cases

  • Case 01

    Chat assistants

    Answer questions, explain concepts, draft emails, brainstorm.

  • Case 02

    Coding help

    Suggest code, explain errors, write tests.

  • Case 03

    Summarizing and extracting

    Turn a 40-page report into five bullet points, or pull names and dates out of contracts.

Famous examples

Strengths, weaknesses and when to use it

Strengths

  • One model handles thousands of different tasks from a plain-language instruction.
  • Learns new tasks from a few examples in the prompt (in-context learning).

Weaknesses

  • Can state false things confidently (hallucination).
  • Knowledge is frozen at training time unless connected to tools or retrieval.
  • Expensive to train and run.

When to use itFor language tasks that are open-ended or hard to specify with rules. Pair with retrieval when facts must be current or private.

Compare with

Check yourself

  1. Q01

    What is the core pretraining task of a GPT-style LLM?

    Show answer

    B: Predicting the next token

  2. Q02

    Why can an LLM "hallucinate"?

    Show answer

    A: It generates plausible text, which is not always checked against facts

Go deeper