42 architectures and training schemes, from the perceptron (1958) to diffusion LLMs (2025).

Each diagram draws a network in miniature, input at the bottom and output at the top; one that settles as a whole is a ring, and a graph network is its graph. Most circles are neurons; in sequence models a column is a token, a circle its vector at one layer. A square is larger: an image patch, a matrix-valued state, a whole network, or an environment. Color and mark both show a cell’s role, so diagrams read without color. Faded parts play little role in the step shown. Parts repeated over positions, windows, copies, or passes share weights; layers, experts, encoders, and decoders drawn alike do not. Sections group by trait: wiring, dynamics, training, cost, or purpose. Below each: its landmark year, not always the first, and typical training. Select a diagram for its explanation, key, and papers.

How to read the diagrams

Input

  • Input unit
  • Image patch
  • Noisy input
  • Random noise
  • Visible unit (in and out)
  • Masked token

Hidden

  • Hidden unit
  • Probabilistic hidden
  • Capsule (vector output)
  • Router

State

  • Recurrent unit
  • Memory cell
  • Matrix-valued state

Mixing

  • Attention
  • Convolution or pooling

Output

  • Output unit
  • Reconstruction of input
  • Velocity

Whole systems

  • A whole network
  • Environment
  • Connection
  • Skip connection
  • Data passed on or fed back
  • Gate, acting at the dot
  • Similarity score
  • Learnable function

Feed-forward

Autoencoders

Energy-based and self-organizing

Convolutional

Similarity

Recurrent and memory

Attention

Linear-time models and hybrids

Routing and graphs

Generative frameworks

Reinforcement

What is a neural network?

A network of simple units

A neural network is built from simple units. Most take in numbers, multiply each by a weight, add them up, and pass the sum through a simple nonlinear function. Units are arranged in layers, and each layer's outputs feed the next, so simple steps stack into a complicated function of the input. A few panels use units that work differently: some measure a distance to a stored point (RBF), and some apply a learned curve to each input (KAN).

An example: the MLP

InputsHidden layerHidden layerOutputs

Point at a unit or a line to see its numbers.

Outputs

Loss

In this network, three numbers pass up through two hidden layers of four units to two outputs, along 36 connections, one weight each. Move the inputs: each unit adds up what arrives, each value scaled by its line's weight, and squashes the sum to between 0 and 1. Thicker lines carry larger weights, and gray ones subtract; brighter units are more active. Training changes only the weights; the wiring stays as drawn. Randomize weights draws a fresh random set, like a network before training. Real networks also learn a bias, a number added to each unit's sum; the drawings and this demo leave it out.

To see training, set a target for each output and press Train one step. The loss is the squared gap between the outputs and their targets; each step moves every weight a little in the direction that lowers it, so the outputs creep toward the targets. That is training on one example; a real network does it over many, so it learns the task rather than one answer.

The MLP uses only four of the symbols below, each first in its list: the input unit, hidden unit, output unit and connection. The rest appear in other panels, for memory, attention, gates and more; each panel's key lists the ones it uses.

Every mark and link

Each color and outer mark names a role, and a cell's shape or a small mark inside it names the kind.

Input

Yellow, with a stem below: data entering the network.

  • Input unit. One number, or one token's vector, fed in.
  • Image patch. A square tile of an image, fed in as one vector.
  • Noisy input. Data with noise added, which the network learns to clean up.
  • Random noise. Random numbers drawn fresh each time, which a generator turns into data.
  • Visible unit (in and out). Set by the data, then updated by the network: in Hopfield and Boltzmann machines the same units are both input and output.
  • Masked token. A token hidden from the network, which it must guess. Hollow, since its value is missing.

Hidden

Green and unmarked: work that stays inside.

  • Hidden unit. Adds up what arrives along its lines and applies a nonlinearity.
  • Probabilistic hidden. Turns on at random, with odds set by its inputs; in the VAE, a code sampled from a learned distribution.
  • Capsule (vector output). Outputs a vector: its length says whether a part is present, its direction how it is posed.
  • Router. Scores the experts and sends each token to the best few.

State

Blue, with a ring: something kept from one step to the next.

  • Recurrent unit. Holds a vector it updates at each step from the new input and its last value.
  • Memory cell. A store kept apart from the working state, written and read by the network: the LSTM's cell, the NTM's memory, Modern Hopfield's stored patterns.
  • Matrix-valued state. A state that is a whole matrix rather than a vector, updated at each step.

Mixing

Pink, with a tick each side: a unit that combines values from many positions.

  • Attention. Weighs every other position by how well it matches, then mixes their values in those proportions. In a Transformer it usually stands for a whole block, attention and the feed-forward layer after it (the decoder's block spans its two attention rows).
  • Convolution or pooling. Applies one small filter at every window of its input, or pools a window into one value.

Output

Red, with a stem above: data leaving the network.

  • Output unit. A result: a prediction, a class score, the next token.
  • Reconstruction of input. The network's attempt to rebuild its own input.
  • Velocity. Which way, and how fast, to move a noisy sample toward real data.

Whole systems

Gray: a whole network as one box.

  • A whole network. Any architecture: an expert, a generator, a denoiser. Panels that show a way of training draw networks this way, since any can fill the role.
  • Environment. The world an agent acts in, outside the network: it takes an action and returns the next state and a reward.

Links

Every line is drawn at one weight; only the dash, the arrowhead or the path differs.

  • Connection. One weight between single units: the value below is scaled by it on the way up. Between whole vectors it is a matrix of weights.
  • Skip connection. Carries a layer's input around it, to be added to its output or joined to a later layer.
  • Data passed on or fed back. Data carried one way: a state to the next step, a message to a neighbor, or, bent around the side or as the arrowhead on an input's stem, an output fed back in to run the network again.
  • Gate, acting at the dot. A learned signal that sets how much passes along the arrow it meets, at the dot.
  • Similarity score. A weight computed from the input by how well two things match, as in every attention read (what passes still goes through learned weights shared by every line), or the match score itself, as in a similarity.
  • Learnable function. A small learned function in place of a single weight.

Learning means adjusting weights

A network starts with random weights. Training shows it examples, scores how wrong its output is with a loss (the objective), and nudges every weight to make that score better; backpropagation works out which way each weight should move. Over many examples, the weights come to encode the task. Most panels here learn this way; a few use local rules instead, such as Hopfield's Hebbian rule and the Kohonen map's competitive rule.

The test is new data

Fitting the training examples isn't the goal; doing well on examples the network hasn't seen is. A network with enough weights can memorize its training set, quirks and errors included, and then fail on anything new. That is overfitting, so a network is judged on held-out examples, kept out of training.

Two things keep it general. Regularization limits how freely it fits: weight decay keeps weights small, dropout switches off random units in training, and data augmentation shows each example in many variations. And every architecture assumes something about its data before seeing any, its inductive bias: a convolution, that a pattern means the same anywhere in an image; a recurrent network, that order matters; a graph network, that the graph's edges do. A good assumption saves data. Attention builds in fewer assumptions about images, which is why the original ViT needed more images than a CNN to match it.

Architectures differ in wiring

Those assumptions live mostly in the wiring: what sets most designs apart is which units connect. Dense layers connect every unit to every unit in the next layer; convolutions connect small windows and reuse the same weights across them; recurrent networks carry a state from one step to the next; attention lets each position weigh every other by its content.

Inside a Transformer block

Token vectorsAttentionAdd & normalizeFeed-forwardAdd & normalize

Point at a part to see what it does.

A Transformer stacks one kind of block, run the same way at every position. Here one position goes through it: attention reads from it and the positions before it (in an encoder, from all of them); then a small MLP, the feed-forward layer, works on that position alone, widening its vector (to four units here, often four times its size) and narrowing it back. Around each step a skip path adds the step's input to its output, and the sum is normalized (most recent models normalize before each step instead). The panels usually draw all of this as one pink attention cell (the Transformer's decoder spreads its block over two attention rows), and leave out position: the original Transformer adds it to each token once, before the first block, while most recent models build it into attention in every block (rotary embeddings, RoPE).

Training schemes differ in the goal

The same network can be trained toward different goals: to predict labels, the next word, or a hidden one, or to generate new data, as GANs and diffusion models do. Panels that show a way of training draw the networks inside as gray boxes, since any network can fill them.

Reading a diagram

Data flows from the inputs at the bottom to the outputs at the top, with two exceptions: a network that settles as a whole, such as a Hopfield network, is drawn as a ring, its units both input and output, and a graph network is drawn as its graph. Each circle is a unit (in sequence models, a whole token's vector), and a square something larger: an image patch, a matrix-valued state, a whole network, or an environment. Each line is a connection (one weight in the MLP), and a cell's color and mark show its role, as the key explains. The diagrams show how parts connect, not complete implementations: normalization, most residual paths and positional information are left out. They are also small: two or three layers stand for the dozens a real network stacks, and four positions for a sequence of any length. Select any diagram for its explanation, how it is trained, and where it came from. In most diagrams, Step through lights each unit once everything it reads has lit, so stacked layers move along a sequence as a diagonal wave; networks that settle, sample or loop follow steps of their own. The highlighter beside the menus marks each diagram's defining part.

Where to start

Start here: 15 steps in order, from the perceptron on, each with a line on what it adds to the ones before, and after each step its side trips, which take in the rest. The page's order menu keeps it as Reading path.

Glossary

Basics

Activation

A unit's output value for a given input: its weighted sum after the activation function. The activations of a layer together are its representation of the input.

Used in: Every network here.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Activation function

The function a unit applies to its weighted sum, such as ReLU (keep positive values, zero out the rest) or a sigmoid (squash any number into 0 to 1). Without one, a stack of weighted sums with nothing nonlinear between them would collapse into a single layer, however deep. KAN learns its functions instead of fixing them. The perceptron's is a hard threshold: on above it, off below.

Used in: Nearly every network here; KAN learns its functions instead of fixing them.

Source: Nair & Hinton 2010 (opens in a new tab); Glorot, Bordes & Bengio 2011 (opens in a new tab)

Bias

A number a unit adds to its weighted sum, learned like a weight. It sets how easily the unit responds, so it can fire even when its inputs are all zero.

Used in: Nearly every network here.

Source:

Class

One of the categories a classifier sorts inputs into, such as cat or dog, or the digits 0 to 9. A classifier usually gives one output per class, turned into probabilities by a softmax.

Used in: , , , , , , ,

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Deep learning

Machine learning with networks of many layers, each finding features built from those of the layer below. It took off in the late 2000s and early 2010s, once more data, faster hardware, and better training methods made deep networks practical; most networks here from the DBN on are deep.

Used in: Nearly every network here; the perceptron, the Hopfield network, and the Kohonen map are shallow.

Source: LeCun, Bengio & Hinton 2015 (opens in a new tab)

Dense and sparse

A dense (fully connected) layer links every unit to every unit of the layer before.

InputsUnits

Sparse means few: a sparse code has only a few units active at once, as in a sparse autoencoder, and a sparse mixture of experts runs only a few experts per token.

Used in: , , , ,

Source: ;

Embedding

A learned vector that stands for an item, such as a token, an image, or a sentence.

Dimension 1 →Dimension 2 →catdogcarbusmanwomankingqueen

Training can place items near each other when they are alike in the way its task needs, so distance in the space comes to mean something. Word2vec (2013) made learned word vectors the standard starting point for language.

Used in: , , , , , ,

Source: Bengio et al. 2003 (opens in a new tab); Mikolov et al. 2013 (opens in a new tab)

Feature

A property of the input that a unit responds to, such as an edge, a texture, or a word's tense. A convolution's output, one feature measured at every position, is a feature map.

Used in: , , , ,

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Hidden layer

A layer between the input and the output, whose values no one sets or reads directly.

Input layerHidden layerHidden layerOutput layer

Hidden layers, with a nonlinear activation function, let a network build its own features, which is what lets it learn more than a straight-line boundary.

Used in: , , , , , ,

Source:

Inductive bias

What a model assumes about its data before seeing any, built into its design. A convolution assumes that nearby pixels matter most and that a pattern means the same wherever it appears; a recurrent network, that order matters; a graph network, that the graph's edges say what is related. An assumption that fits the data saves data, and one that doesn't holds the model back. Attention builds in fewer assumptions about images (neither that nearby pixels matter most nor that a pattern means the same anywhere), which is why the original ViT needed more training images than a CNN to match it, until better training recipes narrowed the gap, and why it keeps improving when images are plentiful.

Discussed in: ,

Source: Battaglia et al. 2018 (opens in a new tab);

Input and output

The input is the data a network is given, such as an image's pixels or a sentence's tokens; the output is what it produces, such as a label, the next token, or an image. The guide marks them with stems: below an input, above an output.

Used in: Every network here.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Layer

A stage of computation that turns one representation into the next, usually a row of units working side by side.

Input layerHidden layerHidden layerOutput layer

A network's depth is its number of layers. In the guide's drawings a row is one stage of the computation, often one layer, but a row can also stand for a whole block (a Transformer's attention and the feed-forward layer after it), so counting rows doesn't give a model's depth.

Used in: Every network here.

Source:

A line between two cells in the guide's diagrams. Its style says what it carries: a plain line a learned weight, dashed a weight set by similarity, dotted a gate, an arrow data passed on, a wavy line a learned function. The key lists them.

Used in: Every network here.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Parameters

A network's learned numbers: its weights and biases. A mixture of experts can have many parameters but use only a few experts per token, so its active parameters, the ones each token runs through, are far fewer.

Used in: Every network here.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab);

Patch

One of the small squares an image is cut into, flattened into a vector and treated as a token. ViT-B/16 reads a 224-by-224 image as 196 patches of 16 by 16 pixels; other patch sizes and resolutions give other counts.

Used in: ,

Source:

Probability distribution

How likely each possible outcome is, adding up to 1 over all of them: each class, token, or action a network might choose, or, for numbers that vary smoothly, how densely they fall in each range (a Gaussian's bell curve). Softmax turns scores into one; generative models learn one over their data and sample from it.

Used in: , , , , , ,

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

ReLU

Rectified linear unit: the activation function that passes a positive sum unchanged and turns a negative one to zero.

Weighted sum →Output →−1.6 → 0−0.4 → 00.8 → 0.81.8 → 1.8

Cheap, and easy to train through many layers, it became the default in deep networks in the early 2010s.

Used in: , , ,

Source: Nair & Hinton 2010 (opens in a new tab); Glorot, Bordes & Bengio 2011 (opens in a new tab)

Softmax

A function that turns a list of scores into weights that are positive and add up to 1, giving the largest scores most of the weight.

21−0.50.2ScoressoftmaxCat7.390.62Dog2.720.23Fox0.610.05Owl1.220.10

Attention uses it to weigh positions, a language model to turn scores into the next token's probabilities.

Used in: , , , , , , , , , ,

Source: Bridle 1989 (opens in a new tab)

Target

The output training wants for an input: the right label, the actual next token, or the direction a flow should move. The loss measures how far the output is from it.

Used in: Nearly every network here; not the Hopfield network, the Kohonen map, the Boltzmann machine or RBM, or a GAN's generator, which learn without a set answer for each input.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Token

One item of a sequence as a model reads it: a word or part of a word, an image patch, a sound sample. Each becomes a vector before the network sees it.

Used in: , , , , , , , , ,

Source: Sennrich, Haddow & Birch 2016 (opens in a new tab)

Unit

The basic element of a network, also called a neuron: it multiplies each input by a weight, adds them up with a bias, and passes the sum through an activation function. The guide draws one as a circle.

Used in: Every network here.

Source: McCulloch & Pitts 1943 (opens in a new tab);

Vector

An ordered list of numbers, such as a unit's weights or a token's embedding: a point, or a direction, in a space with one axis per number.

0.940.34[0.94, 0.34]

Most of what flows through a network is vectors.

Used in: Every network here.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Weight

A number on a connection that scales whatever passes along it. Training adjusts the weights; they are what a network learns. Most lines in the guide stand for one.

Used in: Every network here.

Source:

XOR

Exclusive or: true when exactly one of two inputs is on.

Input 1 →Input 2 →Hidden 1Hidden 20, 01, 00, 11, 1

Its true and false cases can't be split by one straight line, so a perceptron can't learn it, while a network with a hidden layer can; Minsky and Papert's 1969 analysis of such limits is often blamed for slowing the field for years.

Used in: ,

Source: Minsky & Papert 1969 (opens in a new tab);

Operations

Associative memory

A memory recalled by content rather than address: given part of a stored pattern, or a noisy copy, it returns the whole. Its capacity is how many patterns it can store before recall breaks down.

Used in: ,

Source: ;

Attention

A way for each position in a sequence to gather what it needs from the others, taking more from the positions that match it best: its query against their keys.

TokensAttentionNew vector

The weights are set by the input itself, unlike a layer's learned weights, which is why the guide draws them dashed. Self-attention reads the same sequence; cross-attention reads another, such as the source sentence in translation. A layer usually runs several at once, each a head (multi-head attention).

Used in: , , , , , , , , , ,

Source: ;

Bidirectional

Reading a sequence both ways, so each position sees what comes after it as well as before.

InputsForward →← BackwardOutputs

An encoder may read its input both ways, as BERT's does, or in one direction only, as the first seq2seq encoders did. A model writing one token at a time can't see tokens it hasn't written yet, but it can still read an input it is given, such as the sentence to translate, both ways. Processing every position at once isn't the same thing: GPT trains on all positions in parallel, yet each reads only to its left.

Used in: , , , , , ,

Source: ;

Block

A small group of layers repeated to build a deep network, such as a Transformer's attention and feed-forward layers with their residual connections. Stacking the same block many times is how most deep networks are made; the primer opens one.

Used in: , , , , , , , ,

Source: ;

Bottleneck

The narrowest layer of a network that squeezes its input and widens it again, which forces it to keep only what matters most for its task, such as rebuilding the input.

InputCodeOutputEncoderDecoder

In an autoencoder the bottleneck is the code; in U-Net it is the coarsest scale, with skip connections carrying the fine detail around it.

Used in: , ,

Source: ;

Capsule

A group of units whose output is a vector: its length says how likely an entity is present, and its direction describes it, such as its pose. Capsules pass their outputs on by routing by agreement.

Used in:

Source:

Causal mask

In a model that generates a sequence, each position may read only itself and the ones before it, never later ones.

TokensAttention

Its target is the next position, so in training it cannot see what it is learning to predict. The guide draws it as lines that reach back or straight up, never forward. WaveNet gets the same effect from causal convolutions, which only look back.

Used in: , , ,

Source:

Channel

One of the stacked maps at each position of a convolutional layer, such as red, green, and blue in an image, or one filter's output deeper in. A filter reads every channel in its window, and each filter makes one new channel.

Used in: , , , ,

Source:

Clamping

Holding some units fixed at given values, such as the visible units at a training example, while the rest of the network settles or is sampled around them.

Clamped

Used in: , ,

Source:

Code

The representation an encoder makes of its input, from which a decoder rebuilds it: usually smaller than the input, or, in a sparse autoencoder, with only a few units active at once.

InputCodeOutputEncoderDecoder

Used in: , , ,

Source: ; Hinton & Salakhutdinov 2006 (opens in a new tab)

Convolution

Applying one small set of weights, a filter, at every position of the input, so a pattern is detected wherever it appears.

InputFilterFeature map

Each output reads only a few neighbors, and every position shares the same weights, so the weights stay few. Stacked layers see wider and wider regions: in an image, early filters find edges and later ones shapes. WaveNet's dilated convolutions skip inputs, so a few layers reach far back.

Used in: , , , ,

Source: ;

Cosine similarity

How closely two vectors point the same way, from 1 (same direction) through 0 (perpendicular) to −1 (opposite), whatever their lengths: a common score for comparing embeddings.

40°cos 40° = 0.77cos = 0.77cos = 0cos = −1cos = 1

Whether perpendicular means unrelated depends on the embedding.

Used in: ,

Source: ;

Denoiser

The network a diffusion model trains and runs at every step: given a noisy sample and how noisy it is, it predicts the noise (or the clean data), so a little can be taken away. It is usually a U-Net or a Transformer.

Used in: , ,

Source:

Dilation

Spacing out the inputs a convolution reads, skipping some between each.

InputsSpacing 1Spacing 2Spacing 4

Doubling the spacing at each layer lets the reach grow exponentially with depth: with filters two wide, as in WaveNet, and spacings 1, 2, 4, … 512, ten layers reach 1,024 steps back, and a few stacks of them thousands. Wider filters or other spacings reach further or less far.

Used in:

Source: ; Yu & Koltun 2015 (opens in a new tab)

Edge

A connection between two nodes of a graph.

In a graph network the edges are the input's relations, such as bonds between atoms; in KAN each edge carries its own learned function instead of a single weight.

Used in: ,

Source: ;

Encoder and decoder

An encoder turns an input into an internal representation; a decoder turns a representation into an output.

InputCodeOutputEncoderDecoder

Autoencoders, translation models, and U-Nets pair the two; BERT is an encoder alone and GPT a decoder alone.

Used in: , , , , , , , , , , ,

Source: ;

Energy

A single number a Hopfield network or Boltzmann machine gives each state of its units, low for the states it has learned to favor.

State →Energy →

In a Hopfield network no update can raise it, so the state settles into a minimum, often a stored pattern. A Boltzmann machine's random units keep changing, sometimes uphill; what settles is how often each state turns up, the low-energy ones most.

Used in: , , , ,

Source: ;

Equilibrium

For a network of random units, such as a Boltzmann machine, the point after enough updates where how often each state turns up stops changing: low-energy states turn up most, though the units themselves keep changing. Boltzmann machines learn by comparing equilibrium with the data clamped and with it free.

Used in: , ,

Source:

Feed-forward layer

The small MLP in each Transformer block, applied to every position on its own after attention: it widens each vector, applies an activation function, and narrows it back. It holds a large share of each block's parameters, often two-thirds, and a mixture of experts replaces it with many.

Used in: , , , , , , , ,

Source:

Filter

One learned pattern detector in a convolution: a small grid of weights that, at each position, writes how strongly its pattern appears there.

InputFilterFeature map

A layer runs many filters, each making its own feature map; also called a kernel.

Used in: , , ,

Source:

Gate

A learned multiplier, computed by the network and usually between 0 and 1, that scales a signal: near 0 shuts it out, near 1 lets it through.

InputState

LSTMs and GRUs compute their gates from the input and the previous state, to decide what their state keeps, forgets, and shows. Mamba's selective state gates in a similar way, but from the input alone, which lets it train in parallel. xLSTM's exponential gates can go above 1. The guide draws a gate as a dotted line ending at a dot on the arrow it acts on.

Used in: , , , , ,

Source:

Gaussian bump

A bell-shaped response: largest at a center point and falling off smoothly with distance from it.

Input →Output →1.000.490.01

Each unit of a Gaussian radial basis network, the most common kind, responds this way to inputs near its center.

Used in:

Source:

Graph

A set of nodes joined by edges, such as atoms and bonds, people and friendships, or roads and junctions. A graph network works on it directly, so it handles any number of nodes in any arrangement.

Used in:

Source:

Head

A small output layer on a shared network, turning its features into one answer: a class, the probability of each action, a value. In attention, a head is one of several attention steps run side by side, each with its own queries, keys, and values, so each can look for something different.

Used in: , , , , , ,

Source:

Invertible

Able to be run backward exactly: every output comes from one input, which can be recovered. A normalizing flow is built from invertible layers chosen so that their effect on probability is cheap to compute. Most are coupling layers, which leave half the numbers as they are and use them to shift and scale the other half, so each layer is easy to undo.

Used in:

Source:

Kernel

A function scoring how alike two inputs are, such as a Gaussian bump of the distance between them. Kernel methods such as support vector machines work entirely through such scores; each unit of a radial basis network is one kernel, measured against its center. (A convolution's filter is also called its kernel.)

Used in: ,

Source: ; Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Latent

Hidden: describing what a model works with but never observes directly.

InputCodeOutputEncoderDecoder

A latent space is where such codes live; a VAE or GAN draws a point there and decodes it into something new, and nearby points decode to similar things. An autoencoder's code is a latent vector.

Used in: , , , ,

Source:

Masking

Hiding part of what a network may see: tokens swapped for a mask token for it to fill in (BERT, masked diffusion LLMs), or positions attention may not read (a causal mask).

Used in: , ,

Source: ;

Message passing

How a graph network updates each node: every neighbor sends it a message computed from its own state, and the node combines them with its state. Repeating it lets information travel one edge farther each round.

Used in:

Source: ;

Mixture of experts

A layer made of many expert networks whose outputs a gating network, the router, combines.

TokensRouterExpertsOutputs

The original of 1991 weighted every expert; a sparse mixture of experts, the usual kind today, picks only a few for each token, so the model holds far more parameters than any one token runs through. It can grow without costing proportionally more compute per token, though every expert must still be held in memory, and many of today's largest language models use it. The Routing entry steps through it.

Used in:

Source: Jacobs et al. 1991 (opens in a new tab);

Node

A point in a graph, such as an atom or a person, joined to others by edges.

In a graph network each node holds a vector, updated from its neighbors' messages; in KAN a node just adds up what its edges bring.

Used in: ,

Source:

Normalization

Rescaling a layer's numbers to a standard spread, so signals stay in a steady range as they pass through many layers and training stays stable.

12.60.60.460.4620.4−1.6−1.23−1.2333.81.81.381.3841.2−0.8−0.61−0.61

Layer normalization works on each token's vector, batch normalization on each feature across a batch.

Used in: Most deep networks since 2015, and nearly every Transformer block.

Source: Ioffe & Szegedy 2015 (opens in a new tab); Ba, Kiros & Hinton 2016 (opens in a new tab)

Pooling

Shrinking a feature map by summarizing each small patch, usually by its largest value.

Feature mapPooled

It keeps whether a pattern appeared while forgetting exactly where, and lets later layers see more of the input for the same cost.

Used in:

Source: ; Riesenhuber & Poggio 1999 (opens in a new tab)

Position

A slot in a sequence or grid: one token, one time step, one patch, or one place in a feature map. Attention on its own ignores order, so Transformers add positional encodings: the original added a fixed pattern of waves to each token's vector, BERT and ViT learn one per position, and most recent language models rotate queries and keys by their position instead (RoPE).

Used in: , , , , , , , , ,

Source: ; Su et al. 2021 (opens in a new tab)

Prior

The distribution a generative model draws its codes or noise from before generating, usually a plain Gaussian. A VAE is trained to keep its codes close to it, so codes drawn from the prior usually decode to something plausible; where the codes of real data leave parts of the prior unfilled, samples from there can come out poorly.

Used in: , , ,

Source:

Query, key, and value

The three vectors attention makes from each position, each by its own learned weights.

TokensAttentionOutputqkkkvvv

A position's query is compared with every key; the better the match, the more of that position's value it takes, like a lookup that returns a blend instead of one entry.

Used in: , , , , , , , ,

Source:

Read and write heads

The parts of a memory-augmented network that read from and write to its memory. Each produces soft weights over the memory's rows, by content or by location, so reading and writing are differentiable and can be trained by backpropagation.

Used in:

Source:

Recurrence

Running the same network once per step of a sequence, passing a state from each step to the next: a running summary of everything so far.

InputsStateOutputs

The state is what lets the network remember, and squeezing all of history into it is what makes long memories hard.

Used in: , , , , , , , ,

Source: ;

Reparameterization trick

Writing a random sample as the network's outputs plus independent noise, a mean plus a spread times a standard random number, so the error can be passed back through the sampling step. It is what lets a VAE train by backpropagation.

Used in:

Source:

Residual connection

A path that carries a layer's input around it and adds it to the layer's output, so the layer only has to learn a change.

InputLayerSum

It lets very deep networks train, because the signal, and in training its gradient, can pass straight through. Also called a skip connection; U-Net's skip connections copy instead of adding.

Used in: , , , , , , , , , , ,

Source:

Residual stream

The running vector that residual connections carry through a deep network: each block reads it and adds its own output back, so the stream builds up every block's contribution.

Used in: , , , , , , , , , ,

Source: ;

Routing

Deciding where each input goes, or how much of it goes where.

TokensRouterExpertsOutputs

A mixture of experts' router scores the experts for each token and sends it to only the top few, a sparse selection; CapsNet's routing by agreement instead splits each capsule's output among all the higher capsules, by softmax weights that favor those whose predictions agree with it.

Used in: ,

Source: ;

Solver

A numerical method that follows a velocity forward in small steps, as for an ordinary differential equation (ODE). Flow-matching models sample this way, and so can diffusion models (DDIM); diffusion's original sampler instead adds fresh noise at each step, a random version of the same walk. Better solvers take bigger steps with little loss in quality.

Used in: ,

Source: ;

Spline

A smooth curve made of short polynomial pieces joined end to end, shaped by a few control values.

Input →Output →

The original KAN learns one spline per edge; later versions swap in other curves that run faster.

Used in:

Source:

State

What a network carries from one step to the next: an RNN's hidden state, an LSTM's cell state beside it, or the matrix-valued state of linear attention and state space models, which stays the same size however long the sequence grows. In reinforcement learning the state is instead the situation the environment is in, which the policy sees.

Used in: , , , , , , , , , ,

Source: ; ; Sutton & Barto 2018 (opens in a new tab)

State space model

A recurrence built from linear updates of a hidden state, an idea from control theory. Because each update is linear, training can compute a whole sequence in parallel, while generating runs one step at a time with a state of fixed size. Mamba makes the updates depend on the input (selective), so it can choose what to keep.

Used in: ,

Source: Gu, Goel & Ré 2021 (opens in a new tab);

Update rule

How a linear-time model writes each token into its fixed-size state, the main way such models differ. Plain linear attention accumulates: each token adds its key and value, and nothing is ever removed, so old entries blur together as the state fills. Decay, as in RetNet and Mamba, shrinks the old state a little before each write, at a fixed rate or as the input decides, so the model can forget. The delta rule, as in DeltaNet, first reads what the state already returns for the key and writes only the difference from the new value, so it overwrites an entry rather than piling on top of it; Gated DeltaNet adds decay as well, so it can both forget and correct.

Used in: , ,

Source: ; Schlag, Irie & Schmidhuber 2021 (opens in a new tab);

Velocity

The direction and speed a point should move at a given moment, as a vector. Flow matching trains its network to output it, and sampling follows it step by step; the guide marks it with an arrow.

Used in:

Source:

Window

The few neighboring positions an operation reads at once, such as a convolution's three inputs.

InputsLayer 1Layer 2

Sliding it along the input applies the same operation everywhere. Dilating it, skipping inputs between its reads, reaches farther with no extra weights; widening it reaches farther too, but adds a weight for every input it gains.

Used in: , , ,

Source:

Objectives

Adversarial training

Training two networks as opponents, each improving by beating the other. In a GAN the generator gains when the discriminator mistakes its fakes for real data, and the discriminator when it doesn't; the contest pushes the fakes toward the real thing, though it can be unstable to train.

Used in:

Source:

Competitive learning

Units compete for each input: the one whose weights match it best wins and moves its weights toward it, and in a Kohonen map so do its neighbors on the map. Over many inputs each unit comes to stand for one kind of input.

Used in:

Source: ; Rumelhart & Zipser 1985 (opens in a new tab)

Contrastive learning

Training embeddings by pulling matching pairs together and pushing mismatched ones apart, such as a photo and its caption against the other captions in the batch.

Second pairFirst pair

Used in: ,

Source: ;

Hebbian learning

Strengthening the weight between two units that are active together, often summed up as cells that fire together wire together. A Hopfield network stores its patterns this way, in one pass, with no error passed back.

Used in:

Source: Hebb 1949 (opens in a new tab);

Likelihood

How probable a model finds some data (for continuous data such as images, a probability density). Training to raise it, usually its logarithm, teaches the model to assign high probability to real examples; a normalizing flow computes it exactly, a VAE a lower bound on its logarithm.

Used in: , , , ,

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab);

Masked-token prediction

Training a model to fill in tokens hidden from it, using the tokens on both sides.

TokensAttentionPrediction

BERT picks 15% of positions to predict and replaces most of them with a mask token (a few with a random token, a few left as they are). It suits a model that reads the whole text at once; a masked diffusion LLM generates by repeating it, unmasking a few tokens at a time.

Used in: ,

Source:

Next-token prediction

Training a model to predict each token from the ones before it, so ordinary text supplies its own answers, and every position of a sequence is a training example at once.

TokensAttention

It is how GPT-style language models learn.

Used in: , , , , , , , , , ,

Source: Bengio et al. 2003 (opens in a new tab);

Noise and denoising

Noise is random variation, here added on purpose. A denoising model learns to remove it, which teaches it what clean data looks like; diffusion repeats this a little at a time to generate, and a GAN's generator turns noise into data in one pass.

Used in: , , , , ,

Source: ;

Reconstruction

Training a network to reproduce its own input, usually through a narrow middle, so it must learn what matters about the data to get it back.

Used in: , , , ,

Source: ; Hinton & Salakhutdinov 2006 (opens in a new tab)

Variational bound

A lower bound on the logarithm of how probable a model with a hidden code finds the data, trained in place of that log-likelihood, which can't be computed exactly; raising the bound usually raises the log-likelihood too, but not always: part of any gain can come from the bound growing tighter instead. A VAE's bound rewards rebuilding the input while keeping its codes close to its prior. Diffusion models train on a simplified form of the same bound.

Used in: ,

Source:

Training

Backpropagation

How a network finds which way to change each weight.

InputHiddenOutputError passed back

It passes the error back from the output, layer by layer, giving each weight its share of the blame, its gradient; gradient descent then moves every weight a small step the other way. Repeated over many examples, this is what training means for most networks here.

Used in: Nearly every network here; not the Hopfield network, the Boltzmann machines, or the Kohonen map, which learn by local rules.

Source:

Contrastive divergence

A fast way to train an RBM: start Gibbs sampling at the data, run only a step or a few, and nudge the weights toward the data and away from the short run's result. It approximates maximum-likelihood training without waiting for equilibrium. Not related to contrastive learning.

Used in: ,

Source:

Distillation

Training a model, the student, to reproduce another's outputs, the teacher's: to make a smaller or faster copy. For diffusion and flow models it cuts sampling from many steps to a few.

Used in: ,

Source: Hinton, Vinyals & Dean 2015 (opens in a new tab)

Fine-tuning

Training a pretrained model a little further, on a smaller dataset for a specific task, starting from its learned weights rather than from scratch. It is far cheaper than pretraining and adapts the model's features to the task.

Used in: , , , ,

Source: ;

Gibbs sampling

Sampling from a network of random units by updating some of them, each drawn given the rest, over and over. Run long enough it reaches equilibrium; in an RBM a whole layer can be drawn at once, since its units don't connect to each other.

Used in: , ,

Source: Geman & Geman 1984 (opens in a new tab);

Loss

A number that measures how far a network's output is from what it should be; training lowers it.

Weight →Loss →loss 2.58loss 0.75loss 0.35loss 0.27loss 0.25

Each panel's objective says what its loss rewards.

Used in: Nearly every network here; not the Hopfield network or the Kohonen map, which follow update rules instead.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Overfitting

Fitting the training examples so closely, quirks and errors included, that a network does worse on new data.

Training time →Loss →Best

It shows when the loss on held-out examples, kept out of training, starts rising while the training loss still falls. Stopping there, early stopping, guards against it, as do regularization and more data.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Post-training

Training a model further after pretraining, to shape how it behaves: on examples of good answers (instruction tuning), directly on people's preferences (as DPO does), or by reinforcement learning such as RLHF, often several in turn. It turns a text predictor into an assistant.

Used in: ,

Source:

Pre-training

Training a model first on a large, general task, such as predicting words across much of the web, so it learns broadly useful features before any specific use. A DBN pretrains one layer at a time; BERT and GPT pretrain on text.

Used in: , , , ,

Source: ;

Regularization

Anything that limits how freely a network fits its training data, so that it does better on new data. Weight decay pulls every weight a little toward zero; dropout switches off random units at each training step, so no unit can count on another; data augmentation shows each example in many variations, such as an image flipped or cropped; early stopping ends training once the held-out loss stops falling. Some panels build it into their objective: the sparse autoencoder's sparsity penalty, the denoising autoencoder's noise, and the VAE's pull toward its prior.

Used in: , ,

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab); Srivastava et al. 2014 (opens in a new tab)

Sampling

Drawing an output at random from a model's probabilities instead of always taking the likeliest one, which is how generative models give varied results.

drawncat0.500.500.500.72dog0.250.250.250.18drawncar0.150.150.150.07sky0.100.100.100.03

Used in: , , , , , , , , , , ,

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Self-supervised learning

Training on answers the data supplies itself: hide part of the input, or the next word, and ask the network for it. It needs no labels, so it can learn from vast amounts of text and images; it is the usual way to pre-train.

Used in: , , , , , ,

Source: ;

Supervised learning

Training on inputs paired with targets, the answers the network should give: labels people provided, such as what a photo shows, or targets from measurements, simulations, or a program, such as the copied sequences a Neural Turing machine learns to reproduce. The network is corrected toward each target. Most classifiers here, from the perceptron to ResNet, learn this way.

Used in: , , , , , , , , , , , , , , ,

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Training and inference

Training adjusts a model's weights from data; inference runs the model on new inputs with its weights fixed. A model may be trained in several stages, retrained later, or updated as new data arrives, and each stage is costly; inference runs every time the model is used, so its cost per input matters most once a model is in use.

Used in: Every network here.

Source: Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Unsupervised learning

Training with no answers at all: the network finds structure in the data on its own, such as clusters, compact codes, or the data's overall shape. The Kohonen map, Boltzmann machines, and autoencoders learn this way.

Used in: , , , , , , , , ,

Source: ; Goodfellow, Bengio & Courville 2016 (opens in a new tab)

Vanishing gradient

The error passed back through many layers, or many steps of a recurrence, shrinking a little at each until the earliest weights barely learn.

Output1111Layer 40.250.250.25Layer 30.060.06Layer 20.016Layer 10.004

It long made deep and recurrent networks hard to train; LSTM gates, residual connections, ReLU activations, and careful starting weights all answer it.

Discussed in: ,

Source: Hochreiter 1991 (opens in a new tab); Bengio, Simard & Frasconi 1994 (opens in a new tab)

Reinforcement learning

Action

What an agent does at each step, chosen by its policy: push left or right, move a piece, write a token. The environment responds with a new state and a reward.

Used in:

Source: Sutton & Barto 2018 (opens in a new tab)

Actor and critic

The two parts of an actor-critic method. The actor is the policy, choosing actions; the critic estimates the value of a state, the total reward still expected from it (the return), or of taking a given action in it. Comparing what happened with the critic's estimate tells the actor which actions did better than expected. The two can share one network or be separate ones.

Used in:

Source: ; Sutton & Barto 2018 (opens in a new tab)

Clipping

PPO's way of keeping each update small: it clips its objective, so once an action's probability has moved more than about 20% from before the update, in the direction that helps, pushing it further gains nothing. That removes the incentive for larger changes rather than strictly capping them, and keeps learning steady when one batch is lucky or unlucky.

Used in:

Source:

Environment

Everything outside the network that it acts on: a game, a simulator, a robot's surroundings, a person rating answers. It takes each action and returns the next state and a reward. The guide draws it as an outlined box.

Used in:

Source: Sutton & Barto 2018 (opens in a new tab)

Policy

In reinforcement learning, the network that chooses actions: given the current state, it usually gives the probability of each action, and one is drawn; a deterministic policy picks one directly. Policy-gradient methods train it directly, making well-rewarded actions more likely.

Used in:

Source: Sutton & Barto 2018 (opens in a new tab);

Reinforcement learning

Learning by trial and error. A network, the policy, chooses actions, and the environment returns rewards: scores for how well things went. Training makes actions that led to more reward more likely. RLHF fine-tunes language models this way, with rewards from a model trained on people's preferences.

Used in:

Source: Sutton & Barto 2018 (opens in a new tab);

Reward

The score the environment returns after an action, such as +1 for each step the pole stays up. Training aims for the most reward over time, not at each step.

Used in:

Source: Sutton & Barto 2018 (opens in a new tab);

Model families

Autoregressive model

A model that generates one piece at a time, each predicted from everything before it, feeding each output back in as the next input: in the guide, an arrowhead on an input's stem, or an arrow around the side for the newest.

Tokens inAttentionAttentionNext token

Most language models work this way; diffusion language models fill in many tokens at once instead.

Examples: , , , , ,

Source: ;

Diffusion

Generating data by learning to undo a gradual noising: a network is trained to remove a little noise at a time, then run from pure noise, step by step, to make something new. The Diffusion model panel draws it; masked diffusion LLMs do the same with masked tokens.

Examples: ,

Source: ;

Generative model

A model that learns what its training data looks like well enough to make new examples of it: images, audio, or text. Some make a sample all at once (a GAN, a VAE's decoder), some refine noise step by step (diffusion, flow matching), and some write one piece at a time (autoregressive models such as WaveNet and GPT).

Examples: , , , , , , , , , ,

Source: ;

Generator and discriminator

The two networks of a GAN. The generator turns random noise into a sample; the discriminator sees real data and the generator's samples and guesses which is which. After training, only the generator is kept.

Used in:

Source:

Language model

A model of text: given some tokens, it gives a probability for each token that could fit, usually the next one (next-token prediction), sometimes masked ones in between. Trained on vast amounts of text and then post-trained, large ones are today's chat assistants.

Examples: , , , , , , ,

Source: Bengio et al. 2003 (opens in a new tab);

Normalizing flow

A generative model built from invertible steps that turn simple noise into data and back, so it has an exact formula for its likelihood of any data (a probability density), which a flow of discrete steps computes directly. Flow matching trains a continuous one, whose steps are tiny moves along a learned velocity; its likelihood is computed numerically, by solving an ODE, often with a random estimate of one term along the way.

Examples: ,

Source: ;

Word2vec

A shallow network that learns a vector for every word from the words around it.

WordIts vectorWords nearby

In its usual form, skip-gram with negative sampling, each word's vector is trained to score the words really near it high and a few words drawn at random low. Words used in similar contexts end up with similar vectors, so that king − man + woman lands near queen. GloVe and fastText are close relatives, and every language model since begins by looking up a learned embedding for each token.

Discussed in:

Source: Mikolov et al. 2013a (opens in a new tab); Mikolov et al. 2013b (opens in a new tab)

Tasks and data

Clustering

Grouping data points that lie close together, with no labels.

Feature 1 →Feature 2 →

A radial basis network often places its centers by clustering the training data, and a Kohonen map clusters as it learns.

Used in: ,

Source: ;

Principal component

A direction along which data varies most; the first few give the best straight-line compression of the data.

Feature 1 →Feature 2 →

A linear autoencoder with a narrow middle learns the same subspace, so it takes nonlinear layers to do better.

Discussed in:

Source:

Quantization

Rounding values to one of a fixed set of levels.

Time →Value →

WaveNet quantizes each audio sample to one of 256 values, so it can predict the next as a choice among them with a softmax. (Quantizing a model's weights to fewer bits, to save memory, is the same idea.)

Used in:

Source:

Segmentation

Labeling every pixel of an image with what it shows, such as cell or background, rather than labeling the image as a whole. A U-Net outputs a dense map with a label for each pixel: smaller than its input in the original, whose convolutions don't pad, and the same size in most later versions.

Used in:

Source:

Sequence to sequence

Mapping one sequence to another of possibly different length, such as a sentence to its translation: an encoder reads the whole input, and a decoder writes the output, usually one token at a time.

Words inStatesWords out

In the first neural versions (seq2seq, 2014) the decoder got only the encoder's last state, so a whole sentence had to fit in one vector, and long ones lost detail; attention let the decoder read every encoder state instead. Translation drove the move from recurrent encoder–decoders to attention, and then to the Transformer.

Examples: ,

Source: Sutskever, Vinyals & Le 2014 (opens in a new tab); ;

Zero-shot

Doing a task with no training examples for that task. CLIP classifies an image by comparing it with captions such as “a photo of a dog”, so it can use labels from no training set, though its pretraining on web images and captions has likely seen similar images and words.

Used in:

Source:

Scale

Context window

How many tokens a model can take into account at once: its working memory.

TokensAttentionNext token

Attention's cost grows with it, which is why linear-time and hybrid models aim at long contexts.

Discussed in: ,

Source:

KV cache

The keys and values a Transformer keeps for every earlier token as it generates, so each new token can attend to them without recomputing them. It grows with the context, and so does the cost of each new token; recurrent and state-space layers keep a fixed-size state instead.

Used in: , ,

Source: ; Pope et al. 2022 (opens in a new tab)

Parallelism

Working on every position of a sequence at once instead of one after another, which is what makes training on modern hardware fast. A Transformer trains on a whole sequence in one pass, while an RNN goes step by step, each state waiting for the last; linear attention and state space models are built so their recurrence can be computed in parallel too. Diffusion language models carry it into generation, filling in many tokens per pass.

Discussed in: , ,

Source: ;

Quadratic and linear time

Full attention compares every pair of positions, so its pairwise work grows with the square of the length: twice the text, four times that work.

Sequence length →Cost →1×4×16×

The rest of the model grows only in step with the length, so for short texts the quadratic part need not dominate. Recurrent and state-space models carry a fixed-size state instead, so their work grows only in step with the length, but must squeeze all of the past into that state. Hybrids keep a few attention layers for direct access to earlier tokens: still quadratic, but with far less quadratic work.

How sequence models' costs grow with the length of the sequence (with full attention)
ModelTrainingCost of each new tokenMemory while generatingRecall of earlier tokens
RNN, LSTM, GRUone step at a timeflata fixed-size statethrough a fixed-size summary
Transformerin parallel; work grows with the squaregrows with the contexta KV cache that grows with the contextdirect access to every earlier token
Linear attention, Mamba, DeltaNetin parallel; work grows in stepflata fixed-size statethrough a fixed-size summary
Recurrent hybridin parallel; linear work plus a few quadratic layersgrows only in its few attention layersa much smaller KV cachedirect access, through its attention layers

Discussed in: ,

Source:

Diagram

Key

Reading the diagram

Overview

Related

Objective

Papers