The model
A program whose calculations use values learned from examples. These values are its “parameters”. Text is split into small pieces called “tokens”.
Every innovation addresses a problem. Discover which one.
How models learn, evolve and become usable. Explore ideas, mechanisms and trade-offs, starting with the foundations of the Transformer.
A program whose calculations use values learned from examples. These values are its “parameters”. Text is split into small pieces called “tokens”.
During training, the program adjusts these values to perform tasks better, such as predicting the next piece of text. It does not simply store every answer in a library.
A text-generating model calculates possibilities for what comes next. It produces successive pieces of text using what precedes them. A plausible continuation can contain errors.
Explore how a model connects words, learns to follow instructions and reduces its computation and memory needs.
Reveal the next part of a sentence and follow the information used at each step.
A text takes shape, one token at a time.
The initial text has been read: its 5 K/V entries are in memory. Generate the continuation to see what gets reused.
Scripted example; no model is running. A word or punctuation mark acts as a token here; splitting, weights and routing are illustrative.
When the model writes a continuation, it reuses information already computed from the preceding text. This information takes up space: it is the KV cache. Circles represent reading paths, called “attention heads”; the blocks below show retained information.
Choose the first step to begin.
Assumptions: one sequence, 128 dimensions per K/V head, 2 bytes per element; for MLA, a 512-element latent and a 64-element positional key. Model weights, activations, fragmentation and engine overheads are excluded.
K and V are two sets of computed data: keys (K) help determine which positions to consult; values (V) carry information to combine. A “K/V” box represents these two sets, not two copies of the text.
GQA : 2 × G × d × L × T × b
| Architecture | Memory | Share of MHA |
|---|---|---|
| MHA | 2.5 MiB | 100 % |
| MQA | 80 KiB | 3.125 % |
| GQA | 640 KiB | 25 % |
| MLA | 180 KiB | 7.031 % |
A longer bar means more memory. GiB and MiB are memory units: 1 GiB equals 1,024 MiB. These numbers cover only the retained information for the text.
T = tokens, L = layers, H = heads, G = KV groups, d = dimensions per head, b = bytes per element. MHA: 2HdLTb; MQA: 2dLTb; GQA: 2GdLTb; MLA: (512 + 64)LTb. The factor 2 in MHA/MQA/GQA counts K and V; the MLA latent jointly compresses K and V.
MLA is not always the smallest cache: here MQA stores fewer elements. Size alone measures neither quality nor speed. The MLA diagram shows retained elements; projections can be absorbed into weights to compute without reconstructing all K/V.
A text takes shape, one token at a time.
Attended words turn blue. A stronger color represents a higher weight in this mixture of information.
We process “She”. In this illustrative mixture, “Lea” gets the highest weight.
Scripted example; no model is running. A word or punctuation mark acts as a token here; splitting, weights and routing are illustrative.
To process a word, the model combines information from other text positions. Percentages show the share taken from each position for this calculation. The row is the word being processed; the column is the position consulted.
Choose the first step to begin.
Invented two-dimensional Q/K vectors; no model is running. The divisor τ is a teaching control for attention scores; it is not token-sampling temperature.
weights = softmax((QKᵀ / √2 + mask) / τ)
| Reads ↓ / attends to → | Lea | puts | an | apple | on | the | table | . | She | cuts | the | apple | . |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lea | 100% | × | × | × | × | × | × | × | × | × | × | × | × |
| puts | 94% | 6% | × | × | × | × | × | × | × | × | × | × | × |
| an | 89% | 5% | 5% | × | × | × | × | × | × | × | × | × | × |
| apple | 85% | 5% | 5% | 5% | × | × | × | × | × | × | × | × | × |
| on | 81% | 5% | 5% | 5% | 5% | × | × | × | × | × | × | × | × |
| the | 77% | 5% | 5% | 5% | 5% | 5% | × | × | × | × | × | × | × |
| table | 74% | 4% | 4% | 4% | 4% | 4% | 4% | × | × | × | × | × | × |
| . | 71% | 4% | 4% | 4% | 4% | 4% | 4% | 4% | × | × | × | × | × |
| She | 68% | 4% | 4% | 4% | 4% | 4% | 4% | 4% | 4% | × | × | × | × |
| cuts | 4% | 4% | 4% | 65% | 4% | 4% | 4% | 4% | 4% | 4% | × | × | × |
| the | 4% | 4% | 4% | 63% | 4% | 4% | 4% | 4% | 4% | 4% | 4% | × | × |
| apple | 4% | 4% | 4% | 61% | 4% | 4% | 4% | 4% | 4% | 4% | 4% | 4% | × |
| . | 3% | 3% | 3% | 59% | 3% | 3% | 3% | 3% | 3% | 3% | 3% | 3% | 3% |
The query “She” combines information from the start of the sentence. The four tokens in “cuts the apple .” are masked.
output = Σ weightᵢ × Vᵢ
Weights describe how this head mixes values. By themselves, they do not explain the model’s reasoning. Transformer paper
A text takes shape, one token at a time.
The selected experts’ outputs are combined, then the model continues its calculations to predict the next token.
The token “the” passes through E1 and E3. The other four experts remain stored without performing this computation.
Scripted example; no model is running. A word or punctuation mark acts as a token here; splitting, weights and routing are illustrative.
A large model can contain several computation blocks and use only some for each piece of text. These blocks are called “experts”. A selection mechanism, the “router”, chooses which ones to use, then their results are combined.
Choose the first step to begin.
Fictional example with 6 equally sized experts. Illustrative scores are assigned to the sentence’s tokens; they do not give experts fixed specialties. Shared layers, shared experts and communication costs are not counted.
output = 0.609 × E1(x) + 0.391 × E3(x)
2 of 6 experts active for this token; all 6 remain in memory.
This ratio is neither the fraction of all model parameters activated nor a speed gain. Real methods differ in routing, normalization and load balancing. Sparse MoE paper
Attention connects different parts of a text. Optimizers adjust parameters during training; activation and normalization functions organize the network’s calculations.
A long sentence loses details if everything must fit into one numerical representation.
For each output word, the model scores positions in the source sentence and combines their information according to those scores.
When translating “the black cat”, it may give “black” more weight when producing the color word.
Translation can reuse specific information from the source sentence.
Processing still proceeds step by step, limiting how much calculation can happen at once.
A network scores encoder states and combines them into a weighted sum. This soft attention avoids compressing the entire sentence into a single vector.
The model remains recurrent, so sequential computation limits parallelism.
Changing every learned value by the same step size can make training difficult.
Adam keeps recent averages of correction directions and sizes. It uses them to adjust the step for each learned value, called a parameter.
A value that repeatedly receives large corrections can be assigned a more cautious step.
This adjustment makes many networks easier to train.
The histories take memory and do not directly make answers faster after training.
It tracks moving averages of gradients and squared gradients to adapt each weight’s update. A correction compensates for initial bias in these estimates.
Extra optimizer states consume memory, and hyperparameters still matter.
A vocabulary containing only whole words struggles with rare or new words.
The method starts with characters and repeatedly merges frequent pairs. The model then uses this vocabulary of text pieces, called tokens.
Fictional split: “gardening” becomes “garden” and “ing”, two pieces already in the vocabulary.
A limited vocabulary can represent many different words.
Splitting depends on languages and training data: one word does not always correspond to one piece.
Starting with characters, BPE merges frequent pairs to build a limited vocabulary. New words can then be split into known units instead of becoming an unknown symbol.
Token counts depend on the language and the learned vocabulary.
During training, retaining every intermediate result can fill the available memory.
Only selected checkpoint results are kept. When a correction needs a missing result, calculations are repeated from a retained checkpoint.
Fictional example: retain every third stage and recalculate intermediate stages when needed.
A larger network can be trained with the same memory.
Repeating calculations adds work and can lengthen training.
Instead of storing every forward-pass activation, selected checkpoints are retained. Missing activations are recomputed during backpropagation when they become necessary.
Memory savings increase computation time according to the chosen partitioning.
A hard cutoff for negative values limits how a network transforms information.
This function scales each value according to its magnitude, with a smooth transition near zero. It operates in stages that transform each text piece separately.
A small negative value is reduced rather than automatically replaced with zero.
This transformation offers another way to shape internal calculations during learning.
It does not by itself reduce the number of comparisons between text pieces.
The activation multiplies input x by the standard normal cumulative probability at x. It gives a smooth response near zero in layers that transform each token individually.
A better activation does not by itself reduce attention cost.
Internal values that are too large or too spread out can make training difficult.
For each example, a calculation stage centers its values and adjusts their spread. Learned values then allow this rescaling to be modified.
A stage receiving widely scattered values can bring them to a more regular scale.
The network’s different stages become easier to train together.
Where this operation is placed affects its influence on learning.
For one example and layer, activations are centered and rescaled using their statistics. Learned parameters can then modify this transformation.
Its position inside a block affects gradients and stability.
Activating every learned value in a very large network requires considerable calculation.
A selection mechanism sends each text piece to a few subnetworks, called experts. Their specialization is learned and does not necessarily match subjects such as medicine.
Fictional example: choose two subnetworks out of eight to process a piece of a sentence.
The network can contain more learned values without using them all on every pass.
All experts must be stored and their workload must be balanced.
Switch retains routing to sparse experts and simplifies it: a single expert is chosen for each token.
Paper: Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity ↗Mixtral uses the sparse-expert principle: each token is sent to two of the eight experts in each MoE layer.
Paper: Mixtral of Experts ↗On small screens, scroll the diagram horizontally.
A router selects a few expert networks and weights their outputs. Load-balancing constraints encourage using different experts rather than concentrating tokens on the same ones.
Experts still require storage, load balancing and communication.
A sharp cutoff of internal values is not always a good choice for learning.
The input value is multiplied by a factor between zero and one calculated from that same input. Negative values therefore do not all disappear abruptly.
A slightly negative value can remain present while being reduced.
This function provides a smooth transformation for the network’s internal calculations.
Its usefulness depends on the network and it is not a complete architecture by itself.
A sigmoid smoothly gates the input without abruptly eliminating every negative value. The October 2017 Swish paper studies x × sigmoid(βx), which becomes SiLU when β = 1.
Benefits depend on the architecture; this is not yet SwiGLU.
Start with the major milestones. Explore all developments to go deeper. Every card explains the mechanism, its contribution and its limits, with links to original publications.
No results. Try another term or broaden the filters.
Having to process a sentence strictly in order limits training speed.
Each text piece consults others using relevance scores: this is attention. Several reading paths, called heads, perform these calculations across successive stages.
In “the cat eats because it is hungry”, one path may link “it” with “cat”.
Much of the calculation over known text can happen in parallel.
Comparing every pair of pieces becomes expensive as the text gets longer.
MQA retains Transformer attention heads but makes them share a single set of keys and values.
Paper: Fast Transformer Decoding: One Write-Head is All You Need ↗Jamba retains attention layers within a model that also uses Mamba’s recurrent memory.
Paper: Jamba: A Hybrid Transformer-Mamba Language Model ↗Each head scores queries Q against keys K and combines values V. Blocks alternate attention, feed-forward transformations and residual connections; position information restores token order.
Dense attention compares every pair, making its cost quadratic in sequence length.
It is difficult to write a numerical rule that captures exactly the desired behavior.
People choose between two behaviors. A model learns to predict their choices, and that learned score then guides the system’s training.
In a simulation, evaluators may prefer stable movement over falling down.
Learning can be guided without programming every detail of the desired behavior.
The learned score can misrepresent preferences and improve without satisfying their intention.
InstructGPT applies reward learning from human preferences to tune a language model.
Paper: Training language models to follow instructions with human feedback ↗People compare two behaviors. A model learns to predict their preferences, then an agent optimizes that learned reward through reinforcement learning. The principle predates its use for large language models.
The reward can misrepresent preferences and be exploited by the agent.
Reward-guided training can become unstable when choices change too abruptly.
The method compares action probabilities before and after an update. Its objective limits the benefit of increasing certain probabilities excessively.
A well-scored behavior becomes more likely, but the objective limits the incentive to make it suddenly dominant.
The same observations can support several more restrained updates.
This limit guarantees neither improvement with every update nor easy tuning.
GRPO adapts PPO by comparing rewards for several answers to the same question, without a separate value critic.
Paper: DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models ↗The algorithm compares action probabilities under old and new policies. A clipped objective limits incentives to change that probability excessively across several updates using the same data.
Clipping does not guarantee improvement, and tuning remains delicate.
Representing every number with high precision consumes memory and computing capacity.
Some operations use shorter numerical formats. Sensitive values and accumulated results remain more precise, with adjustments to preserve very small corrections.
Multiplications can use a short format while the main learned values are retained in a more precise one.
Training can use less memory and run faster on suitable hardware.
Rounding and numbers that are too small or too large must be controlled.
Operations use formats such as FP16 while master weights and accumulations remain FP32. Loss scaling helps preserve small gradients during conversion.
Gains depend on hardware, and underflow and overflow require control.
A specialized task often has too few examples to train a complete network from scratch.
The network first learns from general text, then from the target domain. Its calculation stages are adapted gradually to the task to limit loss of previous learning.
A model trained on general writing is adapted to customer reviews, then to classifying their sentiment.
General text becomes useful even when specialized examples are scarce.
This method targets tasks such as text classification, rather than an assistant freely following instructions.
A recurrent network is pretrained on text, adapted to the target domain and used for classification. Gradual unfreezing and discriminative learning rates limit forgetting during adaptation.
The focus is supervised classification, not yet an instruction-following assistant.
A fixed representation of a word cannot distinguish its different uses.
Two networks read the text in opposite directions. Their results are combined into a context-sensitive representation of each word, which another model can use.
“Bank” receives different representations in “river bank” and “bank account”.
Text-processing tools gain information about each word’s surrounding context.
Tasks still need their own models and reading remains partly sequential.
Two recurrent language models read text in opposite directions. A combination of their layers provides representations incorporated into downstream task models.
Tasks retain their own architectures, and recurrence limits parallelism.
The same relationship can occur at the beginning or end of a sentence.
Attention comparisons incorporate learned values representing relative distances. A nearby relationship can therefore be reused elsewhere in the text.
“Very” immediately before an adjective keeps that proximity even when an introduction is added to the sentence.
The calculation gets direct information about distance between elements.
The studied version groups large distances together and does not guarantee handling arbitrarily long text.
Learned representations of relative distances enter attention calculations. Two words separated by the same distance can share relational information wherever they occur.
Distances are clipped in the evaluated formulation, so extrapolation is not guaranteed.
Keeping a history for every learned value adds substantial memory during training.
For a table of learned values, the method retains statistics for each row and column. Combining them replaces some per-value statistics.
Instead of a separate history for every cell in a table, summaries of its rows and columns are kept.
Preparing updates requires less memory.
These summaries are approximations and the update rules still need appropriate settings.
Instead of storing a squared-gradient average for each matrix element, it retains row and column statistics. Their factorization gives a more memory-efficient approximation.
The approximation and update rules require suitable settings.
Training each text-processing tool separately makes limited use of large collections of unlabeled text.
The model predicts the next text piece from previous pieces. It then adjusts its learned values on task-specific examples while keeping almost the same structure.
After general training, question-and-answer examples can be used to adapt the network.
General learning becomes a reusable starting point for several tasks.
The method still relies mainly on separate adaptation for each task.
The decoder first learns from unlabeled text with a causal mask. Supervised fine-tuning then adapts its weights to each task while retaining almost the same architecture.
Results still rely mainly on separate fine-tuning for each task.
Some tasks require considering what comes both before and after a word.
During training, the network reconstructs masked pieces in sentences. It is then adapted to tasks such as classification or finding an answer inside a passage.
In “the cat drinks [masked]”, the surrounding sentence helps predict the missing piece.
The resulting representations use context before and after each position.
This calculation is not directly designed to write an answer one piece at a time.
A Transformer encoder reconstructs hidden tokens using left and right context. The original model also learns a sentence-relationship task before downstream fine-tuning.
This mechanism is not directly designed for generating responses token by token.
Producing only one text piece per pass through a large network takes time.
Predictors propose a possible continuation block. A checking model keeps the beginning of the block that meets its acceptance rule, and generation resumes there.
Fictional example: propose three pieces and keep only the first two after checking.
Several pieces may be accepted in one verification pass.
The benefit disappears when proposals rarely agree with the checking model.
Predictors propose an output block, then a scoring model validates the longest acceptable prefix. This precedes speculative decoding without being identical to later probabilistic algorithms.
Gains depend on agreement between proposals and validation.
A complete network can be too large for a single computing chip.
Successive network stages are placed on different chips. A group of examples is split into smaller groups that move through these stages before their updates are combined.
Fictional example: one chip handles a new group while the next finishes the preceding group.
Several chips can help train the same large network.
Transfers and periods when some chips wait reduce efficiency.
Layers are distributed across devices. A batch is divided into microbatches moving through the pipeline, and their gradients are accumulated before updating parameters.
Idle periods and transfers limit pipeline efficiency.
Splitting text into independent segments breaks connections across their boundaries.
The network retains representations from the preceding segment and consults them while processing the next. Distance information avoids confusing positions when these results are reused.
A sentence at the start of a segment can consult information from the end of the preceding segment.
Processing can use context beyond the current segment.
This working state is limited and is not persistent personal memory.
Hidden states from one segment are reused for the next, with gradients stopped at the boundary. Relative positions avoid confusing positions when those states are reused.
This segment memory is not the invention of the generation KV cache.
Keeping a complete copy of a large model for every task consumes substantial storage.
Small networks are inserted into the stages of an existing model. Adaptation mainly updates these additions while the main model’s learned values remain fixed.
The same main model can be paired with one module for classification and another for a different task.
Each task requires far fewer new values to learn and store.
The modules add calculations and may limit performance depending on the task.
Bottleneck networks are inserted into a pretrained model while its main weights remain frozen. Each task mainly stores its extra modules rather than a full model copy.
Modules add forward-pass operations and may limit performance.
Adapting and storing a different model for every task takes additional work.
The model learns to continue web text. Putting a question or the start of a summary in its context can then steer the kind of continuation it produces.
An input ending with “Question: … Answer:” can steer the continuation toward an answer.
The format of the supplied text becomes a way to request different behaviors.
Predicting a plausible continuation guarantees neither truth nor instruction following.
A causal decoder predicts continuations over a large web corpus. Context formatting presents a task, such as a question followed by the beginning of an answer.
Results vary; text prediction guarantees neither truthfulness nor instruction following.
A large internal store becomes expensive if every entry must be examined fully.
Search keys are built by combining two smaller sets. This organization helps find the best matches, whose values are then used in the network’s calculation.
A text representation selects a few relevant entries instead of combining all available entries.
The network can use a large internal store with a cheaper search.
These are internal learned values, not an external document database to consult.
Keys are factorized into two sets to search efficiently over their Cartesian product. The best matches select learned values used in place of some dense transformations.
These are internal parameters, not an external document database or a conventional MoE.
Some operations in a large network are too big for a single chip.
Large multiplications are divided among computing chips. The chips then exchange their results to reconstruct the output needed by the rest of the network.
Fictional example: two chips each calculate part of the same large table of results.
A calculation stage can exceed the capacity of an individual chip.
Exchanges must be fast, or communication consumes much of the benefit.
Large multiplications in attention and feed-forward layers are split across devices. Collective communication recombines their results, complementing data parallelism.
GPUs must communicate quickly; slow interconnects reduce benefits.
Copying model values and all update information onto every chip wastes memory.
The method divides update histories among chips. Depending on the version, it also divides updates and learned values, exchanging the required elements when needed.
Each chip keeps part of the update histories instead of a complete copy.
Local memory can accommodate a share of a much larger model.
Data saved from local storage must be exchanged, adding communication.
Optimizer states, then gradients and parameters depending on the stage, are partitioned across devices. Required data is communicated when it is needed.
Lower local memory usage requires managing additional communication.
Rescaling internal values adds calculations at every network stage.
The method measures the average magnitude of values and divides them by that scale. Unlike fuller normalization, it does not first subtract their mean.
A group of very large values can be brought to a more regular scale without being centered.
The network retains rescaling with fewer operations.
Getting comparable results depends on the network and how it is trained.
Each vector is divided by its root mean square and modulated by a learned scale. The method preserves scale invariance with fewer normalization operations.
Equivalent quality depends on the model and its training.
Different formats and structures for every task complicate comparison and reuse.
The network first learns to reconstruct passages removed from text. It is then adapted to tasks expressed as text, using one part to read and another to produce output.
“Translate: bonjour” and “Summarize: …” both use textual input and textual output.
One framework can serve translation, summarization and other tasks.
A shared format removes neither training cost nor the need for data.
An encoder-decoder is pretrained to reconstruct masked spans, then adapted to text-formulated tasks. Relative-position biases group distances into buckets.
A unified format removes neither pretraining cost nor data requirements.
While writing, retaining separate information for every reading path uses substantial memory.
Paths keep different queries but share keys and values: data used to locate and combine earlier text. Their cache is temporary calculation memory.
Several paths consult the same retained data instead of each keeping a separate set.
Temporary memory and the amount of data reread can be reduced.
Sharing can reduce output quality; speed gains depend on the hardware.
MQA retains Transformer attention heads but makes them share a single set of keys and values.
Paper: Fast Transformer Decoding: One Write-Head is All You Need ↗GQA generalizes MQA: several groups share keys and values, instead of one shared set for all heads.
Paper: GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints ↗Heads keep different queries but share one set of keys and values. The cache retains previous tokens’ representations so they need not be recomputed at every step.
Sharing can reduce quality; actual gains depend on hardware and batch size.
Comparing every piece of long text and retaining all results uses substantial memory.
The method groups similar representations to limit comparisons. It also uses reversible stages that reconstruct some previous results instead of storing them.
Pieces placed in the same group are compared without systematically examining every other possible pair.
These choices reduce some memory and calculation costs for long sequences.
Comparisons are approximate and practical benefits depend on the implementation.
Hashing groups similar vectors to restrict attention comparisons. Reversible layers reconstruct some activations instead of retaining all of them during training.
Comparisons are approximate, and practical performance depends on kernels.
A limited budget forces a choice between a larger model and more training.
Researchers train models at different sizes and fit curves to their prediction errors. These curves help estimate budget tradeoffs.
Before a large training run, smaller experiments help compare different allocations of computation.
These measurements provide a method for planning training expenditure.
The conclusions depend on the experiments and do not guarantee every capability of a future model.
Kaplan et al. fit power laws relating loss, parameters, data and compute. These curves suggest how to allocate a budget; they do not describe a new architecture.
Recommendations depend on the experiments and are later revised, notably by Chinchilla.
The placement of rescaling can make learning corrections harder to pass through the network.
Normalization, which adjusts the scale of values, is placed before attention and internal transformations. A direct route also lets information pass through each block.
Instead of normalizing after a transformation, its input is normalized before it is calculated.
This arrangement can make the start of training easier.
This milestone analyzes a placement already used earlier, notably in GPT-2.
Normalization precedes attention or the feed-forward network inside the residual branch. The paper analyzes gradients and explains why this arrangement facilitates optimization at initialization.
This marks a 2020 analysis, not the invention: GPT-2 already used this placement.
A single transformation offers less flexibility in selecting which information to pass on.
The network calculates two versions of its input. One is smoothly transformed, then multiplied value by value with the other before the result is combined.
One branch can reduce selected values in the other without treating every value alike.
This mechanism adds learned selection to the network’s internal transformations.
Comparisons must account for the width of the stages and the computation budget.
Two projections are multiplied elementwise, one passing through an activation such as Swish or GELU. An output projection combines the result; widths are adjusted to compare similar budgets.
Gains depend on budget and training; comparisons must account for different widths.
Comparing each text piece with every other piece becomes too expensive in a long document.
Each piece consults a nearby window. Selected positions can also communicate with the whole document, connecting different regions.
A position associated with a question can consult the whole document while others mainly read their neighborhood.
The number of comparisons grows more slowly as text gets longer.
Not every pair communicates directly and global positions must be selected.
Each token attends to a nearby window; selected tokens also receive global attention. With fixed window size and global-token count, the number of connections grows linearly.
Not every pair communicates directly, and global tokens must be chosen.
Classic attention calculates mixing scores by comparing pairs of representations.
These variants produce information-mixing coefficients differently: with a network or even random values. They test which comparisons are actually necessary.
One variant directly learns mixing coefficients rather than comparing a query with every key.
These experiments explore alternative ways for information to flow through a network.
Removing those comparisons does not automatically make every calculation cheap on long text.
Some variants directly generate a mixing matrix from representations or use random weights. They avoid query-key products while still combining token values.
Avoiding QK does not automatically make every variant linear in length.
A model cannot reliably recover every fact from its learned values alone.
A search system selects relevant passages from a collection. The generator receives these texts as additional information when producing its answer.
For a question about a policy, the system can retrieve part of the policy and add it to the context.
The answer can draw on documents that can be inspected and updated.
Consulting text does not by itself update the model or guarantee a correct answer.
A dense retriever selects passages, then a generator conditions its output on those texts. The paper trains a combination of a retriever and a BART-style model.
Incorrect retrieval can contaminate answers; finding text does not guarantee correct use.
Updating model values for every new task requires data and computation.
A large model trained to continue text receives an instruction and possibly a few examples. It continues them without changing its learned values during this use.
“chat → cat; chien → dog; maison →” demonstrates a task through examples.
The request text is enough to attempt many tasks.
Results remain sensitive to wording and examples guarantee neither accuracy nor reliable reasoning.
A causal decoder is pretrained at scale. During evaluation, zero, one or several examples appear in context without changing weights: this is in-context learning.
Abilities remain prompt-sensitive and guarantee neither reliable reasoning nor truthfulness.
Attention that compares every pair becomes expensive on long sequences.
Representations are transformed and calculations reorganized to accumulate statistics of earlier elements. The current piece consults this compact state rather than a full comparison table.
With each new element, the system updates its state and uses it to calculate the output.
Calculation can grow more slowly with length and operate step by step.
The mechanism changes attention and compresses details of the past into a limited state.
Queries and keys pass through a feature map. Associativity allows key-value statistics to accumulate in a state that can be queried, enabling recurrent computation.
The formulation changes attention and compresses history into a fixed-size state.
Greatly increasing network capacity creates storage and computation-distribution problems.
Some stages are replaced by experts: subnetworks, two of which are selected for each text piece. The system arranges their distribution and exchanges across many chips.
A piece is sent to the selected subnetworks even when they are located on different chips.
Large translation models become trainable across a collection of chips.
All experts must be stored and their exchanges remain costly.
Some translation Transformer layers are replaced by experts with top-2 routing. The system distributes tensors and organizes communication across many accelerators.
Total capacity still requires storage and communication even when few experts are active.
A local reading window alone may poorly connect distant passages.
The network combines comparisons with neighbors, a few globally accessible positions and randomly selected links. These paths let information circulate without connecting every pair.
A passage exchanges information with its neighbors and a few distant passages rather than the whole document.
Fewer comparisons are needed while paths between distant regions remain available.
Those paths do not guarantee the same results as full attention on every task.
BigBird combines local neighborhoods, global tokens and random links. These connections reduce score counts while retaining information paths between distant sections.
Theoretical guarantees do not imply identical quality to dense attention on every task.
Predicting the next text piece is not enough to produce the summary readers prefer.
People compare summaries. A model learns to assign scores matching their choices, then the generator is trained to improve those scores while remaining close to a reference.
Evaluators may prefer a summary that preserves the main point over one that omits it.
Human preferences directly guide part of summary training.
Evaluator biases and flaws in scoring can be reproduced or exploited.
Evaluators compare summaries and a reward model learns those comparisons. The generator is then optimized using PPO with a constraint keeping it close to a reference model.
Evaluator bias and reward exploitation remain possible.
The table linking every text piece to every other piece becomes very large.
Random transformations produce representations that approximate the usual calculation. Operations are rearranged to use these representations without retaining all comparisons.
Instead of filling every cell of a relationship table, approximate numerical summaries are combined.
Attention cost can grow more slowly with text length.
The number of values used in the approximation sets a tradeoff between accuracy and cost.
FAVOR+ uses positive random features to approximate the attention kernel. Computation is reordered to avoid the full interaction matrix.
Accuracy and cost depend on feature count; gains are not universal.
Overly large values can make attention scores excessively concentrated.
The representations used to make queries and identify consulted elements are brought to a common numerical length. A learned scale then controls the strength of their comparison.
A representation no longer gets a high score simply because its values are larger overall.
Matching becomes less dependent on the raw magnitude of representations.
Recent models may use different variants; their methods are not all identical to this one.
The paper L2-normalizes Q and K and applies a learned scale to their dot product. Later models use other variants of query and key normalization.
Variants differ: this exact formulation should not automatically be attributed to every recent model.
Using a Transformer on images requires converting pixels into suitable inputs.
The image is split into small squares. Each square becomes a numerical representation with position information, then attention combines these representations into an overall result.
To classify an image, the network combines information from different regions instead of reading text.
An attention-based architecture can be used to recognize images.
Results depend on training and increasing the number of pieces raises comparison costs.
An image is divided into patches, projected into vectors and given position information. A Transformer encoder mixes these representations to learn a global representation suitable for classification.
Effectiveness depends on pretraining; more patches increase attention cost.
Adapting every value of a large model for each task costs storage and memory.
Extra representations are learned that several network stages can consult like an initial context. Only these additions change during adaptation.
One set of additions can be learned for summarization and used with the unchanged main model.
A task can be adapted by learning far fewer new values.
These additions take context space and their effectiveness depends on the task.
Trainable vectors act as virtual tokens that layers can attend to. Adaptation learns this prefix rather than updating every network weight.
Prefixes consume context and may be less effective for some tasks.
Networks with multiple experts can become difficult to distribute and stabilize.
A selector sends each text piece to just one expert, meaning a subnetwork. Rules try to distribute work and avoid overloading the same experts.
Fictional example: each piece goes to one of four experts without running the other three for that piece.
Selection becomes simpler while allowing many learned values overall.
An expert can receive too much work and exchanges between chips remain expensive.
Switch retains routing to sparse experts and simplifies it: a single expert is chosen for each token.
Paper: Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity ↗A router sends each token to a single layer expert. Capacity rules, a balancing loss and numerical choices aim to stabilize workload distribution.
Expert capacity can overflow, and communication remains a major cost.
A text model needs a suitable representation to produce images.
A system converts images into compact codes. The Transformer learns to predict these codes after the description codes, then a decoder turns them into pixels.
A description such as “a pear-shaped armchair” begins the sequence of image codes.
Image generation can be guided by a text description.
The compressed codes can lose detail and this first version does not use diffusion.
A discrete autoencoder turns images into tokens. A Transformer then predicts a sequence combining text followed by image tokens; the autoencoder’s decoder reconstructs pixels.
Compression can lose detail; this first version is not a diffusion model.
Recognizing new categories often requires labeled examples for each one.
One network turns images into numbers and another does the same for text. Training brings matching pair representations closer and moves other pairs apart.
A photo can be compared with “a dog” and “a bicycle” to choose the closer description.
Written descriptions can serve as categories without new task-specific training.
Matching images and text is not enough to build an assistant that can converse about an image.
An image encoder and a text encoder learn a shared space. A contrastive loss pulls matching pairs together and pushes others apart; text descriptions become zero-shot recognition classes.
Recognition or representation matching alone does not produce multimodal conversation.
Keeping a complete model version for every task is expensive.
Learned numerical representations are added to the input, without necessarily corresponding to readable words. Only these additions change during adaptation; the main model’s values remain fixed.
A numerical prefix can be learned to classify reviews and reused before each review.
Several tasks can share the same large model with small separate additions.
Results depend strongly on model size and the task.
Trainable vectors are added to input embeddings and only those vectors are optimized. Unlike prefix tuning, the method does not directly add a separate prefix at every layer.
Observed effectiveness depends strongly on model size and task.
Comparisons between text pieces must account for their order and distance.
The numbers used to seek and identify information are rotated in pairs according to position. Their comparison then depends on the gap between those positions.
Two neighboring words have a rotation difference linked to their proximity even when they occur elsewhere in a sentence.
Relative distance between pieces directly affects attention scores.
This mechanism does not guarantee good performance on text far longer than training examples.
Interpolation reduces position indices before applying RoPE, fitting a longer text into the learned range.
Paper: Extending Context Window of Large Language Models via Positional Interpolation ↗On small screens, scroll the diagram horizontally.
Pairs of Q and K components are rotated by position-dependent angles. Their dot product then depends on angle differences and therefore on token distance.
Positions far beyond training lengths often require specific adaptation.
Changing every value in a large model requires substantial memory during adaptation.
Existing learned values remain fixed. Two small numerical tables are learned and multiplied to represent a correction to selected large tables in the model.
To adapt a model to a writing style, these small tables are learned instead of an independent change to every value.
Far fewer values need to be trained and stored for each adaptation.
Table size and targeted stages limit the changes that can be represented.
QLoRA trains LoRA’s small matrices through a frozen base model quantized to 4 bits.
Paper: QLoRA: Efficient Finetuning of Quantized LLMs ↗On small screens, scroll the diagram horizontally.
Pretrained weights remain frozen. Their update is represented by the product of two small matrices learned during adaptation; the product can later be merged into the original weights.
Rank and target-layer choices limit what the adaptation can represent.
Attention calculations need to distinguish nearby elements from distant ones.
Each reading path subtracts a penalty proportional to distance between pieces. Paths use different slopes without adding a position representation to every piece.
With equal content relevance, a nearby word receives a higher score than a more distant word.
The same position rule can be applied to lengths absent from training.
Applying the rule to long text does not guarantee finding information at every distance.
Each head subtracts a distance-proportional penalty from attention scores using its own slope. This favors nearby tokens and applies to lengths unseen during training.
Measured extrapolation does not guarantee reliable retrieval at every distance.
A model that can continue text does not necessarily follow a new request.
An existing model is adapted using examples pairing an instruction with an expected output. Some task families are held aside to test following other instructions.
The model sees requests such as “translate this sentence” and “classify this review”, with their expected answers.
This training can improve results on tasks absent from adaptation.
Transfer depends on the quality and diversity of the supplied tasks.
A pretrained model is fine-tuned on examples whose inputs contain instructions. Evaluation uses held-out task families to test transfer beyond training tasks.
Task quality and diversity determine transfer; this is not RLHF.
Learning corrections can have very different sizes at different network stages.
The method adds rescaling after attention and within internal transformations. It also learns a scale for each reading path to reduce some imbalances.
A stage receiving much larger corrections than another may benefit from these scale adjustments.
Corrections can become better balanced and training more effective in the studied experiments.
These operations add cost and their usefulness depends on the configuration.
The block adds normalization after attention, per-head scaling and normalization inside the feed-forward network. These changes reduce some gradient-scale mismatches across layers.
Additional operations have a cost and do not imply universal adoption.
Keeping and separately comparing every past element becomes expensive.
Each new input changes a limited-size state according to a structured mathematical system. This structure enables parallel calculation during training and step-by-step updates during use.
When a new element arrives, the system updates its state without individually rereading all previous elements.
This approach offers another way to process long sequences.
The state compresses the past and does not provide direct access to every old detail.
Mamba extends state-space models by making what is retained or forgotten depend on the input.
Paper: Mamba: Linear-Time Sequence Modeling with Selective State Spaces ↗A dynamical system updates a compact state from inputs. Its structure enables efficient convolution-kernel computation during training and recurrent processing during generation.
The state compresses history and differs from direct token-to-token retrieval.
Storing all useful information only in learned values requires very large models.
The system retrieves passages neighboring the current segment from a large collection. Dedicated network stages read these passages and incorporate them into prediction of the next text.
A segment discussing a subject can be accompanied by similar passages retrieved from the collection.
The experiments show that a searchable collection can support a model with fewer learned values.
The system depends on retrieval quality and the availability of its collection.
The model retrieves neighboring text chunks with a frozen retriever. An encoder and cross-attention layers integrate retrieved passages during token prediction.
The system depends on the quality and availability of its document index.
A direct answer sometimes skips a useful calculation.
Showing examples with written intermediate steps encourages the model to write similar steps before producing its final answer.
Fictional example: calculate a subtotal before applying a discount.
Some problems become easier to solve.
A plausible explanation can be wrong or fail to reflect the internal computation.
Self-consistency generates several Chain-of-Thought reasoning paths, then selects the most frequent answer.
Paper: Self-Consistency Improves Chain of Thought Reasoning in Language Models ↗The model imitates demonstrations that show intermediate steps before the answer. These additional tokens split calculations or deductions into simpler operations.
Plausible reasoning guarantees neither correctness nor a faithful explanation.
Making a model bigger can exhaust the budget before it has learned enough.
Balance the number of learned values against the amount of training text.
Fictional example: train a smaller model longer instead of enlarging its counterpart.
The same budget can yield better results.
The best balance changes when the cost of answering is included.
Experiments vary model size, token count and compute. Fitted laws recommend scaling parameters and data together to use the training budget efficiently.
The optimum changes when inference cost or different data distributions are included.
Completing text is not enough to follow a request.
People demonstrate useful answers and rank alternatives to the same request. A learned scoring system then guides further training.
Fictional example: prefer a clear answer over an irrelevant continuation.
The model follows some instructions better.
An answer that people prefer can still contain factual errors.
InstructGPT applies reward learning from human preferences to tune a language model.
Paper: Training language models to follow instructions with human feedback ↗DPO learns directly from preferred and rejected responses, without training the separate reward model used in the InstructGPT recipe.
Paper: Direct Preference Optimization: Your Language Model is Secretly a Reward Model ↗After supervised demonstrations, humans rank responses. A reward model learns these preferences and guides reinforcement learning with PPO.
Quality depends on collected preferences; factual errors remain.
Testing every setting directly on a large model is expensive.
A rule adjusts the scales of learned values and their updates as size increases.
Fictional example: choose the learning speed using a reduced version.
Some settings transfer with fewer expensive experiments.
Transfer requires compatible versions and does not work for every architectural change.
µP adjusts weight and update scales to network width. Hyperparameters are tuned on a smaller model and then transferred.
Transfer requires consistent parameterization; arbitrary architecture changes remain difficult.
A single attempt can follow an unsuccessful path.
The model generates several different sequences of steps for the same question, then the most frequent final answer is selected.
Fictional example: five attempts return the same result three times.
Voting can eliminate some isolated errors.
The attempts consume computation and may all repeat the same mistake.
Self-consistency generates several Chain-of-Thought reasoning paths, then selects the most frequent answer.
Paper: Self-Consistency Improves Chain of Thought Reasoning in Language Models ↗Sample several reasoning chains, then select the most frequent final answer. Different paths can converge on the same solution.
Cost grows with attempts, and correlated mistakes can win the vote.
Human-written demonstrations are limited.
The model generates worked solutions to questions with known answers. Those producing a correct answer are retained as examples for further training.
Fictional example: retain a solution that reaches the expected total.
More examples become available for learning.
A correct final answer does not guarantee that every intermediate step is sound.
The model generates rationales; those reaching the correct answer become fine-tuning data. For failures, access to the answer helps generate another rationale.
A correct answer can hide faulty reasoning; filtering is crucial.
A text-only model does not directly receive information from an image.
One component condenses the image, then reading stages connect this information to the text.
Fictional example: show a photograph and ask for its dominant colour.
The model can use examples containing both images and sentences.
Compression can lose details, and answers remain fallible.
A Perceiver Resampler compresses visual representations. Cross-attention layers connect them to a language model while large pretrained components remain frozen.
Visual compression loses detail and does not eliminate hallucinations.
A very large model exceeds the capacity of a single machine.
A system coordinates many chips to train the different parts of the model together.
Fictional example: distribute a long computation across several groups of machines.
The experiment measures the effects of increasing scale.
This model combines earlier techniques rather than inventing all of them.
Pathways coordinates PaLM training across TPU groups. The model combines earlier architecture choices and tests how scale improves few-shot learning and prompted reasoning.
This is a large-scale synthesis, not the invention of its component techniques.
Comparing every text piece creates a large intermediate table.
Computation proceeds in blocks in the chip's fast memory, without storing the complete table.
Fictional example: process several groups of words in succession.
The same mathematical attention needs fewer memory transfers.
The number of comparisons still grows with the square of the text length.
The second version retains tiled computation and distributes work more effectively across GPU units.
Paper: FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning ↗On small screens, scroll the diagram horizontally.
Computation is tiled into blocks held in fast GPU memory. An online softmax avoids materializing the entire attention score matrix.
Operation count remains quadratic; gains depend on hardware and dimensions.
Updating all learned values requires considerable memory.
The main learned values remain fixed. Small learned lists of numbers strengthen or reduce selected internal information during processing.
Fictional example: adapt a model to classify messages.
Each specialisation needs few additional values.
This adaptation offers less flexibility than full training and requires suitable examples.
Learned vectors rescale keys, values and internal activations while main weights remain frozen. Each task therefore needs only small additional parameter sets.
This adaptation is less expressive than full fine-tuning and needs task data.
A result alone does not reveal the difficulties encountered while building it.
The release provides several model sizes, code and observations about training.
Fictional example: compare two sizes using a documented recipe.
Researchers can study more concrete design choices.
Access to the files does not mean that every use is permitted.
The family uses autoregressive decoder Transformers at several scales. The publication exposes infrastructure and stability challenges beyond describing the network alone.
The milestone concerns access and documentation; permitted use depends on published terms.
A single training exercise prepares poorly for some tasks.
The model learns to recover hidden passages of different lengths, with markers identifying the exercise.
Fictional example: complete a word, then reconstruct a paragraph.
One recipe covers several kinds of text transformation.
Benefits vary with the tasks and the way the model is served.
Mixture-of-Denoisers combines different masking rates and span lengths. Mode markers indicate the expected reconstruction task to the encoder-decoder model.
Benefits depend on tasks; encoder-decoder serving has specific constraints.
Ordinary continuation only sees what comes before.
Training presents the beginning and ending before asking for the missing passage.
Fictional example: complete a function between its declaration and return statement.
Insertions can fit both sides of the text.
The model must have learned this particular format to use it correctly.
Texts are split into prefix, middle and suffix, then reordered so the model predicts the middle after seeing the other two. Training remains autoregressive.
Format mixtures and markers must be learned; not every model supports them.
Waiting for the longest text to finish leaves capacity unused.
At each generation step, the server inserts new requests into the freed slots.
Fictional example: start one question while another answer continues.
More requests can progress on the same hardware.
The server must also limit waiting times and handle different text lengths.
The scheduler decides at each iteration which sequences advance one token. Completed requests leave the batch and new requests enter immediately.
Scheduling must also preserve latency and handle variable sequence lengths.
Comparing every position with all the others becomes expensive.
A state summarises the past. A mathematical structure allows several updates to be calculated in parallel.
Fictional example: process a long series of measurements.
Processing can make efficient use of parallel computation.
Efficiency on sequences does not guarantee the abilities of a general-purpose assistant.
S5 replaces multiple single-input/output systems with a multivariate system initialized from S4. An associative scan parallelizes the recurrence.
This is a sequence-modeling milestone; efficiency does not guarantee LLM capabilities.
Detailed numerical representations take considerable memory.
Some numbers use eight bits, with suitable scaling factors to limit rounding errors and represent a useful range of values.
Fictional example: represent a value using a coarser rounding step.
Compatible chips compute and transfer these numbers more efficiently.
Not every operation tolerates this reduced precision without difficulty.
Two eight-bit floating-point formats trade precision against numerical range. Scaling factors help represent activations, weights or gradients without excessive overflow.
Suitable kernels and hardware are required; some operations retain higher precision.
Learning only to continue text is not enough to follow instructions.
The model trains on many different tasks described in ordinary language, instead of practising just one kind of request.
Fictional example: alternate translation, summarisation and sentence classification.
It can better follow some instructions never encountered in exactly that form.
Diverse examples do not guarantee success on every new task.
A model is fine-tuned on many instructions, with or without reasoning demonstrations. The paper jointly studies task count, model size and supervision formats.
Instruction diversity and quality matter; the model does not automatically learn every new task.
A trained model can be too large for the available hardware.
Its learned values are rounded progressively, compensating for some rounding errors using a small collection of representative calibration examples.
Fictional example: retain fewer numerical levels for the values.
The model can fit in less memory.
Quality can decrease, and speed improvements depend on the hardware.
A small calibration corpus estimates rounding error effects. Weights are quantized incrementally while errors are compensated in the remaining weights of each layer.
Accuracy can decrease; reduced memory does not imply speedup on every GPU.
The model cannot infer everything from the text already available.
It produces an action, receives a tool's result, then continues its answer.
Fictional example: consult a source before summarising its contents.
The continuation can account for a recent observation.
Choosing the wrong tool or misreading its result remains possible and takes time.
The prompt alternates textual reasoning, a tool action and an observation of its result. This loop revises plans using external information.
Tool and planning errors remain; calls add latency.
Resources and documentation often concentrate on a few languages.
A collaboration assembles multilingual text and publishes its model alongside its training recipe.
Fictional example: compare answers in two languages from the collection.
More languages and training choices become available for study.
Including a language does not guarantee quality equal to the others.
The decoder Transformer learns text continuation across many natural and programming languages. It adopts ALiBi positional biases in a distributed training recipe.
Multilingual coverage does not imply equal quality across languages or instruction following.
A few extreme values make rounding internal calculations difficult.
A transformation transfers some of this range into the model's fixed values before rounding.
Fictional example: rebalance two factors without changing their original product.
Some computations become suitable for more compact integers.
Calibration must suit the intended uses, and some loss of precision remains possible.
An equivalent transformation rescales channels, moving part of activation outliers into the weights. This makes W8A8 quantization more manageable.
Calibration depends on data and model-specific accuracy tradeoffs.
Generating each text piece separately multiplies expensive processing passes.
A fast model proposes a continuation. The main model checks it using a corrected acceptance rule.
Fictional example: propose several words and keep the accepted beginning.
The exact method preserves the main model's probabilities.
The benefit disappears when proposals are too costly or too often rejected.
A fast model drafts a continuation; the target model checks it in parallel. An acceptance and correction rule preserves the target distribution in the exact method.
Speedup depends on acceptance rate and drafting cost.
Having a person evaluate every example requires substantial work.
A model critiques and revises proposed answers against written principles, then generates comparisons between answers to guide further training.
Fictional example: request removal of an unnecessarily insulting claim.
Some evaluation examples can be generated automatically.
The chosen principles and automatic evaluators can introduce their own errors.
A model critiques and revises responses using explicit principles. AI-generated preferences then train a reward model and a reinforcement-learning stage.
Principles and judges introduce their own biases; control remains imperfect.
A summary of the past can lose useful links between items.
Computations combine a stored state with current content to retain and retrieve associations.
Fictional example: connect a name with information provided earlier.
The method improves some retrieval abilities of recurrent models.
The memory remains compressed and can lose important information.
H3 combines state-space layers with multiplicative interactions to store and retrieve associations. The paper also explores hybrids with a few attention layers.
Recurrent compression can lose information; replacing all attention remains a tradeoff.
Writing a large collection of tasks by hand takes time.
Human examples start the generation of new instructions and answers. A filtering stage removes cases judged invalid or too repetitive.
Fictional example: create a new summarisation request.
More examples become available for training.
The generator's mistakes can also end up in the training data.
A model proposes instructions, inputs and outputs from examples. Filtering removes invalid or overly similar cases before supervised fine-tuning.
Generator errors and biases propagate into the corpus; diversity needs monitoring.
Real recordings differ greatly from clean laboratory audio.
The model learns to turn sound representations into written text using a large collection of recordings paired with transcriptions.
Fictional example: transcribe a short sentence spoken with an accent.
Transcription can better withstand some audio variations.
On noise or silence, the model can invent text.
A Transformer encodes audio spectrograms and decodes text and task markers. Training mixes transcription, language identification and translation into English.
The model can hallucinate text over noise; it is not a complete conversational assistant.
Full attention compares all positions and becomes expensive.
Filters combine distant positions, while content controls some of the information flow.
Fictional example: process a long passage without a table of every comparison.
The cost can grow more slowly than full attention.
This efficiency does not guarantee equally precise retrieval of every detail.
Hyena composes implicitly parameterized long convolutions with input-dependent gates. Convolutions can be computed efficiently without a full attention matrix.
Good asymptotic cost does not ensure the same precise retrieval as explicit attention.
Training also stores numbers used to guide each update.
Lion mainly uses the direction of a combination of recent updates and retains reduced tracking information.
Fictional example: keep a direction without storing every indicator used by Adam.
Tracking the learning process takes less memory.
The update speed needs tuning, and benefits vary between experiments.
Lion uses the sign of a combination of gradient and moving average to choose update direction. It keeps only one momentum state per parameter.
Learning rate needs adjustment; gains vary with task and batch size.
Studying a very large model requires resources that are difficult to obtain.
LLaMA combines several existing techniques with extended training on public text.
Fictional example: test an adaptation on a smaller version.
More teams can experiment with these models.
The model popularises a combination of components without having invented each one.
LLaMA combines earlier techniques: RMSNorm pre-normalization, SwiGLU activation and RoPE positions. Extended training on public data also prioritizes inference efficiency.
The model popularizes a combination; it does not separately invent these components.
A few manual demonstrations do not cover every useful call.
The model proposes calls. Those improving prediction of the following text are retained for training.
Fictional example: insert a calculator call before a result.
Some examples of tool use are generated automatically.
Improving a continuation does not guarantee good organisation of a long task.
The model inserts candidate calls into text. Calls whose results improve next-token prediction are retained, then used for training.
A call useful for prediction does not ensure good long-task planning.
Image information is not directly readable by a text model.
A component transforms visual information. Example conversations teach the model how to use it.
Fictional example: ask which objects appear in a photograph.
The model can follow some visual instructions.
Some details remain inaccessible, and absent objects may be mentioned.
A projector connects a CLIP image encoder to a language model. Partly synthetic visual instruction data teaches the model to answer image-related requests.
Encoder and resolution limit visible detail; answers may hallucinate.
A large collection can devote too much space to less useful sources.
A small model tests how to weight text categories. The resulting mixture is then used for the larger model.
Fictional example: revise the proportions of books and web pages.
The same volume of data can become more useful.
The mixture need not transfer to every size and task.
A small proxy model adjusts domain weights through robust optimization. The large model is then trained on the resulting mixture.
Domains and proxy model affect results; transfer is not universal.
Some methods require a separate evaluator and an expensive training loop.
Pairs identify which answer people prefer for the same request. Training adjusts their probabilities relative to a fixed reference version.
Fictional example: prefer a clear summary to a confusing one.
The preference-training procedure has fewer components.
Learning preferences guarantees neither truthfulness nor freedom from bias.
DPO learns directly from preferred and rejected responses, without training the separate reward model used in the InstructGPT recipe.
Paper: Direct Preference Optimization: Your Language Model is Secretly a Reward Model ↗The loss compares both responses' probabilities relative to a reference model. It reformulates regularized preference optimization without a separate reward model or PPO.
Out-of-distribution preferences and pair-dataset biases can limit results.
Each independent reading path normally stores its own information about past text.
Each path formulates its own query but shares keys and values: the information used to locate and read the past.
Fictional example: two groups of two paths each share the same stored data.
The cache, temporary storage of computations about past text, becomes smaller.
Sharing can reduce quality depending on the model and group count.
GQA generalizes MQA: several groups share keys and values, instead of one shared set for all heads.
Paper: GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints ↗MLA also reduces cache memory, but compresses keys and values into a small vector instead of sharing them in groups.
Paper: DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model ↗Several query heads share a key/value head pair. Group count directly controls cache memory; the paper also studies converting existing models.
Fewer groups can reduce quality; the best choice depends on the model.
Reproducing a recipe requires more than a list of good ideas.
MPT combines existing choices about position representation, attention computation and learning, with additional versions adapted to particular uses.
Fictional example: continue training on long stories.
Teams gain a concrete combination to study.
Accepting long inputs does not guarantee good use of every distant detail.
MPT-7B adopts ALiBi, FlashAttention and the Lion optimizer. StoryWriter continues training on long passages to use a larger context window.
This is technique adoption; positional extrapolation does not ensure all long-range understanding.
Encoding each text piece's position imposes representation choices.
The model uses only the restriction against reading future positions to learn some ordering relationships.
Fictional example: compare sequences longer than those used in training.
Some controlled tasks show interesting generalisation.
These tests do not demonstrate general superiority for large language models.
The model adds no explicit positional encoding. The authors compare length generalization against RoPE, ALiBi and other schemes on controlled tasks.
Controlled-task results do not prove general superiority for LLMs.
A final score does not reveal which step caused the error.
People annotate steps. An evaluator trained on those annotations then ranks several solutions.
Fictional example: flag the first incorrect calculation in a demonstration.
Selection can favour solutions with stronger intermediate steps.
Annotations require work, and the evaluator can also make mistakes.
Annotators evaluate steps rather than only final answers. A process reward model then ranks candidate solutions to help select stronger ones.
Annotations are costly and a verifier remains fallible beyond its training data.
Adapting a large model normally requires considerable memory.
The base values remain fixed and compressed. Only small additions, called adapters, are trained.
Fictional example: adapt answer style without retraining the base.
Specialisation can fit in less graphics memory.
Not all training takes place in four bits, and results depend on the settings.
QLoRA trains LoRA’s small matrices through a frozen base model quantized to 4 bits.
Paper: QLoRA: Efficient Finetuning of Quantized LLMs ↗On small screens, scroll the diagram horizontally.
Base weights stay frozen in four-bit NF4 while small LoRA adapters are trained. Double quantization and paged optimizers further reduce memory needs.
This is not full four-bit training; quality and speed depend on configuration.
Memory used by conventional attention grows with the text.
The model updates a summary state for each text piece, while allowing parallel training.
Fictional example: continue an answer without adding a memory record for every word.
Storage for the past can remain constant during generation.
Older details are compressed and do not all remain directly accessible.
Time mixing and channel mixing combine gates with weighted aggregation. The formulation supports recurrent evaluation and sequence-parallel training.
Finite state compresses history rather than keeping individually addressable token caches.
Rounding every value the same way can seriously degrade answers.
Examples identify influential channels, then a change of scale reduces their rounding error.
Fictional example: better preserve a sensitive group of values.
The model can use less memory without complete retraining.
Calibration must remain representative, and acceleration depends on available implementations.
Calibration activations identify important channels. Rescaling weights before quantization reduces their error without retraining the whole network.
Calibration must remain representative and acceleration requires suitable kernels.
Positions far beyond those seen during training can disrupt the model.
New positions are mapped into the familiar range, followed by a short period of further training.
Fictional example: fit a longer ruler onto the same scale.
The usable text window can be extended.
The ruler describes scaling only: not every detail becomes equally accessible.
Interpolation reduces position indices before applying RoPE, fitting a longer text into the learned range.
Paper: Extending Context Window of Large Language Models via Positional Interpolation ↗YaRN refines interpolation by treating RoPE rotation frequencies differently and adjusting attention scaling.
Paper: YaRN: Efficient Context Window Extension of Large Language Models ↗Long-sequence positions are mapped into RoPE's familiar interval. The model is then fine-tuned to use the new scale without abrupt extrapolation.
An advertised window does not guarantee uniform retrieval of all information.
A chip can wait while some parts of the computation remain busy.
The implementation distributes blocks better and reduces communication and additional operations.
Fictional example: share computation for one reading path across several units.
The chip can spend more time on useful calculation.
Benefits depend on hardware, and comparisons grow with the square of the length.
The second version retains tiled computation and distributes work more effectively across GPU units.
Paper: FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning ↗The third version adapts this exact attention to Hopper GPUs by overlapping transfers and computation.
Paper: FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision ↗On small screens, scroll the diagram horizontally.
The kernel reduces non-matrix operations and better distributes blocks from one head across GPU units. It also reduces communication between thread groups.
Gains depend on tensor shapes and GPU; complexity remains quadratic.
A text-continuation model still needs adaptation to act as an assistant.
After learning from text, demonstrations and human preferences guide the conversational versions.
Fictional example: prefer answering the question over merely continuing its wording.
The publication describes more of the adaptation recipe.
Its components predate the model, and results depend on the chosen examples.
Base models receive further pretraining, then Chat variants undergo supervised and human-preference tuning. The 70B variant adopts GQA to reduce attention cache.
Components predate the release; behavior also depends on instruction and preference datasets.
A fast way to learn is not always practical for answering.
A retention rule combines information and gradually reduces the influence of some older positions.
Fictional example: update a state after every new word.
Several computation forms implement the same mechanism.
The state compresses the past, and performance must be compared at equivalent quality.
Retention combines query-key interactions with temporal decay. Equivalent formulations support parallel, recurrent or chunkwise recurrent computation.
Recurrent state summarizes history; gains need comparison at matched quality.
Reading a long request in one go temporarily monopolises the chip.
The server processes the input in chunks, mixed with steps for answers already underway.
Fictional example: read part of a report between two generation steps.
The hardware can distribute its work better.
Chunks that are too small or too large worsen some waiting times.
Prompt prefill is split into chunks. The scheduler mixes chunks with decoding steps to improve GPU use and reduce imbalance.
Chunk size trades throughput against latency and scheduling overhead.
Extending every position scale in the same way can degrade a model.
Some scales are stretched, others preserved, followed by further training to adapt the model.
Fictional example: retain nearby landmarks while expanding long distances.
The usable window can grow with less adaptation effort.
Long-distance quality still needs measurement for each model.
YaRN refines interpolation by treating RoPE rotation frequencies differently and adjusting attention scaling.
Paper: YaRN: Efficient Context Window Extension of Large Language Models ↗YaRN interpolates some RoPE frequencies while preserving others, together with attention scaling adjustments. Additional training adapts the model to the new window.
Tuning and actual long-context quality depend on the model.
Reserving one large continuous space per request wastes memory.
The information stored about past text is divided into small blocks linked by a table. Identical beginnings can share these blocks.
Fictional example: expand an answer's storage block by block.
The server can accommodate more simultaneous requests.
Blocks need management, and storage for past text is still required.
The cache is split into physical blocks linked through a logical table. Sequences no longer require large contiguous allocations; prefixes can share blocks.
Paging does not eliminate the cache and adds block management.
Simply removing old pieces from the cache can disrupt attention.
The model retains a few initial pieces and a recent window while removing the others.
Fictional example: keep a stream's opening and its recent sentences.
Generation can continue with bounded memory.
Removed content is no longer accessible: this is not unlimited memory.
Alongside a recent window, retain initial tokens that attract attention. These sinks stabilize computation as older tokens are removed from cache.
Evicted information is no longer accessible: unlimited streaming does not mean unlimited memory.
Reading and storing the entire text at every stage is expensive.
Each stage reads a nearby window. Several reading paths also share some stored information.
Fictional example: directly consult neighbouring sentences during generation.
The cache, temporary storage for the past, can become smaller.
Distant text is not directly accessible at every stage.
Each layer attends to a local window; stacking propagates information beyond it. GQA shares keys/values and a rolling buffer bounds window storage.
Direct access to distant tokens is limited; this is not free global attention.
Adding raw text does not guarantee efficient learning.
The family combines cleaned web text with several choices that reduce computation and memory costs.
Fictional example: remove repetitive content before training.
The report makes these decisions available for joint study.
Variants differ, and the report follows the models' first releases.
The recipe emphasizes corpus cleaning and efficient computation choices, including attention key/value sharing depending on the variant. The report compares architecture and data decisions.
The November report follows model releases; MQA and GQA are not interchangeable.
A rigid summary of the past can retain the wrong information.
Each text piece controls updates to an internal state, computed efficiently during training.
Fictional example: update the state differently depending on the word received.
Generation retains a state whose size does not grow with the text.
This compression can lose older details that need exact retrieval.
Mamba extends state-space models by making what is retained or forgotten depend on the input.
Paper: Mamba: Linear-Time Sequence Modeling with Selective State Spaces ↗Mamba-2 reformulates Mamba’s selective mechanism through the duality between state spaces and structured attention.
Paper: Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality ↗Jamba combines Mamba layers with Transformer attention layers and expert layers.
Paper: Jamba: A Hybrid Transformer-Mamba Language Model ↗State-space parameters depend on the input. An efficient GPU scan computes the recurrence during training, while decoding keeps only fixed-size state.
This compression can weaken exact retrieval of distant context elements.
Several requests can start with the same long text.
A tree organises memory blocks for shared beginnings and allows their reuse.
Fictional example: ask several questions after the same initial instruction.
Computation already performed on that beginning can be saved.
The beginning must match exactly, and blocks must remain in a compatible cache.
A radix tree organizes KV-cache blocks by shared prefixes. SGLang retains and reuses those blocks across calls, beyond one generation's internal cache; eviction frees memory.
Identical prefixes and compatible caches are required; evicted blocks must be recomputed.
Activating an entire large network for every text piece is expensive.
A selection component chooses several small networks, called experts. Others remain active for shared information.
Fictional example: activate a small selection of experts for a word.
Total capacity can increase without computing through every expert.
Their workload must be balanced, and data may need moving between machines.
On small screens, scroll the diagram horizontally.
Expert networks are split more finely, allowing the router to combine more small experts. Always-active experts capture common knowledge to reduce redundancy among routed experts.
Load balance and communication remain major constraints.
These phases do not use machines in the same way.
Separate chip groups process the input and generate the answer, transferring the computed memory between them.
Fictional example: assign long documents to a dedicated group.
The server can better meet some response-time targets.
Transferring memory consumes network capacity and can cancel the benefit.
Prompt processing and token generation run on separate GPU groups. The system sizes these groups and transfers KV cache between phases.
Cache transfer consumes network bandwidth; gains depend on infrastructure and traffic.
An ordinary draft does not always exploit the main model's computation.
A small component predicts internal numerical representations rather than only text, and builds proposals that the main model then checks.
Fictional example: check several candidate word sequences together.
More frequently accepted proposals can accelerate generation.
The extra component needs training, and its proposals can be rejected.
The drafter predicts target-model internal features, also conditioned on tokens. It builds candidate continuations verified through speculative sampling.
The predictor must be trained and served; gains depend on acceptance rate.
Producing one text piece per pass limits speed.
Small components added to the model propose several continuations, arranged in a tree for joint checking.
Fictional example: propose several next words and their continuations.
Some computation passes can validate more text.
The additions require training, and some acceptance rules change the original probabilities.
Heads trained on LLM representations predict several future positions. Tree attention then verifies combinations of proposed tokens together.
Heads require training; not every acceptance rule preserves the distribution.
Using every learned value for each word would be expensive.
A selection component chooses two expert networks out of eight for each text piece.
Fictional example: only the two selected paths perform their specialised computation.
Active computation remains below that of all experts combined.
Every expert still needs storage, and distributing them complicates execution.
Mixtral uses the sparse-expert principle: each token is sent to two of the eight experts in each MoE layer.
Paper: Mixtral of Experts ↗On small screens, scroll the diagram horizontally.
At each layer, a router selects two of eight expert networks for each token. Attention remains shared; only some expert weights participate in computation.
All experts must be stored; routing complicates distributed execution.
Detailed numerical values take considerable space.
Training constrains some values to be negative, zero or positive, with a suitable shared scale.
Fictional example: represent a coefficient as minus one, zero or one.
Suitable implementations can exploit this compact representation.
Total memory includes more than these values, and acceleration requires appropriate hardware support.
Linear-layer weights take −1, 0 or +1 with scaling factors; activations are also quantized. Training incorporates the constraint from the start.
1.58 bits describes ternary weights, not total memory; gains need suitable kernels.
A large auxiliary evaluator adds cost.
Several answers to the same question receive scores. Their relative scores guide the model's updates.
Fictional example: favour solutions that pass a test within the group.
A large auxiliary network estimating expected success can be avoided.
Generation remains expensive, and a bad reward rule teaches undesirable behaviour.
GRPO adapts PPO by comparing rewards for several answers to the same question, without a separate value critic.
Paper: DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models ↗For one question, generate several answers and compare rewards within the group. This relative baseline estimates the advantage used to update the model with regularization.
Generation cost remains and reward quality is critical.
Temporary text memory becomes large for long inputs.
Keys, used to locate information, and values, used to read it, are compressed differently. A recent portion retains higher precision.
Fictional example: compress the older blocks of a conversation.
Storage for the past decreases without retraining the model.
Quality and speed depend on settings and the computation implementation.
Keys are quantized per channel and values per token because their outliers are distributed differently. A small recent portion remains at higher precision.
Accuracy and throughput depend on groups, context and kernels.
One uniform position setting does not suit every distance.
A search chooses different scaling factors for position components, then progressively adapts the model while also checking its behaviour on shorter inputs.
Fictional example: test several settings on short and long passages.
Some models can accept much longer inputs.
The advertised length does not guarantee reliable understanding of every passage.
LongRoPE adjusts RoPE dimensions and positions with nonuniform factors. Progressive extension and readjustment also aim to preserve short-sequence performance.
Millions of advertised tokens do not guarantee reliable understanding throughout the window.
Compact memory can lose details that attention retrieves directly.
The model alternates summary-state stages with attention stages, adding expert networks in some places.
Fictional example: retain a few direct accesses to text among compact stages.
Storage for the past can decrease.
Multiple mechanisms complicate computation implementations and memory allocation.
Jamba combines Mamba layers with Transformer attention layers and expert layers.
Paper: Jamba: A Hybrid Transformer-Mamba Language Model ↗Jamba retains attention layers within a model that also uses Mamba’s recurrent memory.
Paper: Jamba: A Hybrid Transformer-Mamba Language Model ↗Jamba interleaves Mamba and Transformer layers and adds MoE experts to some layers. The presented configuration uses many more Mamba than attention layers.
Multiple layer types complicate kernels and resource allocation.
A short window no longer provides access to earlier passages.
Each block combines reading nearby text with an updated summary of older segments.
Fictional example: retain condensed associations after a paragraph has passed.
A stream can exceed the local window with bounded memory.
Older passages are compressed with losses and do not remain fully accessible.
Each block combines local attention with linear memory of past segments. A recurrent update compresses previous associations and a gate mixes the two outputs.
The past is compressed lossily; long streams do not become fully addressable.
Reducing learning speed too early makes continuation less convenient.
The speed rises, stays stable, then falls at the end. Small experiments also help select settings.
Fictional example: extend the plateau before the final decrease.
The recipe facilitates some experiments with smaller models.
Transferring settings depends on the recipe and is not universal.
Small-scale experiments tune hyperparameters with Tensor Programs. WSD separates warmup, a stable plateau and final learning-rate decay, easing continued training.
Transferring settings depends on the training recipe and model architecture.
Sending every position through every stage spends a uniform budget.
A selection component chooses which text positions are processed by some stages. The other positions continue through the model without that particular computation.
Fictional example: reserve an expensive stage for selected positions.
Active computation can be reduced.
Selection must respect generation order and remain efficient on the hardware.
A router scores tokens and selects a fixed-size subset for some layers. Others take the residual path, saving that computation.
Routing must remain compatible with causality and hardware constraints.
Predicting only the next piece provides a very local objective.
Several outputs share the main computation and learn to predict different upcoming positions.
Fictional example: learn the next word and the one after it.
These outputs can also supply proposals to accelerate generation.
Future positions remain uncertain, and their proposals need checking.
Several heads share a common trunk and learn different future positions. They provide a richer training signal and can support speculative decoding.
Future predictions remain uncertain; acceleration needs suitable verification.
Some successive updates make poor use of chips' parallel capabilities.
A new formulation groups updates into blocks suited to matrix multiplication.
Fictional example: process a segment together rather than every position separately.
Chips can make better use of their computation units.
The mathematical equivalence applies to certain structures, not every form of attention.
Mamba-2 reformulates Mamba’s selective mechanism through the duality between state spaces and structured attention.
Paper: Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality ↗State-space duality describes some attention and recurrent mechanisms using related structured matrices. Mamba-2 uses this structure to compute blocks efficiently through matrix multiplication.
The equivalence concerns specific structures; arbitrary softmax attention is not an equivalent recurrence.
Storing every attention key and value takes considerable space.
The model stores a shorter list of numbers and a separate position key. Computation uses this condensed version.
Fictional example: retain a shorter numerical description per position.
Memory can decrease substantially compared with conventional attention.
Depending on the chosen dimensions, this cache can exceed one shared set for all reading paths.
MLA also reduces cache memory, but compresses keys and values into a small vector instead of sharing them in groups.
Paper: DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model ↗A low-rank projection compresses keys and values into a cached latent vector. Rearranged transformations and separate positional handling compute attention from this compression.
The reported 93.3% reduction compares DeepSeek-V2 with DeepSeek 67B; it is not universal.
Adding new information can leave an older incorrect association in place.
The rule compares the value associated with an item against its newly expected value, then writes their difference.
Fictional example: correct an association instead of simply adding it again.
Memory can update some information more effectively.
It remains finite in size and can lose details from the past.
Instead of merely adding a key-value association, the delta rule subtracts the current prediction for that key and writes the correction. The paper parallelizes these updates across sequences.
Memory remains finite; the paper improves an earlier delta rule.
A fixed proposal tree spends computation on less useful branches.
The small predictor's scores shape the tree of continuations the main model will check.
Fictional example: extend a likely branch instead of an unlikely one.
The proposal budget can be used more effectively.
Scores remain imperfect, and a large tree adds work of its own.
EAGLE-2 builds a candidate tree using drafter confidence scores. Its structure changes with position and probabilities rather than remaining fixed.
Larger trees add computation; tree shape must fit the hardware.
Manually producing and checking many examples is expensive.
One model generates example answers and another gives them quality scores, so that suitable examples can be selected for further training.
Fictional example: retain an answer judged clearer for future adaptation.
The pipeline can provide many synthetic examples.
Errors and biases from both generator and evaluator can accumulate.
Instruct models produce responses and a Reward model evaluates quality. The report documents post-training based overwhelmingly on synthetic examples and releases the associated pipeline.
This does not invent synthetic data; generator and judge errors can accumulate.
Computation units can wait for data to arrive.
The implementation advances several attention operations simultaneously and also offers a reduced-precision variant.
Fictional example: load one block while computing the previous one.
Attention can run faster on the targeted chips.
Benefits depend strongly on hardware, and the low-precision variant adds numerical approximation.
The third version adapts this exact attention to Hopper GPUs by overlapping transfers and computation.
Paper: FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision ↗On small screens, scroll the diagram horizontally.
The kernel overlaps memory transfers, matrix multiplication and softmax. An FP8 variant adds transformations to limit quantization error on Hopper GPUs.
Benefits strongly depend on GPU architecture; FP8 introduces numerical approximation.
Small models have less capacity to learn independently.
They learn a teacher model's probabilities and alternate local and global reading of text.
Fictional example: learn several continuations considered possible by the teacher.
Compact models can achieve better results.
Producing targets costs computation, and their weaknesses can come from the teacher.
Smaller models learn teacher distributions; the architecture alternates local windows and global attention. Soft-capping smoothly bounds attention scores and output logits.
Distillation depends on the teacher and adds target-generation costs.
Changing one component does not explain every difference in results.
The recipe combines text selection, large-scale computation, longer inputs and preference adaptation.
Fictional example: improve both training data and conversation examples.
The report makes the overall development process available for study.
It documents a combination without dating the invention of every technique.
The report documents data filtering and mixing, large-scale training, context extension and repeated supervised and preference tuning. It also presents multimodal extensions.
This is a combination of techniques; the report does not date their individual invention.
The same effort does not suit both easy and difficult questions.
Revisions and solution searches are compared, using a verifier and a budget adapted to estimated difficulty.
Fictional example: test more possibilities for a difficult problem.
Answers can improve without enlarging the model.
Benefits depend on the verifier, and extra attempts take time.
The paper compares successive revisions and verifier-guided search. It allocates computation according to estimated question difficulty instead of applying one strategy to every problem.
Gains depend on model, difficulty and verifier; this is not always better than training larger.
A single path combines results in a relatively constrained way.
Several streams replace that path, and learned coefficients control their mixtures before and after each stage.
Fictional example: combine two streams with different weights.
The model gains more ways to pass information onwards.
These mixtures can increase memory, computation and training difficulties.
Multiple representation streams replace a single residual path. Learned coefficients control how streams feed a layer and how its output updates them.
More streams and mixing can increase memory, cost and stability challenges.
Without data and analysis, routing choices are difficult to understand.
The model selects eight expert networks out of sixty-four and releases a recipe with comparative experiments.
Fictional example: compare two rules for selecting experts.
Researchers can examine several design decisions.
Openness removes neither the storage of all experts nor their costly communication.
The model activates eight of sixty-four experts per token. The paper releases a recipe and ablation analyses, including routing, stability and normalization choices.
Openness supports study but eliminates neither total memory nor expert communication costs.
The usual rule couples the weights of all positions being read.
A function transforms each score separately, with settings to stabilise learning.
Fictional example: adjust the contributions of two past positions independently.
This alternative can achieve comparable results in some experiments.
Comparing every position remains expensive, and these results do not establish general superiority.
A sigmoid transforms each query-key score independently instead of normalizing a full row with softmax. The paper studies initial norms and proposes the FlashSigmoid kernel.
Dense computation remains quadratic; this work revisits an earlier idea rather than inventing it.
Very different numerical magnitudes can complicate updates.
Representations and some learned values are normalised. Learning mainly changes their directions, with suitable scaling factors.
Fictional example: change an arrow's direction rather than its length.
Some experiments show more efficient learning.
The arrow represents a numerical vector, and the recipe requires specific settings.
nGPT normalizes relevant vectors and frames updates as motion on a hypersphere. Learned factors control layer contribution magnitudes.
Reported gains depend on the experiments; this geometry needs a dedicated recipe.
A vocabulary of predefined pieces imposes a segmentation that can be unsuitable.
A component groups bytes, the units encoding text. Main computation processes these groups, then another component reconstructs bytes.
Fictional example: create small groups in an unpredictable passage.
Segmentation can adapt to content.
Grouping and local components add work and complexity.
A local encoder groups bytes into variable-size patches according to predictability. A global Transformer operates on patches and a local decoder predicts bytes.
Local components and segmentation add complexity; gains depend on content.
A large model combines training, storage and communication costs.
The recipe activates selected experts, condenses the past and uses lower-precision numbers with suitable precautions.
Fictional example: better distribute work between lightly and heavily used experts.
These choices jointly target greater efficiency.
The report retains a per-sequence balancing term despite simplifying other constraints.
The model balances routed experts using load-adjusted biases, uses a latent cache and learns future tokens. FP8 training includes precision and communication safeguards.
The model retains a small sequence-wise balancing loss; auxiliary-loss-free does not mean no such loss anywhere.
Keeping old information indefinitely can interfere with updates.
A gate controls forgetting, while a targeted correction changes what the memory predicts incorrectly.
Fictional example: reduce older traces while correcting an association.
Memory combines two complementary ways to update itself.
It remains compressed, and benefits depend on the tasks and budgets compared.
A gate controls state forgetting while the delta rule corrects particular associations. A chunkwise algorithm makes training parallel and GPU-friendly.
Memory remains compressed; comparisons depend on selected tasks and budgets.
Using every value in a large network is expensive.
A lookup selects a few entries from a large table of associations learned during training.
Fictional example: use only the entries matching an internal query.
Stored capacity can grow without as much active computation.
Storage and access remain costly: this is not retrieval from external documents.
A token-derived query retrieves entries from a large key-value memory. Only selected values contribute to the layer, using efficient lookup mechanisms.
Storage and memory access remain costly; this parametric memory is not a RAG corpus.
Revisiting an entire long text requires substantial computation and memory.
Titans keeps a compact representation of the text and updates its values while reading. Another mechanism directly consults nearby passages.
Fictional example: a name introduced early may influence an answer much later.
Some earlier information remains usable without revisiting everything at each step.
This representation can forget and guarantees no memory between conversations.
A module learns key-value associations as context arrives; gradients, momentum, and forgetting govern updates during inference.
This memory is compressed and may forget; it guarantees neither exact recall nor persistence between conversations.
Consulting every earlier passage becomes expensive as text grows longer.
Some calculation stages use a compact representation of earlier text; others consult passages directly. Only selected specialized parts of the network process each text piece.
Fictional example: processing a dossier before answering a question about its contents.
This combination aims to make long texts less expensive to process.
Accepting a long input does not guarantee retrieving every detail.
Lightning Attention computes linear attention, combined with softmax layers and a MoE; the report describes training on one million tokens.
Advertised context length does not guarantee perfect recall; speed depends on kernels.
Copying written answers does not always suffice to solve new problems.
The model generates attempts; checking assigns rewards that guide learning. R1 also combines prepared examples with several training stages.
Fictional example: automatically checking whether a program passes the requested exercises.
This recipe can improve problem solving where outcomes can be checked.
Written steps guarantee neither a correct answer nor a faithful account of internal computation.
R1-Zero applies RL without preliminary SFT; R1 adds cold-start data, several RL stages, and distillation into smaller models.
Verifiable rewards suit objectively assessable tasks; longer answers consume compute.
Some questions require more solution steps than others.
After training on examples, generation is stopped or extended before the final answer. Adding “Wait” encourages further written steps.
Fictional example: extending a solution to attempt an additional check.
The system can adjust the computation time spent on a question.
Longer text costs more and guarantees neither a better answer nor a faithful account of reasoning.
After SFT on one thousand questions, budget forcing stops reasoning or extends it with “Wait” to encourage another verification step.
More tokens increase latency and do not guarantee a better answer to every question.
Among many passages, useful information may receive too little attention.
The model calculates scores for passages it might consult. The method adjusts their scale according to text length, separately for each reading pathway.
Fictional example: a relevant name needs to stand out among many sentences.
This adjustment can prevent overly diffuse attention in the models studied.
Experiments on small models do not establish a universal benefit.
Scalable-Softmax multiplies scores by a factor proportional to the logarithm of position count, with a learned scale per head.
A small-model study; results do not establish universal improvements at large scale.
Producing text strictly from left to right limits opportunities for parallel computation.
The model learns to recover hidden pieces of text. To generate an answer, it progressively fills masked positions over several passes.
Fictional example: completing “The [mask] sleeps” and then refining the choices.
Multiple positions can be processed together instead of each waiting its turn.
Repeated passes cost computation: parallel work does not automatically mean a faster answer.
A Transformer learns to reconstruct masked tokens; successive unmasking steps turn corrupted text into a response, following pretraining and SFT.
Multiple passes are needed; potential parallelism and actual acceleration must be distinguished.
Expensive training can waste computation when its updates are poorly adjusted.
Muon transforms the tables of corrections applied to learned values. The Moonlight work also adjusts their scale and limits growth of those values to train large models.
Fictional example: comparing two training recipes with the same computation budget.
The method aims to obtain better learning within a given budget.
Its benefit depends on the model and the training conditions.
Update orthogonalization is combined with weight decay and update-scale calibration; the authors train Moonlight.
The gain over AdamW is experimental and depends on the training regime.
Having the large model calculate every new text piece is slow.
A small model uses intermediate results from several stages of the large model to propose a continuation. The large model then checks these proposals.
Fictional example: proposing “the door is open” and accepting only the validated beginning.
Accepting several proposals together can reduce generation time.
Proposals that are frequently rejected or expensive to produce can erase the advantage.
The drafter fuses representations from multiple layers and directly predicts tokens; training better simulates its generation conditions.
Acceleration depends on acceptance rate, batch size, and drafter cost.
Consulting all text at every calculation stage requires substantial memory.
Most stages consult only a window of nearby text. Other stages consult the full context; some variants also process images.
Fictional example: using neighboring sentences while connecting a name to the beginning of a document.
Most stages retain less information for generation.
Global stages remain expensive, and distant information may still be used poorly.
Five local-window layers alternate with one global layer; multimodal models add a vision encoder and extended context.
Global layers remain expensive; a large context does not mean perfect access to every detail.
Retaining all intermediate information about text can take considerable memory.
Most stages update a compact representation of preceding text. A few stages retain direct attention over the text.
Fictional example: tracking the overall subject while consulting earlier passages at selected stages.
This combination aims to reduce generation cost while retaining some direct consultation.
The compact representation loses details; memory used by attention stages still grows.
Most attention layers are replaced by Mamba layers; pruning and distillation also compress selected models.
Mamba layers retain fixed state, but remaining attention layers keep their growing cache.
Processing long content containing text and images can become very expensive.
Text pieces and image representations pass through a shared network. The model varies how positions are represented and selects specialized network parts for computation.
Fictional example: answering a question about a photo accompanied by a long commentary.
This combination aims to handle varied content with selectively activated computation.
All network parts require storage; accepting extensive text does not guarantee recalling it.
iRoPE interleaves RoPE layers with layers without positional encoding, with temperature adjustment; visual and text tokens share the backbone.
An advertised multimillion-token context does not guarantee recall; all experts still need storage.
Information that was consulted is not necessarily useful for the next calculation stage.
After consulting the text, each reading pathway receives a setting calculated from the input. This setting attenuates or passes through its results.
Fictional example: reducing the contribution of a pathway that is less useful for the current sentence.
The model can filter attention results more finely.
Observed benefits depend on the tested models and are not guaranteed everywhere.
A sigmoid function modulates head outputs after attention; the study observes greater sparsity and less artificial concentration on initial tokens.
Results concern the tested architectures and do not prove universal improvement.
A long written solution may be unnecessary for a simple question.
Training prepares the same model either to answer directly or to produce steps before answering. The selected mode changes how generation proceeds.
Fictional example: responding directly to a greeting but writing out a mathematical solution.
One model offers different balances between response time and problem-solving work.
Extra steps cost computation without guaranteeing their faithfulness or the final answer’s correctness.
Post-training unifies immediate responses and reasoning traces; GQA, RoPE, SwiGLU, and QK-Norm form an already well-tested architecture.
A larger thinking budget increases cost; the report does not describe MTP for initial Qwen3.
A phone has less memory and computation available than a server.
Some representations can be prepared and stored outside main memory. A nested network also allows a smaller version of the model to run.
Fictional example: selecting a smaller version for a phone application.
The method can reduce working memory and the amount of computation required.
Stored values, values used for computation, and actual memory consumption remain different quantities.
Per-layer embeddings can be prepared and stored outside main memory; MatFormer allows nested submodels to run with fewer parameters.
Total parameters, active parameters, and effective memory differ; savings depend on implementation.
Storing every part of a large model may exceed available memory.
The method measures the use and outputs of specialized network parts, called experts. It replaces selected parts with small modules that approximate their contribution.
Fictional example: replacing a rarely used part after testing on a collection of texts.
The transformed model can require less storage.
Approximation can degrade its answers and depends on the examples used to select replacements.
MoNE measures access frequency and output variance to replace selected experts with lightweight modules approximating their contribution.
Compression changes the model and may reduce quality; calibration data matters.
A mechanism that performs well alone may be less effective when combined with another.
The study compares different proportions of direct consultation and compact-memory stages. It trains multiple models to measure tradeoffs instead of assuming a winning combination.
Fictional example: comparing more compact stages against more direct consultations.
These measurements help select a combination for a desired cost and outcome.
They do not establish an ideal proportion that applies to every model.
The authors train 72 models with different mechanisms and ratios; the best standalone component does not necessarily win when hybridized.
Tradeoffs observed at the studied sizes do not establish a universal optimal ratio.
A model that runs quickly on a server may run slowly on a phone.
The search measures delay and memory on devices. It mainly combines computations over short text neighborhoods with a few broader consultation stages.
Fictional example: measuring several variants on the phone that will run the application.
The architecture can better match actual hardware constraints.
A result measured on one device does not automatically transfer to other hardware.
Architecture search measures on-device memory and latency; it combines mostly short double-gated convolutions with a few GQA layers.
An acceleration measured on mobile CPUs does not automatically transfer to every GPU or workload.
A very large network is difficult to train and does not automatically chain tool actions.
A correction limits excessive attention values during learning. Trials in simulated environments then train the model to produce sequences of tool actions.
Fictional example: finding a file, running a calculation, then using its result.
The recipe combines more stable training with learning successive actions.
All network parts remain large to store even when only selected parts compute.
MuonClip extends Muon with attention-logit control; synthetic environments and RL provide tool-use trajectories.
A trillion total parameters remain expensive to store even when only a small fraction is active.
A large model needs to limit the cost of memory and generation.
Reading pathways share some stored information. Selected network parts perform computation; an additional stage also proposes text pieces that the model can check together.
Fictional example: proposing a short continuation rather than checking each piece separately.
This combination aims to reduce the cost of serving the model.
Results also depend on training and data, rather than on these mechanisms alone.
The report describes GQA with partial RoPE, a balanced-routing MoE, and an MTP layer proposing speculative tokens.
Quality and speed also depend on data and post-training, not architecture alone.
The learned values of a large model can take too much memory.
Specialized network parts use a compact number format that is accounted for during adaptation. Only selected parts participate in computation for each text piece.
Fictional example: loading a model on a machine with limited memory.
Reducing precision can decrease the space occupied by stored values.
Memory for the text being processed and suitable hardware are still required.
Expert weights are quantized into MXFP4 during post-training; each token uses four experts out of 128 or 32 depending on the model.
Weight memory excludes the KV cache; performance depends on compatible hardware.
Keeping all required information at every reading stage becomes expensive.
Several stages update a compact representation of preceding text, then one stage consults the text directly. The network also selects which parts compute and proposes continuations for checking.
Fictional example: answering about a long document without retaining everything at every stage.
This combination aims for less expensive generation over long contexts.
Compact representations lose detail; few values used for computation does not mean little storage.
The model alternates three Gated DeltaNet layers with one Gated Attention layer, using a highly sparse MoE and MTP for speculative decoding.
The recurrent state compresses history; throughput gains depend strongly on implementation.
Compressing a long history can erase information that is still useful.
Most stages finely control adding and erasing information in a compact representation. Other stages consult text directly using compressed memory.
Fictional example: retaining still-useful information while weakening an association that has become less relevant.
The mechanism aims for a better balance between memory cost and using context.
Compression can lose details, and global stages retain memory that grows with the text.
KDA extends Gated DeltaNet with finer gates; Kimi Linear alternates three KDA layers and one global MLA layer.
Global layers retain a growing cache; detailed retrieval remains difficult with purely recurrent memory.
Comparing each new text piece with all earlier pieces becomes expensive.
A first lightweight calculation selects positions that may be useful. The main attention calculation then consults this selection instead of treating every passage the same way.
Fictional example: retaining passages about a date before answering a question about it.
A shorter selection can reduce computation for long texts.
Selection can omit useful information and has its own computational cost.
A lightweight indexer selects relevant tokens before main attention; DSA complements DeepSeek’s latent mechanism to reduce long-context cost.
Selection may discard information; the indexer itself still incurs cost.
Multiplying connections can disrupt information transmitted through a deep network.
Multiple pathways carry results between stages. The method constrains how these pathways are mixed to limit amplification and preserve more stable transmission.
Fictional example: comparing a multiple-pathway network with and without the constraint during training.
The network can explore more pathways while limiting some instabilities.
These connections add data transfers and require implementation optimizations.
Multiple Hyper-Connections are projected onto a constrained space to restore identity-like transmission properties and limit instability.
Additional connections increase memory traffic; efficiency requires dedicated optimization.
Enlarging every network calculation substantially increases the cost of using a model.
Groups of text pieces retrieve representations from large learned tables. The model consults selected entries instead of computing through an entire additional network.
Fictional example: consulting a representation associated with a frequent group of words.
The model can add learned values without using every value at every step.
The tables require storage and must remain fast to access.
Large embedding tables represent groups of tokens; sparse lookups add parameters without activating an entire additional network.
Tables need efficient storage and lookup; gains depend on budget and hardware.
Even a small drafting model can be slow if it writes every piece sequentially.
The small model uses results from the large model to propose a block of text in parallel. The large model then checks the proposed pieces before accepting them.
Fictional example: proposing a complete short continuation rather than its pieces one at a time.
Less sequential drafting can reduce generation delay.
The benefit depends on accepted proposals, hardware, and workload.
A diffusion drafter conditioned on target-model representations proposes a block in one pass; the target model then verifies the tokens.
Gains depend on acceptance, batch size, and engine; verification remains essential.
Combining long texts with images can require substantial resources.
The model learns from visual and textual content. It alternates compact representations with direct context consultation, selects certain network parts, and can propose multiple pieces for checking.
Fictional example: answering about a screenshot and its long description.
The combination aims to process different kinds of content with controlled computation.
All learned values still require storage even when few participate in each calculation.
Gated DeltaNet and Gated Attention combine with a sparse MoE, multiple-token prediction, and training incorporating visual modalities.
A low active-parameter count does not mean low total storage; advertised throughput depends on comparators.
Consulting a very long text can require too much memory and computation.
Several mechanisms compress retained information and select what to consult. The model also combines stabilized connections between stages with a different update recipe during training.
Fictional example: answering about a large dossier using reduced representations.
This combination aims to reduce the cost of long contexts.
Compression can lose details; reported savings depend on the measured comparison.
The report describes CSA and HCA for context compression and selection, mHC for residual connections, and Muon for training.
Advertised savings compare against V3.2 in a specific setup; compression may lose detail.
Transcribing a long document can accumulate too much information about text already produced.
The model keeps access to representations of the document image and a window of recent text. It does not retain the entire transcription in its generation memory.
Fictional example: continuing a transcription while still consulting the original image.
Transcription-related memory stops growing with the full transcription length.
The visual reference and recent-text window still occupy memory.
Unlimited OCR retains access to visual reference tokens and a recent-text window; this attention replaces DeepSeek OCR decoder layers.
Memory stays constant with transcription length but still depends on reference size and window.
One model does not suit every device or every type of input.
The family provides different sizes and different ways to distribute computation. Depending on the variant, it can receive images or sound and produce steps before answering.
Fictional example: choosing a variant suitable for audio inputs on a particular device.
Several tradeoffs become available within one family.
Each variant has its own capabilities; none automatically combines all the family’s features.
The report presents dense and MoE models, image and audio inputs, a thinking mode, and a 12B variant without separate encoders.
Features differ by size; PLE, MoE, and every modality cannot be attributed to every variant.
Checking a long, unpromising draft can waste computation.
The system estimates which proposals are likely to be accepted. It adjusts the work sent to the large model while also accounting for server load.
Fictional example: shortening the block to check when proposals are uncertain.
The system seeks a better balance between individual waiting time and the number of answers served.
Useful settings depend on workload, and proposals still require checking.
The framework combines semi-autoregressive generation with adaptive verification: proposal confidence and server load guide work submitted to the target model.
The latency-throughput tradeoff depends on actual load; a long draft is not always worthwhile.
Strictly sequential generation limits opportunities to produce several pieces together.
Adaptation teaches the model to complete and correct text blocks. Multiple passes refine proposals; additional training stages seek a balance between speed and results.
Fictional example: filling and then correcting positions in a short answer.
The experimental model explores more parallel generation.
Refinement costs computation, and measured speedups are not guaranteed on every device.
The model refines 256-token blocks in parallel; denoising SFT followed by RL and sampler distillation balances quality and speed.
Multiple refinements are needed; H100 measurements do not guarantee identical gains on every device.
Follow an idea into work that builds on, improves or combines it. Choose a family, then a connection to read its explanation and source. Alternatives are shown separately from lines of development.
MQA retains Transformer attention heads but makes them share a single set of keys and values.
Read the paper ↗GQA generalizes MQA: several groups share keys and values, instead of one shared set for all heads.
Read the paper ↗MLA also reduces cache memory, but compresses keys and values into a small vector instead of sharing them in groups.
Read the paper ↗The second version retains tiled computation and distributes work more effectively across GPU units.
Read the paper ↗The third version adapts this exact attention to Hopper GPUs by overlapping transfers and computation.
Read the paper ↗QLoRA trains LoRA’s small matrices through a frozen base model quantized to 4 bits.
Read the paper ↗InstructGPT applies reward learning from human preferences to tune a language model.
Read the paper ↗DPO learns directly from preferred and rejected responses, without training the separate reward model used in the InstructGPT recipe.
Read the paper ↗GRPO adapts PPO by comparing rewards for several answers to the same question, without a separate value critic.
Read the paper ↗Interpolation reduces position indices before applying RoPE, fitting a longer text into the learned range.
Read the paper ↗YaRN refines interpolation by treating RoPE rotation frequencies differently and adjusting attention scaling.
Read the paper ↗Switch retains routing to sparse experts and simplifies it: a single expert is chosen for each token.
Read the paper ↗Mixtral uses the sparse-expert principle: each token is sent to two of the eight experts in each MoE layer.
Read the paper ↗Mamba extends state-space models by making what is retained or forgotten depend on the input.
Read the paper ↗Mamba-2 reformulates Mamba’s selective mechanism through the duality between state spaces and structured attention.
Read the paper ↗Jamba combines Mamba layers with Transformer attention layers and expert layers.
Read the paper ↗Jamba retains attention layers within a model that also uses Mamba’s recurrent memory.
Read the paper ↗Self-consistency generates several Chain-of-Thought reasoning paths, then selects the most frequent answer.
Read the paper ↗Dates refer to the first arXiv submission or the indicated official publication. A model may be available before its paper is published.
The original model is the one described in the publication. A method may be demonstrated on an experimental model and later popularized by other models.
Reported results and numerical gains depend on the model, hardware and measurement protocol.
Download the bilingual catalogue (JSON)