---
title: How LLMs work
description: What happens between your prompt and the model’s answer.
---

<!--
aka: large language model
-->

## LLM

Large Language Model. An AI trained on a huge amount of text so it can generate more text, one token at a time.

---

## Token

The small chunks an LLM reads and writes — whole words or pieces of words, not raw letters. Rule of thumb: about 4 characters, or roughly 0.75 words, per token. Try the [Token Prediction Lab](../labs/token-prediction.lab.md).

---

## Embedding

A list of numbers that places a token or idea in a map of meaning. Similar ideas sit close together; the model can even do semantic arithmetic, like `King - Man + Woman ≈ Queen`. Explore one in the [Embedding Space Lab](../labs/embedding-space.lab.md).

---

<!--
aka: weights
-->

## Parameter

One of the internal weights a model learns during training. More parameters can store more nuanced patterns. They don't change while you chat.

---

## Context

What you give the model right now: your prompt, files, tools, and the conversation so far. Unlike the weights, it changes with every request.

---

## Context window

How much the model can keep in working memory for one prompt. Anything outside the window is invisible. Think of it as the size of the desk the model works on.

---

## Transformer

The 2017 model architecture behind modern LLMs. It replaced older sequential networks so the model can look at a whole sequence at once.

---

## Self-attention

The Transformer mechanism that lets every token weigh how much the other tokens matter to it.

---

## Next-token prediction

Given the tokens so far, guess the next one. Longer answers are just this step repeated.

---

## Temperature

How willing the model is to pick a less likely next token. Low temperature is more predictable; high temperature is more varied.

---

## Pre-training

The first training stage, where a model reads a huge corpus and learns general patterns of language before anyone fine-tunes it for a specific job.

---

## Base model

What pre-training produces: fluent at continuing text, but not yet a helpful assistant. GPT-3 could complete text; it was not ChatGPT.

---

## Fine-tuning

Extra training on a smaller, curated set of examples so a general model learns a specific style, task, or instruction-following behavior. Changes the weights. Not the same as putting examples in a prompt.

---

<!--
aka: reinforcement learning from human feedback
-->

## RLHF

Reinforcement Learning from Human Feedback. A fine-tuning method that steers a model from "predict the next word" toward "follow human intent."

---

## Reward model

A model that learns from people's rankings to score answers, so another model can be trained toward the answers people prefer. For math and code, a test or an answer key can do the scoring instead.

---

## Alignment

The work of getting a model to do what people actually want — and not just what the training data made statistically likely.

---

<!--
aka: flagship
-->

## Frontier model

One of the handful of most capable models in the world at a given moment. Also called a flagship. See [State of the art: AI models](../resources/sota-models.resource.md).

---

<!--
aka: state of the art
-->

## SOTA

State of the art. The best known result on a task right now. In AI it changes monthly, which is why we keep a [living reference](../resources/sota-models.resource.md).

---

## Open weights

A model whose trained weights are published for anyone to download and run. Not the same as open source: the training data and code usually stay private.
