Differend Labs

Learn

This page starts with the math that AI is built on, then follows one sentence all the way through a GPT, from the moment you type it to the moment an answer comes back. Every step is something you can see or try.

Topics link to the original research papers. Those papers are written for specialists, so expect math and jargon. This page is the plain-language version.

It all starts with math

Every AI on this page is built from math that is taught in schools and universities. Here is the path, one class at a time.

  1. Algebra

    Using letters to stand for unknown numbers, and finding them. If y = 2x + 1 and y = 7, then x = 3.

  2. Trigonometry

    The math of angles, triangles and repeating waves, like sound waves and the seasons.

  3. Calculus

    The math of change. It tells you how fast something is changing at any moment, called the derivative, and which direction to move to make a number go up or down.

  4. Linear algebra

    What many students take after calculus. It is the math of lists and tables of numbers. A list of numbers is called a vector. A table of numbers is called a matrix. One multiplication can change every number in a huge table at once, and computer chips called GPUs are built to do exactly this very fast.

  5. Probability and statistics

    The math of uncertainty and data. It measures how likely something is and finds patterns across many examples.

What machine learning is

Machine learning is a way to build a math formula from examples instead of writing the formula by hand. It uses each class above for a specific job:

  • Linear algebra holds everything. Words, pictures and sounds are turned into vectors, and the model itself is a set of matrices full of adjustable numbers called parameters.
  • Calculus does the learning. After every guess, the model measures its error. The derivative of that error says which way to nudge each parameter so the error gets smaller. Repeating this nudge is called gradient descent.
  • Probability shapes the answers. A model does not output one certain answer. It outputs how likely each possible answer is.

Try it: a real machine learning model

Each dot is one apartment: its size and its monthly rent. The model is the formula rent = w × size + b. It starts with bad guesses for the two parameters w and b. Each training step uses calculus to nudge them so the line fits the dots better.

formula
average error
training steps0

Example data, made up for teaching. The math is real: this is gradient descent, the same method used to train GPTs.

What machine learning is used for

  • Filtering spam out of your email.
  • Recommending the next video, song or product.
  • Turning speech into text, and translating between languages.
  • Helping doctors spot problems in X-rays and scans.
  • Predicting the next word in a sentence, which is what a GPT does.

The model you just trained has 2 parameters. A GPT works on the same principle, with billions of parameters and trillions of words as examples. The rest of this page follows what happens inside one.

What G, P and T stand for

ChatGPT is a chat app built on a GPT. The three letters describe exactly what it is.

Inside a GPT, step by step

This is the real order of events every time you send a message.

  1. Step 1You type

    Everything starts as plain text. Type your own sentence here and follow it down the page.

  2. Step 2The tokenizer cuts it into pieces

    A model cannot read letters. A tokenizer cuts text into pieces called tokens. There is more than one way to cut. Here are the three main ones, all running live on your sentence.

    By character

    Every letter, space and comma is its own token. Tiny vocabulary, nothing is ever unknown. But sentences become very long, and long means slow and expensive.

    By word

    Each word is one token. Short and easy to read. But the vocabulary must hold every word ever, and any new word, name or typo becomes ? unknown.

    By common pieces (BPE)

    The method GPT uses. Common words stay whole and rare words are built from familiar pieces, so nothing is unknown and sentences stay short. This one is real: it learned merges from a few paragraphs of text when this page loaded.

    A dot (·) is a space that belongs to the token after it. Try a made-up word like “flurbish” and watch the word method fail.

    How BPE learns its pieces
    1. Start with every word split into single characters.
    2. Count which two neighbors appear together most often, like t + h.
    3. Glue that pair into one new piece, th, and add it to the vocabulary.
    4. Repeat. th + e becomes the. Thousands of rounds later, common words are single pieces.

    First merges this page learned:

    Tokenizers in real models

    TokenizerUsed byMethodVocabulary
    GPT-2 tokenizerGPT-2, GPT-3byte-level BPE50,257
    cl100k_baseGPT-3.5, GPT-4byte-level BPE~100,000
    o200k_baseGPT-4obyte-level BPE~200,000
    Llama 3 tokenizerMeta Llama 3BPE128,256
    WordPieceGoogle BERTWordPiece, similar to BPE30,522
    SentencePieceGoogle T5SentencePiece32,000

    Bigger vocabularies mean fewer tokens per sentence, especially for languages other than English, but a bigger model to store them. Anthropic's Claude uses its own tokenizer, and its details are not public.

  3. Step 3Each token becomes a number

    The tokenizer looks up every piece in its vocabulary list and swaps it for that piece's position number, called a token ID. From here on, the model only ever sees numbers.

    IDs from this page's small BPE vocabulary. A real GPT's IDs go up to about 100,000 or more.

  4. Step 4Each number becomes a point on a map of meaning

    Every token ID is swapped for a long list of numbers called an embedding. Think of it as an address on a giant map where words with similar meanings live near each other.

    rentbillsmoneyloan schoolexamtuitionessay catdogkitten happygladcalm scholarship

    An illustration. Real embeddings have hundreds or thousands of numbers each, squeezed here onto a flat page. Notice that “tuition” sits between school and money, because it belongs to both.

  5. Step 5The transformer pays attention

    Now the transformer reads all the tokens together. For each one, it asks which other words in the sentence matter for understanding it. This is called attention, and it is the T in GPT.

    The scholarship was hard to find because it was buried at the bottom.

    When the model reads “it,” how much attention goes to each earlier word?

    scholarship64%
    find12%
    hard8%
    The6%
    other words10%

    Example numbers. A real model does this for every word, many times in parallel, across dozens of layers.

    Read the paper

  6. Step 6It scores every possible next token

    At the end, the model gives every token in its vocabulary a chance of coming next. Then it picks one. A setting called temperature controls how adventurous that pick is.

    I need help paying my ___

    safe and predictablesurprising and random

    Example scores. Low temperature almost always picks the top word. High temperature spreads the chances out, so unusual words get picked more often. This math is real: it is the same formula models use.

  7. Step 7Add it, and do it all again

    The picked token is added to the end of the text, and the whole trip from Step 2 runs again for the next one. A full answer is this loop, run hundreds or thousands of times.

    Knowledge is

    An example run with made-up choices. The model never plans the whole sentence. It only ever picks the next piece.

How it learned to do that

Pre-training the P in GPT

The model reads a huge amount of text and practices one game: guess the next token.

It guesses, checks the real next token, and adjusts its parameters, billions of tiny dials inside it, so the right answer gets a little more likely. After trillions of guesses, it has absorbed grammar, facts, styles and patterns. It also absorbs the gaps and biases in whatever it read.

Read the paper

Fine-tuning

Extra training on a smaller, focused set of examples.

A pre-trained model can continue any text, but it is not yet a helpful assistant. Fine-tuning on examples of good conversations teaches it to answer questions instead of, say, continuing your question with more questions.

Reinforcement learning RL

Learning by trying things and getting a score.

agentworld actionreward (a score)

Nobody shows the model the right answer. It tries something, gets a number back for how well it did, and slowly shifts toward whatever earns more. A dog learning tricks for treats works the same way.

Read the book

Reward hacking

When the model finds a way to get a high score without doing what people wanted.

In a well-known 2016 example, an AI trained on a boat racing game discovered it could spin in circles hitting the same bonus targets forever. It beat human players' scores and never finished the race. The score was the goal, so the score is what it chased.

Read the paper

RLHF and RLAIF

Using RL to teach a chatbot what good answers look like.

In RLHF, reinforcement learning from human feedback, people compare two answers and pick the better one. A separate reward model learns their taste, and the chatbot is trained to score well with it. In RLAIF, an AI does the comparing instead of people. HARK Entry 01 at Differend Labs tests whether an AI judge rates things the way people would.

Big ideas

Alignment

Making sure AI does what people actually need, not only what its score says.

Reward hacking is the small version of the problem. Read the alignment problem for the full explanation.

AGI artificial general intelligence

An AI that could learn and do almost any thinking task a person can, across every subject, instead of being good at only some.

There is no agreed definition. Companies and researchers each describe it differently, and people strongly disagree about whether it will happen and when. Today's models are very strong at some tasks and still fail at others that people find easy. When someone says AGI, it is fair to ask which definition they mean.

Read the paper

Agent

An AI that takes actions on its own, step by step, to reach a goal.

A chatbot answers. An agent might search the web, fill in forms, send emails, or write and run code, with less checking by a person between steps. More actions mean more places for its goal and your needs to drift apart.

Zero-knowledge proof

A way to prove something is true without revealing anything else.

Picture proving you found Waldo without showing where he is on the page. You cover the whole page with a huge sheet that has one tiny hole, and slide it so only Waldo shows through. Your friend sees Waldo, so they know you found him, but they learn nothing about where he is.

Real zero-knowledge proofs do this with math. They can prove you are over 18 without revealing your birthday. In AI, researchers are working on using them to prove a model ran correctly, or passed a safety test, without revealing private data or the model's secret parameters.

Read the paper

Looking inside a model interpretability

Research that opens up a trained model and works out what its parts do, and why.

In Step 4 and Step 5 above, each token became a list of numbers, and the transformer mixed those lists together, layer after layer. Each number computed along the way is called a neuron. A neuron takes the numbers from the layer before it, multiplies each by a weight, adds them up, and passes the total through a simple function. Every piece of text you give the model sets every neuron to some value. When the value is high, people say the neuron “fires.”

One way to study a neuron is to collect the texts or images that make it fire the most and look for what they share. Sometimes they all share one idea, such as pictures of cars. The idea a model has learned to detect is called a feature. A neuron that fires for one idea is called monosemantic, which means “one meaning.” A neuron that fires for several unrelated ideas is called polysemantic, “many meanings.” A well-known example from a 2020 study of an image model was a neuron that fired for both cat faces and the fronts of cars.

One explanation for polysemantic neurons is superposition. The idea is that a model needs to track more features than it has neurons, so it stores each feature as a direction spread across several neurons, and each neuron ends up carrying pieces of several unrelated features. Try it below.

Two neuron axes, left to right and bottom to top, with three feature arrows spaced evenly around a circle: A points up, B points down and left, C points down and right. neuron 1neuron 2 ABC

This is a made-up example with real math. Three features share two neurons. Each feature is an arrow of length 1, and the two neurons read off how far the arrow points right (neuron 1) and up (neuron 2). Notice that neuron 2 gives the same reading, −0.50, for B and C, so neuron 2 alone cannot tell them apart. The dictionary line multiplies the two neuron readings by each arrow and adds them (a dot product). The matching arrow always scores 1.00 and the others score −0.50, so the three arrows recover all three features from only two neurons.

A sparse autoencoder (SAE) is a second model trained to do that recovery on a real model. It learns a long list of directions, called a dictionary, often with many more entries than the model has neurons, and it rewrites the model's activity using only a few entries at a time. “Sparse” means only a few entries are used at once. In 2024, Anthropic used this method to find millions of features inside its Claude 3 Sonnet model, including one that fired for the Golden Gate Bridge.

This matters for alignment. If people could read what a model is computing, they could check whether it is doing what people need, instead of judging it only by its answers. For large models, most of that inner computation is not yet understood.

Reading a big claim the “already clean” debate

How to tell what a piece of research has shown from what it hopes.

In 2026, Nick Cammarata of Goodfire, a company that does interpretability research, published a long essay called “Neural Networks Are Already Clean.” It argues that superposition was the wrong explanation for the messy neurons in early studies. In the essay's account, those neurons came from ordinary problems that can be fixed, such as weaknesses in how the models were built and in the tools used to inspect them. It also describes a pattern it calls recursive generalization: a neuron that learns one idea gradually takes on closely related ideas at its edges, so its extra jobs are connected rather than random. The essay reports that in early checks of Qwen3-32B, an open-weights language model, about 90% of the neuron behaviors audited had one main job. If this holds up, researchers could study a model's own neurons directly, instead of first training a second model to untangle them.

The essay drew wide attention and some pushback. Critics pointed out that it moves from measured results to much larger claims, such as this sentence from its summary:

“Highly speculative: this might be most of what we need, and interpretability might be far more tractable, possibly in the near term, than we’ve assumed.”

Three questions help with reading any claim like this.

  1. What was measured, and what is predicted? A measurement is something someone counted or tested: “in the neurons we audited, about 90% had one main job.” A prediction goes past what was measured: “this might be most of what we need.” Both can be honest, but only the measurement is evidence.
  2. Look for hedge words. Words such as might, may, possibly, could, suggests and “we think” mean the author is not claiming certainty. Careful researchers use them on purpose, and this essay labels its own sentence “highly speculative” and calls itself a working hypothesis. The risk comes later: when a hedged sentence is repeated in a headline or a post without its hedge, a guess becomes a claim.
  3. Ask who benefits, then keep checking. Companies that build AI, or sell tools to understand it, benefit when the public believes AI can be understood and controlled. That does not prove anyone is wrong or dishonest. It is a reason to wait for independent checks: other teams repeating the measurements, methods and data published in full, and peer review.

Where the science stands: the essay calls its numbers preliminary and says a technical companion paper will give fuller details. Other researchers have found real limits in today's tools. In 2025, Google DeepMind's interpretability team reported that sparse autoencoders did worse than simpler methods on some practical tasks. Another 2025 study found that common automatic scores for how understandable a model's features are gave similar results for trained models and for models with random, untrained weights. So the fair summary is an interesting result, a large open question, and nothing settled yet.

Read the sources

More words

Every other word, grouped by topic. Search finds words anywhere on this page.

Core ideas

AI
Artificial intelligence. Computer programs that do tasks that usually need a person, like writing or recognizing speech. Almost all AI today is built with machine learning.
Machine learning
Building a math formula from examples instead of writing it by hand, using linear algebra, calculus and probability. See It all starts with math.
Model
The finished program that training produces: a huge file of numbers plus instructions for using them.
Parameters
The billions of numbers inside a model that training adjusts. Also called weights.
Neural network
Layers of simple math steps connected together. Transformers are one kind.
LLM
Large language model. A model trained on huge amounts of text to predict what comes next. GPTs are LLMs.
Generalization
How well a model does on new tasks it never saw during training. Good generalization is the opposite of overfitting.
Overfitting
When a model memorizes its training examples instead of learning the general pattern. It scores well on examples it has seen and badly on new ones, like a student who memorized last year's answer key.
Classifier
A model that sorts things into groups, like spam or not spam, or which language a sentence is in.
Multimodal
A model that works with more than one kind of input or output, like text, images and audio together.
Diffusion model
The kind of model behind most AI image generators. It learns to turn random static into an image, step by step, guided by your text. Paper: Denoising Diffusion Probabilistic Models
Reasoning model
A model trained to write out intermediate steps before its final answer. Working through steps helps on math, code and planning problems. Paper: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Distillation
Training a smaller, cheaper model (the student) to copy the answers of a bigger model (the teacher). Today, many companies use a large LLM like Claude to label their data, then train a small model of their own on those labels. The small model is faster and cheaper to run, but it can only be as good as the teacher's labels. Paper: Distilling the Knowledge in a Neural Network

Using a model

Prompt
The text you give an AI to start from, plus any hidden instructions the company adds.
Few-shot prompting
Putting a few worked examples in the prompt, then asking the model to do the same for new items. For example, show it 10 emails already marked spam or not spam, and it can mark the rest in the same way. No extra training is needed. Paper: Language Models are Few-Shot Learners
Zero-shot prompting
Asking a model to do a task with instructions only, and no examples.
Context window
How many tokens a model can read at once. Older parts of a long chat can fall out of it.
Hallucination
When a model states something false with confidence, because it predicts likely-sounding text rather than checked facts.
Inference
Using a finished model to get an answer, as opposed to training it. Every message you send a chatbot is one inference.
RAG
Retrieval-augmented generation. Before answering, the system searches a set of documents for relevant passages and hands them to the model, so its answer can use information it was never trained on. Paper: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
API
Application programming interface. A way for one program to send requests to another. Apps that “use ChatGPT” or “use Claude” usually send your text to the company's model through its API.
Claude, ChatGPT and Gemini
Three popular AI chatbots built on LLMs. Claude is made by Anthropic, ChatGPT by OpenAI, and Gemini by Google. Each company trains its own models.

Agents

Harness
All the software around a model that lets it act as an agent: the prompts it is given, the tools it can use, the memory it keeps, and the code that decides what happens next. The same model can do much better or much worse depending on its harness.
Tool use
Letting a model call outside programs, like a web search, a calculator or a code runner, and read the results. Benchmarks marked “w/o tools” test the model with no tools allowed.
Memory
Notes an agent saves and reads back later, so it can remember facts and past results beyond its context window.
Orchestration
The code that runs an agent step by step: what to do first, which tool to call, when to check the work, and when to stop.
Coding agent
An agent that writes, runs and fixes code on its own. Examples include OpenAI’s Codex, Anthropic’s Claude Code and the open-source OpenCode.

Data

Dataset
A collection of examples used to train or test a model, like a million emails each marked spam or not spam.
Labels
The correct answers attached to examples in a dataset, usually added by people. Labeling is often done by low-paid workers, and their judgment shapes what the model learns.
Annotation
Another word for labeling: adding the correct answers, tags or notes to examples in a dataset. “Annotating data” and “labeling data” mean the same thing.
Ground truth
The known correct answer you check results against. Many tasks have no ground truth ready, which makes it hard to know if an AI got them right.
Synthetic data
Training examples created by a computer, often by another AI, instead of collected from the real world. It is cheaper, but mistakes in it can be copied into the new model.
Bias
When a model treats some groups of people unfairly because of patterns in its training data. If past hiring data favored one group, a model trained on it will learn to favor that group too.
Data science
Using statistics, programming and machine learning to find patterns in data and answer questions with it, such as which customers are likely to cancel a subscription. “Enterprise” data science means doing this inside businesses.
AutoML
Automated machine learning. Software that tries many model designs and settings on its own and keeps whichever performs best, instead of a person testing each one by hand.

Testing and safety

Benchmark
A standard test used to score models. A model can get good at the test without getting good at the real task.
Well-known benchmarks
Each tests something different. HLE (Humanity’s Last Exam) is very hard expert questions across many subjects. SWE-bench asks a model to fix real bugs from GitHub projects. Terminal-Bench tests doing tasks in a computer’s command line. Version numbers like “4.0” mark updated question sets, and scores are usually the percent of tasks solved. Paper: Humanity’s Last Exam Paper: SWE-bench
Evaluation
Any careful check of what a model can do or how it behaves. Most Differend Labs research is evaluation.
Control
In an experiment, the version you leave unchanged so you can compare. If the changed version scores better than the control, the change likely helped.
Red teaming
Deliberately attacking your own model, the way an adversary would, to find its failures before real users do. Paper: Red Teaming Language Models to Reduce Harms
Jailbreak
A prompt written to trick a model into ignoring its safety rules.
Prompt injection
Hidden instructions placed inside a web page, email or document that an AI reads, so the AI follows the attacker's instructions instead of the user's. A major risk for agents. Paper: Not what you’ve signed up for: indirect prompt injection
Guardrails
Rules and filters placed around a model to block harmful requests or answers.
Interpretability
Research into what is happening inside a model: which parameters and patterns produce which behaviors. Today, most of a large model's inner workings are still not understood. See Looking inside a model. Paper: Toy Models of Superposition
Mechanistic interpretability
The part of interpretability that tries to explain a model's inner workings step by step, like reading a circuit diagram, rather than only testing what it outputs. Often shortened to “mech interp.” Paper: Zoom In: An Introduction to Circuits
Feature
An idea or pattern a model has learned to detect inside itself, such as “this text is about a bridge” or “this picture has a car in it.” A feature can live in one neuron or be spread across several.
Superposition
A proposed explanation for neurons that respond to several unrelated things: the model stores more features than it has neurons by sharing each neuron among several features. How common it is in real models is debated. See Reading a big claim.
Sparse autoencoder
A second model trained to rewrite a model's inner activity as a few entries from a long list of directions, called a dictionary, so that each entry is easier to understand. Often shortened to SAE. Paper: Sparse Autoencoders Find Highly Interpretable Features in Language Models
Steering
Changing a model's behavior by turning one of its features up or down directly inside it, instead of changing the prompt or retraining. In 2024, Anthropic briefly released “Golden Gate Claude,” a version with its Golden Gate Bridge feature turned up so far that it brought the bridge into almost every answer.

The industry and open source

Frontier model
One of the most capable models available at a given time. A frontier lab is a company building them, such as OpenAI, Anthropic and Google DeepMind. Last year’s frontier is often this year’s cheaper option.
Who makes the models
OpenAI (GPT, ChatGPT, Codex), Anthropic (Claude), Google DeepMind (Gemini), Meta (Llama), xAI (Grok), Mistral in France, and DeepSeek, Moonshot AI (Kimi) and Zhipu AI (GLM) in China. Version names like “5.6” or “V4.1” mark newer releases.
Token pricing
Companies charge by the token, usually quoted per million tokens. Input tokens are what you send in. Output tokens are what the model writes back, and they cost more, because the model generates them one at a time. Some providers charge less at off-peak hours, when their computers are less busy.
Compute
The amount of computer processing power used to train or run a model. Training a large model can take thousands of GPUs running for months.
GPU
Graphics processing unit. A computer chip first built for video games that turned out to be very fast at the matrix multiplication machine learning needs.
Hosting and self-hosting
A model has to run on computers somewhere. A host is a company that runs it for you and charges per use. Self-hosting means running open weights on your own computers, which avoids per-token fees but means paying for the hardware and the work yourself.
Open weights
A model whose parameters are published so anyone can download and run it.
Open source
Software whose code is published under a license that lets anyone use, study, change and share it.
Software license
The legal terms that say what you may do with code or model weights. MIT is very permissive: use, change and sell it, as long as you keep the copyright notice. Apache 2.0 is also permissive, and adds a patent grant and a rule to note your changes.
arXiv
A free website where researchers post papers, often before formal peer review. Most AI research appears there first. It is pronounced “archive.”
GitHub
A website where people store and share code. Each project is a repository, or repo. Stars are bookmarks from other users, a rough sign of popularity.
Installing a package
Downloading someone else’s code library so your program can use it. In Python, pip install name does this. uv is a faster tool for the same job.

Missing a word you keep hearing? Email hello@differend.ai and it will be added here.