MLGuerrillaStart M1 →
Text and language·20 min read·Updated 23 September 2026

Large language models (LLMs)

An LLM takes text as input and writes text back one token at a time. It is the model behind chat assistants, coding agents and most of the AI features you use.

A large language model, or LLM, is a neural network trained to predict the next token of text. A token is a chunk of text, usually a word or part of a word. The model predicts a token, adds it to the end of the input and predicts again, and everything it produces, from a chat reply to a tool call, comes out of that same loop.

The "large" refers to the number of parameters, the learned numbers inside the model. GPT-3 had 175 billion of them in 2020, and Moonshot AI's Kimi K3, released with open weights in 2026, has about 2.8 trillion. This page covers how an LLM works inside and the papers the design comes from. It also lists the models you'll see as of September 2026, and when a different kind of model fits the job better.

What it is

An LLM turns text into a probability for every possible next token

The clearest way to see what an LLM does is to run a small one and look at what comes out. Alibaba's Qwen2.5-3B-Instruct runs on a laptop through Ollama, and the input below is the raw start of a sentence with no chat formatting around it, "The customer was charged twice for the same order, so this support ticket should go to the". What comes back is a probability for every entry in the model's vocabulary, which is 151,936 tokens for this one, and those probabilities add up to 1.

A figure titled "An LLM's output is a probability for every token in its vocabulary". The top panel shows the prompt "The customer was charged twice for the same order, so this support ticket should go to the" going into Qwen2.5-3B, and a horizontal bar chart of the ten most likely next tokens with their probabilities: " billing" 30.2% in terracotta, then " ____" 7.8%, " __" 4.0%, " ___" 3.7%, " complaint" 3.6%, " Billing" 3.6%, " [" 2.6%, " issue" 2.5%, " fraud" 2.5% and " customer" 2.3%. A note says these ten add up to 62.9%, and the other 37.1% is spread across the remaining 151,926 tokens. The bottom panel shows eight generation steps at temperature 0, each picking the top token and adding it to the input: " billing" 30.2%, " department" 65.4%, "." 47.5%, " A" 24.7%, "." 94.2%, " Correct" 65.5%, " B" 99.8% and "." 100%. A bracket under the first three steps says the model completes the sentence, and a bracket under the last five says it is now writing a quiz. The caption says that with no chat template around the input, nothing marks where an answer should end, so it keeps going.
The underscore tokens and the quiz most likely come from the same place in the training data, fill-in-the-blank exercises with sentences shaped like this one.

The top answer, " billing", gets 30.2%. " Billing" with a capital B is a separate token and gets another 3.6%, and three of the top ten are runs of underscores. The ten most likely tokens only add up to 62.9%, and the other 37.1% is spread across the rest of the vocabulary.

To produce text, the model picks one token from that distribution, adds it to the input and runs again. When it takes the most likely token every time, which is what a temperature of 0 does, this model writes " billing department. A. Correct B." and keeps going. It completes the sentence and then writes what looks like a multiple-choice quiz, and within 60 tokens it has moved on to an unrelated quiz question about power supply systems, because it's continuing the text the way its training data would.

This model has been post-trained to answer and stop, and that behavior depends on its chat template, the special tokens that mark where a user's message ends and the assistant's reply begins. Sent through the template, the same sentence gets a 72-token answer that starts "This support ticket should be directed to the billing or customer service team", and then the model writes its end-of-turn token, which tells the software to stop. The section on how it works covers post-training, and How LLMs Actually Run Things walks through tokens and this loop step by step.

Most frontier LLMs now take images as well as text as input. As of September 18, 2026, Anthropic's and OpenAI's model docs list text and image input with text output for all their current models. The amount of input a model can take at once is its context window. That's about 1 million tokens for OpenAI's and Anthropic's current models, apart from Claude Haiku 4.5 at 200,000.

Keep reading

The rest of this article is free with an account

Create a free account to read the remaining 6 sections. It takes about twenty seconds and there's nothing to pay. The same account opens the slide decks and CV reviews.

  1. 02LLMs do most of the text work in AI products, from chat to coding agents
  2. 03Inside, an LLM is a stack of transformer layers trained on trillions of tokens
  3. 04The LLMs you'll see, as of September 18, 2026
  4. 05Pick an LLM when the output is language, and a neighbor when the answer is narrower
  5. 06How to try it
  6. and 1 more