Intern-S2-Preview Team, Shanghai AI Laboratory — arXiv:2608.13505, 13 August 2026

Intern-S2: A Scientific Agentic Foundation Model

A benchmark asks one question and grades one answer. A scientist reads a figure, loads a signal, writes code, reads the traceback, and tries again. This paper is 35 pages about the second thing — and almost all of it is plumbing.

Prerequisites: what a softmax is + what a gradient step does. Policy gradients, importance sampling, MoE routing, Q-Formers, and distillation are all built from zero.
11
Chapters
4
Interactive Sims
397B
Parameters
214,854
Executable Tasks

Chapter 0: The Loop a Benchmark Cannot Score

Picture an afternoon in a lab. A graduate student has a physiological recording — three hundred thousand samples of an electrophysiology trace, four channels, sampled fast enough that the interesting events are a few dozen samples wide. She also has a PDF: a 2019 methods paper whose Figure 3 shows the exact artefact she thinks she is looking at, with the axis labels that matter printed inside the figure and not in the caption. She has a repository of analysis code that ran fine last year and now fails on line 214. And she has a question that nobody has written down as a multiple-choice item: is this artefact real, and if it is, what does the signal do over the next two seconds?

Now count what answering that requires.

She has to read a rendered page, not a text extraction — because the numbers she needs are burned into a figure. She has to ingest a long numerical signal as numbers, not as a sentence describing it. She has to run code, look at what came back, and change the code. She has to keep going — ten, forty, two hundred steps — without losing the thread of what she was testing. And at the end she has to produce a number: a forecast, with a horizon somebody else chose.

Each of those is a different kind of competence, and the depressing thing is that a model can be excellent at every one of them separately and still be useless in that room, because the room is a loop and the competences are graded as isolated turns.

The paper's opening move, in its own words. "Scientific discovery increasingly requires AI systems that can reason over scientific evidence of heterogeneous modalities, interact with scientific tools and environments, and sustain progress across long task horizons." And then the sentence that names the gap: meaningful discovery "involves more than producing a correct response to an isolated question. It requires sustained reasoning and adaptive planning based on heterogeneous evidence, and repeated interaction with tools and external environments over long task horizons."

Why the existing families are each half a solution

The introduction does something unusually honest for a model report: it says exactly which competitors are good at what, and where each stops. Two families, two different failures.

FamilyWhat it does wellWhere it stops (the paper's claim)What that costs in the lab
General-purpose LLMsBroad instruction following, general reasoning"not specialized for heterogeneous scientific modalities, domain protocols, or verifiable tool interaction"It will describe your EEG trace in fluent English and get the numbers wrong, because it never saw the numbers — it saw a picture of them or a paragraph about them
Scientific multimodal modelsPerception and reasoning over specialised inputs — microscopy, remote sensing, figures"still often evaluated as static question-answering systems rather than long-horizon agents"It answers the question about Figure 3 correctly and then cannot open the repository, run the script, or read the traceback

Read those two rows next to each other and the shape of the paper appears. It is not proposing a new attention mechanism. It is proposing that the union of those two columns is a single engineering problem, and then spending thirty pages on the engineering.

The distinction that matters and gets blurred. A foundation model is something you query. An agentic foundation model — the paper's term — is something you put inside a loop that has an environment, tools, and a verifier that can say solved or not solved by executing something. The difference is not the weights. It is whether the training signal ever came from an execution.

What is actually being released

The report describes a series. Three names appear, and keeping them apart will save you confusion later:

NameWhat it isWhere it appears in the paper
Intern-S2-Preview-397BThe main model. 397 billion parameters, a sparse mixture-of-experts backbone, with a vision path, a time-series encoder, and a time-series forecaster attached. Everything in the evaluation tables is this modelEverywhere — "with Intern-S2-Preview-397B as the main model evaluated in this report"
Intern-S2-Preview-35BA smaller sibling, used for one controlled training study — the adaptive-length-regularization ablation in Figure 8§4.3.2 only
Intern-MemDec-4BA 4-billion-parameter memory, trained separately on biology, that is attached to the frozen 397B model at inference. It is explicitly "a separate extension model," not a component of the base model§2.1, §5.3

There is also a predecessor that acts as the control throughout: Intern-S1-Pro, a trillion-parameter model from the same group. Intern-S2-Preview-397B has, in the paper's phrasing, "less than half the number of parameters" of it. Hold on to that ratio — 397 against roughly 1,000 — because several of the paper's most interesting results are "the smaller model won," and a result like that only means something if you know the sizes.

The map: two architecture bets, three data engines, four training stages

Here is the whole paper in one diagram. Every box gets a chapter.

Architecture — two bets (Ch 1–2)
An upgraded time-series encoder that reaches 300,000 steps, plus a new numerical forecasting branch. And separately, a Memory Decoder: domain knowledge attached to a frozen backbone instead of written into it
Pre-training — three data engines (Ch 3)
Visual Pre-training on rendered pages (learn the layout, not the extraction) · interleaved PDF sequences filtered by visual gain · a hundred-million-scale image retrieval pipeline
Post-training — four stages (Ch 4–8)
SFTmulti-task RL under verifiable rewards (partial rollout, GEPO, adaptive length, speculative decoding) → black- and white-box agentic RL on 214,854 executable tasks → on-policy distillation merging two experts into one released model
Evaluation — read honestly (Ch 9–10)
Scientific, multimodal, agentic, general, and time-series benchmarks against seven other frontier models — including the rows where it loses

Four words, defined before we need them

This paper uses four terms in senses slightly narrower than their common usage, and getting them precise now will save confusion in every later chapter.

TermLoose usageWhat it means here, precisely
Agentic"Uses tools"Trained on interactive rollouts in an executable environment, where the reward comes from the environment's final state and the credit is assigned back to specific policy-generated token spans
Rollout"A model output"One complete sampled trajectory — for reasoning RL, a single generation up to 65,536 tokens; for agentic RL, an entire multi-turn session with tool calls and observations interleaved
Harness"The wrapper around a model"A specific, named artefact that decides how the agent is instantiated, driven, and observed — and which the paper treats as a variable, running RL inside OpenClaw, Claude Code, OpenCode, OpenHands, and Mini-SWE without modifying any of them
Memory"Conversation history" or "a vector store"A separately trained 4-billion-parameter model whose next-token distribution is convex-combined with a frozen backbone's, weighted per token by a learned router

The third one causes the most trouble on a first read. When the paper says "harness × task," it is not describing a design pattern in the abstract; it is describing the fact that the agent runtimes on your laptop can be the training environment for a 397-billion-parameter model, unmodified, and that the only thing that had to change was the model service they call.

Three constraints that shape every decision in this paper

Before the mechanisms, it helps to know what the engineers were actually up against, because almost every design choice in Chapters 4 through 8 is a response to one of exactly three pressures.

ConstraintThe concrete form it takes hereChapters it dictates
Generation is the bottleneckA maximum generation length of 65,536 tokens, sampled 8,192 times per batch, on a 397-billion-parameter mixture of experts. Rollout dominates the wall clock — Chapter 4 derives roughly 82% from the paper's own speedup numbers4 — partial rollout, speculative decoding, online draft training
The reward is a program, and programs can be gamedExecutable environments with writable filesystems, git histories, and test files, optimised against by a policy with 214,854 chances to find a shortcut7 — verifier integrity, all-correct semantics, infrastructure-error tracking
The training signal is heterogeneousOne batch may contain a competition maths problem, an open-ended protocol write-up, a repository-level bug fix, and a terminal task — different lengths, different entropies, different verifiers5 — GEPO, adaptive length regularisation; 8 — two experts and distillation

Hold those three in mind and the post-training half stops being a list of tricks. Every mechanism is an answer to "generation is expensive," "the reward is attackable," or "these tasks are not comparable."

The fourth constraint, which the paper handles in the architecture rather than the training. Scientific evidence does not arrive as text. A 300,000-step signal, a rendered page, a microscopy image, and a nucleotide string all have to reach the same hidden space, and three of the four have no natural tokenisation. That is what Chapters 1 through 3 are about, and it is why this paper spends its architecture budget on input and output paths rather than on the backbone.

Why the agentic half is the newer, harder half

Both halves of post-training use reinforcement learning, and they are not equally mature. It helps to see why by comparing what one episode looks like in each.

Reasoning RL (Chapters 4–5)Agentic RL (Chapters 6–7)
An episode isOne generationA whole session: dozens of turns, tool calls, observations
Who produces the tokensThe policy, start to finishThe policy for some spans; the environment and the harness for the rest
Where the reward comes fromA verifier over the final answerA verifier over the final environment state
Infrastructure requiredAn inference engine and a trainerThose, plus sandboxes, a gateway, protocol adapters, a trace store, judgers, and a task synthesiser
What can go wrong invisiblyNumerical drift between enginesAll of that, plus leaked solutions, corrupted verifiers, crashed containers scored as passes, and loss computed on text the model never wrote
Cost per unit of signalOne reward per generationOne reward per session — far more compute for the same scalar

Read the last row and Chapter 9's agentic results stop being surprising. Agentic RL buys one number for the price of a whole interactive session, which means fewer gradient signals per accelerator-hour than reasoning RL by a large factor. A preview system being competitive but not leading on long-horizon coding is what a newer, more expensive training stage looks like.

What "Preview" is telling you

The name is not modesty for its own sake. The conclusion is explicit: "Intern-S2-Preview remains a preview system; future work should improve reliability over longer scientific workflows, expand domain-specific memories and task environments, strengthen verifiers, and deepen integration with specialized scientific tools."

Each clause of that sentence points at a specific gap you will be able to locate in the results by Chapter 9:

The stated future workThe evidence for it in the paper
"reliability over longer scientific workflows"ResearchClawBench 18.44 — end-to-end research succeeds on roughly one task in five, and no model in the table exceeds 23.35
"expand domain-specific memories"Exactly one memory exists (biology), and seven of its 21 tasks regressed
"expand … task environments"43.5% of the 214,854 executable tasks live inside nine environments
"strengthen verifiers"The leakage countermeasures in §4.4.3 are a list of holes found, which implies a list of holes not yet found
"deepen integration with specialized scientific tools"The agentic task distribution is coding and terminal work, not instrument control or laboratory information systems

The model itself is public — released at huggingface.co/internlm/Intern-S2-Preview, with the agentic RL framework at github.com/InternLM/xtuner. A 35-page report plus open weights plus the training framework is an unusually complete release, and it is worth registering that this is what "preview" means here: not a teaser, but a working system with its gaps written down.

A warning about how to read this paper

Almost every named technique in the post-training section is somebody else's, cited: GEPO comes from a companion paper by the same lab, R3 from a 2026 routing-replay paper, the bidirectional-KL masking idea from KPop, dynamic sampling from DAPO, the Muon optimizer from two 2025 works, the hybrid LK draft loss from a speculative-decoding paper, the distillation warmup from Nemotron 3 Ultra, the PDF parser is MinerU2.5-Pro, the vector database is Milvus.

That is not a criticism. It is the point. The contribution of a system report like this is not a new trick; it is the claim that these particular pieces compose into a pipeline that stays stable at 397 billion parameters, 65,536-token generations, and 256K-token sequences — and the specific glue that makes them compose. When you read a chapter and think "that is just X," the honest follow-up question is: had anyone made X survive contact with the other five?

What we will actually derive. By the end you will be able to write the importance-sampling ratio for a token generated three policy versions ago, compute the leave-one-out advantage for a group of eight rollouts by hand, apply the length reweighting and verify that it preserves the total positive advantage mass to the last decimal, mask a token whose two engines disagree using bidirectional binary KL, assign a session reward across a branching PrefixTree of agent messages, and recompute the paper's headline 56.92 → 60.32 memory result from its own 21-row table. Every number in this lesson is from the paper.

Why "heterogeneous modalities" is harder than it sounds

The phrase appears in the abstract's first sentence and it is easy to nod past. It is doing more work than "multimodal" usually does, because the modalities science produces are not the modalities the internet produces.

ModalityWhat a consumer multimodal model was trained onWhat science actually hands youWhy the gap bites
ImagesPhotographs, screenshots, memes, product shotsFluorescence micrographs, ultra-high-resolution satellite scenes, crystal diffraction patterns, gel electrophoresis lanesNone of these look like anything in a web crawl. A "bright blob" means something specific, and the meaning is domain knowledge, not perception
DocumentsWeb pages, cleanly structured HTMLPDFs with two-column layout, interline equations, multi-page tables, and figures whose axis labels are the dataText extraction deletes the structure. See Chapter 3
NumbersNumerals in sentencesThree hundred thousand samples of a four-channel physiological trace at kilohertz ratesA tokeniser is a terrible instrument for a signal. See Chapter 1
SequencesNatural languageNucleotide strings, amino-acid strings, SMILES, crystal lattice parametersThese are languages with rigid grammars and no redundancy — one wrong character is a different molecule
EnvironmentsNot a modality at allA repository, a container, a shell, an instrument driverYou do not perceive it. You act in it and read what came back. See Chapters 6–7

Look at the last row. It is not a modality in the usual sense, and that is precisely the paper's argument: the fifth thing on the list is what turns a question-answerer into a collaborator, and it is the one that no amount of better perception will give you.

A note on the sequence row, because it explains the biggest numbers in Chapter 9. English is enormously redundant — you can drop a letter from most words and a reader recovers it. A nucleotide sequence has no such slack. "ATGCGA" and "ATGCGT" are different biology, and nothing in the surrounding context will let a model infer which one you meant. A general LLM has essentially never been trained to attend to sequences at that resolution, which is why every general model in Table 2 scores between 4.49 and 13.87 on Biology-Instructions while Intern-S2-Preview-397B scores 56.92. It is not a small difference in skill; it is the difference between having been taught to read a script and not.

The pipeline as a dependency graph

The four post-training stages are not independent improvements you could reorder or drop. Each one consumes something the previous one produced. Naming those dependencies makes the whole thing memorable:

StageRequires from upstreamWhat breaks if you skip the upstream stage
SFTA pre-trained model with scientific knowledge and document structure in itInstruction demonstrations get grafted onto a model that does not know the domain, so you are teaching format over an empty room
Multi-task RLSFT's "instruction-following and tool-use initialization"RL from a base model explores a space where almost nothing is a well-formed response. The verifier says "no" to everything and there is no gradient signal
Agentic RLThe same SFT checkpoint's "long-horizon agentic trajectories" and tool-use patternsAn agent that cannot emit a valid tool call never reaches an environment state a verifier can score. Every rollout is a zero
On-policy distillationTwo experts from the same SFT checkpointTeachers and student diverge, student trajectories fall outside teacher support, and the O(H) sampled-token payload stops being sufficient. See Chapter 8

The last row is the sharpest. Chapter 8's most consequential efficiency decision — transmitting one number per token instead of sixty-four — is licensed entirely by a choice made three stages earlier, that both teachers branch from one SFT checkpoint. Skip that and the final stage's communication budget multiplies by 64.

How this lesson maps onto the paper

If you read alongside the arXiv HTML, here is the correspondence, so you can check any claim against its source.

ChapterPaper sectionsKey equations
0 — the loopAbstract, §1
1 — the body§2, §2.2.1, §2.2.2— (the time-series modules are described, not formalised)
2 — Memory Decoder§2.1, §5.3 (Memory Decoder), Figures 1 and 12(1)–(4)
3 — reading the page§3, §3.1, §3.2, §3.3, Figures 3–5(5)–(9)
4 — rollout economics§4.3, §4.3.1, §4.3.3, Figure 7(10)–(13), (18)–(24)
5 — shaping advantage§4.3.2, §4.3.4, §4.3.5, Figure 8(14)–(17), (25)–(29)
6 — harness × task§4.4, §4.4.1, §4.4.2, Table 1, Figures 9–10
7 — credit and integrity§4.4.3, Figure 11(30)
8 — two experts§4.5, §4.1, §4.2, Figure 6(31)–(36)
9 — the scoreboard§5, §5.1, §5.2, §5.3, Tables 2–5
10 — connections§6 and the reference list

Ten numbers to hold before you start

Every one of these gets derived, verified, or interrogated in a later chapter. Meeting them now gives the rest of the lesson somewhere to land.

NumberWhat it isWhere it is unpacked
397BParameters, against the predecessor's 1TCh 1
300,000Maximum time-series input length, up from about 240,000Ch 1
56.92 → 60.32Biology-Instructions average with a 4B memory attached to the frozen backboneCh 2 — recomputed by hand from a 21-row table
256k / 512Pre-training chunk size and its overlapCh 3
65,536Maximum RL generation length — the source of the straggler problemCh 4
3Policy updates of staleness after which a paused rollout is discardedCh 4
2× and 1.7×Speculative-decoding speedup on rollout and end to endCh 4 — the pair implies rollout was ~82% of wall clock
8,192Completed responses per rollout batch, in 8 mini-batch updatesCh 5
214,854Executable coding and terminal tasks, in 62,280 environmentsCh 6 — and the ratio is the interesting part
99%Horizon-predictor accuracyCh 9 — it is why every forecasting success rate is 100

Four misreadings to avoid

Papers of this shape attract predictable misreadings. Naming them now costs a paragraph and saves an argument.

The misreadingWhat the paper actually says
"It beats GPT-5.5 and Claude-Opus-4.8"On five scientific benchmarks it beats every model tested; on general and agentic benchmarks the claims are almost all scoped to "among open-source models," and Gemini-3.1-Pro, Claude-Opus-4.8, and GLM-5.2 lead various rows. Chapter 9 counts them
"Memory Decoder is part of the model"§2.1 opens by calling it "a separate extension model for continual domain specialization, rather than a component of the base Intern-S2-Preview-397B model." None of the Table 2 or 3 numbers use it
"They invented GEPO / R3 / DAPO sampling / Muon"All cited. GEPO is a companion paper from the same lab; the rest are outside work. The contribution is the composition and the two architecture extensions
"Agentic RL means it was trained to use tools"It means the reward came from an executable environment's final state, verified by a program, with credit mapped back to specific token spans through a trace store — inside real third-party agent runtimes. Tool use is the surface; execution-derived reward is the substance

The one-paragraph version

If you had to summarise this to a colleague in the corridor: Shanghai AI Lab released a 397-billion-parameter sparse-MoE scientific foundation model that reads rendered PDF pages rather than text extractions, ingests 300,000-step numerical signals through a dedicated encoder and emits forecasts through a dedicated numerical head, and was post-trained in four stages — SFT, verifiable-reward RL with a partial-rollout system and three separate advantage transforms, agentic RL run inside unmodified third-party agent harnesses on 214,854 executable tasks, and a final distillation that merges a reasoning expert and an agentic expert into one model. It dominates domain-native scientific benchmarks by factors of four, wins six of seven scientific forecasting columns against dedicated time-series models, leads open models on general knowledge, and sits mid-table on long-horizon agentic coding. Almost every named technique is cited prior work; the contribution is that they compose and stay stable at this scale.

The road, chapter by chapter

Chapters 1–3 — build the body
What the model is made of and how a signal becomes tokens → how to specialise a frozen model without touching it → how to teach a model to read a page instead of a text dump
Chapters 4–5 — make RL survive the scale
Why a long-tail generation idles a whole cluster and what pause-and-resume costs you in off-policy bias → the three transforms that turn a verifier reward into the number that multiplies your log-probability
Chapters 6–8 — make an agent trainable
The harness × task abstraction and the trace store that maps an agent's action back to the tokens that produced it → who gets credit when a session succeeds badly → how two specialists become one model
Chapters 9–10 — interrogate it
Every table read with the losses included → where this sits in the lineage and what it connects to

Trace the afternoon, step by step

Before moving on, make the opening scene mechanical. Here is the graduate student's afternoon as a sequence of nine steps, with the capability each one demands and the chapter that supplies it. This table is the whole paper's motivation compressed into one object.

#What she doesWhat the model would needChapter
1Opens the 2019 methods PDF and looks at Figure 3Read a rendered page, including numbers printed inside a figure that no text extractor will recoverCh 3 — Visual Pre-training
2Reads the paragraph that says "as shown in Fig. 3" and connects it to the figureUnderstand a figure's position in a narrative, not just its contentCh 3 — interleaved sequences
3Loads 300,000 samples of a four-channel traceIngest a long numerical signal as numbers, with cross-channel structure preservedCh 1 — the time-series encoder
4Runs the analysis script; it fails on line 214Execute code in a real environment and read what came backCh 6 — harness × task
5Reads the traceback, forms a hypothesis, edits two filesMulti-step tool use with state carried across turnsCh 6 — the trace store
6Runs it again. Different error. Tries againRecover from its own mistakes without spirallingCh 7 — process-aware credit
7Recalls a domain fact about this specific assayDeep knowledge of one narrow subfield, without having lost everything elseCh 2 — Memory Decoder
8Forecasts the next two seconds of the signalEmit real numbers at an instruction-specified horizonCh 1 — the forecasting branch
9Writes up what she found, with the evidence chainLong-form scientific generation grounded in what actually happenedCh 5, Ch 8

Nine steps, seven distinct capabilities, one session. And here is the thing worth noticing: a benchmark can score steps 1, 3, 7, and 8 as isolated questions. It cannot score steps 4, 5, and 6 at all, because those are not questions. They are attempts, and their value depends on what happened next.

The word that makes it trainable: verifiable

There is a reason the paper keeps saying "verifiable" and "executable," and it is not decoration. Reinforcement learning needs a reward. For a chat model, the reward usually comes from a learned preference model — a network trained to predict what a human would rate highly. That is workable and it is also a second model with its own errors, its own biases, and its own exploitable seams.

A verifiable reward is different in kind: the reward is produced by running something. Did the test suite pass? Does the SMILES string parse and satisfy the constraint? Does the crystal structure obey the symmetry group? These questions have answers that a program returns, not opinions that a network predicts.

Why science is unusually well-suited to this. Most of the interesting scientific outputs are checkable by machine. A molecule either is or is not valid. A protein binder either does or does not pass a structural and physicochemical evaluation pipeline. A forecast either does or does not match the held-out continuation. A patch either does or does not make a red test go green. This is not true of "write a persuasive essay," and it is why the phrase in the paper's post-training section is "under verifiable objectives" rather than "under human preference."

It also explains the shape of Chapter 7. If your reward is a program, then your reward is a piece of attack surface, and an optimiser will find any hole in it long before a human notices. Half of the agentic RL section is about that.

What the evaluation covers, and why in four groups

The evaluation splits into families, and each family is answering a different question about whether the pipeline worked:

FamilyQuestion it answersExample benchmarks in the paper
ScientificDid the domain pre-training and SFT put real science in the weights?Biology-Instructions, Mol-Instructions, MolecularIQ, SciReasoner, TOMG-Bench, MP20, ProteinBinder-9
Scientific multimodalCan it perceive the specialised images science actually produces?XLRS-Bench (ultra-high-resolution remote sensing), MicroVQA (microscopy), SFE, ObsCrisis-Bench (multispectral satellite)
AgenticCan it do the loop — plan, call tools, execute, recover?SciCode, SGI-Bench, ResearchClawBench, SkillsBench, Terminal-Bench 2.1, SWE-Bench Pro, SWE-bench Multilingual, WildClawBench
GeneralDid any of the above cost it the abilities it started with?MMLU-Pro, SimpleQA-Verified, AdvancedIF, HMMT-2026, MMMU-Pro, ChartQAPro
Time seriesDo the two new architecture limbs do anything?SciTS understanding and forecasting, GIFT-Eval

The last two families are the interesting ones for a reader, because they are the ones a specialised model usually loses. A report that shows only the first three has told you nothing about whether the specialisation was paid for out of general capability. Chapter 9 will hold this table up against the results.

A structural note on ResearchClawBench, because it defines the ceiling. That benchmark asks whether an agent "can conduct end-to-end scientific research from raw data and related literature to a publication-style research report" — 40 tasks derived from real papers across ten domains, with the target paper withheld, graded by expert-authored multimodal rubrics on "whether agents reproduce the original experimental protocols, evidence chains, analyses, and scientific conclusions." Every model in the paper scores between 13.69 and 23.35. That is the frontier of this whole enterprise as of August 2026: roughly one task in five.
The paper argues that scientific multimodal models are "incomplete" for scientific workflows. What specifically is its complaint?

Chapter 1: The Body — What 397B Is Made Of

Before any training story, you need to know what is being trained. This chapter walks the tensor path from four different kinds of input into one hidden space, and then out again as either text or numbers. Where the paper publishes a shape, we use it. Where it does not, we say so out loud rather than inventing one — a system report is allowed to omit its hidden size, and we are not allowed to fill it in.

What the paper tells you about the backbone, and how

The report never gives you a table of layer counts. But it leaks the architecture in the places where architecture forces an engineering decision, and those leaks are reliable. Three of them:

Sentence in the paperSectionWhat it forces you to conclude
"For MoE policies, training–inference inconsistency arises from both expert-routing differences and numerical discrepancies between the two execution engines"§4.3.1The backbone is a sparse mixture of experts. A dense model has no routing to be inconsistent about
"expert linear layers operate in FP8, the remaining layers use BF16, and numerically sensitive operations, including apply_rope, RMSNorm, the MoE router, recurrent states in Gated DeltaNet, and the language-model head, are computed in FP32"§4.3.1Rotary position embeddings; RMSNorm rather than LayerNorm; and — the interesting one — Gated DeltaNet recurrent states, which means this is not pure softmax attention. There are gated linear-attention layers with a carried state
"our maximum sequence length of 256K tokens"§4.5The distillation stage runs on trajectories up to 262,144 tokens. Pre-training chunks are also "capped at 256k tokens"
Read the precision map as an architecture diagram. An engineer only writes down which operations must stay in FP32 if they have been bitten by those operations. Every item on that list is a place where a small numerical error compounds instead of averaging out: the router (a discrete argmax over experts, so a tiny logit wobble flips which expert runs), the recurrent state (errors accumulate along the sequence rather than staying local), RMSNorm and RoPE (they scale everything downstream), and the LM head (it feeds the log-probabilities that the entire RL objective depends on). The list is the model's list of fragile joints.

Four input types, one hidden space

A multimodal model is, mechanically, a set of projections — small learned maps that take whatever an encoder produced and re-express it as something shaped like a token embedding, so the language backbone can attend over all of it at once. Intern-S2-Preview has four such lanes.

Lane 1 — text
Ordinary tokenisation. This is the lane everything else has to imitate
↓ all four lanes end in the same hidden space ↓
Lane 2 — images and rendered pages
A frozen visual encoder produces features; a learned projection Win maps them into the LLM hidden space. Frozen matters: §3.1 says "the visual encoder remains frozen, while the LLM backbone, visual projection, and prediction head are optimized"
Lane 3 — numerical time series (in)
Chunk → compressive patching → channel-wise Transformer → Transformer encoder body. "The connection between the time series encoder and the LLM remains unchanged" from Intern-S1-Pro
Lane 4 — numerical time series (out)
A dedicated forecasting branch: a causal Transformer conditioned by cross-attention on both LLM semantics and encoder numerics, plus a horizon predictor. Numbers come out as numbers, not as text tokens

Lane 4 is the genuinely new limb. Everything before it in the literature turns "predict the next 200 values" into "emit two hundred numerals as text," and Chapter 9 will show you exactly what that costs.

The time-series encoder, derived

Start with the problem, because the design is a direct answer to it. Scientific time series, in the paper's list, "exhibit substantial variations in sequence length, sampling frequency, and channel dependency." Concretely, one encoder has to survive all of these:

Domain (all named in the paper)Rough character of the signalWhat breaks a naive encoder
AstronomyLong, slow, irregular light curvesSequence length
GeoscienceMulti-channel, seasonal, longLength × channel count
NeuroscienceMany channels, cross-channel phase structureChannel dependency — the information is between channels
Physiological signalsModerate rate, artefact-proneLocal morphology matters
BioacousticsHigh rate, short eventsTime resolution
Radar (new in S2)About megahertz — "high-frequency but short sequence lengths"A setting Intern-S1-Pro did not support at all

Now the pipeline, stage by stage, as §2.2.1 lays it out.

Stage 1 — temporal chunking. The input series is "partitioned into temporal chunks, enabling localized processing of long sequences." This is the same reason you tile a huge image: attention is quadratic, and 300,000 positions of quadratic attention is not a thing you do.

Stage 2 — compressive patching. Each chunk goes through three sub-steps, in order:

Sub-stepWhat it doesThe engineering reason
NormalizationStandardise the values — and, crucially, "channel-wise mean and standard deviation are retained as auxiliary statistics"If you normalise and throw away the statistics, you have destroyed the absolute scale. A forecaster that must emit real voltages needs the mean and standard deviation back
CNN-based local feature extractionShort convolutions over the raw samplesLocal morphology — a spike, an edge, a transient — is a translation-invariant local pattern. That is exactly what a small convolution is for, and it is cheap
Q-Former temporal compressionDivide the local representations into temporal patches; "each patch is compressed by a Q-Former with learnable queries into a fixed number of tokens"This is the length-control valve. See below
What a Q-Former actually is, in one paragraph. A Q-Former (query Transformer) is a small Transformer that holds a fixed set of learnable query vectors — say Q of them — and cross-attends them into a variable-length input. The queries are parameters, not data: they exist before any input arrives. Whatever the input length, the output is always Q vectors, because the output is one vector per query. It is a learned, content-aware pooling operator. That is the entire trick, and it is why it appears twice in this paper — once to compress a time patch and once, in the forecaster, to select from two different context streams.

Worked example 1: where the 300,000 steps go

The paper says the encoder maintains "a controllable output sequence length for heterogeneous long time series" by "dynamically adjusting the temporal patching process according to input length." Let us make that arithmetic concrete. The specific patch length and query count below are illustrative — the paper does not publish them — but the relationship between them is exactly what the sentence describes.

Let L be the patch length in raw samples and Q the number of Q-Former queries per patch. For an input of T steps:

number of patches = ⌈ T / L ⌉,   output tokens = Q · ⌈ T / L ⌉

Take the paper's stated maximum, T = 300,000, and suppose you have budgeted 1,024 tokens of the LLM's context for this signal. Solve for L with Q = 4:

1,024 = 4 · (300,000 / L)  ⇒   L = 4 · 300,000 / 1,024 = 1,200,000 / 1,024 = 1,171.875 ≈ 1,172 samples per patch

Now feed the same encoder a short radar burst, T = 4,096 samples. If L stayed fixed at 1,172 you would get ⌈4096/1172⌉ = 4 patches, so 16 tokens — a four-thousand-sample signal squeezed into sixteen vectors, which is why S1-Pro could not do high-frequency short signals well. Adapt L instead: with the same 1,024-token budget, L = 4 · 4,096 / 1,024 = 16 samples per patch. Sixteen samples per patch on a megahertz signal is 16 µs of detail per token. That is what "dynamically adjusting the temporal patching process according to input length" buys, and it is why the same module now covers both astronomy and radar.

Sanity check the ratio. Between those two settings the input length changed by a factor of 300,000 / 4,096 = 73.2, and the patch length changed by exactly the same factor: 1,171.875 / 16 = 73.2. The output token count did not move at all. A module with a constant output budget and an input-proportional receptive field is the only kind that can be dropped into a fixed context window without a per-domain configuration file.

Stage 3 — the channel-wise Transformer. This is the change from the previous generation, and it is worth dwelling on because the paper states the old behaviour explicitly: Intern-S1-Pro "directly aggregated multi-channel representations through mean pooling." S2 replaces that with "a channel-wise Transformer encoder to model inter-channel dependencies before being fed into the Transformer encoder body."

Worked example 2: what mean pooling destroys

Mean pooling across channels is a linear operator, and linear operators cannot see relationships. Here is the smallest example that shows it. Take three EEG channels at one time patch, with a feature that is positive when the channel leads and negative when it lags:

Scenarioch1ch2ch3MeanWhat is physically happening
A — frontal lead+0.9−0.3−0.6(0.9 − 0.3 − 0.6)/3 = 0.000A wave travelling front to back
B — occipital lead−0.6−0.3+0.9(−0.6 − 0.3 + 0.9)/3 = 0.000The same wave travelling back to front
C — no propagation0.00.00.00.000Nothing at all

Three physically distinct states, one identical pooled vector. The propagation direction — often the entire clinical finding — lives in the ordering across channels, and mean pooling is invariant to ordering by construction. A Transformer over the channel axis is not: its attention computes pairwise interactions, so it can represent "channel 1 is high while channel 3 is low" as a distinct pattern from its mirror image.

The general lesson, worth carrying out of this paper. Whenever you see mean pooling over a structured axis, ask what the pooling is invariant to, and then ask whether that invariance is a feature or a silent deletion. Over a batch axis, permutation invariance is correct. Over a channel axis in a physical sensor array, it deletes geometry. Over time, it deletes order — which is exactly the criticism levelled at clip-level pooling in contrastive audio models.

What the upgrade bought, in the paper's own numbers

QuantityIntern-S1-ProIntern-S2-Preview-397BChange
Maximum input lengthabout 240,000 time stepsabout 300,000 time steps×1.25
Inference speed at maximum lengthbaseline"approximately 5 ∼ 6× faster"×5 to ×6
GPU memory at maximum lengthbaseline"around 20% of the previous version"×0.2, i.e. a 5× reduction
High-frequency short sequencesnot supportedsupportedNew capability
Disciplinary coverageastronomy, geoscience, neuroscience, physiological signals, bioacousticsthe same, plus radar (≈ MHz)+1 domain

Put those together and the practical statement is: a job that used to take a certain wall-clock time on a certain card now runs in roughly one fifth to one sixth of that time using roughly one fifth of the memory, on a 25% longer signal. If you had a single 80 GB accelerator and the old encoder saturated it at 240,000 steps, the new one has room for the 300,000-step maximum and a great deal of headroom besides. That headroom is the entire reason the radar case became possible: high-frequency signals mean more patches per second of real time.

The forecasting branch, and why it is not text

Here is the design, from §2.2.2. Two streams condition one generator:

Stream A — semantics
Multimodal representations from the LLM: what the instruction asked for, what the accompanying text said, what the image showed
Stream B — numerics
Temporal representations from the time-series encoder: what the signal actually did
↓ both "selectively extracted by Q-Former and integrated" ↓
Causal Transformer forecaster
Conditioned "via cross-attention for future sequence generation." Emits values, not numerals
↓ in parallel ↓
Horizon predictor
"Interprets the forecasting instruction and determines the required prediction length." Reported accuracy: 99%

Two engineering decisions here deserve the "why," because both are load-bearing.

Why a Q-Former between the two streams and the forecaster? Because they have different lengths and different natures. The LLM context is however many tokens the prompt was; the encoder output is however many patch tokens the signal produced. Cross-attending a forecaster directly into both would make the conditioning cost grow with prompt length, and would give an instruction like "forecast the next 200 steps" the same weight as two hundred tokens of unrelated preamble. The Q-Former's fixed query set is a bottleneck by design: a constant, learned number of slots that both streams must compete to write into.

Why a separate horizon predictor rather than just generating until a stop token? Because a numerical branch has no stop token. A text decoder can emit an end-of-sequence symbol; a branch that emits real numbers has to be told how many to emit. The instruction says it in English ("forecast the next two seconds," "predict 96 steps ahead"), so a small module reads the instruction and converts it to an integer. The paper reports that module gets it right 99% of the time — and Chapter 9 will show you that this unglamorous component is responsible for one of the paper's largest margins, because the competing general-purpose models fail on precisely this step.

The forecaster, written out

forecasting branch# Lane 4. Values out, not numerals. Called after the LLM has reasoned in text.

def forecast(llm_hidden, series_tokens, stats, instruction_hidden):
    mu, sigma = stats                                # kept by the encoder's normalisation step

    # how many values does the instruction ask for? A numerical head has no EOS.
    horizon = horizon_predictor(instruction_hidden)  # int, reported 99% accurate

    # two conditioning streams, each squeezed to a fixed number of slots
    sem = qformer_sem(llm_hidden)                    # (B, Q, D) what was asked / what the text said
    num = qformer_num(series_tokens)                # (B, Q, D) what the signal actually did
    cond = cat([sem, num], dim=1)                  # (B, 2Q, D) constant cost, whatever the prompt

    y = []
    state = start_token()
    for t in range(horizon):                        # causal Transformer forecaster
        h     = forecaster_block(state, cross_attend=cond)
        val   = value_head(h)                        # a REAL number, not a token id
        y.append(val)
        state = advance(state, val)

    return stack(y) * sigma + mu                     # de-normalise: the stats come back here

Three lines are worth naming. horizon = horizon_predictor(...) is the module with no analogue in a text decoder, and Chapter 9 will show it is responsible for every 100 in Table 5's success-rate column. cond = cat([sem, num]) is why the conditioning cost does not grow with prompt length. And * sigma + mu is why the normalisation step in Lane 3 was careful to retain the statistics rather than discard them — without them, the branch can emit shapes but not values.

Numerical fidelity, stated as a design principle. The paper's justification is one sentence: "By introducing a dedicated numerical forecasting branch rather than generating values as discrete text tokens, the model preserves numerical fidelity while maintaining computational efficiency." Both halves are real. A value like 0.03714 costs seven text tokens and is quantised by the tokeniser's digit vocabulary; the same value costs one real number in a numerical head. And there is a subtler cost: a text decoder's probability mass over "0.037" and "0.038" is a categorical distribution with no notion that those are adjacent. Numerical output restores the metric.

Why the visual encoder is frozen and the LLM is not

Lane 2's most consequential line is a parameter-freezing decision, stated once in §3.1 and easy to miss: "The visual encoder remains frozen, while the LLM backbone, visual projection, and prediction head are optimized." Work out what that arrangement forces.

ComponentTrained?What it is therefore learning
Visual encoder EvNoNothing. It is a fixed measuring instrument. Its output space is a constant that everything else must adapt to
Projection WinYesHow to express a visual feature in the language model's coordinates
LLM backbone ΦθYesHow a scientific page unfolds — that a caption follows a figure, that a table has a header block, that an equation is referenced two paragraphs later
Prediction head ψYesHow to map a hidden state back into the encoder's feature space so the contrastive score is computable

Three consequences follow, and all three are load-bearing.

First, the targets stay still. The contrastive objective of Equations (7)–(8) predicts the encoder's own features. If the encoder were trainable, the target would move every step, and the cheapest way to reduce the loss would be for the encoder to collapse all patches onto one easily-predicted vector. Freezing removes that degenerate solution entirely — you cannot game a target you cannot change.

Second, the document knowledge lands in the backbone. This is the point of the whole stage. If the vision tower were doing the learning, you would end up with a better page encoder and an unchanged language model. Because only the language side moves, "the model's ability to continue a visual sequence" is written into the same weights that will later be asked to reason about the paper's contents.

Third, it is cheap. No gradients through the vision tower means no activations to keep for it, and the encoder can be run once and cached. For a stage the paper describes as "a lightweight stage for modality expansion," that is the difference between running it over your whole PDF corpus and running it over a sample.

Walking one real prompt through all four lanes

Concept plus realisation means following actual data. Take the opening scene's question, posed to the model as a single multimodal turn, and account for every token.

Piece of the promptLanePath into hidden spaceRough token cost
"Here is the methods paper. Look at Figure 3."1 — textTokeniser → embedding table~12
Page 4 of the PDF, rendered2 — imageFrozen Ev → foreground mask → raster scan → Win~1,100 after masking (Chapter 3's worked example)
The cropped Figure 32 — imageSame path, higher effective resolution on a smaller region~256
300,000 samples × 4 channels of the trace3 — time seriesNormalise (keep μ, σ) → chunk → CNN → Q-Former → channel Transformer → body~1,024, by construction
"Is this artefact real, and forecast the next two seconds."1 — textTokeniser~14
total context~2,400 tokens

Now the output side. The model reasons in text — that is Lane 1 again — and when it reaches the forecast, control passes to Lane 4: the horizon predictor reads "the next two seconds," converts it to an integer using the sampling rate, and the causal forecaster emits that many real values, cross-attending to both the LLM's semantic state and the encoder's numerical representations, with μ and σ from the normalisation step available to put the values back on the original scale.

Look at the fourth row of that table again. Three hundred thousand samples became about a thousand tokens — a compression of roughly 300:1, or 1,200:1 counting all four channels. If you had serialised those numbers as text at, say, seven tokens per value, you would need 8.4 million tokens for the same signal, which is 32 times the model's entire maximum sequence length. The time-series encoder is not a convenience. It is the only reason the input fits in the universe at all.

The encoder forward pass, written out

Concept without realisation is decoration, so here is the whole Lane 3 path as code, with a shape comment on every line. Names follow §2.2.1; the constants marked illustrative are ones the paper does not publish.

time-series encoder# x: (B, C, T) - batch, channels, time steps. T can be up to 300,000.

def encode_series(x, token_budget=1024, Q=4):        # Q = queries per patch (illustrative)
    B, C, T = x.shape

    # --- normalisation: keep the statistics, do not discard them ---
    mu    = x.mean(dim=-1, keepdim=True)          # (B, C, 1)
    sigma = x.std(dim=-1, keepdim=True)           # (B, C, 1)  <- retained as auxiliary stats
    xn    = (x - mu) / (sigma + 1e-6)               # (B, C, T)

    # --- temporal chunking: localised processing of a long sequence ---
    chunks = split_into_chunks(xn)                   # list of (B, C, T_chunk)

    # --- compressive patching, per chunk ---
    L = ceil(Q * T / token_budget)                  # patch length ADAPTS to input length
    toks = []
    for ch in chunks:
        h = cnn_local(ch)                            # (B, C, T_chunk, D) local morphology
        p = to_patches(h, L)                         # (B, C, n_patch, L, D)
        t = qformer(p, n_query=Q)                    # (B, C, n_patch, Q, D) fixed count per patch
        toks.append(t)
    z = cat(toks, dim=2)                          # (B, C, N_tok, D) with N_tok ~ token_budget/Q

    # --- NEW in S2: model the channel axis instead of averaging it away ---
    z = channel_transformer(z)                     # (B, C, N_tok, D) inter-channel dependencies
    z = merge_channels(z)                          # (B, N_tok, D)   <- S1-Pro used mean() here

    # --- global temporal context ---
    z = transformer_body(z)                        # (B, N_tok, D)
    return to_llm_space(z), (mu, sigma)           # (B, N_tok, D_llm) + the stats the forecaster needs

Two lines are the whole chapter. L = ceil(Q * T / token_budget) is the length-control valve from Worked Example 1 — the patch grows with the input so the token count does not. And channel_transformer replacing a mean() is the single architectural change that Worked Example 2 justified.

Worked example 3: what "20% of the memory" actually means

Efficiency multipliers are abstract until you attach a machine to them. Suppose the old encoder, at its 240,000-step maximum, occupied 40 GB of a single 80 GB accelerator and took 6.0 seconds per forward pass. The paper reports the new encoder runs "approximately 5 ∼ 6× faster" while "reducing GPU memory consumption to around 20% of the previous version," at a maximum length that is itself 25% longer.

QuantityOld, at 240,000 stepsNew, at 300,000 stepsWorking
Memory40 GB≈ 8 GB40 × 0.20
Forward-pass time6.0 s1.0–1.2 s6.0 / 6 to 6.0 / 5
Headroom on an 80 GB card40 GB free — one signal at a time72 GB free80 − 8
Concurrent long signals210floor(80 / 8)

The last row is the one that changes what you can build. Two concurrent signals is a demo; ten is a batch. And the memory saving is what makes the radar case viable at all: a megahertz signal produces far more patches per second of real time, so the module has to be cheap per patch before high sampling rates are affordable.

Where the savings plausibly come from — and a caveat. The paper attributes the improvement to chunking plus adaptive patching, and the arithmetic is consistent with attention cost. If a naive encoder attends over all T positions, cost scales as T2. Chunking into pieces of size S and attending within each gives (T/S) · S2 = T·S, which is linear in T. Compressing to a fixed token budget N means the global body pays N2 regardless of T. That is the standard mechanism, and it matches the reported numbers — but the paper does not publish a cost model, so treat this as the explanation that fits, not as a quantity it claims.

What 256K tokens of context is for

The maximum sequence length turns up three times in the paper, in three different roles, and it is worth seeing them together because they are the same budget spent on different things.

WhereWhat fills the 256KWhy it needs to be that large
Pre-training (§3.2)A document-level interleaved sequence: many pages of text with cropped figures, equations, and tables in reading orderCross-page reasoning chains are the stated target. Cut smaller and "the progressive organization of knowledge in long documents" is unlearnable
Agentic RL (§4.4)A whole session: system prompt, task, and dozens of assistant messages interleaved with tool observationsA repository-level SWE task involves reading files, tracebacks, and diffs. The context is the working memory of the agent
Distillation (§4.5)A student trajectory being scored token by token by a teacherThis is the one that forced the O(H) payload decision in Chapter 8 — at 256K positions, per-token teacher logits do not fit on the wire

And a sense of scale for the middle row. If an average agent turn — one assistant message plus one tool observation — runs about 1,200 tokens, then 262,144 tokens is roughly 218 turns of interaction before the window is full. That number is the practical meaning of "long task horizon," and it is also, from Chapter 7's annotator list, why "context-, turn-, or session-limit termination" is a behaviour worth penalising: running out of room is a failure mode with a specific budget attached.

What the report publishes, and what it withholds

A useful habit when reading a system report is to write down the gaps explicitly, because they bound what you can conclude and what you could reproduce.

PublishedWithheld
Parameter count (397B); the sibling sizes (35B, 4B memory); predecessor scale (1T)Layer count, hidden size, expert count, top-k, active parameters per token
That it is sparse MoE, uses RoPE, RMSNorm, and Gated DeltaNet recurrent statesThe attention/linear-attention layer ratio; the tokeniser and its vocabulary size
The precision map (FP8 experts, BF16 body, FP32 for six named operations)Pre-training token counts, corpus sizes, compute budget
Max time-series length, speedup and memory ratios, max sequence and generation lengthsTime-series patch length, Q-Former query count, encoder depth
RL optimizer, learning rate, weight decay, batch and mini-batch structureεIS clip bounds, the BKL threshold φ, GEPO's coefficients and thresholds, α / γ / τ for length regularisation, β and αs for the memory

The pattern is consistent: mechanisms and headline scalars are published; the constants that would let you reproduce the run are not. That is normal for a frontier system report and it is worth stating plainly rather than reading past. Everything in this lesson that is a specific number is from the left column. Everything illustrative is labelled.

The time-series encoder replaces Intern-S1-Pro's cross-channel mean pooling with a channel-wise Transformer. What does the mean pooling structurally destroy?

Chapter 2: Memory Decoder — Specialising Without Rewriting

Here is a situation every team with a good general model eventually hits. The model is strong. A collaborator needs it to be strong at one specific thing it has never seen — non-coding RNA family classification, say, or a lab's internal assay protocol. The obvious move is to fine-tune. And the obvious move is a trap, for a reason the paper states plainly:

The trap, in the paper's words. "Directly fine-tuning the backbone for each new domain is undesirable, because the same parameter updates that improve domain performance may perturb the model's general reasoning, agentic behavior, and multimodal capabilities."

Notice this is not the usual hand-waving about catastrophic forgetting. It is sharper: the parameters that encode "how to plan a tool sequence" are the same tensors as the parameters that encode "what a promoter–enhancer interaction is." There is no biology submatrix you can update in isolation. Gradient descent on 40,000 RNA examples touches everything.

And the reason this matters more in science than elsewhere: "the long-tailed and continuously evolving nature of scientific expertise." There is no fixed set of domains. Every month there is a new assay, a new instrument, a new subfield. If specialising costs you a full fine-tune of a 397-billion-parameter model plus a regression suite across every general benchmark, you will do it approximately never.

The reframe: attachment instead of rewriting

Memory Decoder's answer is to stop editing the model at all. Instead:

The input
One prefix ct = [x ; y<t] — the prompt plus whatever has been generated so far
↓ sent to both, in parallel ↓
Path A — the frozen backbone
Intern-S2-Preview-397B, weights untouched. Produces pS2(· | ct), a full next-token distribution
Path B — the domain memory
Intern-MemDec-4B, trained only on the target domain. Produces pmem(· | ct), its own full next-token distribution
↓ a lightweight token-level router picks λt
The fused prediction
pfinal = (1 − λt) pS2 + λt pmem — a convex combination, decided fresh at every single token

That last equation is Equation (3) of the paper, and it is worth staring at:

pfinal(· | ct) = (1 − λt) pS2(· | ct) + λt pmem(· | ct)    (3)

Three properties fall out immediately, and each one is a design win.

PropertyWhy it holdsWhy it matters
The result is always a valid distributionA convex combination of two distributions with λ ∈ [0,1] is a distribution: all entries stay non-negative and the sum stays exactly 1No renormalisation, no numerical surprise, drop-in with any sampler
λt = 0 recovers the original model exactlyThe backbone term is untouched and the memory term vanishesThe worst case of attaching a memory is "no change," never "worse general model." That is the whole safety argument
Memories are composable and disposableNothing in the backbone changed, so a second memory is a second module, and removing one is deleting a file"New scientific capabilities can be introduced by attaching independently trained memories without modifying the Intern-S2-Preview-397B backbone"

Prove the first property, since everything rests on it

"A convex combination of two distributions is a distribution" is the load-bearing claim of Equation (3), and it takes three lines to prove, so prove it.

Non-negativity. For any token v, pfinal(v) = (1 − λ)pS2(v) + λpmem(v). Both probabilities are ≥ 0, and both coefficients are ≥ 0 whenever λ ∈ [0,1]. A sum of non-negative terms is non-negative. ✓

Normalisation. Sum over the vocabulary and pull the constants out:

v pfinal(v) = (1 − λ) ∑v pS2(v) + λ ∑v pmem(v) = (1 − λ)(1) + λ(1) = 1

Exactly 1, for every λ, with no renormalisation step. ✓ Verify it on the worked table: at λ = 0.3 the fused column is 0.420 + 0.305 + 0.190 + 0.085 = 1.000, and at λ = 0.7 it is 0.580 + 0.245 + 0.110 + 0.065 = 1.000.

Why this is not pedantry. Compare with the obvious alternative: mix the two models' logits instead of their probabilities. Logit mixing does not preserve normalisation — you must re-softmax — and worse, it is not equivalent to probability mixing. A logit average is a normalised geometric mean of the distributions, which is multiplicative: any token that either model assigns near-zero probability is suppressed by both. Probability mixing is additive, so a token the memory is confident about survives even if the backbone thinks it is unlikely. For a mechanism whose entire job is to let a small specialist override a large generalist, additive is the only choice that works.

Where the memory's knowledge comes from: retrieval, compressed

The memory is not just a small model fine-tuned on the domain. It is trained to imitate a retrieval system. Follow the construction.

Step 1 — build a token-level datastore. Given a domain instruction-tuning corpus Dsft = {(q(i), a(i))}, walk every position on the answer side. At position t of example i, the prefix is ct(i) = [q(i) ; y<t(i)]. Encode that prefix into a key kt, and store the pair (key, next token). You now have a lookup table whose entries are "in this exact context, this exact token followed."

Step 2 — define a retrieval distribution. For a new prefix, find the nearest keys and let them vote, weighted by distance. That is Equation (1):

pret(y | ct) ∝ ∑(kj, vj) ∈ N(kt) 1[y = vj] · exp( − d(kt, kj) / τ )    (1)

Unpack every symbol. N(kt) is the retrieved neighbour set. d is the retrieval distance. τ is a temperature. The indicator 1[y = vj] means a neighbour only votes for the token it actually stored. And exp(−d/τ) means a neighbour whose context was nearly identical votes loudly, while a distant one barely whispers.

Worked example 4: the retrieval vote, by hand

Suppose τ = 1 and the five nearest neighbours to the current prefix are:

NeighbourStored next token vjDistance dWeight exp(−d/τ)
j = 1"enhancer"0.20e−0.20 = 0.8187
j = 2"enhancer"0.50e−0.50 = 0.6065
j = 3"promoter"0.70e−0.70 = 0.4966
j = 4"silencer"1.60e−1.60 = 0.2019
j = 5"enhancer"2.30e−2.30 = 0.1003

Group by token. "enhancer" collects 0.8187 + 0.6065 + 0.1003 = 1.5255. "promoter" collects 0.4966. "silencer" collects 0.2019. The total is 1.5255 + 0.4966 + 0.2019 = 2.2240. Normalise:

pret = [ enhancer: 1.5255/2.2240 = 0.6860 ,  promoter: 0.4966/2.2240 = 0.2233 ,  silencer: 0.2019/2.2240 = 0.0908 ]

Check: 0.6860 + 0.2233 + 0.0908 = 1.0001, which is rounding. Note what this distribution encodes that a one-hot label would not: "enhancer" is the answer, but "promoter" is the reasonable confusion and "silencer" is the far one. That relative structure is precisely the extra signal the memory is being taught.

Why teach a distribution instead of the answer? A gold token teaches "say enhancer." The retrieval distribution teaches "say enhancer, and if you are going to be wrong, be wrong toward promoter." The second is a much denser gradient: it constrains the model's ranking over the entire vocabulary at every position, not just its argmax. This is the same reason distillation from soft teacher logits beats training on hard labels — and Chapter 8 will show the paper using exactly that argument again, for a different purpose.

Step 3 — compress the retrieval into parameters. Running a nearest-neighbour search over a token-level datastore at every decoding step is expensive and stateful. So the memory is trained to predict what the retrieval would have said, with a two-term loss — Equation (2):

Lmem(ct) = β · LKL(ct) + (1 − β) · LCE(ct)    (2)
LKL(ct) = KL( pret(· | ct)  ‖  pmem(· | ct) ),   LCE(ct) = − log pmem(yt | ct)

β ∈ [0,1] "balances the retrieval teacher and the gold SFT answer." Both terms are needed, and you can see why by imagining each alone. Pure KL: the memory learns to imitate a retriever, including the retriever's mistakes, and can never exceed it. Pure cross-entropy: you are back to ordinary fine-tuning on hard labels and you have thrown away the ranking structure. The mixture says match the neighbourhood's shape, but stay anchored to the truth.

The name, decoded. "Memory Decoder" is a decoder that has had a retrieval memory baked into its weights. At inference there is no datastore, no index, no search — the neighbourhood structure has been amortised into 4 billion parameters that run in parallel with the backbone. Compare this with retrieval-augmented generation, where the index is live at inference: same source of knowledge, opposite point in the compute/latency trade.

The router: a learned, per-token trust dial

Now the question that decides whether any of this works: how much should we trust the memory at this particular token?

The router is "lightweight" and "token-level," and it decides λt from "their hidden states and output-distribution uncertainty features." That last phrase is the interesting one. The router does not only look at what each model wants to say; it looks at how confident each one is. A backbone that is spreading its mass over forty plausible tokens and a memory that is putting 0.9 on one of them is a strong signal to raise λ. The reverse — a confident backbone and a flat memory — is a strong signal to lower it.

The router is trained with the backbone and the memory both frozen. Its loss, Equation (4), is cross-entropy on the fused distribution plus a signed linear regulariser on λ itself:

LCE(ct) = − log pfinal(yt | ct),    R(ct) = st · λt
Lrouter(ct) = LCE(ct) + αs · R(ct)    (4)

The regulariser is a straight line in λ, and its slope st is a signed indicator keyed to which corpus the training example came from — the router is trained "on a mixture of domain and general instruction data," with αs > 0 controlling the strength. Since the objective is minimised, a negative slope on domain examples pulls λt up, and a positive slope on general examples pushes it down.

Why a linear regulariser and not, say, an L2 penalty toward a target λ? Because a linear term has a constant gradient, ∂R/∂λ = st. It applies exactly the same push everywhere in [0,1], so it never fights harder as λ approaches an endpoint. The cross-entropy term supplies the curvature — it will resist a λ that makes the fused prediction worse — and the regulariser just supplies a constant, direction-only prior. The two together give you: "prefer the memory on domain text, prefer the backbone on general text, unless the fused likelihood says otherwise."

Worked example 5: fusing two distributions, and reading the router

Shrink the vocabulary to four tokens so the arithmetic is visible. A biology prompt is mid-answer, and the two models disagree:

TokenpS2 (frozen 397B)pmem (biology memory)Fused at λ = 0.3Fused at λ = 0.7
"enhancer"0.300.700.7(0.30)+0.3(0.70) = 0.4200.3(0.30)+0.7(0.70) = 0.580
"promoter"0.350.200.7(0.35)+0.3(0.20) = 0.3050.3(0.35)+0.7(0.20) = 0.245
"region"0.250.050.7(0.25)+0.3(0.05) = 0.1900.3(0.25)+0.7(0.05) = 0.110
"sequence"0.100.050.7(0.10)+0.3(0.05) = 0.0850.3(0.10)+0.7(0.05) = 0.065
column sums1.0001.0001.000

At λ = 0.3 the argmax is still "enhancer" (0.420) but only just; at λ = 0.7 it is decisive (0.580). And here is the crossover worth computing by hand: the backbone prefers "promoter" (0.35 > 0.30) while the memory prefers "enhancer" (0.70 > 0.20). At what λ does the fused argmax flip?

(1−λ)(0.30) + λ(0.70) = (1−λ)(0.35) + λ(0.20)
0.30 + 0.40λ = 0.35 − 0.15λ  ⇒   0.55λ = 0.05  ⇒   λ* = 0.0909

Barely any memory weight is needed to overturn this particular decision — 9.1% — because the backbone was nearly indifferent between its top two while the memory was not. That is the mechanism by which a 4-billion-parameter module can move a 397-billion-parameter model's output: it does not need to overpower the backbone, only to break its ties in the right direction.

Memory fusion and the router dial

Left: the frozen backbone's next-token distribution. Right: the biology memory's. Centre: the fusion at the current λ. Drag λ and watch the argmax cross over — the crossover point is marked. Switch the context between a domain token and a general token to see what the router is supposed to learn: on general text, high λ actively damages the prediction, which is why the regulariser has a sign.

λ (memory weight) 0.30
Context:

What it actually bought: the 21-task table, recomputed

The paper instantiates one memory — Intern-MemDec-4B, on biology — and evaluates on all 21 tasks of Biology-Instructions. This is the cleanest result in the paper because you can verify the headline number yourself from the row data. Here it is, with the deltas computed:

Biology-Instructions taskFrozen 397B aloneWith MemDec-4BΔ
DNA-cpd63.1172.57+9.46
DNA-emp19.9527.25+7.30
DNA-enhancer activity53.6860.71+7.03
DNA-pd84.4089.12+4.72
DNA-tf-h56.5755.99−0.58
DNA-tf-m56.9667.09+10.13
Multi-sequence antibody-antigen40.2436.44−3.80
Multi-sequence promoter-enhancer interaction22.4638.47+16.01
Multi-sequence RNA-protein interaction84.7487.34+2.60
Multi-sequence siRNA efficiency63.0560.63−2.42
Protein-Fluorescence70.4872.23+1.75
Protein-FunctionEC61.8860.10−1.78
Protein-Solubility68.6068.00−0.60
Protein-Stability69.6767.80−1.87
Protein-Thermostability58.4453.97−4.47
RNA-CRISPROnTarget6.6117.18+10.57
RNA-Isoform82.6584.81+2.16
RNA-MeanRibosomeLoading56.2059.71+3.51
RNA-Modification59.6460.48+0.84
RNA-NoncodingRNAFamily78.8085.70+6.90
RNA-ProgrammableRNA Switches37.1341.23+4.10
Average (21 tasks)56.9260.32+3.40

Worked example 6: verify the averages yourself

Add the "frozen 397B" column. Running the sum in the table's order: 63.11, then 83.06, 136.74, 221.14, 277.71, 334.67, 374.91, 397.37, 482.11, 545.16, 615.64, 677.52, 746.12, 815.79, 874.23, 880.84, 963.49, 1019.69, 1079.33, 1158.13, and finally 1195.26. Divide by 21:

1195.26 / 21 = 56.9171… → 56.92  ✓

Now the "with MemDec" column: 72.57, 99.82, 160.53, 249.65, 305.64, 372.73, 409.17, 447.64, 534.98, 595.61, 667.84, 727.94, 795.94, 863.74, 917.71, 934.89, 1019.70, 1079.41, 1139.89, 1225.59, 1266.82. Divide by 21:

1266.82 / 21 = 60.3248… → 60.32  ✓

And the gain, computed two ways as a check. As a difference of averages: 60.3248 − 56.9171 = 3.4076. As an average of differences: the deltas sum to 1266.82 − 1195.26 = 71.56, and 71.56 / 21 = 3.4076. Identical, as they must be — the mean is linear.

Now the part a press release would not print. Seven of the twenty-one tasks got worse: DNA-tf-h (−0.58), antibody-antigen (−3.80), siRNA efficiency (−2.42), Protein-FunctionEC (−1.78), Protein-Solubility (−0.60), Protein-Stability (−1.87), Protein-Thermostability (−4.47). That is a third of the benchmark. The +3.40 average is the net of fourteen gains averaging +6.24 against seven losses averaging −2.22.

Look at which tasks lost, because the pattern is not random. Four of the seven regressions are protein property-prediction tasks — solubility, stability, thermostability, enzyme function. And look at the biggest wins: promoter–enhancer interaction (+16.01), DNA transcription-factor binding in mouse (+10.13), CRISPR on-target activity (+10.57), non-coding RNA family (+6.90). Those are nucleotide-sequence tasks.

A single memory trained on one domain corpus has a centre of mass. Where the memory's training data was dense, λ is doing useful work; where it was thin, the router is still occasionally routing to a module that has nothing better to say than the backbone did, and the fusion dilutes a good prediction with a mediocre one. The honest reading of §5.3 is: the memory attachment is a real gain in aggregate, it is domain-shaped rather than uniform, and the failure mode is bounded and visible.

The cross-domain check — and what it does and does not show

The obvious worry about any specialisation method is that it quietly wrecks everything else. The paper checks: it evaluates the memory-augmented variant on MMLU Pro, Mol-Instructions, MMMU Pro, MicroVQA, IMO-Answer-Bench, and SFE, with Intern-S1-Pro (1T) as an extra reference, and reports that "Intern-MemDec-4B remains close to the frozen backbone on general knowledge, reasoning, scientific, and multimodal benchmarks while improving the target biology benchmark."

Two things about that sentence. First, it is exactly the claim the architecture predicts: at λ ≈ 0 the fused model is the backbone, so the router only has to learn to keep λ small off-domain. Second, "remains close" is reported as a radar plot (Figure 12c), not as a table of numbers — so we can tell you the claim and the mechanism, and we cannot give you the per-benchmark deltas, because the paper does not print them. Note the asymmetry in evidence quality: the biology gain is a 21-row table you can audit, the no-regression claim is a shape.

When you should not reach for this

Every mechanism has a domain of applicability, and the 21-task table tells you where this one's edges are. Read the seven regressions as a specification.

SituationMemory Decoder is…Why
The domain is dense in your memory's training corpusThe right tool+16.01, +10.57, +10.13 on the nucleotide-sequence tasks
The domain is adjacent to the memory's corpus but not in itRiskyThe router may still route to it. Four protein property-prediction tasks lost between 0.60 and 4.47 points
The knowledge changes weeklyWrong toolUpdating means retraining the memory. Retrieval keeps the datastore live; this compresses it into weights
You need provenance — "which document says this?"Wrong toolThe datastore was compiled away. There is nothing to cite
Serving cost is the binding constraintCheck the arithmeticTwo forward passes per token. Fine at 4B beside 397B; not fine at 70B beside 70B
You need many domains at onceUnproven hereThe paper instantiates one memory. Composition of several is asserted as possible, not demonstrated
The failure mode the regressions point at. A router trained on a mixture of domain and general data learns a boundary between them. Protein property prediction sits inside the biology corpus's nominal domain but may be sparse within it — so the router raises λ (this looks like biology) while the memory has little to contribute (it saw few thermostability examples). Fusion then dilutes a competent backbone prediction with a weak one. The bug is not the router being wrong about the domain; it is the domain being an inadequate proxy for where this particular memory is actually good.
Cross-domain bridge
This is a mixture of experts — but the router lives at the output, not inside the block
In a sparse mixture-of-experts layer, a router picks which feed-forward experts process a token, and the mixing happens in hidden space, inside every block, with all experts trained jointly. Memory Decoder does the same arithmetic one level out: the router picks how to mix two complete output distributions, once per token, with the experts trained entirely separately and one of them frozen. The consequence of moving the mixture to the output is modularity — you can ship a new expert without retraining the router's colleagues — and the cost is that you now pay two full forward passes instead of one sparse one. Same equation, opposite engineering trade. See also RAG, which keeps the datastore live instead of compressing it into weights.

The whole mechanism, in twenty lines

memory decoder inference# backbone and memory are BOTH frozen. Only the router was ever trained here.

def step(prefix):
    h_s2,  p_s2  = backbone(prefix)      # (D_s2,), (V,)  frozen 397B
    h_mem, p_mem = memory(prefix)        # (D_mem,), (V,) frozen 4B, domain-trained

    # the router sees hidden states AND uncertainty, not just the argmaxes
    feats = cat([h_s2, h_mem,
                  entropy(p_s2), entropy(p_mem),      # how confident is each one?
                  max(p_s2),     max(p_mem)])
    lam = sigmoid(router(feats))            # scalar in (0, 1), fresh EVERY token

    return (1 - lam) * p_s2 + lam * p_mem     # (V,) still sums to 1 - Equation (3)


# router training: both models frozen, mixed domain + general data
def router_loss(prefix, gold, is_domain):
    p_final = step(prefix)
    ce  = -log(p_final[gold])                # fused likelihood supplies the curvature
    s_t = -1.0 if is_domain else +1.0       # signed, keyed to the corpus
    return ce + alpha_s * (s_t * lam)         # Equation (4): constant-gradient prior

Read the last line once more. s_t * lam is linear in λ, so its derivative is the constant st. On domain data that constant is negative, so minimising the total pushes λ up; on general data it is positive, so minimising pushes λ down. The cross-entropy term is the only thing that can overrule it, and it will, whenever a high λ would make the fused prediction worse. The whole router is one scalar, one sigmoid, and a prior with a sign.

Where this sits among the four ways to specialise a model

Memory Decoder is one option in a well-populated field. Lining them up makes the trade explicit — and makes clear that there is no free lunch, only different bills.

Full fine-tuneLoRA / adaptersRAGMemory Decoder
Backbone weightsRewrittenFrozen, but the forward pass is alteredFrozen and untouchedFrozen and untouched
Risk to general capabilityHigh — the paper's stated objectionModerate — adapters still change every layer's outputNoneNone at λ = 0
Where the knowledge livesIn the weightsIn a low-rank deltaIn an external index, at query timeIn a separate model's weights
Inference cost1 forward pass1 forward pass + adapter1 pass + retrieval latency + a longer prompt2 forward passes, in parallel
ComposabilityNone — merging fine-tunes is its own research problemPartial — adapter merging is lossyGood — add documentsGood — attach another memory
Update cost for new factsAnother full runAnother adapter runInsert a documentRetrain that memory
Latency of knowledge accessFree — it is in the weightsFreePaid every queryFree — amortised into the memory's weights
The honest summary of that table. Memory Decoder buys you RAG's safety — nothing about the base model changes — with fine-tuning's latency profile, because the retrieval has been compressed into parameters ahead of time. The price is the one line in bold: you now run two models per token. For a 4B memory beside a 397B backbone that is roughly a 1% parameter overhead, which is why the design is viable here and would not be if the memory were 70B.

Where the retrieval idea comes from, and what changed

Equation (1) will look familiar if you have seen kNN-LM: build a datastore of (context representation, next token) pairs from a corpus, and at inference interpolate the language model's distribution with a distance-weighted vote from the nearest neighbours. That method works and it has a well-known cost — you carry the datastore forever, and every decoding step pays a nearest-neighbour search over it.

kNN-LM style retrievalMemory Decoder
At inference, the domain knowledge isA datastore plus an index4B parameters
Cost per tokenA vector searchA forward pass, parallel with the backbone
Interpolation weightUsually a fixed hyperparameterPredicted per token by a trained router
Can it generalise past the datastore?No — it can only vote for tokens it storedYes — it is a model, trained to approximate the retrieval, so it interpolates
Serving storyTwo systems: a model and an indexOne system: two models

The row that matters most is the fourth. A retriever is a lookup and cannot answer for a context it never saw; a model trained on the retriever's outputs has been forced to find structure in those outputs, and structure extrapolates. That is the same reason a student who learned the pattern beats a student who memorised the answer key, and it is the actual argument for Equation (2)'s existence.

Why does the Memory Decoder design guarantee that attaching a memory can never turn a strong general model into a weak one?

Chapter 3: Teaching a Model to Read a Page

Open a chemistry paper and look at what carries the information. A reaction scheme. A table of yields with the interesting row bolded. An equation set inline between two paragraphs that reference it as "(3)". A caption that says "see inset." Now run that page through a text extractor and read what comes out: the equation is a run of mangled symbols, the table is a comma soup, the figure is gone entirely, and the two paragraphs that referred to each other by position are now adjacent to something else.

Text extraction is lossy in a very specific way: it deletes exactly the structure that made the document a document. This chapter is about the paper's three answers to that, all in §3. They are independent engines and they attack different losses.

EngineWhat loss it attacksSection
Visual Pre-trainingThe page's appearance — layout, figure, equation rendering — is thrown away by extraction, so learn from the rendered pixels instead§3.1
Interleaved text–image dataThe relationship between a figure and the prose around it is thrown away by pairing an image with a caption, so rebuild the page as a sequence in reading order§3.2
Image retrieval enhancementGood scientific images are rare in a random crawl, so build an index of hundreds of millions and go find them§3.3

Visual Pre-training: predict the next patch of the page

The idea is disarmingly simple once stated. You already have a huge corpus of scientific PDFs. You are already training on the text you extracted from them. Render the same documents as page images and train on those too, with an objective that needs no labels at all.

Here is the pipeline, with shapes, following Equations (5) through (9).

Step 1 — encode the page. A frozen visual encoder Ev turns the page image I into a sequence of visual features:

Z = Ev(I) = (z1, …, zN)

Step 2 — drop the blank paper. A foreground mask mi "removes blank regions," and the survivors are put in raster-scan order — left to right, top to bottom, exactly how a person reads:

U = RasterScan{ zi | mi = 1 } = (u1, …, uL),   L ≤ N    (5)

This step is pure economy and it matters more than it looks. A journal page is mostly margin. If a quarter of your patches are white paper, a quarter of your compute is spent predicting that blank follows blank — a task with essentially zero loss and therefore zero gradient. Masking them out concentrates the budget on ink.

Step 3 — run it through the LLM autoregressively. The visual features are projected into the language model's hidden space by Win, run through the backbone Φθ, and a lightweight head ψ predicts the next visual latent:

ût+1 = ψ( [ Φθ( Win u≤t ) ]t )    (6)

Read that as: take all patches up to t, project, run the LLM, take the hidden state at position t, and map it to a prediction of what patch t+1 looks like. It is next-token prediction with patches instead of tokens.

Step 4 — and here is the actual insight: score it contrastively, not with a regression.

stj = ( ût+1T uj+1 ) / ( τ · ‖ût+12 · ‖uj+12 ),   ptj = exp(stj) / ∑k ∈ B exp(stk)    (7)
LVP = − (1/|B|) ∑t ∈ B log ptt    (8)

Unpack it. stj is the cosine similarity between the prediction at position t and the true patch at position j+1, divided by a temperature τ. The softmax runs over the batch B. And LVP is the negative log of the diagonal — the probability that the prediction for position t matched the true continuation of position t, and not somebody else's.

Why contrastive rather than an L2 regression onto the true patch? Because an L2 loss on a continuous target has a degenerate optimum: predict the conditional mean. The conditional mean of "what comes after this half-line of text" is a grey smudge. It has low L2 error and contains no information. A contrastive objective changes the question from "reproduce the patch" to "identify the patch among distractors," and identifying requires exactly the discriminative content that the mean throws away. This is the same argument that made contrastive and predictive latent objectives displace pixel reconstruction across self-supervised vision.

Step 5 — interleave with text. Both objectives run together during continued pre-training:

L = λtext LCE + λvis LVP    (9)

And the parameter split is the crux: "The visual encoder remains frozen, while the LLM backbone, visual projection, and prediction head are optimized." The encoder is a fixed measuring instrument. What is being trained is the language model's ability to continue a visual sequence — which means the document structure is being written into the backbone, not into a separate vision tower.

Why this is cheap in the only currency that matters. Visual Pre-training "requires neither OCR and layout parsing nor paired data and manual annotations," because the supervision is the next patch, which is already in the image. That is the difference between a stage you can run over every PDF you own and a stage that needs an annotation budget. The paper's framing: it "provides a scalable complement to text pre-training."

Interleaved text–image data: rebuilding the page as a sequence

The second engine attacks a different loss. §3.2 opens by naming what is wrong with the standard recipe: "Existing multimodal pre-training strategies heavily rely on image caption data, which captures semantic alignment between an image and a local text span." That is fine for object recognition. But in a PDF, "the more critical information … often lies in the contextual relationships between images, equations, tables, and surrounding text, including layout position, explanatory paragraphs before and after visual elements, textual references, cross-page reasoning chains, and the progressive organization of knowledge in long documents."

The goal, in the paper's phrase, is that the model learn "not only what an image depicts, but also how it is embedded in document narratives." The pipeline:

1 — parse
MinerU2.5-Pro does OCR and layout-aware structural parsing: text blocks, headings, paragraphs, and visually informative regions
2 — crop three kinds of visual unit
Regular images, interline equations, and tables — each cropped from the page by its bounding box and saved as a standardised sub-image
3 — reassemble in reading order
Text blocks and visual units reorganised "according to the layout reading order and bounding-box order," forming page-level interleaved sequences
4 — filter by visual gain
Keep only pages where the images actually help predict the text. See below
5 — assemble documents
Concatenate filtered pages in original order, chunk at 256k tokens with a 512-token overlap. Focus: life sciences, chemistry, materials science

Step 4 is the clever one and it deserves its own derivation.

Visual gain: a filter that measures whether a picture is worth anything

Treating equations and tables as images rather than as parsed text is a deliberate bet, and it is not free: an image costs far more tokens than the LaTeX would. So you had better be sure the visual content is carrying information. The paper measures it, borrowing the trick from Toolformer: compute the language model's perplexity on the page text twice — once with no visual input, once with the images, tables, and equations included — and define

visual gain = PPLtext-only − PPLinterleaved

"A significant decrease in PPL after adding visual information indicates that the visual content provides meaningful support for understanding the page." Decorative images, advertisements, and weakly related visuals score near zero. Experimental figures, mechanism diagrams, structural illustrations, tables, and equations produce "a notable PPL reduction." The paper then combines "human review with domain-specific thresholds and retain only pages whose visual gain exceeds the corresponding threshold."

Worked example 7: turn a perplexity drop into bits

Perplexity differences are hard to feel. Convert them. Perplexity is the exponential of the average per-token cross-entropy in nats, so PPL = eH and therefore H = ln(PPL).

Take a page from a mechanism-diagram-heavy chemistry paper: text-only PPL 12.4, interleaved PPL 9.1. Then:

Htext-only = ln(12.4) = 2.5177 nats/token
Hinterleaved = ln(9.1) = 2.2083 nats/token
ΔH = 0.3094 nats/token = 0.3094 / ln(2) = 0.3094 / 0.6931 = 0.4464 bits per token

Now scale it. A dense page might be 700 text tokens, so the figure supplied 700 × 0.4464 ≈ 312 bits — about 39 bytes — of information that was genuinely not recoverable from the text alone. That is not much in absolute terms, but it is the right unit to reason in, because now you can compare it against the cost: if the cropped figure costs 256 image tokens to include, you are paying 256 tokens for 312 bits. Whether that is a good trade is a threshold, which is exactly why the paper says the thresholds are domain-specific.

Contrast with a decorative stock photo on a press-release page: text-only PPL 11.0, interleaved PPL 10.9. Then ΔH = ln(11.0) − ln(10.9) = 2.3979 − 2.3888 = 0.0091 nats = 0.0131 bits per token, or about 9 bits for the whole page. Nine bits, for hundreds of image tokens. Discard.

The general principle, worth stealing. Visual gain is a counterfactual utility measure: it does not ask "is this image good?", it asks "does having this image change what my model predicts about the thing I care about?" That framing generalises far beyond PDFs. It is the same shape as measuring a retrieved document's value by the drop in loss on the answer, or a feature's value by ablation. Any time you cannot define quality directly, define it as the loss reduction it causes on a task you can measure.

Why 256k chunks with a 512-token overlap

Two numbers, both worth a sentence. The 256k cap matches the maximum sequence length the rest of the system is built for, so a pre-training sample and a distillation trajectory live in the same regime — no separate long-context machinery.

The 512-token overlap is a seam repair. Cut a document at a hard boundary and every fact whose evidence straddles the cut becomes unlearnable: the model sees the conclusion without the premise in one chunk, and the premise without the conclusion in the other. Overlapping by 512 tokens means any dependency shorter than 512 tokens is intact in at least one chunk. The cost is duplication: at a 512/256,000 overlap ratio you are re-training on 0.2% of tokens twice, which is nothing.

Image retrieval: going to look for the rare good pictures

The third engine is the least glamorous and the most operational. The observation in §3.3: retrieval of high-quality data "is a common practice in preparing textual pre-training corpus. However, the pipeline of retrieving high-quality image data is underexplored." The goal is to "recall high-quality data and raise their sample ratio during the training."

StageWhat the paper specifiesWhy that choice
Extraction and dedupPull images and key metadata from the sources; deduplicate on the SHA256 of the image bytesA cryptographic hash of the raw bytes is exact, cheap, and order-independent. It catches literal re-uploads, which dominate at web scale
EncodingAn 8B embedding model produces 1024-dimensional embeddingsEight billion parameters is a large embedder by 2026 standards — this is a bet that recall quality is worth the encoding cost, since it is paid once per image, ever
StorageMilvus, sharded into "multiple collections," for data "at the scale of hundreds of millions"The paper's stated reason is "to balance storage and retrieval performance." Sharding lets a query fan out in parallel and lets a shard be rebuilt without touching the rest
Query, image inputEncode the image; also caption it with a caption model and encode the caption; retrieve on both"Joint retrieval … from both visual and semantic perspectives, which improves recall and semantic matching ability." Two views of the same query catch different neighbours
Query, text inputEncode the text with the same model; cross-modal similarity searchSame embedding model at index time and query time — the paper says this explicitly, "so as to maintain consistency in the vector space." Mixing encoders silently destroys a shared space
Post-processingFilter duplicates, rerank candidates with a reranker model that assigns quality scores, then filter on those scoresThe classic retrieve-then-rerank split: a cheap approximate search over hundreds of millions, then an expensive precise model over the top few
The one line here that will save you a week. "The same embedding model as used in the vector construction stage is adopted for vector encoding, so as to maintain consistency in the vector space." Every embedding model defines its own geometry. Index with model A, query with model B, and the cosine similarities you compute are between vectors that live in unrelated coordinate systems — the results will not error, they will just be quietly meaningless. This is the single most common bug in production vector search, and it is invisible in the logs.
Cross-domain bridge
All three engines are the same move: recover a signal the standard pipeline discards
Text extraction discards appearance → render and predict patches. Caption pairing discards context → rebuild the page in reading order. Random crawling discards rarity → index and search. In each case the standard pipeline was not wrong, it was lossy in a way nobody had priced. The recurring skill is naming the loss precisely enough to build an objective around it — which is the same skill behind embedding-based retrieval and RAG. See also InternVL for the projection-into-the-LLM pattern that Lane 2 uses.

Visual Pre-training as code

visual pre-training# One training step on a batch of rendered pages. No labels anywhere.

def vp_step(page_images):                       # (B, 3, Hpx, Wpx)
    with no_grad():                              # the visual encoder stays FROZEN
        z = visual_encoder(page_images)           # (B, N, Dv) N patches per page

    m = foreground_mask(z)                       # (B, N) bool - drop blank paper
    u = raster_scan(z[m])                        # (B, L, Dv) with L <= N   -- Eq (5)

    hid  = backbone(W_in @ u)                     # (B, L, D_llm) autoregressive, causal
    pred = head(hid)                              # (B, L, Dv) predicted NEXT latent -- Eq (6)

    # contrastive scoring: identify the true continuation among in-batch targets
    a = l2norm(pred[:, :-1])                     # (M, Dv)  predictions  u_hat_{t+1}
    b = l2norm(u[:, 1:])                        # (M, Dv)  targets      u_{t+1}
    s = (a @ b.T) / tau                           # (M, M) cosine / temperature -- Eq (7)
    loss_vp = cross_entropy(s, arange(M))       # the DIAGONAL is the label -- Eq (8)

    return lam_text * loss_text + lam_vis * loss_vp   # Eq (9)

The label is arange(M). Nobody wrote it down; it is the index of each prediction's own continuation, and every other position in the batch serves as a negative. That is where "requires neither OCR and layout parsing nor paired data and manual annotations" comes from, concretely.

Worked example 8: what the foreground mask saves

The mask looks like housekeeping. Put numbers on it. Take a single-column journal page rendered at a patch grid of 48 × 36, so N = 1,728 patches. Typical margins on such a page — top, bottom, left, right, plus inter-column and inter-paragraph white space — run around 35% of the area. Then:

L ≈ 0.65 × 1,728 = 1,123 retained patches, from N = 1,728

A causal Transformer over a sequence pays roughly quadratically in length for attention, so the attention work scales as (1,123 / 1,728)2 = 0.4224 — about 42% of what the full grid would have cost. And the discarded 605 patches were the ones with essentially no loss to reduce, since predicting "blank follows blank" is free. You removed 35% of the tokens and 58% of the attention cost while losing none of the gradient signal.

Raster-scan order is a choice, and it is the right one. The retained patches are ordered "left to right, top to bottom" — the reading order of the writing systems the corpus is in. That means the autoregressive task is predict what comes next as you read, which aligns the visual objective with the text objective the same backbone is being trained on in Equation (9). Order the patches column-major, or by a space-filling curve, and the two objectives would be teaching the same weights two different notions of "next."

Why equations and tables are cropped as images

§3.2 names exactly three kinds of visual unit to crop: "regular images, interline equations, and tables." The first is obvious. The other two are a deliberate and slightly surprising choice, because both could have been serialised as text — LaTeX for the equation, markdown for the table.

UnitWhat survives text extractionWhat only survives as an image
Interline equationSometimes a LaTeX string, if the PDF embedded one. Often a scrambled run of glyphs with the sub- and superscripts flattened into the baselineThe two-dimensional layout: what is over the fraction bar, what the summation's limits are, which index the subscript belongs to. That geometry is the meaning
TableCell text, in some orderWhich cell is in which column, merged headers, the rule that separates a header block from a body block, and the emphasis on the row the authors thought mattered
FigureNothingEverything, including axis numbers that never appear in the caption

And this connects straight back to Visual Pre-training: the reason cropping equations as images is affordable is that the backbone has already been trained, in §3.1, to model rendered mathematical layout as a visual sequence. The two engines are not independent; the second one spends a budget the first one created.

Worked example 9: the chunking overhead

Filtered pages are concatenated in document order and split "into chunks suitable for long-context VLM pre-training, with each chunk capped at 256k tokens and sharing a 512-token overlap." What does the overlap cost?

Each chunk after the first repeats 512 tokens of its predecessor. With a stride of 256,000 − 512 = 255,488 new tokens per chunk, a document of D tokens needs about D / 255,488 chunks, and the duplicated fraction is:

512 / 255,488 = 0.002004 = 0.20%

Two tokens in a thousand, seen twice. For a corpus of 1 trillion tokens that is 2 billion duplicated tokens — real, and utterly worth it against the alternative. Consider a cross-reference like "as we showed in Section 2, the yield was 84%" landing 200 tokens after a hard chunk boundary. Without overlap, the model sees the claim with no evidence in one chunk and the evidence with no claim in the other, and the dependency is unlearnable from either. With a 512-token overlap, every dependency shorter than 512 tokens survives intact in at least one chunk.

The trade you are actually making. Overlap length is a bet on your corpus's dependency-length distribution. Too short and you sever real dependencies; too long and you pay duplication linearly. 512 against 256,000 is a 0.2% premium to insure against short-range boundary damage — and the paper accepts that long-range dependencies straddling a 256k boundary are simply lost, because insuring against those would cost a proportionate fraction of the chunk.

What the parser has to get right first

Everything in §3.2 rests on one upstream component: MinerU2.5-Pro, which "perform[s] OCR and layout-aware structural parsing on PDF documents" and "identifies text blocks, headings, paragraphs, and visually informative regions on each page." If that step is wrong, the interleaved sequence is wrong, and the model learns a false page.

What the parser must get rightWhat a mistake produces downstream
Reading order in a two-column layoutSentences interleaved from both columns. The model learns that scientific prose is incoherent
Figure bounding boxesA crop that clips the axis labels, or one that swallows the neighbouring paragraph as pixels
Which regions are "visually informative"Journal furniture — running heads, DOI stamps, licence footers — cropped as visual units and fed in as if they carried meaning
Table boundariesA multi-page table split at the page break, so half a table appears with no header
Interline versus inline equationsInline mathematics cropped out of a sentence, leaving a hole in the text stream
Which is why the visual-gain filter is doing double duty. It was introduced as a quality measure for images, but it is also a partial parser check: a page whose units were segmented badly tends to have low or negative visual gain, because a mis-cropped figure does not help predict the text around it. The filter cannot catch reading-order errors — those corrupt the text stream itself — but it does quietly discard a class of parse failures. Layering a cheap statistical check downstream of a complex extraction step is a good habit whether or not you are training a model.

What visual gain cannot see

Visual gain is a good filter and it is worth understanding its blind spots, because the paper hedges it with "we combine human review with domain-specific thresholds" and that hedge is doing real work.

Blind spotWhat slips through or gets droppedWhy the metric cannot see it
A figure that is the findingDropped, sometimesIf the surrounding text already describes the result fully, the image adds no perplexity reduction — even though it is the primary evidence a scientist would look at
A figure that merely restates the textKept, sometimesRedundancy lowers perplexity beautifully. A bar chart of numbers already in a table scores well and teaches nothing new
Cross-page dependencyInvisibleThe measurement is per page. A figure on page 4 explaining an equation on page 2 gets no credit
Domain difficultySystematically biasedA page whose text is intrinsically hard has high baseline perplexity and therefore more room to drop. That is why the thresholds are "domain-specific"
The measuring model's own gapsCircularGain is measured with a language model. If that model is weak at chemistry, chemistry figures look enormously helpful; as it improves, the same figures score lower
The last row is the deep one, and it applies to every counterfactual-utility metric. "Does this help my model?" is a moving question, because the model moves. A datum that was informative to the checkpoint that measured it may be redundant to the checkpoint you train. Anyone building a data pipeline on model-scored utility inherits this: your filter's verdicts have an expiry date tied to the scorer that produced them, and re-scoring with a stronger model will change what you keep. The paper's answer — human review plus per-domain thresholds rather than one global cutoff — is the pragmatic mitigation, not a solution.

Why life sciences, chemistry, and materials science

The interleaved pipeline "focuses on life sciences, chemistry, and materials science." That is a scoping decision, and it lines up exactly with where the evaluation is strongest — which is either a coincidence or the point.

Domain named in §3.2What its pages are dense inWhich Table 2 rows it feeds
Life sciencesMicrographs, gels, pathway diagrams, multi-panel figures with sub-labels, sequence alignmentsBiology-Instructions (56.92), MicroVQA (68.81)
ChemistryReaction schemes, structural formulae, spectra, yield tablesMol-Instructions (52.37), MolecularIQ (61.49), TOMG-Bench (65.66)
Materials scienceCrystal structures, phase diagrams, diffraction patterns, lattice tablesMP20 (67.88)

Those five rows include the two largest margins in the entire paper. Biology-Instructions at 4.1× the best competitor and MP20 at 4.1× are exactly the two domains whose page structure this pipeline was built to preserve. That is not proof of causation — the SFT mixture and the RL tasks also targeted these domains — but the alignment between what §3.2 chose to parse and where §5.2 reports its largest wins is worth noticing.

Worked example 10: the scale of the image index

§3.3 gives enough numbers to size the system. "Hundreds of millions" of images, each encoded to a 1024-dimensional vector. Take 300 million as the working figure.

Raw vector storage, at 4 bytes per dimension:

300,000,000 × 1024 × 4 bytes = 1.229 × 1012 bytes = 1.23 TB

At half precision, 614 GB. Either way it does not fit on one machine's memory, which is precisely the paper's stated reason for "constructing multiple collections based on the Milvus vector database and storing image vectors in shards to support subsequent high-performance retrieval."

Brute-force search cost per query. A single cosine similarity over 1024 dimensions is about 1024 multiply-adds. Against 300 million vectors:

300,000,000 × 1024 = 3.07 × 1011 multiply-adds per query

At a very generous 1011 effective operations per second on a CPU that is roughly 3 seconds per query — per query, single-threaded, with the whole index in memory. Which is why nobody does brute force, and why the pipeline is retrieve-then-rerank: an approximate index narrows 300 million to a few hundred in milliseconds, and then "a reranker model to rerank candidate results and assign quality scores" pays the expensive per-item cost on only those few hundred.

The general shape: a cheap filter with high recall, then an expensive filter with high precision. The approximate index is allowed to be sloppy because the reranker will clean up; the reranker is allowed to be slow because it only ever sees a short list. Get this ordering backwards — an expensive first stage or a sloppy second one — and you have either a system that cannot run or one whose results are noise. The same two-stage structure appears in search, in recommendation, and in every RAG system worth deploying.

The three engines, by cost profile

A practical question when borrowing any of this: what does each engine cost, and when do you pay it?

EngineOne-time setup costPer-item costRecurring cost
Visual Pre-trainingNone — a frozen encoder, a projection, a small headRender a page, run the frozen encoder once, train the LLM on the sequenceNone. The knowledge is in the backbone afterwards
Interleaved text–imageA PDF parser (MinerU2.5-Pro) and per-domain gain thresholds set with human reviewParse, crop, two perplexity evaluations for the gain measurement, then assembleRe-measure gain if you change the scoring model
Image retrievalAn 8B embedder, a sharded Milvus deployment, a reranker — and encoding hundreds of millions of images onceOne query encoding, one approximate search, one rerank over the shortlistThe index has to be kept and served

Notice the asymmetry. The first engine is nearly free and has no operational tail. The second costs two forward passes per page at build time and leaves behind a threshold you now own. The third is the only one that leaves a system running: an index at hundreds-of-millions scale is a service with uptime, storage, and re-indexing concerns long after the training run finished.

The ordering advice that falls out. If you are building a document pipeline and can only do one of these, do the first. Visual Pre-training needs no annotation, no parser, no threshold, and no service — the paper's own phrase is that it "requires neither OCR and layout parsing nor paired data and manual annotations." Every other engine in this section presupposes infrastructure you must then maintain.

How the three engines feed each other

It is worth being explicit that these are not three parallel improvements. They form a chain.

Engine 1 teaches the backbone to model rendered pages
After Visual Pre-training, the LLM has seen millions of scientific pages as visual sequences — layout, equation geometry, table rules, figure placement
↓ which is what makes the next decision affordable ↓
Engine 2 can therefore crop equations and tables as images
Serialising them to LaTeX would lose the 2-D structure; keeping them as images only works because the backbone already reads rendered mathematics
↓ and both are starved without ↓
Engine 3 supplies the rare good images
"Raise their sample ratio during the training" — a retrieval pipeline is how you make a scarce, high-value slice of the distribution common enough to learn from

And all three exist to serve one number that will not appear until Chapter 9: SimpleQA-Verified 69.90, fifteen points clear of the next open model, measured without retrieval tools. Factual recall without tools is a pre-training result. It is the cleanest available evidence that this section of the paper did something real.

What the retrieval pipeline costs, and why it is worth it once

One more piece of arithmetic on §3.3. Encoding "hundreds of millions" of images with an 8-billion-parameter embedding model is not a small job. But note where the cost sits: it is paid once per image, ever. After that, every query — every text-to-image and image-to-image lookup, forever — costs one query encoding plus an approximate search. The expensive model is on the write path, not the read path.

Which is exactly the opposite of the caption-model decision in the same section. For an image query, the system "uses a caption model to generate a textual description of the image, and the caption text is then encoded into a vector," so it can search from "both visual and semantic perspectives." That caption is generated at query time — on the read path — and it is worth it because the two views recall genuinely different neighbours: the image embedding finds things that look alike, and the caption embedding finds things that are about the same thing. A fluorescence micrograph and a schematic of the same pathway look nothing alike and are semantic neighbours.

Visual Pre-training scores its next-latent prediction with a contrastive softmax over in-batch targets (Equations 7–8) instead of regressing onto the true patch. What specifically goes wrong with the regression?

Chapter 4: Rollout Economics — Not Idling the Cluster

Reinforcement learning on a language model has a rhythm: generate, score, update. Generate a batch of responses to a batch of prompts, run a verifier over them to get rewards, take a gradient step, repeat. In a small setup you barely notice the generate phase. At this scale it is the whole story — "rollout generation is the primary computational bottleneck in reinforcement learning."

And it is a bottleneck with a nasty shape. Not slow-on-average: slow-in-the-tail.

The straggler problem, made concrete

You launch 8,192 rollouts. Most finish in a few thousand tokens. But this is a long-chain-of-thought reasoning model with a maximum generation length of 65,536 tokens, and a handful of prompts will send it most of the way there. In a synchronous pipeline you cannot start training until the batch is complete, so:

The paper's description of the failure. "In a synchronous rollout pipeline, a small number of exceptionally long generations may delay the completion of an entire batch, leaving most GPUs idle while waiting for stragglers."

Put numbers on it. Suppose 99% of your rollouts finish by 4,000 tokens and 1% run to 65,536. The batch is not done until the slowest one is done, so the wall-clock cost of the batch is set by 65,536 tokens of autoregressive decoding, while the average rollout needed roughly 4,600. The ratio 65,536 / 4,600 ≈ 14 means that for about thirteen-fourteenths of the batch's duration, the overwhelming majority of your accelerators have nothing to do. On a cluster that costs real money per hour, this is the difference between a training run and a heating bill.

The two standard escapes, and the one the paper picked

§4.3.1 names the field's two answers before choosing:

ApproachHow it worksThe cost it introduces
Co-location with partial rolloutsTraining and inference share the same GPUs. When enough rollouts have finished, pause the rest and switch the pool to trainingPaused trajectories become stale: parts of them were written by an older policy
Full disaggregationSeparate GPU pools: one generates forever, one trains foreverA producer–consumer balancing problem — size the pools wrong and one starves the other. The paper calls this "the difficult producer–consumer balancing problem"

Intern-S2-Preview takes the first: "a co-located partial-rollout system based on the XTuner training engine and the LMDeploy inference engine." Here is the loop, exactly as described:

1 — keep the engine fed
"The inference engine is continuously supplied with new requests during rollout generation to maintain high GPU utilization." As a rollout finishes, another takes its slot
2 — pause, do not abort
Once enough completed trajectories exist for a batch, the in-flight rollouts are "paused at their current generation positions rather than aborted or discarded." Prefixes and metadata are kept
3 — the same GPUs switch to training
Only completed trajectories enter the batch. The policy is updated
4 — hand back and resume
Training states offloaded, updated weights synced to the inference engine, "the paused requests resume generation from their retained prefixes"

Nothing computed is thrown away. That is the whole argument for pause-over-abort: a rollout 40,000 tokens deep represents 40,000 forward passes, and discarding it burns all of them.

The bill: your trajectory now has multiple authors

Step 4 hides a real problem, and the paper states it without flinching: "because a resumed trajectory may contain segments generated before and after one or more policy updates, different tokens within the same trajectory can originate from different behavior-policy versions."

Think about what that means for the gradient. Policy gradient methods assume the data you are learning from was sampled from the policy you are updating. Here, token 12,000 of a trajectory came from πv3 and token 45,000 came from πv5, and you are updating πv6. Every one of those tokens is off-policy — drawn from a distribution that is not the one you are differentiating.

The classical repair is importance sampling: reweight each sample by how much more or less likely it is under the policy you care about than under the one that produced it. The paper records, for every sampled token, both the behaviour-policy version and the generation-time log-probability, and then writes Equation (10):

ρi,t(θ) = πθ( yi,t | si,t ) / πbeh(i,t)( yi,t | si,t )    (10)

Note the subscript beh(i,t): the behaviour policy is indexed by both the trajectory and the position within it. Different tokens of the same response can have different denominators. That is unusual, and it is a direct consequence of pause-and-resume.

The system also bounds how stale a trajectory may get: "a trajectory is discarded if its oldest retained segment was generated more than three policy updates before the current learner." Three. That is a hard cap on how far the ratio can drift, enforced by deletion rather than by a correction term.

Clipping the weight, not the objective — and why that is different from PPO

Importance ratios have a well-known pathology: they are unbounded above and their variance can explode. So the ratio is truncated, Equation (11):

ρ̄i,t(θ) = clip( ρi,t(θ), 1 − εISlow, 1 + εIShigh )    (11)

And then a sentence that is easy to skim past and is the most important thing in the section:

The paper's own contrast. "The clipped ratio is subsequently used as a detached importance weight in the REINFORCE objective. Unlike PPO-style clipping, which clips the surrogate objective and may completely suppress gradients from tokens outside the trust region, clipping the importance weight bounds update variance while retaining a nonzero policy-gradient contribution from every unmasked token."

Sit with the difference, because it is a genuinely different algorithm and the distinction is often muddled.

PPO-style clippingDetached clipped weight (this paper)
What gets clippedThe surrogate objective: min(ρA, clip(ρ)A)The weight ρ̄ only, which is then stop-gradiented
Does ρ carry gradient?Yes — ρ contains πθ, so it is part of the computational graphNo — sg[ρ̄] is a number. The gradient flows only through log πθ
Outside the trust regionThe min() selects the clipped branch, which is constant in θ, so the gradient is exactly zero for that tokenThe weight saturates at the clip bound but the log-probability term still carries gradient — the token contributes a bounded, nonzero push
Failure mode avoidedA token that drifted far off-policy silently disappearing from the update

Concretely: if ρ = 8.0 and the clip bound is 1.2, PPO (for a positive advantage) contributes nothing at all from that token. Here, the token contributes with weight 1.2 — capped, but present. Given that pause-and-resume manufactures off-policy tokens by design, an update rule that deletes them would throw away exactly the data the system went to such trouble to preserve.

The other inconsistency: two engines, one model, different answers

There is a second, sneakier source of mismatch, and it has nothing to do with time. The rollouts are generated by LMDeploy and the gradients are computed by XTuner. Same weights, two different implementations. They do not agree exactly.

For a sparse MoE model there are two reasons, and the paper separates them cleanly.

Reason 1 — routing. An MoE router picks a small set of experts per token via a top-k over router logits. A discrete argmax has no tolerance: a difference of 10−6 in a logit can flip which expert runs, and then the two engines have computed different functions, not merely different roundings. The fix is Rollout Routing Replay (R3): "the expert selections made by LMDeploy during rollout are recorded and replayed by XTuner when evaluating the corresponding tokens. This ensures that rollout and training follow the same expert paths."

Reason 2 — arithmetic. Even on the same path, numerics differ. The mitigation is the precision map from Chapter 1: FP8 for expert linear layers, BF16 elsewhere, FP32 for apply_rope, RMSNorm, the MoE router, Gated DeltaNet recurrent states, and the language-model head.

What is left over. "After routing replay and operator-level alignment, a small number of tokens may still exhibit large probability discrepancies because of residual numerical differences." So a third mechanism, borrowed from KPop: detect and drop the survivors using the bidirectional binary KL divergence, Equations (12) and (13):

DBKL(p ‖ q) = p log(p/q) + (1−p) log((1−p)/(1−q))    (12)
mBKLi,t = 1[ DBKL(ptrain ‖ prollout) ≤ φ ] · 1[ DBKL(prollout ‖ ptrain) ≤ φ ]    (13)

Read Equation (12) as: collapse the whole vocabulary to a two-outcome question — "was it this token, or was it anything else?" — and measure the KL between the two engines' answers to that question. ptrain and prollout are the probabilities the two engines assign to the token that was actually sampled, "under matched model parameters and replayed routing decisions." A token survives only if both directions are under the threshold φ.

Worked example 11: binary KL by hand, and why both directions

Case A — ordinary disagreement. ptrain = 0.90, prollout = 0.80.

DBKL(0.90 ‖ 0.80) = 0.9 · ln(0.9/0.8) + 0.1 · ln(0.1/0.2)
= 0.9 · ln(1.125) + 0.1 · ln(0.5) = 0.9(0.117783) + 0.1(−0.693147) = 0.106005 − 0.069315 = 0.036690

Reverse it:

DBKL(0.80 ‖ 0.90) = 0.8 · ln(0.8/0.9) + 0.2 · ln(0.2/0.1)
= 0.8(−0.117783) + 0.2(0.693147) = −0.094226 + 0.138629 = 0.044403

Different numbers — 0.0367 versus 0.0444 — from the same pair, which is the first thing to internalise: KL is not symmetric. Both are small; at any sane φ this token survives.

Case B — a real outlier. ptrain = 0.05, prollout = 0.60. The rollout engine thought this token was the obvious choice; the training engine thinks it was nearly a mistake.

DBKL(0.05 ‖ 0.60) = 0.05 · ln(0.05/0.60) + 0.95 · ln(0.95/0.40)
= 0.05(−2.484907) + 0.95(0.864997) = −0.124245 + 0.821747 = 0.697502
DBKL(0.60 ‖ 0.05) = 0.60 · ln(12) + 0.40 · ln(0.421053) = 0.60(2.484907) + 0.40(−0.864997) = 1.490944 − 0.345999 = 1.144945

Nineteen to thirty-one times larger than Case A in the two directions. This token is masked out.

Why require both directions to pass? Because each direction is blind in a different place. D(p‖q) weights the disagreement by p and blows up when q → 0 where p is not small; D(q‖p) does the mirror. A token where one engine says 0.001 and the other says 0.15 registers loudly in one direction and quietly in the other. Taking the conjunction of two one-sided tests turns an asymmetric statistic into a symmetric admission rule, at the cost of one extra evaluation per token — which is free, since you already have both numbers.

And notice how the three mechanisms stack, because they are not redundant:

MechanismRemovesWhat it cannot fix
R3 routing replayDiscrete expert-path mismatchFloating-point differences along the same path
FP32 on sensitive operatorsThe largest sources of numerical driftResidual per-token outliers
Bidirectional-KL maskThe residual outliers, by deleting themNothing — it is the last resort, and it costs you those tokens' gradient
Clipped importance weightVariance from genuine policy stalenessEngine disagreement, which is not staleness at all
Partial rollout: where the cluster time goes

Each bar is one rollout, its length drawn from a long-tailed distribution. In synchronous mode the batch ends when the slowest finishes, and the grey area is idle accelerator time. In partial rollout mode the batch closes as soon as enough have completed; the rest pause (marked with a bar), training runs, and they resume — carrying a staleness counter. Trajectories whose oldest segment exceeds 3 policy updates are discarded, shown in red. Drag the tail severity and the completion threshold and watch utilisation and waste move against each other.

Tail severity 0.55
Batch closes at 70%

Making generation itself faster: speculative decoding that chases the policy

Partial rollout fixes idling. It does not make a token come out faster. For that the paper adds speculative decoding — and then hits a problem specific to RL.

The standard method: a small, cheap draft model proposes several tokens ahead; the expensive policy model verifies all of them in one parallel forward pass, using an exact rejection-sampling procedure. Because the verification is exact, "this verification procedure preserves the sampling distribution of the policy model" — so, crucially, "speculative decoding accelerates rollout generation without introducing additional off-policy bias." You are not approximating the policy. You are sampling from it, faster.

The RL-specific problem. "A central challenge in applying speculative decoding to RL is that the policy model evolves continuously during training. A fixed draft model therefore becomes increasingly stale as the policy is updated, resulting in a growing mismatch between their output distributions and a progressive decline in the token acceptance rate." In ordinary inference the target is frozen and the draft can be trained once. Here the target is a moving object.

The answer is to train the draft online: at each RL iteration, update the draft using the current policy's token distributions on the rollout states just collected, "while gradients are stopped through the policy model." The draft chases; the policy never feels it.

Deriving the acceptance rate, and the loss that targets it

Let p be the target policy's distribution at a draft position and q the draft's, both computed at the rollout sampling temperature. Two divergences matter:

DKL(p ‖ q) = ∑v p(v) log( p(v) / q(v) )    (19)
DTV(p, q) = ½ ∑v | p(v) − q(v) |    (20)

And now the identity that ties the second one directly to speed, Equation (21):

αt,k = ∑v min( p(v), q(v) ) = 1 − DTV(p, q)    (21)

Under lossless speculative sampling, the probability that a drafted token is accepted equals the overlap of the two distributions — the area both agree on. Minimising total-variation distance is therefore literally maximising the acceptance rate. Not a proxy for it. The same number.

Worked example 12: acceptance and the overlap identity

Vocabulary of three, target p = (0.60, 0.30, 0.10), draft q = (0.50, 0.20, 0.30).

Overlap: min(0.60, 0.50) + min(0.30, 0.20) + min(0.10, 0.30) = 0.50 + 0.20 + 0.10 = 0.80.

Total variation: ½( |0.60−0.50| + |0.30−0.20| + |0.10−0.30| ) = ½(0.10 + 0.10 + 0.20) = ½(0.40) = 0.20.

And 1 − 0.20 = 0.80. The identity holds. Four out of five drafted tokens are accepted here.

The classical speculative-sampling result (Chen et al. and Leviathan et al., 2023, both cited by the paper) says that with acceptance rate a and K drafted positions, the expected number of tokens produced per verification round is (1 − aK+1)/(1 − a). The paper uses K = 4. So:

Acceptance a(1 − a5)/(1 − a)Expected tokens per round
0.30(1 − 0.00243)/0.701.425
0.50(1 − 0.03125)/0.501.938
0.70(1 − 0.16807)/0.302.773
0.80(1 − 0.32768)/0.203.362
0.90(1 − 0.59049)/0.104.095

That table is standard theory, not the paper's measurement — include it to build intuition, not to attribute. What the paper reports is the end result: speculative decoding "ultimately delivers an approximately speedup in rollout generation and a 1.7× end-to-end speedup for the overall RL training pipeline."

Read the gap between 2× and 1.7×. If rollout generation were the entire pipeline, doubling it would double everything. It is not: training, weight synchronisation, and verification are untouched. Run Amdahl's law backwards. If a fraction f of the time is rollout and you halve it, the speedup is 1/(1 − f + f/2) = 1/(1 − f/2). Setting that to 1.7 gives f/2 = 1 − 1/1.7 = 0.4118, so f ≈ 0.82. The two reported numbers, taken together, quietly tell you that about 82% of this RL pipeline's wall clock was rollout generation. Which is precisely why two of this chapter's mechanisms exist.

The hybrid draft loss: two objectives, adaptively mixed

So why not just minimise DTV, since that is the acceptance rate? Because absolute value has a constant-magnitude subgradient — it points the right way but tells you nothing about how far off you are, which makes it a poor optimisation target when the draft starts far from the policy. Forward KL has the opposite character: smooth, well-scaled gradients, but it is optimising a proxy.

The paper uses the hybrid LK loss, Equation (22), and mixes the two with a coefficient that depends on how well things are going, Equation (23):

L(t,k)LK = λk · DKL(pt,k ‖ qt,k) + (1 − λk) · DTV(pt,k, qt,k)    (22)
λk = exp( − η · sg[ ᾱk ] ),   η = 3    (23)

ᾱk is the current acceptance rate at draft position k, aggregated over sequence and batch. Compute the schedule:

Acceptance ᾱkλk = e−3ᾱWeight on KLWeight on TVRegime
0.00e0 = 1.0000100%0%Draft is lost. Pure distribution matching
0.20e−0.6 = 0.548854.9%45.1%Getting there
0.50e−1.5 = 0.223122.3%77.7%TV has taken over
0.80e−2.4 = 0.09079.1%90.9%Nearly pure acceptance-rate optimisation
0.95e−2.85 = 0.05785.8%94.2%Polishing

The paper's summary of the schedule matches the arithmetic exactly: when alignment is poor, "the objective is therefore dominated by the forward KL term, which provides smooth and well-scaled gradients for rapidly aligning the draft distribution with the evolving policy"; as acceptance rises, "the objective gradually shifts from stable distribution matching to direct acceptance-rate optimization."

The full objective averages over K draft positions, Equation (24):

Ldraft = (1/K) ∑k=1K (1/|Tk|) ∑t ∈ Tk L(t,k)LK    (24)

with K = 4 and η = 3. Note λk is per-position: the first drafted token is easy to get right and the fourth is not, so position 1 will be deep in TV mode while position 4 is still doing KL. One schedule per lookahead depth, automatically.

Why this whole section is honest. Speculative decoding is lossless: the rejection-sampling verification is exact, so the tokens that come out are distributed exactly as the policy would have produced them alone. Contrast this with the other speed mechanism in this chapter — partial rollout — which is not free and pays for its speed with off-policy tokens that then need Equations (10) through (13) to repair. When you are optimising a training pipeline, sort your accelerations by whether they change the distribution you are learning from. The free ones you take immediately. The ones that cost bias you take with a correction attached.

The rollout loop, written out

co-located partial rollout# One RL iteration on a shared GPU pool. XTuner trains, LMDeploy generates.

def iteration(prompts, batch_target=8192, max_stale=3):
    launch(prompts)                                # keep the engine saturated: as one
    done = []                                       # finishes, another request takes its slot
    while len(done) < batch_target:
        traj = next_completed()
        done.append(traj)
        launch_one(next_prompt())

    # PAUSE, do not abort: prefixes + metadata are retained
    paused = pause_in_flight()                     # each keeps tokens, logprobs, policy version

    # the SAME GPUs now train
    for mb in split(done, n=8):                    # 8 mini-batch update steps
        policy_update(mb)                          # each step makes the REST more off-policy
    version += 1

    offload_training_state()
    sync_weights_to_inference()

    # resume, dropping anything that has drifted too far
    for t in paused:
        if version - t.oldest_segment_version > max_stale:
            discard(t)                              # hard staleness bound = 3 updates
        else:
            resume_from_prefix(t)


# the correction that pause-and-resume makes necessary
def token_weight(tok):
    rho = exp(logp_now(tok) - tok.logp_at_generation)   # Eq (10), per-token behaviour version
    rho = clip(rho, 1 - eps_low, 1 + eps_high)          # Eq (11)
    return detach(rho)                                  # NOT part of the graph - this is the
                                                        # difference from PPO surrogate clipping

The line worth pausing on is for mb in split(done, n=8). Eight mini-batch updates per rollout batch means that even the completed trajectories are off-policy for seven of the eight steps — they were generated by the policy as it stood before step one. Partial rollout is not the only source of staleness; it is the source that makes staleness per-token rather than per-batch.

Worked example 13: how stale is "three updates"?

Translate the staleness bound into tokens. Suppose a batch closes when 70% of rollouts have completed, and the median completed rollout ran 4,000 tokens. Then a paused trajectory resumes having been paused once, and can be paused at most three times before it is dropped. Three pause cycles is roughly three more batch windows, so a surviving long rollout can accumulate on the order of four windows' worth of generation — call it 16,000 tokens — split across four policy versions.

Now count gradient steps. Each window is 8 mini-batch updates, so a token generated in the first window and used in the fourth is being evaluated by a policy that is 3 × 8 = 24 gradient steps away from the one that produced it. At a learning rate of 1 × 10−6 that is a small drift, which is precisely why 3 is a defensible bound and 30 would not be:

Staleness (policy updates)Gradient steps of driftWhat happens to ρVerdict
00–7 (within-batch mini-steps)Near 1. Clipping rarely bindsFine
1–38–24Drifts; clipping starts to bind on some tokens, bounding the varianceAccepted — the correction handles it
> 3> 24Many tokens pinned at the clip bound, so the weight carries little information about the true ratioDiscarded
Why a hard cap rather than a smooth decay. You could imagine down-weighting stale trajectories continuously instead of deleting them. The problem is that once most of a trajectory's tokens are pinned at the clip bound, the weight has stopped being an estimate of anything — every token reports the same saturated number regardless of how far off it really is. A correction that has lost its resolution is worse than no data, because it still contributes gradient with unquantified bias. Deleting is honest.

The three failure modes, and which mechanism owns each

It is easy to lose track of what is fixing what, because Chapter 4 stacks four corrections. Sort them by the question each one answers:

QuestionFailure if unansweredMechanism
Did the same weights produce this token in both engines?You are computing gradients for a function that never ranR3 routing replay
Did the same arithmetic run?Log-probabilities disagree at the fifth decimal, everywhereThe FP8 / BF16 / FP32 precision map
Is this specific token's recorded log-probability trustworthy?A handful of tokens with garbage weights inject unbounded noiseThe bidirectional-KL mask
Was this token generated by the policy I am updating?Biased gradient with unbounded varianceThe clipped importance weight and the staleness bound

The first three are about agreement between two implementations. The fourth is about agreement between two moments in time. Conflating them is the easiest mistake to make while reading §4.3.1, and the paper is careful to keep them apart: R3 "removes discrete expert-routing mismatch, whereas the BKL mask filters the remaining token-level numerical outliers," and the clipped weight "corrects the policy mismatch introduced by pause-and-resume partial rollouts and repeated mini-batch updates."

Why does the paper use the clipped importance ratio as a detached weight on a REINFORCE term rather than adopting PPO-style surrogate clipping?

Chapter 5: Shaping the Advantage

By the end of Chapter 4 we have tokens, log-probabilities, and a repaired importance weight. What we do not yet have is the number that says how good was this response. That number — the advantage — is what multiplies the log-probability in the gradient, and this chapter is about the three transforms the paper applies to it, in order, and why each one exists.

Here is the pipeline. Everything downstream of the verifier:

verifier
A group of G responses to one query, each scored: R1, …, RG
↓ DAPO dynamic sampling drops all-identical groups ↓
1 — leave-one-out baseline
ALOOi = Ri − mean of the other G−1 rewards
2 — GEPO entropy control
Attenuate by the group's entropy regime, so a low-entropy maths group and a high-entropy generation group are comparable
3 — adaptive length regularisation
Among correct answers on queries the model has mastered, prefer the short ones. Never touch the wrong ones
the final scalar
Ãi = Rlen( RGEPO( ALOOi ) ), shared by every policy-generated token in response i

Step 1: the leave-one-out baseline, derived from scratch

Why does a policy gradient need a baseline at all? Because raw rewards have an arbitrary origin. If every response to a query scores 1.0, multiplying every log-probability by +1.0 pushes all of them up — a large, uninformative update that says nothing about which response was better. What you want is the relative quality within the group.

The paper follows Intern-S1-Pro in using the leave-one-out form, Equation (27):

ALOOi = Ri − (1/(G−1)) ∑j ≠ i Rj    (27)

The baseline for response i is the mean of the others, excluding i itself. That exclusion is not fussiness — if i were included in its own baseline, the baseline would be correlated with the thing it is subtracted from, which biases the estimator. Leaving one out makes the baseline independent of the sample it corrects.

Worked example 14: LOO advantages for a group of eight

G = 8 rollouts on one maths query, verifier gives 1 for correct and 0 for incorrect. Six correct, two wrong: R = (1, 1, 1, 0, 1, 0, 1, 1), so ∑R = 6.

For a correct response (Ri = 1), the others sum to 6 − 1 = 5, so the baseline is 5/7 = 0.714286 and

ALOO = 1 − 5/7 = 2/7 = +0.285714

For an incorrect response (Ri = 0), the others sum to 6 − 0 = 6, so the baseline is 6/7 = 0.857143 and

ALOO = 0 − 6/7 = −6/7 = −0.857143

Check the group sums to zero, as a correct baseline must: 6(+0.285714) + 2(−0.857143) = 1.714286 − 1.714286 = 0.000000. ✓

Read the asymmetry. Failing when six of eight siblings succeeded costs −0.857; succeeding when six of eight succeeded earns only +0.286 — three times smaller. The baseline automatically makes the rare outcome the informative one. On a query where the model succeeds 6/8 of the time, there is very little left to learn from another success and a great deal to learn from a failure. Flip the group to 2 correct out of 8 and the arithmetic flips with it: correct responses earn 1 − 1/7 = +0.857 and failures cost 0 − 2/7 = −0.286. Nobody tuned that. It falls out of the estimator.

Which is also why a group where every reward is identical is worthless: every advantage is exactly zero and the gradient contribution is nil. Rather than waste the rollouts, the paper adopts DAPO's dynamic sampling: "query groups whose rewards are all identical are filtered out online and replaced with newly sampled groups." You keep sampling until you get a group that disagrees with itself.

Step 2: GEPO — why heterogeneous tasks cannot share an advantage scale

Now the multi-task problem. The RL mixture spans "diverse scientific and general-purpose tasks" that "differ in structure, solution diversity, and uncertainty of policy exploration." Consider two extremes:

A competition maths problemOpen-ended scientific generation
Correct answersEssentially oneVery many
Policy entropy while solvingLow — the model commits early to a chain and follows itHigh — many tokens are genuinely open
What a strong push doesSharpens an already-sharp distribution. Risk: collapseNudges a broad distribution. Risk: little
What suppressing failures doesRemoves a wrong path. Usually fineCan kill exploration that had not paid off yet

The paper's diagnosis: this heterogeneity "makes group-based policy optimization methods induce an entropy-dependent bias, making advantage signals across prompt groups statistically non-comparable." Two groups can produce advantages of the same magnitude that mean completely different things about the update they will cause.

Group-level entropy, Equation (25), is the diagnostic — estimated from samples you already have, with no extra rollouts:

Hg(x) = − (1/K) ∑i=1Kt=1Ti log πθ( yi,t | yi,<t, x )    (25)

Note the inner sum runs over t, so this is total sequence surprisal averaged across the group, not a per-token average. Longer responses contribute more. Then GEPO reshapes:

What GEPO does, stated exactly as the paper does. It "attenuates positive advantages in low-entropy groups to prevent over-exploitation that would further amplify the entropy gap, while attenuating negative advantages in high-entropy groups to avoid prematurely suppressing exploration." Two multiplicative coefficients in (0,1), applied on different branches, gated by entropy thresholds that move with the training step. And the asymmetry has a stated reason: "low-entropy groups are more susceptible to aggressive intervention, which may trigger length collapse, and therefore require milder attenuation than high-entropy groups."

The published coefficient values are not in the report, so the worked numbers below are illustrative; the branch structure is the paper's.

Worked example 15: group entropy on two task families

Take K = 4 responses per group, five tokens each, and read off the average per-token log-probability.

Group M (maths, verifiable answer). The policy is confident: log π ≈ −0.05 per token. Per response, ∑t log π = 5(−0.05) = −0.25. So

Hg(M) = −(1/4) · 4 · (−0.25) = 0.25

Group S (open-ended scientific write-up). Many tokens are genuinely free: log π ≈ −1.20 per token. Per response, 5(−1.20) = −6.00. So

Hg(S) = −(1/4) · 4 · (−6.00) = 6.00

A factor of twenty-four between two groups in the same batch. Now suppose at this training step the thresholds are Hlow = 1.0 and Hhigh = 4.0. Group M sits below Hlow, so its positive advantages are attenuated; group S sits above Hhigh, so its negative advantages are attenuated. With illustrative coefficients of 0.5 on the low-entropy positive branch and 0.8 on the high-entropy negative branch, and reusing the advantages from Worked Example 14:

GroupHgBranch triggeredAdvantage beforeAdvantage after
M (maths)0.25Low entropy, A > 0+0.28570.5 × 0.2857 = +0.1429
M (maths)0.25Negatives untouched−0.8571−0.8571
S (generation)6.00Positives untouched+0.2857+0.2857
S (generation)6.00High entropy, A < 0−0.85710.8 × (−0.8571) = −0.6857

Read what that does to the entropy gap over time. In group M, rewarding successes is what sharpens the distribution further — so damping the positives slows the slide toward collapse. In group S, punishing failures is what narrows exploration — so damping the negatives keeps the search alive. Each branch pushes back against the direction each regime was already drifting.

The design principle worth extracting. GEPO does not force every task to a shared entropy target. The paper is explicit: "Instead of forcing heterogeneous tasks toward a shared entropy target, GEPO preserves task-dependent exploration regimes while rebalancing their effective contributions to policy updates." A maths task should be low-entropy; that is what solving it looks like. The bug was never the entropy, it was that the update magnitudes were not comparable across regimes. And the whole thing "requires neither explicit task annotations nor additional rollouts" — the entropy is computed from log-probabilities you already had.

Step 3: adaptive length regularisation, and the invariant that makes it safe

Long-chain-of-thought models overthink. The paper cites the literature on it and names the symptom: "producing unnecessarily long reasoning trajectories even when the correct solution can be reached with substantially less computation."

The standard fixes both have costs the paper wants to avoid: an explicit length reward "introduce[s] auxiliary optimization objectives that may conflict with task rewards," and a separate length-control fine-tuning stage "complicate[s] the post-training pipeline and may disturb capabilities acquired during earlier RL stages." So instead: reweight advantages directly, with two principles.

PrincipleThe ruleThe stated reason
1Never regularise negative responses"Since an incorrect response may fail for many different reasons, penalizing its length can prematurely suppress potentially useful exploration and consequently degrade model performance"
2Activate only when the pass rate on that query is high enough"This design allows the model to freely explore difficult queries and encourages concise reasoning only after it has largely mastered them"

Formally, let Pq = { i : Âi > 0 } be the positive set, Equation (14). Then, Equation (15):

Ãi = [ ∑j ∈ P Âj ] / [ ∑j ∈ P wj Âj + ε ] · wi Âi  if i ∈ Pq and |Pq| ≥ τG;   otherwise Ãi = Âi    (15)

with the length weight, Equations (16) and (17):

wi = α + (1 − α) · ( 1 − (Li − L+min) / (L+max − L+min + ε) )γ,   i ∈ Pq    (16)
L+min = minj ∈ P Lj,   L+max = maxj ∈ P Lj    (17)

Three things to notice before computing anything. The min and max are taken over the positive set only, so length is scored relative to the other successful answers, not to failures. α is "the minimum weight assigned to long responses" — a floor, so the longest correct answer is down-weighted but never zeroed. And γ "controls the shape of the length-dependent decay," so you can make the penalty gentle near the short end and steep near the long end, or the reverse.

The big fraction in front is a normaliser, and it is the whole safety argument. Read it as: multiply everything by whatever constant restores the original total.

Worked example 16: the full length reweighting, verified

Continue Worked Example 14. Six positives with  = 2/7 = 0.285714 each, two negatives at −0.857143. Their reasoning lengths, in tokens:

L = (900, 1200, 1500, 2400, 3000, 5000)

Activation check. |Pq| = 6, G = 8. With an illustrative τ = 0.5 the threshold is τG = 4, and 6 ≥ 4, so regularisation fires. (Had only three of eight been correct, nothing below would happen at all.)

Compute the weights. L+min = 900, L+max = 5000, so the span is 4100. Take α = 0.2 and γ = 1 (illustrative — the paper does not publish them):

Li(Li−900)/41001 − thatwi = 0.2 + 0.8(·)
9000/4100 = 0.000001.000000.2 + 0.80000 = 1.00000
1200300/4100 = 0.073170.926830.2 + 0.74146 = 0.94146
1500600/4100 = 0.146340.853660.2 + 0.68293 = 0.88293
24001500/4100 = 0.365850.634150.2 + 0.50732 = 0.70732
30002100/4100 = 0.512200.487800.2 + 0.39024 = 0.59024
50004100/4100 = 1.000000.000000.2 + 0.00000 = 0.20000

Compute the normaliser. The weights sum to 1.00000 + 0.94146 + 0.88293 + 0.70732 + 0.59024 + 0.20000 = 4.32195. Since every Âj is the same 0.285714 here, both sums factor:

j∈P Âj = 6 × 0.285714 = 1.714286
j∈P wj Âj = 0.285714 × 4.32195 = 1.234843
normaliser = 1.714286 / 1.234843 = 1.388263

Apply it. Ãi = 1.388263 × wi × 0.285714:

LiwiÂi beforeÃi afterChange
9001.00000+0.285714+0.396647×1.39
12000.94146+0.285714+0.373432×1.31
15000.88293+0.285714+0.350217×1.23
24000.70732+0.285714+0.280572×0.98
30000.59024+0.285714+0.234142×0.82
50000.20000+0.285714+0.079329×0.28
sum of positives1.714339vs 1.714286 before

The sum came back to 1.714339 against an original 1.714286 — a discrepancy of 0.000053, entirely from rounding the weights to five decimals. That is the invariant the paper describes: "The normalization term approximately preserves the total positive advantage mass, thereby changing the relative preference among successful responses without substantially altering the overall optimization scale."

Why the invariant is the point. Without the normaliser, multiplying every positive advantage by a weight in [0.2, 1.0] would shrink the total positive signal — and since the negatives are untouched, you would have silently changed the balance between "reward success" and "punish failure" across the whole run, differently on every query, depending on how spread out its lengths happened to be. The normaliser turns a global change of scale into a pure reallocation: the same total credit, distributed toward the concise answers. The 900-token answer went from +0.2857 to +0.3966, and the 5000-token answer paid for it, going to +0.0793. Nothing else moved.

And the reported result of the whole mechanism, from the Intern-S2-Preview-35B ablation in Figure 8: "Both settings achieve comparable reward curves, while adaptive length regularization substantially reduces the average output length." Same accuracy, shorter answers — which is the only version of this result worth having, because a length penalty that costs accuracy is just a worse model.

The advantage pipeline, stage by stage

Eight rollouts on one query. Each bar is a response: height is its advantage, width encodes its reasoning length. Toggle the three stages on and off and watch the bars move. The running totals under the chart check the two invariants — LOO advantages sum to zero, and the length stage preserves the positive mass. Push the pass rate below the activation threshold and stage 3 switches itself off, exactly as Equation (15) says it should.

Correct of 8 6
α (length floor) 0.20
γ (decay shape) 1.0

Composing the three, and the order that matters

Equation (28) states the composition:

Ãi = Rlen( RGEPO( ALOOi ) )    (28)

GEPO first, length second. The paper gives the reason for that order in one line: "This ordering ensures that the length-dependent weights act on the final entropy-adjusted advantages rather than modifying the verifier rewards." Since the length stage's normaliser is computed from the advantages it is rescaling, running it after GEPO means it preserves the post-GEPO mass — the thing that will actually be used — rather than a quantity GEPO is about to change.

The full objective, term by term

Everything from Chapters 4 and 5 arrives in Equation (29):

LRL(θ) = − E(q, {yi}) ∼ B [ (1/G) ∑i (1/|yi|) ∑t mBKLi,t · sg[ ρ̄i,t(θ) ] · Ãi · log πθ(yi,t | si,t) ]    (29)
FactorWhat it isWhich problem it solves
1/GAverage over the groupA query with more rollouts should not dominate
1/|yi|Average over the response's tokensA 60,000-token response should not outweigh a 600-token one by a factor of 100
mBKLi,tThe 0/1 numerical-consistency mask, Equation (13)Deletes tokens where the two engines disagree beyond φ
sg[ρ̄i,t]Detached clipped importance weight, Equation (11)Corrects for pause-and-resume staleness with bounded variance
ÃiThe shaped, sequence-level advantage"The sequence-level advantage Ãi is shared by all policy-generated tokens in response yi"
log πθThe only factor carrying gradientThis is plain REINFORCE underneath all the machinery
Strip it back and it is one line of undergraduate RL. Everything except log πθ is a coefficient. The gradient is ∇θ L = −E[ ci,tθ log πθ(yi,t) ] with ci,t = m · ρ̄ · Ãi / (G|yi|), a plain number. The entire chapter, and half of the last one, is the story of how that one number gets computed correctly at 397 billion parameters. That is what a systems paper is.

The training configuration, in full

SettingValueWhat it implies
OptimizerMuonA matrix-aware optimizer that orthogonalises the update direction rather than rescaling coordinate-wise like Adam. Increasingly the default for very large training runs
Learning rate1 × 10−6Small. RL on a post-SFT checkpoint is a nudge, not a re-training
Weight decay0.01
Rollout batch8,192 completed responsesNote "completed" — paused trajectories do not count toward it
Mini-batch updates per batch8So 1,024 responses per gradient step, and the later steps are already off-policy with respect to the batch — which is the second reason Equation (11) exists
Maximum generation length65,536 tokensThe straggler ceiling from Chapter 4

Where log π comes from, derived once so it never mystifies again

Equation (29) is REINFORCE, and REINFORCE is one line of calculus that is worth deriving because every term in this chapter is a modification of it.

You want to maximise the expected reward of your policy: J(θ) = Ey ∼ πθ[R(y)]. Write the expectation as a sum and differentiate:

θ J = ∇θy πθ(y) R(y) = ∑y R(y) ∇θ πθ(y)

That is not yet an expectation — you cannot sample it. Multiply and divide by πθ(y), which is legal wherever the probability is nonzero:

θ J = ∑y πθ(y) · R(y) · [ ∇θ πθ(y) / πθ(y) ] = Ey ∼ πθ[ R(y) ∇θ log πθ(y) ]

using ∇ log f = ∇f / f. That is the whole trick, and it is why every policy-gradient objective you will ever read has a log-probability in it: the log is what turns a derivative of a probability into something you can estimate by sampling.

Now re-read Equation (29) with that in hand. R(y) has become Ãi — the reward, baselined and reshaped. Two extra scalars, mBKL and sg[ρ̄], have been multiplied in to repair the fact that the sample did not come from πθ. The two 1/n factors are averaging conventions. And ∇θ log πθ is untouched, exactly as derived above. Everything this paper does to reinforcement learning is a modification of the coefficient; nobody touched the estimator.

And now the baseline is easy to justify. Adding any constant b that does not depend on y leaves the gradient unbiased, because E[∇ log π] = ∇ ∑y π(y) = ∇1 = 0. So R(y) − b has the same expected gradient as R(y), with a variance you can choose b to minimise. The leave-one-out mean is a b that is nearly optimal and, critically, independent of the sample it corrects.

The pipeline as code

advantage shaping# From a group of verifier rewards to the scalar that multiplies log pi.

def shape(R, lengths, group_entropy, H_lo, H_hi, tau=0.5, alpha=0.2, gamma=1.0):
    G = len(R)
    if all_equal(R): return None                    # DAPO: resample this group entirely

    # --- 1. leave-one-out baseline, Eq (27) ---
    tot = sum(R)
    A = [(r - (tot - r) / (G - 1)) for r in R]      # sums to exactly zero

    # --- 2. GEPO, Eq (25)-(26): entropy-regime rebalancing ---
    if group_entropy < H_lo:
        A = [a_lo * a if a > 0 else a for a in A]  # damp exploitation
    elif group_entropy > H_hi:
        A = [a_hi * a if a < 0 else a for a in A]  # protect exploration

    # --- 3. adaptive length regularisation, Eq (14)-(17) ---
    P = [i for i in range(G) if A[i] > 0]
    if len(P) >= tau * G and P:
        lo, hi = min(lengths[i] for i in P), max(lengths[i] for i in P)
        w = {i: alpha + (1 - alpha) * (1 - (lengths[i] - lo) / (hi - lo + 1e-9)) ** gamma
             for i in P}
        norm = sum(A[i] for i in P) / (sum(w[i] * A[i] for i in P) + 1e-9)
        for i in P: A[i] = norm * w[i] * A[i]      # mass preserved, order changed

    return A                                        # one scalar per RESPONSE, shared by its tokens

Note the guard on the length stage: if len(P) >= tau * G and P. When the model is failing most of the time on a query, the branch never runs and every advantage passes through unchanged. Difficulty gates concision, automatically, per query, with no schedule.

Worked example 17: what γ actually does to the curve

α sets the floor and γ sets the shape. Take α = 0.2 and vary γ over the normalised length r = (L − L+min) / (L+max − L+min), so w = 0.2 + 0.8(1 − r)γ:

rγ = 0.5 (concave)γ = 1 (linear)γ = 2 (convex)γ = 3
0.001.00001.00001.00001.0000
0.250.89280.80000.65000.5375
0.500.76570.60000.40000.3000
0.750.60000.40000.25000.2125
1.000.20000.20000.20000.2000

Check one cell by hand at r = 0.5, γ = 2: (1 − 0.5)2 = 0.25, so w = 0.2 + 0.8(0.25) = 0.2 + 0.2 = 0.4000. ✓ And at γ = 0.5: (0.5)0.5 = 0.70711, so w = 0.2 + 0.8(0.70711) = 0.2 + 0.56569 = 0.76569. ✓

Read the columns as policies. γ < 1 is forgiving in the middle and punishes only the extreme tail — "I do not mind moderately long answers, but the very longest should not be the template." γ > 1 falls away immediately — "I want the shortest one, and everything else is roughly equivalent." Since the normaliser restores the total either way, γ controls purely who gets the credit, not how much there is.

The Muon line, and why the optimizer is worth a sentence

"We use the Muon optimizer with a learning rate of 1 × 10−6 and a weight decay of 0.01." One line, easy to skip. But Adam and Muon differ in a way that matters at this scale.

Adam-familyMuon
Treats a weight matrix asA bag of independent scalarsA matrix, with structure
What it normalisesEach coordinate, by its own running second momentThe update matrix's spectrum — roughly, it orthogonalises the update
ConsequenceA few directions can dominate the stepThe step spreads its energy across directions more evenly
Extra stateTwo moments per parameterMomentum plus a short iterative orthogonalisation per step

For RL on a post-SFT checkpoint, "spread the update evenly across directions" is exactly the property you want: you are making a small correction to a model that is already good, and you would rather not let a handful of coordinates take the whole step. Combined with a learning rate of 1 × 10−6 — two to three orders of magnitude below a typical pre-training rate — the message of the configuration line is consistent: this stage is a nudge.

In the adaptive length regularisation of Equation (15), what does the leading fraction — the ratio of the sum of positive advantages to the sum of weighted positive advantages — accomplish?

Chapter 6: Harness × Task — Making an Agent Trainable

Everything so far trains on a response: one prompt in, one long generation out, one verifier score. But the whole premise of Chapter 0 was that scientific work is a loop. So how do you run reinforcement learning when the episode is not a paragraph but a forty-minute session in which the model opens files, runs a test suite, reads a stack trace, edits three files, and runs the suite again?

The paper's answer is not an algorithm. It is an abstraction and a lot of infrastructure. And the abstraction is worth the chapter, because it is genuinely reusable.

The two things that were tangled

Before this framework, an agentic RL setup was usually one bespoke pipeline per combination: this agent scaffold running these tasks. Change the scaffold and you rewrote the rollout code; change the task source and you rewrote the verification code. The paper's move is to name the two axes and cut between them:

HarnessTask
Definition, from the paper"specifies how an agent is instantiated, driven, and observed""specifies the initial environment, executable objective, and verifier-defined outcome"
ConcretelyThe control loop, the prompt scaffolding, the tool protocol, when it stops. OpenClaw, Claude Code, OpenCode, OpenHands, Mini-SWE, or your own loopA container or repository at a known state, an instruction in English, and a program that returns solved / not solved
What varying it changes"a harness determines the interaction policy and context construction""the task determines the environment and reward semantics"

Their composition, in the paper's words, "converts heterogeneous agent executions into a common form of RL experience: an interactive rollout with an explicit environment, an observable action–observation history, and automatic outcome signals."

Why this is a product decision, not just tidiness. If harnesses and tasks are independent, then H harnesses × T task families gives you H·T training configurations for H + T units of engineering work. If they are tangled, you need H·T units of work. The paper says it plainly: "Adding a new harness therefore requires a thin integration adapter rather than a new RL execution stack." That is the difference between supporting five agent frameworks and supporting one.

White box and black box

The harness axis splits in two, and the black-box half is the ambitious part.

White-box harnessBlack-box harness
What you haveThe control loop's source; you can orchestrate it directlyA shipped agent runtime with its own CLI, SDK, or model API. You do not get to reach inside
Named examplesThe lab's own loopsOpenClaw, Claude Code, OpenCode, OpenHands, Mini-SWE
What the framework doesDrives itLets it "retain their native messages, tool loops, and control flow" and wraps it with an adapter that "translate[s] session lifecycle events, model calls, and interaction artifacts"

Read that last cell again. The claim is that Intern-S2-Preview was trained with reinforcement learning inside real, third-party agent runtimes, unmodified. The agent framework thinks it is calling an ordinary model API. It is actually generating RL rollouts.

Which forces a specific engineering problem: those frameworks speak different protocols. The serving layer therefore accepts OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages, streaming or not, and relays "streamed text, reasoning, and tool-call events … to the harness in their native form." From the client's side, in the paper's phrase, "this remains an ordinary model service."

Token-in, token-out — the detail that makes it trainable

Here is the problem that would kill this if it were not solved. To compute a policy gradient you need the exact token IDs the policy emitted and the exact log-probabilities it assigned. But a black-box harness gives you back a string. Re-tokenising that string is not guaranteed to reproduce the original token sequence — tokenisers are not injective over rendering round-trips, and one merged or split token silently corrupts your gradient.

So the serving layer "transparently captures training-only evidence, including exact input and output token IDs, rollout log probabilities, and token-wise MoE router experts, without exposing these extensions to the agent's control logic." The paper names the interface token-in–token-out (TITO):

The Session Server keeps the tokenised prefix
"reuses the exact tokenized prefix already recorded for the session, tokenizes only newly appended context, and sends the resulting token IDs directly to the inference engine"
The returned tokens are captured at the source
"The returned tokens and policy statistics are captured from the same response stream delivered to the agent" — not reconstructed afterwards
R3 records the computation path too
"For sparse MoE models, Rollout Router Replay (R3) additionally records the rollout-time expert choices for reuse during training"

The summary sentence is precise and worth memorising: "TITO therefore preserves the sampled token sequence, while R3 preserves the conditional computation path that produced it." Two different kinds of fidelity, both required, and the second one only exists because the model is a mixture of experts. This is the same R3 from Chapter 4, doing the same job in a harder setting.

Three protocols, one service

The protocol list in §4.4.1 is short and its implications are not. "Our LLM serving layer accepts OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages, and supports both regular and streaming generation."

ProtocolWhat a harness expecting it assumesWhat the gateway must therefore normalise
OpenAI Chat CompletionsA messages array with roles; tool calls as a structured field on the assistant messageRole rendering into the model's chat template; tool-call serialisation
OpenAI ResponsesA different item-based shape, with reasoning and tool items as first-class entriesThe same underlying turn, re-rendered into a different envelope
Anthropic MessagesIts own content-block structure, including separate thinking and tool-use blocksAgain the same turn, again a different envelope — and streaming events with different names

The trap hiding in that table is that each envelope implies a different string, and therefore a different token sequence, for what is semantically the same conversation. Which is exactly why the next section's TITO design matters: if the gateway rendered a response into a protocol envelope and the trainer later re-tokenised that envelope, the token sequence it recovered would depend on which harness happened to be connected. The tokens are captured before the envelope is applied.

The design rule underneath. Adapt at the edges, and keep one canonical representation in the middle. The gateway speaks three dialects outward; the Trace Store knows only token IDs, labels, log-probabilities, and router experts. Adding a fourth protocol touches the edge and nothing else. This is the same instinct as harness × task itself, applied one layer down.

Two views of one interaction, kept deliberately apart

A rollout produces two completely different kinds of record, and the design's cleverness is refusing to merge them.

The semantic viewThe execution view
Produced byThe Agent Runner and Judger AdaptersLLM Serving
Contents"the action–observation trajectory, outcome reward, process annotations, and session metadata""token IDs, loss labels, behavior log probabilities, and router experts"
Stored inThe Replay BufferThe Rollout Trace Store
Who reads itAnything that reasons about what the agent didOnly the trainer

The stated benefit: keeping the views separate "decouples environment-facing logic from model-specific training representations while retaining a lossless path from an agent action to the policy tokens that generated it." You can change the tokeniser without touching the environment code, and change the environment without touching the trainer.

The PrefixTree: storing a branching session without storing it twice

Now the data structure, which is the most quietly elegant thing in the paper.

An agentic session is a growing context. Turn 1 is the system prompt plus the task. Turn 2 is all of that, plus the assistant's first response, plus a tool result. Turn 3 is all of that, plus more. Store each model call as an independent record and you store the system prompt once per call — and if you sample several rollouts from the same task, you store the shared history once per rollout too. At 256K-token sessions this is ruinous.

So: "The Trace Store organizes each session as an incremental PrefixTree. Each node represents a newly appended context delta or assistant response and stores its token IDs, labels, rollout log probabilities, and router experts. Longest-prefix matching reuses the stable history of a session and appends only newly observed segments."

What longest-prefix matching buys you. Every node is stored exactly once and shared by every path through it. A branch point — two rollouts that agreed for 40,000 tokens and then diverged — costs you one copy of the shared 40,000 tokens plus the two tails. When a trajectory is chosen for training, "the store materializes the corresponding root-to-leaf path," reconstructing the full sequence on demand. Storage proportional to the union of what was generated, not to the sum over rollouts of their full contexts.

And the tree carries the loss mask with it, which is the second thing it is for: "System instructions, user messages, and tool observations are masked from the loss, while eligible policy-generated segments retain their training labels."

That masking is not optional bookkeeping. Consider what happens without it. A tool observation is text the model did not write — it is a compiler error, a directory listing, a JSON blob. Train on it and you are doing maximum-likelihood on your own environment's output format, teaching the policy to hallucinate plausible-looking tracebacks. The mask is the line between "the model's actions" and "the world's replies," and the PrefixTree is where that line is recorded.

The third job the tree does is the subtle one: "the PrefixTree preserves the lineage and exact boundaries of model calls across multi-turn and branching interactions. It thus establishes a stable correspondence between a semantic agent action and its rollout-time token span." That correspondence — "this tool call, in the transcript" maps to "these 340 token positions, in the trace" — is what makes Chapter 7's per-message credit assignment possible at all.

Where the tasks come from

An agent RL framework with no tasks trains nothing. The task distribution comes from two sources with very different characters.

Source 1 — curated executable coding and terminal tasks. Table 1 of the paper, in full:

ProviderCollectionTasksEnvironmentsTasks per environment
SWE-benchSWE-smith59,136222266.4
SWE-GymSWE-Gym2,4382,4011.02
R2E-GymR2E-Gym-V17,4808,1010.92
NebiusSWE-rebench-V232,10032,0751.00
AweAI-TeamScale-SWE20,20019,4721.04
NVIDIANemotron-Terminal-Synthetic-Tasks80,000810,000.0
RUC-AIBOXClawGym-Task13,500113,500.0
Total214,85462,2803.45

Worked example 18: what the tasks-per-environment column is telling you

First verify the totals. Tasks: 59,136 + 2,438 = 61,574; + 7,480 = 69,054; + 32,100 = 101,154; + 20,200 = 121,354; + 80,000 = 201,354; + 13,500 = 214,854. Environments: 222 + 2,401 = 2,623; + 8,101 = 10,724; + 32,075 = 42,799; + 19,472 = 62,271; + 8 = 62,279; + 1 = 62,280. Overall ratio 214,854 / 62,280 = 3.45.

Now the interesting part. That 3.45 average is a lie in the way averages usually are, because the column is wildly bimodal:

GroupTasksShare of tasksEnvironmentsShare of environments
The five SWE-family sources121,35456.5%62,27199.99%
Nemotron-Terminal + ClawGym93,50043.5%90.014%

Check: 121,354 + 93,500 = 214,854 ✓, and 62,271 + 9 = 62,280 ✓. So 43.5% of all training tasks live inside nine environments. Those two collections are procedural terminal and workspace tasks — many different objectives inside a small number of containers. The SWE family is the mirror image: one repository snapshot per issue, so nearly one environment per task, which is exactly what "mine real-world GitHub issues, pull requests, and repository histories" produces.

Two very different kinds of diversity, and you need both. Environment diversity teaches an agent to cope with an unfamiliar codebase: unknown build system, unknown layout, unknown conventions. Task diversity within a fixed environment teaches it to cope with an unfamiliar goal: the same shell, a thousand different things to accomplish. A curriculum with only the first produces an agent that orients well and does not know what to do; only the second produces an agent that is fluent in one machine. The 56.5% / 43.5% split is a deliberate hedge across the two axes, and the tasks-per-environment column is the only place in the paper where you can see it.

Whatever the source, everything is normalised into the same contract — "an initialized execution environment, a natural-language objective, and an automatic verifier" — by "materializing its base repository or container and required assets as the initial environment, translating its issue statement or instruction into the task objective, and retaining its tests or reward programs as the verifier."

And one line about what this normalisation deliberately does not do: "these tasks remain grounded in live environments rather than being reduced to static instruction–response pairs, so their rewards reflect program behavior, repository state, and task-specific execution outcomes." The reward is what the computer did, not what a judge thought about a transcript.

Source 2 — the self-evolving task synthesiser

Curated coding tasks teach coding. For "broader agentic coverage" the paper builds a closed loop that manufactures its own tasks out of community-contributed skills — documents that "describe concrete user workflows and their required tools and dependencies."

1 — filter the seeds
Drop "infeasible, unsafe, low-quality, or redundant candidates, including workflows involving unavailable authentication, external transactions, or toxic content," then resample to balance domains so no one domain dominates
2 — build a skill-state graph
Nodes are "observable environment states"; edges are "state-transforming capabilities extracted from skills." Two skills compose only when their input and output states are compatible
3 — sample paths of varying length
A path through the graph is a capability sequence. Longer path, longer horizon. This is where task difficulty comes from — it is a graph parameter, not a prompt
4 — synthesise environment, task, verifier — each validated
"Every stage is paired with an executable validator." Rule-based checks for "structural correctness, dependency resolution, and executability"; rubric-based checks for "semantic quality and cross-stage consistency." Failures trigger stage-local repair or regeneration
5 — run, curate, and feed back
Validated tasks go into online RL and are also rolled out for offline data. Execution failures are aggregated "by skill domain and synthesis stage" and used to "update skill sampling weights as well as synthesis skills, environment templates, and stage-specific prompts"
The skill-state graph is the load-bearing idea. Naively composing skills gives you nonsense: "resize the image, then git-bisect the repository." Typing the composition by state — each skill declares what must be true before it runs and what is true afterwards — means only physically coherent chains get sampled. This is exactly classical AI planning's precondition/effect model, applied not to solve a problem but to generate problems that are solvable by construction. And because path length is a free parameter, you get a difficulty dial with no human in the loop.

Step-level curation: keeping bad steps in the context, out of the loss

One more mechanism, and it is a nice one. When synthesised tasks are rolled out to build offline training data, trajectories that pass outcome filtering still get step-level curation. Each interaction step is annotated by behaviour type — the paper's list is worth reading in full, because it is a taxonomy of how agents fail:

Annotated behaviourWhat it looks like in a transcript
Normal progressThe agent did a sensible next thing
Tool-use errorsWrong tool name, malformed arguments, a call that could never have worked
Repetitive failed attemptsThe same failing command three times in a row
Invalid recoveryA response to an error that does not address the error
Premature terminationDeclaring victory before the objective was met
Protocol violationsBreaking the harness's message or tool contract
Unsupported assumptionsActing on a fact nothing in the session established
Hallucinated observationsReferring to output the environment never produced — the worst one

And then the treatment: "Erroneous steps remain in the interaction context but can be marked as skip and excluded from the imitation loss, while the remaining responses serve as optimization targets."

That sentence contains a real insight. You cannot simply delete a bad step, because the steps after it were caused by it — the recovery only makes sense given the error. Delete the error and the recovery becomes an unmotivated non-sequitur, and you have taught the model to produce recoveries out of nowhere. Keeping the step in context and excluding it from the loss says: this happened, condition on it, but do not become it. The paper's own summary: "This selective masking avoids imitating flawed intermediate behavior without destroying the causal context of later actions."

The contract, as code

An abstraction is only real if you can write its interface down. Here is harness × task, with the two halves that never touch each other.

harness x task# A TASK knows nothing about agents. A HARNESS knows nothing about tasks.

class Task:
    def setup(self) -> Env:  ...      # materialise repo/container + assets
    objective: str                     # the instruction, in English
    def verify(self, env) -> Reward: ... # run tests / reward program AFTER the agent stops

class Harness:
    def run(self, objective, env, model_url): ...  # its OWN loop, prompts, tools, stop rule


def rollout(harness, task):
    env = task.setup()
    session = trace_store.new_session()             # a PrefixTree root

    # the harness thinks model_url is an ordinary OpenAI/Anthropic endpoint
    harness.run(task.objective, env, model_url=gateway.url(session))

    reward = task.verify(env)                       # executed, not judged
    notes  = process_annotator.scan(session)        # deterministic error detection
    return replay_buffer.add(session, reward, notes)


# what the gateway captures WITHOUT the harness ever knowing (TITO)
def on_model_call(session, new_context):
    prefix_ids = session.tokenised_prefix                # reused, never re-tokenised
    new_ids    = tokenize(new_context)                 # only the delta
    out        = engine.generate(prefix_ids + new_ids)
    trace_store.append(session,
        token_ids = out.ids,           labels  = "trainable",
        logprobs  = out.logprobs,      experts = out.router_experts)  # R3
    return render_native(out, protocol=session.protocol)   # chat / responses / messages

Everything the trainer needs is captured in on_model_call, and nothing in Harness.run knows it happened. That is the whole black-box story in one function.

Worked example 19: what the PrefixTree saves on one task

Take a single task rolled out G = 8 times, as a group-relative method requires. Each session is a 10-turn interaction; suppose the shared system prompt plus task statement is 3,000 tokens, and each turn adds an average of 1,200 tokens of assistant response plus tool observation. Assume the eight rollouts agree for the first two turns and then diverge (a plausible pattern — the opening moves of a task are nearly forced).

Naive storage: one flat context per model call. Turn t of one session contains the whole history, so its stored length is 3,000 + 1,200t. Across 10 turns, one session stores:

t=110 (3,000 + 1,200t) = 30,000 + 1,200 · 55 = 30,000 + 66,000 = 96,000 tokens

Eight sessions: 768,000 tokens.

PrefixTree storage: each node once. The shared trunk is the 3,000-token header plus two shared turns, so 3,000 + 2,400 = 5,400 tokens, stored once. Each of the eight sessions then contributes eight divergent turns of 1,200 tokens: 8 × 1,200 = 9,600 tokens each. Total:

5,400 + 8 × 9,600 = 5,400 + 76,800 = 82,200 tokens
768,000 / 82,200 = 9.3× less storage

Two separate effects are stacked in that number, and it is worth separating them. Most of the saving is that a node is stored once rather than once per turn that contains it — that is the incremental-delta property, and it applies even to a single session with no branching (96,000 tokens flat versus 15,000 as deltas, a 6.4× saving). The rest is prefix sharing across the eight rollouts of the trunk. As the paper puts it: "Longest-prefix matching reuses the stable history of a session and appends only newly observed segments."

And the storage is not the main point. The tree is what makes the loss mask and the credit map possible. When training selects a trajectory, "the store materializes the corresponding root-to-leaf path," and each node already carries its label — trainable or masked — its rollout log-probabilities, and its router experts. The mask, the weights, and the token IDs travel together, so there is no separate alignment step that could drift out of sync.

Worked example 20: what black-box support is worth

Suppose you support 5 harnesses and 4 task families. Count the integration work under each design.

DesignUnits of workArithmeticAdding a 6th harness costs
Bespoke pipeline per pairing205 × 44 more pipelines
Harness × task with adapters95 + 41 thin adapter

Twenty against nine is a 2.2× saving today; the ratio grows as H·T against H + T. But the marginal number is the one that actually decides whether a research group can move: adding a harness costs one adapter instead of four pipelines, which is the difference between "we will support the new agent framework next quarter" and "someone can do it this afternoon."

And there is a second-order benefit the paper gestures at in its evaluation. Because the training framework can drive real harnesses, the evaluation can too — and it does: SkillsBench on OpenClaw 2026.5.7, Terminal-Bench on Terminus 2, SWE-Bench Pro and Multilingual on Mini-SWE-Agent, ResearchClawBench on ResearchHarness v0.0.49. Train and test on the same class of artefact, and the distribution shift between the two shrinks to the difference between task sets rather than the difference between a synthetic loop and a real one.

The caveat that comes attached. If a model is trained inside particular harnesses and evaluated inside particular harnesses, some of its measured skill is harness-specific — knowing this scaffold's prompt conventions, its tool-call format, its recovery idioms. The paper is careful about the symmetric version of this point in Chapter 7 ("a harness determines the interaction policy and context construction"), and it is worth carrying: an agentic benchmark number describes a model-and-harness pair. Swap the harness and you are measuring something else.

What each piece of the infrastructure is for

§4.4.1 names half a dozen components. Sorted by the problem each one exists to solve:

ComponentProblem it solvesWhat breaks without it
Agent Rollout RunnerProvisions the environment and manages the interaction "until normal completion or a termination condition"Sessions run forever, or leak containers
Shared Sandbox ProviderAbstracts "environment creation, command and tool execution, isolation, error handling, and resource cleanup across local, remote, and custom backends"Every task source needs its own execution plumbing
Agent Gateway & AdaptersA stable interface over white-box, black-box, and custom harnessesEach harness needs its own RL execution stack
LLM Serving (TITO)Speaks three protocols outward, captures token-level evidence inwardYou cannot compute a gradient from a black-box session
Judger AdaptersOutcome verification and process annotation "against the same session state and execution artifacts"Verification drifts from what actually ran
Replay BufferHolds the semantic viewNothing can reason about what the agent did
Rollout Trace StoreHolds the execution view as a PrefixTreeNo lossless path from an action back to its tokens
Experience assemblyJoins the two views "by session and segment, computes advantages, and exports model-ready experiences"The two views exist and cannot be combined

Notice that six of those eight are not machine learning at all. They are process isolation, protocol adaptation, resource lifecycle, and storage. The paper's own framing of why this is the contribution: the composition "converts heterogeneous agent executions into a common form of RL experience."

The self-evolving loop, and the word "closed"

One last thing about §4.4.2 worth drawing out. Most synthetic-data pipelines are open loops: generate, filter, train, ship. This one closes:

skills → graph → paths → task bundles → rollouts → failure statistics → updated sampling weights and templates → skills

"We aggregate execution failures and verifier feedback by skill domain and synthesis stage, and use these statistics to update skill sampling weights as well as synthesis skills, environment templates, and stage-specific prompts. The revised system then resamples capability paths and generates the next task distribution, progressively improving executability, coverage, and difficulty from observed agent behavior."

Read "by synthesis stage" carefully — it is the diagnostic that makes the loop actionable. A failure statistic aggregated only by domain tells you "chemistry tasks fail a lot," which is not a fix. Aggregated by stage, it tells you whether the environment failed to build, the objective was ambiguous, or the verifier was wrong — three completely different repairs, in three different templates. Instrumenting a generative pipeline by the stage that produced each artefact is what turns "our synthetic data is bad" into a bug report.
Why does the serving layer implement a token-in–token-out interface instead of re-tokenising the strings a black-box harness returns?

Chapter 7: Credit and Integrity

You have a session. It has eleven assistant messages, nine tool results, and one number at the end: solved. Now answer two questions that decide whether the training works.

First: which tokens get the credit? The session succeeded, but message four called a tool that does not exist, and messages five and six were spent recovering from that. Reward everything equally and you have just taught the model that inventing tool names is part of a winning strategy.

Second: is the reward even real? The verifier ran a test suite. The agent had write access to the repository. What stopped it from editing the tests?

§4.4.3 answers both, in that order.

Session-aware outcome credit: one reward, many segments

Start with the base case. An agentic session "may contain multiple assistant responses separated by system instructions, user messages, tool calls, and environment observations. Nevertheless, these segments jointly solve one task and receive one final outcome reward."

So within a rollout group for the same task, a group-relative advantage Ai is computed from the complete-session reward — the same group-relative machinery as Chapter 5, one level up. Then: "The same session advantage is assigned to all eligible policy-generated segments in its trace, rather than treating each model call as an independently rewarded episode."

Why not treat each model call as its own episode? Because you do not have a reward for each model call. The verifier ran once, at the end, on the final state of the environment. Splitting one reward into eleven fabricated per-message rewards would require a value model or a process reward model — more machinery, more approximation error. Broadcasting the single true reward across all trainable segments is the honest option: it is unbiased about what happened and simply agnostic about when it happened. The credit-assignment problem is not solved; it is deferred to the next mechanism.

Two bookkeeping facts make this work, both from Chapter 6: "Token-level labels exclude non-policy context from the loss, while the PrefixTree preserves the exact boundaries of the trainable response segments."

Process-aware advantage control: the fix for succeeding badly

Now the interesting case. "Outcome-only credit can reinforce undesirable intermediate behavior when a session eventually succeeds despite malformed outputs, invalid or repeated tool calls, unnecessary recovery attempts, or abnormal termination."

The architecture keeps two channels strictly apart:

The outcome verifierThe process annotator
Question it answers"Is the task solved?""Was this particular message well-formed behaviour?"
What it producesThe session rewardAn adv_penalty attached to a specific assistant message
What it changesEverything downstream of Ai"These annotations do not change the session reward or the token labels"
NatureExecuted. A program ranDeterministic pattern detection, not a judgement of taste

The process weight wi,k ∈ [−1, 1] for segment k of session i enters through Equation (30):

Ãi,k,t = wi,k · Ai  if Ai > 0;    Ãi,k,t = Ai  if Ai ≤ 0    (30)

and the advantage is zero for non-trainable tokens.

Stare at the branch. The weight applies only when the advantage is positive. The paper's reason: "They are applied only to positive advantages, so the negative learning signal of failed trajectories is preserved."

Worked example 21: four segments, one session, one reward

A session succeeded and drew a group-relative advantage of Ai = +0.60. Four trainable assistant segments; the process annotator flagged two of them.

SegmentWhat it didwi,kà = w · AEffect on the gradient
k = 1Read the failing test, formed a hypothesis1.00+0.600Full positive credit
k = 2Called a tool with an invalid argument name0.000.000Contributes nothing. Not punished, not learned
k = 3Repeated the identical failing call a third time−0.50−0.300Reversed — pushed down, inside a winning session
k = 4Wrote the correct patch, tests passed1.00+0.600Full positive credit

Now run the same four segments in a session that failed, Ai = −0.60. The branch in Equation (30) means the weights are ignored entirely: every trainable segment gets −0.600, including the good ones.

That asymmetry looks unfair on segment 1 — it was a reasonable action, penalised for the company it kept. It is nonetheless the correct engineering choice, for two reasons. Reason one: if you let process weights reduce the penalty on well-formed steps inside failures, you have built an incentive to produce beautifully-formatted actions that solve nothing, and format is much easier to optimise than correctness. Reason two: outcome failure is the only signal in the entire system that is unambiguously trustworthy, because a program produced it. Weakening it with heuristic annotations trades a hard signal for a soft one.

The one-sentence division of labour, from the paper. "The outcome reward determines whether the task is solved, whereas the process weight determines whether an intermediate behavior should receive positive credit." Outcome decides sign and magnitude. Process can only ever withhold or reverse a reward, never manufacture or soften a punishment.

And note what makes Equation (30) implementable at all: it needs wi,k to be applied to the exact token span of message k. That mapping is precisely what Chapter 6's PrefixTree was built to preserve — "The PrefixTree maps each annotated message to its exact trainable token span." Without the trace store, this mechanism could not exist.

A session as a PrefixTree, and where the advantage lands

One agentic session, drawn as the tree the Trace Store keeps. Grey nodes are non-policy context — system prompt, user message, tool observations — masked out of the loss entirely. Coloured nodes are policy-generated segments. Set the session outcome, then click any assistant segment to flag it with a process weight and watch its token-level advantage change while its neighbours do not. Flip the outcome to failure and the weights stop mattering, exactly as Equation (30) specifies. Branch the session to see prefix sharing: the trunk is stored once.

Process weight 0.00
Outcome:

Outcome versus process, and why the paper keeps them separate

The split in this chapter has a name in the literature, and the paper cites it: the distinction between outcome supervision and process supervision. Outcome supervision scores the final answer; process supervision scores each intermediate step. Both have a well-known character.

Outcome supervisionProcess supervision
What it needsA verifier that runs once at the endA judgement about every step
How you get itExecute the taskHuman annotation, or a learned process reward model
ReliabilityHigh — it is a program's verdictDepends on the annotator or the model
Credit resolutionCoarse — one number for the whole sessionFine — a number per step
GameabilityLow, once the environment is sealedHigher — a learned scorer is a second thing to satisfy

The usual move in the literature is to train a process reward model and use it to shape rewards throughout the trajectory. This paper does something more conservative: it keeps outcome supervision as the only source of reward, and uses process information solely as a multiplicative gate on positive credit, computed from deterministic checks rather than a model.

Read that as a deliberate trade of resolution for trustworthiness. A process reward model would give you a signal at every step, including for steps that are subtly bad in ways no rule can express — a plausible but unproductive hypothesis, an inefficient search order. This design cannot see any of that. What it gets in exchange is that its process channel has no failure mode of its own: a rule that says "this tool name is not in the registry" cannot be wrong, and cannot be optimised against except by using a real tool name. In a system where the reward is already an attack surface, adding a second learned component to that surface is a decision worth avoiding.

Worked example 22: the group-relative advantage for a session

Where does Ai come from in an agentic setting? The same place it came from in Chapter 5, one level up: a group of rollouts of the same task, each scored by the verifier on the complete session.

Take G = 6 rollouts of one SWE task under one harness. All-correct semantics, so the reward is binary. Two of the six solved it: R = (1, 0, 0, 1, 0, 0).

∑R = 2
solved: A = 1 − (2 − 1)/5 = 1 − 0.2 = +0.800
failed: A = 0 − (2 − 0)/5 = 0 − 0.4 = −0.400

Check the sum: 2(+0.800) + 4(−0.400) = 1.600 − 1.600 = 0.000. ✓

Now note the difference from a reasoning group. On a hard task where only two of six succeed, a success is worth +0.800 and a failure only −0.400 — the rare outcome carries twice the signal. Compare with Chapter 5's group of eight where six succeeded: there, success was worth +0.286 and failure −0.857. The estimator inverts the asymmetry automatically as difficulty changes, which is exactly the behaviour you want on a task distribution spanning "resolve a one-line typo" and "implement a multi-file feature."

And then each of those six numbers is broadcast to every trainable segment in its session, modulated by the process weights of Equation (30) whenever it is positive. A successful rollout with eleven assistant messages produces eleven token spans all carrying +0.800, minus whatever the annotator withheld.

What makes a segment "eligible"

The paper says the session advantage is assigned to "all eligible policy-generated segments." That qualifier is carrying two separate filters, and it is worth pulling them apart.

FilterRemovesSet by
Provenance — did the policy write it?System instructions, user messages, tool observations, environment output, paddingThe PrefixTree's per-node label, recorded at capture time
Numerical trust — is the recorded log-probability reliable?Individual tokens where the two engines disagree beyond φThe bidirectional-KL mask from Chapter 4, applied token by token

These operate at different granularities and both are necessary. Provenance is a span property: an entire tool observation is out, regardless of its contents. Numerical trust is a token property: a single position inside an otherwise-good assistant message can be dropped while its neighbours train. A segment can therefore be fully eligible by provenance and still contribute nothing, if every one of its tokens failed the mask.

Why this composes cleanly. The two filters multiply: the effective per-token coefficient is (is-policy-token) × mBKL × wi,k × Ai, and if any factor is zero the token contributes nothing. Three independent reasons a token might be excluded — the model did not write it, the engines disagree about it, or the annotator withheld credit — expressed as three independent multiplicands rather than as nested special cases. That is what makes Equation (30) and Equation (29) the same shape.

The annotator's taxonomy, mapped to weights

§4.4.2 lists the behaviour types the step-level curation annotates, and §4.4.3 lists what process weights "can suppress or reverse." Putting the two lists side by side gives you the practical mapping — the specific values are illustrative, the categories are the paper's.

Detected behaviourWhy it is bad even when the session winsReasonable w
Parse or format errorThe harness had to recover from a malformed message. Reinforcing it teaches the model that malformed output is survivable0.0
Invalid tool name or argumentsA call that could never have worked. Zero information, one wasted turn, and it is cheap to learn to avoid0.0
Repeated or failed tool callActively harmful — this is the seed of a loop. The model must learn that repeating a failure is not a strategy−0.5
Unnecessary recovery attemptBurns context on a problem that was not there0.0
Context-, turn-, or session-limit terminationThe session ended because it ran out of room, not because it finished. Reinforcing the path that got there rewards verbosity−0.5
Premature terminationDeclaring victory early. If the outcome verifier still says solved, this was luck−0.5
Unsupported assumptionActing on a fact the session never established0.0
Hallucinated observationReferring to output the environment never produced — the model has started reading its own imagination as tool results−1.0
Normal progress1.0

Two structural notes. The weight is bounded in [−1, 1], so the most a process annotation can ever do is invert the session advantage completely — it cannot amplify it. And every one of these detections is deterministic: the paper specifies "a process annotator attaches an adv_penalty to the specific assistant message exhibiting a deterministic process error." No model judges taste here. Either the JSON parsed or it did not; either the tool name is in the registry or it is not.

Why determinism matters more than coverage. You could catch far more bad behaviour with an LLM judge scoring each message for quality. You would also have introduced a second learned model into your reward path — one the policy can learn to satisfy without satisfying you. Keeping the process channel to mechanically-checkable properties means it cannot be gamed by anything short of actually emitting well-formed actions, which is the behaviour you wanted. Narrow and unspoofable beats broad and soft.

Verifier integrity: what stops the agent cheating

This section exists because of a hard truth about executable rewards: an environment that an agent can act in is an environment an agent can corrupt. The paper names the threats — "executable environments expose the reward channel to solution leakage, test manipulation, and other forms of reward hacking" — and then lists the countermeasures. Each one is a specific attack, closed.

Attack the agent could attemptThe countermeasure, from the paper
Read the gold patch or the held-out tests from the workspace"Gold patches, held-out tests, and exact scoring test identifiers are excluded from the rollout workspace and made available only to the grading infrastructure after agent execution"
Recover the real fix from the repository's own history — git log, a branch, a remote"Repository histories are sanitized into a single baseline commit and remote references are removed"
Search the web for the issue by its identifier"Task identifiers that directly reveal upstream issues are likewise omitted from agent-facing instructions when necessary"
Edit or delete the tests so they pass"Canonical test files are restored or overlaid after the agent has stopped, and gold test patches are applied on top of the agent's source changes. Modifications to agent-visible tests therefore cannot directly alter the scoring procedure"
Fix the target bug while breaking something else"Conservative all-correct semantics for software-engineering tasks, requiring both target-fix and regression checks to pass"; where a canonical expected test-state map exists, "the observed outcomes must match it exactly"
Benefit from the harness breaking — a crashed container scored as success"Missing grading artifacts, execution failures, and unparseable verifier outputs are tracked separately from genuine task failure, preventing infrastructure errors from being interpreted as successful policy behavior"

Notice the shape of the fourth row, because it is the general pattern: the agent's edits and the grading artefacts are applied in a fixed order, with grading last. The agent may write whatever it likes to the test files; the canonical versions are overlaid afterwards. This converts a security problem ("prevent the agent from touching the tests") into a sequencing problem ("it does not matter what it touched"), which is a much easier problem and does not require sandboxing that the agent cannot reason around.

Why this section is the most important one in the post-training half. Every other mechanism in this paper is an optimisation on top of a reward. If the reward can be manufactured by the policy, all of that optimisation runs at full speed toward a hole. A reward-hacking policy does not fail loudly — it produces beautiful training curves, because it is genuinely maximising the objective you wrote. The paper's summary is the right test to apply to any RL environment you build: "these measures keep the reward tied to genuine changes in the executable task state rather than access to hidden solutions or corruption of the verifier."

And a small operational note buried in §5.1.2 that shows the same instinct applied at evaluation time: for SWE-Bench Pro, "we modified the official evaluation image to avoid agents getting ground truth from git logs." They found the leak in somebody else's benchmark image and closed it before reporting a number on it.

The credit-assignment problem this design does not solve

Be clear about the boundary. Session-aware outcome credit plus process weights gives you two things: an unbiased reward, and a way to withhold it from mechanically-bad steps. It does not give you an answer to the classic question.

The unsolved question. A session with eleven assistant messages succeeded. Which of the eleven was the one that mattered? Message four might have been a brilliant diagnostic insight and message nine a trivial edit; both receive the identical +0.60. Neither the outcome verifier nor a deterministic process annotator can tell them apart, because "this step was the key one" is not mechanically checkable.

The field's usual answers all carry costs this paper chose not to pay:

ApproachWhat it would give youThe cost
A learned value function over session statesPer-step advantagesAnother large model, trained on states that barely repeat, with its own error that the policy can exploit
A process reward modelPer-step scores including subtle qualityA second learned component in the reward path — exactly what Chapter 7's design is avoiding
Counterfactual rollouts — branch from step k and measureAn honest causal estimateMultiplies rollout cost by the number of branch points, in a system where rollout is already 82% of wall clock
Broadcast the outcome, gate on mechanicsAn unbiased signal, plus a filter on malformed behaviourCoarse credit. The paper's choice

Over many rollouts of many tasks, the coarse signal is not as bad as it sounds: a step that reliably appears in successful sessions and not in failed ones accumulates positive credit statistically, even though no single session identified it. That is the same argument that makes REINFORCE work at all, and it is why the paper can afford to leave the fine-grained question open — at the price of needing more rollouts than a per-step method would.

What the reward curves actually show

Figure 11 reports reward trajectories "across SWE, general-purpose, and terminal tasks under multiple agent harnesses," each panel "a representative example over 160 optimization steps," locally smoothed. The paper's own reading:

Task familyReported behaviour
General-purpose"improve rapidly and then stabilize for both Claude Code and OpenClaw"
SWE and terminal (longer horizon)"exhibit more harness-dependent transients, but their displayed trajectories improve or recover over the optimization window"

And then a caveat the paper writes itself, which is worth quoting because most reports do not: "These different dynamics are expected: a harness determines the interaction policy and context construction, while the task determines the environment and reward semantics. The shared upward trend is therefore evidence that the common trace, credit-assignment, and optimization stack remains effective across distinct harness–task compositions, rather than evidence that their absolute reward scales are directly comparable."

Translated: do not read these curves against each other. A reward of 0.4 on a terminal task and 0.4 on a SWE task are different quantities with different verifiers. What the figure supports is a claim about the machinery — that one training stack works across compositions — not a claim about which composition is harder.

Cross-domain bridge
Process weights are the same idea as a linter that cannot fail your build
In a well-designed CI pipeline, the test suite decides whether a change ships and the linter decides whether it is nice. A linter that can block a green build is a linter people disable; a linter with no consequence is a linter people ignore. The usual resolution — style issues shape review priority but never override the tests — is exactly Equation (30): the executable check owns the verdict, and the stylistic check can only withhold approval from something already passing. If you have designed a CI policy you have designed a credit-assignment scheme. See agent evaluation and tools and sandboxing for the environment side of this.

Credit assignment as code

session credit# One session's trace -> a per-token advantage map.

def assign(session, group_rewards, i):
    # group-relative advantage from the COMPLETE-SESSION reward
    A = group_rewards[i] - mean(group_rewards[:i] + group_rewards[i+1:])

    adv = zeros(session.n_tokens)              # default: no gradient anywhere

    for seg in session.segments:               # from the PrefixTree, in order
        if seg.label != "trainable":            # system / user / tool observations
            continue                            # stay ZERO - never imitate the environment

        w = seg.process_weight                  # in [-1, 1], from the annotator
        a = w * A if A > 0 else A            # Eq (30) - the asymmetric branch

        # the PrefixTree gives the EXACT token span for this message
        adv[seg.start:seg.end] = a

    return adv


# the process annotator never touches the reward, only the weight
def annotate(seg, history):
    if not parses(seg):                 return 0.0    # malformed output
    if seg.tool not in TOOLS:              return 0.0    # invalid tool name
    if identical_to_recent_failure(seg, history): return -0.5  # repeated failed call
    if seg.stop_reason in ("context_limit", "turn_limit"): return -0.5
    return 1.0

Two lines carry the chapter. if seg.label != "trainable": continue is the boundary between the model's actions and the world's replies. a = w * A if A > 0 else A is the asymmetry. Everything else is bookkeeping that the trace store already did.

Worked example 23: the same four segments, three outcomes

Extend the earlier example to see the full behaviour of Equation (30). Same session shape, same annotations, three different verifier verdicts, and a group whose other rollouts give A the values below.

Segment (w)Session solved,
A = +0.60
Session solved but
most siblings did too, A = +0.10
Session failed,
A = −0.60
k=1, good (w = 1.00)+0.600+0.100−0.600
k=2, bad args (w = 0.00)0.0000.000−0.600
k=3, repeated call (w = −0.50)−0.300−0.050−0.600
k=4, correct patch (w = 1.00)+0.600+0.100−0.600
Tool observations, system prompt0.0000.0000.000

Three readings. In column one, a clean win: the two good segments get full credit, the malformed call gets nothing, and the repeated call is actively pushed down inside a session that succeeded — which is the entire point of the mechanism. In column two, the same structure scaled down sixfold, because the leave-one-out baseline says this success was expected. In column three, the weights vanish and every trainable segment carries the full penalty.

And note the bottom row across all three columns: the tool observations are zero everywhere. There is no verdict under which the model is trained to reproduce its environment's output.

The failure this prevents, spelled out. Without process weights, column one would read +0.600 on all four segments. The gradient would then increase the probability of the exact token sequence that called a tool with an invalid argument name, and of the sequence that repeated a known-failing command — because both appeared inside a winning session. Do that for a few thousand steps and you have trained a policy whose strategy includes flailing, since flailing has never cost it anything. Outcome-only credit does not merely fail to discourage bad process; it actively rewards it whenever the session recovers.

All-correct semantics, worked

"We use conservative all-correct semantics for software-engineering tasks, requiring both target-fix and regression checks to pass." Make that concrete on a SWE-style task, which ships two test sets:

Test setStandard nameState before the patchRequired state after
The tests that demonstrate the bugfail-to-passFailingPassing
The rest of the suitepass-to-passPassingStill passing

Suppose a task has 3 fail-to-pass and 412 pass-to-pass tests. An agent submits a patch that fixes all 3 and breaks 1 of the 412. Under a proportional metric it scores 414/415 = 99.76%. Under all-correct semantics it scores 0.

The harsh version is the right one, and the reason is what a partial reward would teach. A gradient that rewards 99.76% is a gradient that says "breaking one unrelated test is a rounding error." Compound that over training and you have a policy with a systematic tolerance for collateral damage — which is precisely the behaviour that makes an automated code agent unusable in a real repository. Binary all-correct semantics encode the actual acceptance criterion of the job.

Why leakage is not a hypothetical

It is tempting to read the leakage-prevention list as due diligence. It is not; each item corresponds to a channel that an optimiser will find, because the optimiser is not trying to cheat — it is trying to maximise a number, and these are the cheapest paths to that number.

ChannelWhy an optimiser finds it before it finds the fix
Gold patch in the workspaceReading a file is one tool call. Understanding a bug is forty
git log containing the real commitRepository history is the first thing any competent agent inspects — for legitimate reasons
An issue identifier that can be searchedIf the model has web access, the identifier is the answer
Writable testsassert True passes every suite, and costs one edit
Infrastructure errors scored as successCrashing the container is far easier than solving the task, and a naive harness may record no failure

The last row is the subtlest and the paper closes it explicitly: "Missing grading artifacts, execution failures, and unparseable verifier outputs are tracked separately from genuine task failure, preventing infrastructure errors from being interpreted as successful policy behavior." If a broken run is silently scored as a pass, you have built a reward for breaking the runner.

Equation (30) applies the process weight wi,k only when the session advantage Ai is positive. What breaks if you also apply it to negative advantages?

Chapter 8: Two Experts, One Model

There is a problem we have been walking past. Chapters 4 and 5 built a reasoning RL pipeline. Chapters 6 and 7 built an agentic RL pipeline. They are different objectives, different reward semantics, different response lengths, different entropy regimes. What happens if you just train one model on both at once?

The paper's answer is careful: "Although mixed reinforcement learning enables a single policy to acquire broad capabilities, jointly optimizing highly heterogeneous reasoning and agentic tasks can introduce optimization conflicts and prevent the model from fully exploiting domain-specific training signals."

Note it does not say joint training fails. GEPO exists precisely to make heterogeneous joint training work, and the multi-task RL stage is joint. The claim is narrower: for two families this far apart, you get more out of specialising first.

The shape of the final stage

One SFT checkpoint
The common ancestor. This matters enormously — see below
↓ two independent RL runs ↓
Reasoning expert
Trained by the mixed reasoning RL of Chapters 4–5
Agentic expert
Trained by the black- and white-box agentic RL of Chapters 6–7
↓ lightweight SFT warmup on both teachers' trajectories ↓
The initial student
The original SFT model, warmed up so it already produces trajectories both teachers recognise
↓ on-policy distillation ↓
Intern-S2-Preview
The released unified model. One set of weights, both capabilities

Why two experts and not twenty

Multi-teacher distillation usually means many fine-grained domain specialists. The paper deliberately does not: "we organize specialization around two broad capability domains. Our preliminary evaluation suggests that independently training teachers for many fine-grained domains incurs substantial RL and infrastructure costs, while providing limited additional benefit for our setting."

Do the arithmetic that sentence implies. Each teacher is a full RL run on a 397-billion-parameter model — the partial-rollout cluster, the verifier fleet, the sandbox provider, all of it. Twenty teachers is twenty of those. And the marginal return is bounded: after the first few domains, teachers start overlapping, and a student cannot absorb more than the union of what its teachers know. Two teachers over two genuinely disjoint capability families sits at, in the paper's phrase, "a favorable balance between specialization quality, training cost, and distillation complexity."

The distribution mismatch problem, and why shared ancestry fixes it

Here is the failure mode that makes on-policy distillation hard. In on-policy distillation, the student generates the trajectories and the teacher scores them. That is the good property — the student is corrected on states it actually visits, not on a teacher's idealised transcript. But it has a precondition: the teacher must be competent at scoring what the student produced.

The paper's statement of the risk. "Since teachers are evaluated on prefixes sampled by the student, a large policy discrepancy can cause student trajectories to fall outside the reliable support of the teacher, resulting in noisy or uninformative supervision."

Think about what "outside the reliable support" means concretely. The teacher assigns a probability to the student's token given the student's prefix. If that prefix is somewhere the teacher would essentially never have gone, the teacher's distribution there is not a considered judgement — it is an extrapolation from a region it barely modelled. You are asking an expert about a situation they have never been in and treating the answer as ground truth.

Two things reduce the gap. First, structural: "both expert policies are derived from the same SFT checkpoint and therefore retain broadly compatible generation behaviors." They are siblings, not strangers. Second, procedural: a warmup borrowed from Nemotron 3 Ultra — "we use the reasoning and agentic experts to generate high-quality trajectories and perform a lightweight SFT warmup on the original SFT model," and that becomes the initial student. "This warmup exposes the student to the characteristic reasoning patterns and interaction behaviors of both teachers, increasing the overlap between student-generated trajectories and teacher-supported distributions before OPD optimization begins."

The objective, and which direction of KL it is

The idealised objective, Equation (31):

JOPD(θ) = ∑d ∈ {rea, agt} λd Eq ∼ Dd, y ∼ πθ [ ∑t=1H ( log πTd(yt | st) − log πθ(yt | st) ) ]    (31)

which the paper notes is equivalent to minimising

DKL( πθ(· | st)  ‖  πTd(· | st) )    (32)

"on states induced by the student itself."

That is the reverse KL, and the direction is the whole design. Forward KL, D(teacher ‖ student), is mass-covering: the student is punished wherever the teacher has probability and it does not, so it spreads out to cover everything the teacher might do. Reverse KL, D(student ‖ teacher), is mode-seeking: the student is punished wherever it has probability and the teacher does not, so it retreats onto behaviours the teacher endorses. For a policy you are about to deploy, mode-seeking is what you want — you would rather have one behaviour the teacher approves of than a smear across all of them. And the states are the student's own, so it is being corrected exactly where it will actually be.

The other virtue is density. Compare it to what Chapter 5 was working with: "In contrast to RL objectives based on sparse trajectory-level rewards, OPD provides dense token-level supervision from the corresponding expert throughout the generated trajectory." One scalar for a 60,000-token response, versus a teacher opinion at every single position.

Worked example 24: the communication payload, and why they cut it

To give the student a teacher opinion at every position, the teacher's opinion has to travel from a teacher-scoring worker to a learner worker. How much data is that?

Take a single trajectory at the system's maximum, H = 256K = 262,144 tokens.

Option A — full-vocabulary logits, O(HV). The paper does not publish its vocabulary size, so use a round V = 100,000 purely to feel the magnitude:

262,144 × 100,000 = 2.62 × 1010 numbers ≈ 52.4 GB per trajectory in bfloat16

Option B — top-k logits, O(Hk). The paper names top-64 as the realistic version of this:

262,144 × 64 = 16,777,216 numbers ≈ 33.6 MB per trajectory in bfloat16

Option C — the sampled token's teacher log-probability only, O(H).

262,144 numbers ≈ 0.52 MB per trajectory in bfloat16

Option C is 64× smaller than Option B and roughly 100,000× smaller than Option A. Now multiply by a batch: at 8,192 trajectories, Option B would be 33.6 MB × 8,192 ≈ 275 GB moving across the interconnect per batch. Option C is about 4.3 GB. That is the difference between a design that runs and one that spends its life in the network.

The paper's justification for why the cheap option suffices: "Since our teachers share the same SFT origin and the warmup stage further reduces their policy discrepancy with the student, we find that transmitting only the teacher log-probability of each sampled token is sufficient for stable distillation."

Notice the dependency chain. Shared SFT ancestry → small student–teacher gap → the sampled token alone is an adequate summary of the teacher's opinion → O(H) payload → distillation at 256K sequence length is affordable. Break the first link — distil from an unrelated teacher — and the last one breaks too, because now you genuinely need to know what the teacher thought about the tokens the student did not pick. Architectural decisions that look like efficiency tricks are usually load-bearing on an assumption made three sections earlier.

The practical objective: same machinery, different advantage

To reuse the partial-rollout infrastructure, OPD is written in the same clipped importance-weighted REINFORCE form as Chapter 5. Only the advantage changes, Equation (33):

ÂOPDi,t = sg[ log πTd(yi,t | si,t) − log πprox(yi,t | si,t) ]    (33)

where πprox is "the frozen proximal student policy used to construct the distillation signal." The paper's reading: "The advantage is positive when the teacher assigns a higher probability to the sampled token than the proximal student and negative otherwise, thereby increasing or decreasing the probability of the sampled action accordingly."

Worked example 25: reading the distillation advantage

Because it is a difference of logs, the advantage is exactly the log of the probability ratio: ÂOPD = ln( pT / pprox ).

SituationpteacherpproxÂOPD = ln(pT/pprox)What the update does
Teacher strongly endorses a token the student under-rates0.400.10ln 4 = +1.3863Large push up
Mild endorsement0.220.20ln 1.1 = +0.0953Small push up
Perfect agreement0.300.30ln 1 = 0.0000Nothing. No gradient at all
Teacher dislikes what the student sampled0.050.30ln(1/6) = −1.7918Strong push down
Teacher considers it nearly impossible0.0020.25ln 0.008 = −4.8283Very strong push down

Two properties worth naming. First, the advantage is self-annihilating at convergence: when the student matches the proximal policy's teacher-agreement, the advantage is zero everywhere and training halts on its own. There is no reward to keep chasing. Second, the scale is logarithmic, so a teacher that assigns 0.002 to something the student liked produces a strongly negative but finite advantage — it does not blow up the way a raw ratio pT/pprox would in the other direction.

The importance ratio and clipping are unchanged from Chapter 4, Equations (34) and (35), using "the same interval as reasoning RL":

ρOPDi,t(θ) = πθ(yi,t | si,t) / πbeh(i,t)(yi,t | si,t),   ρ̄OPD = clip( ρOPD, 1 − εISlow, 1 + εIShigh )

and the full objective is Equation (36):

LOPD(θ) = − ∑d λd EBd [ (1/Nd) ∑i (1/|Ti|) ∑t ∈ Ti mBKLi,t · sg[ρ̄OPDi,t] · ÂOPDi,t · log πθ(yi,t | si,t) ]    (36)

Compare it with Equation (29) side by side and the symmetry is exact:

ComponentReasoning RL (29)OPD (36)
Gradient carrierlog πθlog πθ — identical
Numerical maskmBKLmBKL — identical
Off-policy correctionsg[ρ̄]sg[ρ̄OPD] — identical form, same clip interval
Normalisation1/G over the group, 1/|yi| over tokens1/Nd over the domain batch, 1/|Ti| over trainable tokens
The advantageSequence-level: from verifier rewards via LOO, GEPO, length regularisation. One number per responseToken-level: the teacher–student log-probability gap. One number per token
Masked outNon-policy tokens"Non-policy tokens, including prompts, environment observations, tool outputs, and padding tokens, are excluded through Ti"

The paper says it outright: "Equation (36) has the same optimization form as the unified reasoning RL objective in Equation (29). … The only distinction is the advantage."

Why that unification is worth more than it looks. A distillation stage written in a different framework needs its own trainer, its own batching, its own off-policy handling, its own numerical-consistency story — and its own bugs. Written in the same form, it inherits partial rollout, R3 routing replay, the BKL mask, and the clipping interval for free. This is the same abstraction instinct as harness × task in Chapter 6: find the shape both things already have, and make the difference a parameter.

Worked example 26: forward versus reverse KL, on three outcomes

The direction claim in the callout above is easy to assert and worth proving to yourself once. Take a teacher that is genuinely bimodal — two acceptable continuations and one bad one — and a student restricted to a family of distributions that can only really commit to one place.

teacher pT = [ 0.45 , 0.45 , 0.10 ]

Consider two candidate students:

StudentDistributionCharacter
Scover[ 0.34 , 0.33 , 0.33 ]Spread out — covers everything the teacher might do, including the bad option
Smode[ 0.90 , 0.08 , 0.02 ]Committed to one of the teacher's two good modes

Forward KL, D(pT ‖ S) — the mass-covering direction. For Scover:

0.45 ln(0.45/0.34) + 0.45 ln(0.45/0.33) + 0.10 ln(0.10/0.33)
= 0.45(0.28030) + 0.45(0.31015) + 0.10(−1.19392) = 0.12614 + 0.13957 − 0.11939 = 0.14631

For Smode:

0.45 ln(0.45/0.90) + 0.45 ln(0.45/0.08) + 0.10 ln(0.10/0.02)
= 0.45(−0.69315) + 0.45(1.72722) + 0.10(1.60944) = −0.31192 + 0.77725 + 0.16094 = 0.62627

Forward KL prefers Scover, 0.146 against 0.626 — by a factor of 4.3. It would rather the student hedge across all three options, including the bad one, than commit to a good one.

Reverse KL, D(S ‖ pT) — the mode-seeking direction. For Scover:

0.34 ln(0.34/0.45) + 0.33 ln(0.33/0.45) + 0.33 ln(0.33/0.10)
= 0.34(−0.28030) + 0.33(−0.31015) + 0.33(1.19392) = −0.09530 − 0.10235 + 0.39399 = 0.19634

For Smode:

0.90 ln(0.90/0.45) + 0.08 ln(0.08/0.45) + 0.02 ln(0.02/0.10)
= 0.90(0.69315) + 0.08(−1.72722) + 0.02(−1.60944) = 0.62384 − 0.13818 − 0.03219 = 0.45347

Reverse KL also prefers Scover here, 0.196 against 0.453 — because Smode abandoned one of the teacher's two genuinely good modes, and reverse KL does penalise that too. So where is the mode-seeking? Look at which term dominates Scover's reverse KL: 0.33 ln(0.33/0.10) = +0.394, coming entirely from the bad option. Reverse KL punishes the student for putting mass where the teacher does not, weighted by the student's own mass there. So its gradient's loudest instruction is "get out of the third slot."

Follow that instruction and see who rewards it. Move Scover's third component from 0.33 to 0.02, redistributing onto the teacher's two good modes — call it [0.49, 0.49, 0.02]. Compute both divergences for that student:

D(pT ‖ S) = 0.45(−0.08516) + 0.45(−0.08516) + 0.10(1.60944) = −0.03832 − 0.03832 + 0.16094 = 0.08430
D(S ‖ pT) = 0.49(0.08516) + 0.49(0.08516) + 0.02(−1.60944) = 0.04173 + 0.04173 − 0.03219 = 0.05127
StudentForward KL D(pT‖S)Reverse KL D(S‖pT)
[0.34, 0.33, 0.33] — hedging0.146310.19634
[0.49, 0.49, 0.02] — on the good modes0.084300.05127
[0.90, 0.08, 0.02] — one mode only0.626270.45347

Now compare the rewards for abandoning the bad option. Reverse KL fell from 0.19634 to 0.05127 — a 74% reduction. Forward KL fell from 0.14631 to 0.08430 — only 42%. And push the third component all the way to zero and the asymmetry becomes absolute: reverse KL's 0.02 ln(0.02/0.10) term goes to 0 · ln 0 = 0, while forward KL's 0.10 ln(0.10/q) term diverges to infinity. Forward KL will not let you drop a teacher behaviour at any price. Reverse KL positively wants you to.

The takeaway for a deployed policy. Reverse KL's gradient says "get out of places the teacher would not go," and it says it loudly. Forward KL's gradient says "be able to go everywhere the teacher might," and it will actively resist you dropping a low-probability teacher behaviour. For a model that will be sampled from once, in production, on a real task, the first instruction is the right one. It is also the same direction of KL that variational inference uses, and for the same reason: you are choosing a distribution to act from, not one to average over.

Why a frozen proximal student, and not the live one

Equation (33) compares the teacher against πprox, "the frozen proximal student policy used to construct the distillation signal" — not against the current learner πθ. That distinction is worth a paragraph, because it is exactly the same instinct as the detached weight in Chapter 4.

If the advantage were sg[log πT − log πθ] with πθ live, the target would move underneath every mini-batch update: the same token would have a different advantage on mini-batch 1 and mini-batch 8 of the same rollout batch, purely because the learner had drifted. Freezing the reference at the start of the batch gives every token in that batch a fixed target, so the eight mini-batch steps are all optimising the same objective. It is a trust region built out of a snapshot rather than a constraint.

on-policy distillation stepdef opd_batch(prompts_by_domain, student, teachers, prox):
    loss = 0.0
    for d, prompts in prompts_by_domain.items():        # d in {"rea", "agt"}
        traj = student.generate(prompts)                    # ON-POLICY: the student drives
        for t in traj:
            # the teacher only ever scores the SAMPLED token -> O(H) payload
            lp_T    = teachers[d].logprob_of(t.ids, t.states)  # (H,)
            lp_prox = prox.logprob_of(t.ids, t.states)         # (H,)
            adv     = detach(lp_T - lp_prox)                   # Eq (33) = log(p_T / p_prox)

            rho = detach(clip(exp(student.logprob_of(t.ids, t.states) - t.logp_beh),
                              1 - eps_low, 1 + eps_high))       # Eq (34)-(35)

            mask = t.bkl_mask & t.is_policy_token             # drop tool output, prompts, padding
            loss -= lam[d] * (mask * rho * adv *
                              student.logprob_of(t.ids, t.states)).mean()
    return loss                                              # Eq (36) - identical shape to Eq (29)

Compare the body of that loop with the reasoning-RL objective and the only line that differs is adv. Everything else — the clipped detached ratio, the numerical mask, the policy-token mask, the mean — is reused verbatim.

The domain weights λd, and what they can go wrong

Equation (36) carries a per-domain coefficient λd that "controls the contribution of each teacher domain," and Equation (31) uses the same symbol to control "the sampling or loss weight of each domain." The paper does not publish its values, and the value it chose is the entire content of "how much of each expert survives."

If λrea ≫ λagtIf they are balancedIf λagt ≫ λrea
The student converges toward the reasoning expert. Strong on SciReasoner and HMMT; the agentic expert's long-horizon habits fadeThe student is pulled toward two different behaviours on two different prompt distributions — which is fine, because the domains are disjoint at the prompt levelStrong on Terminal-Bench and SWE-Bench; reasoning depth erodes toward whatever the agentic expert happened to retain

The middle column is the one that makes this work, and it is worth being explicit about why. "During OPD, each query is assigned to either the reasoning or agentic domain, and the corresponding expert is selected as its teacher." The two teachers are never asked about the same prompt. There is no arbitration, no averaging of two opinions about one token, and therefore no way for the teachers to actively disagree. λd is a data mixture weight, not a blend of conflicting supervision.

Contrast this with the Memory Decoder's λt, which is the opposite situation. There, two models are asked about the same token and their distributions are genuinely mixed — which is why it needed a learned, per-token router and a signed regulariser to keep it honest. Here, the routing is by prompt domain and is known in advance, so a scalar suffices. Same symbol, entirely different job: one arbitrates a conflict, the other sets a curriculum ratio. It is worth keeping them apart when reading, because the paper reuses λ three times across Chapters 2, 3, and 8.

What the student ends up with

The paper's closing claim for the stage: "The resulting student consolidates the scientific reasoning capabilities of the mixed-reasoning policy and the long-horizon interaction capabilities of the agentic policy into the unified Intern-S2-Preview model."

And this is why Chapter 9's shape is what it is. A model that had only run reasoning RL would look strong on SciReasoner and weak on Terminal-Bench; one that had only run agentic RL would look like the reverse. Intern-S2-Preview-397B is competitive on both and best-in-class on neither of the agentic leaders — which is the signature of a consolidation, and the price you pay for one set of weights instead of two.

DesignWhat you shipCost
Joint RL over everythingOne modelOptimisation conflicts between heterogeneous task families
Two experts, routed at inferenceTwo models plus a routerDouble the serving footprint; a routing decision that can be wrong
Two experts, distilled into oneOne modelAn extra training stage, plus whatever the student fails to absorb

Reading Equation (36) as a gradient

One more pass, to make the mechanism physical. Differentiate the summand with respect to θ. Only log πθ carries gradient, so for a single trainable token:

−∇θ [ m · ρ̄ · ÂOPD · log πθ(yt) ] = − m · ρ̄ · ÂOPD · ∇θ log πθ(yt)

Now read the sign. Gradient descent steps in the direction of −∇L, which here is + mρ̄ÂOPD∇ log πθ. So:

SituationÂOPDThe step does
Teacher likes the sampled token more than the proximal student did> 0Moves along +∇ log πθ(yt) — raises the probability of exactly that token in exactly that context
Teacher likes it less< 0Moves along −∇ log πθ(yt) — lowers it
They agree= 0Nothing. No step from this token
The two engines disagreed numericallymasked, m = 0Nothing. The token is not trusted enough to learn from

And the magnitude is ln(pT / pprox), so a token the teacher rates ten times higher gets a push of ln 10 = 2.303 while one it rates 1.1 times higher gets 0.095 — a 24× difference in step size from a 9× difference in opinion. The logarithm compresses the extremes, which is what keeps a single confidently-disagreeing token from dominating a batch.

What distillation cannot recover

One honest limit before the summary. On-policy distillation transfers what a teacher would say at the student's own states. That is a strong signal, and there are things it structurally cannot move.

What OPD transfers wellWhat it transfers poorly or not at all
Local next-token preferences — phrasing, formatting, tool-call syntax, the shape of a reasoning stepCapability the student cannot reach. If the student never generates a trajectory containing the insight, the teacher is never asked about it. On-policy means the student chooses the states
Behaviour on prefixes the student actually visitsBehaviour on prefixes it does not. The whole objective is defined on the student's own distribution
Habits that show up token by token — when to stop reasoning, when to call a toolLong-range strategy that is only visible across thousands of tokens. A per-token log-ratio is a myopic signal
The intersection of both teachers' stylesAnything the warmup did not put in reach. The student starts inside both teachers' support by construction, and the objective keeps it there
The consequence, and it is visible in Chapter 9. Distillation is a consolidation, not an amplification. The unified model should be expected to land at or slightly below each expert on that expert's home turf, not above it — you are trading a little peak specialisation for one set of weights. When you see Intern-S2-Preview-397B competitive but not leading on Terminal-Bench and SWE-Bench Pro, the agentic expert's own scores are the number you would actually want to see, and the paper does not report them. That is the honest gap in the ablation: there is no "agentic expert alone" column.

The whole post-training pipeline, end to end

This is the last training chapter, so here is the complete journey from pre-trained checkpoint to released model, with every mechanism from Chapters 4 through 8 placed where it acts.

StageWhat entersMechanisms in playWhat leaves
1. SFT (§4.2)The pre-trained checkpoint from Chapter 3's data enginesA broad multimodal mixture — conversation, instruction following, safety, code, image-text, visual grounding, tool use, scientific tasks, long-horizon agentic trajectories. Chain-of-thought built by rejection sampling with Intern-S1-Pro and other open models, then validated by language models and human domain expertsA controllable assistant with tool-use and format initialisation. The common ancestor of everything downstream
2a. Multi-task RL (§4.3)The SFT checkpointPartial rollout + off-policy correction (Eq 10–11), R3, the FP32 precision map, the BKL mask (Eq 12–13), online speculative decoding (Eq 18–24), LOO advantages (Eq 27), DAPO dynamic sampling, GEPO (Eq 25–26), adaptive length regularisation (Eq 14–17), all composed in Eq 29. Muon, lr 1e-6, 8,192 responses per batch, 8 mini-steps, 65,536 max generationThe reasoning expert
2b. Agentic RL (§4.4)The same SFT checkpoint, in parallelHarness × task; white-box and black-box harnesses behind a three-protocol gateway; TITO + R3 capture; the PrefixTree trace store; 214,854 executable tasks plus the self-evolving synthesiser; session-aware outcome credit; process-aware advantage control (Eq 30); verifier integrityThe agentic expert
3. Warmup (§4.5)Trajectories from both expertsA lightweight SFT pass on the original SFT model, following Nemotron 3 UltraThe initial student, already inside both teachers' support
4. OPD (§4.5)The student, both teachers, prompts labelled by domainStudent-generated trajectories; teacher scores the sampled token only (O(H) payload); reverse KL on student states (Eq 31–32); the same clipped-REINFORCE form with a token-level advantage (Eq 33–36); the same BKL mask and clip interval as stage 2aIntern-S2-Preview — the released model

Two structural observations. First, stages 2a and 2b are parallel, not sequential — they branch from one checkpoint and never see each other's gradients, which is exactly what makes them specialists. Second, the same three low-level mechanisms — partial rollout, R3, the BKL mask — appear in stages 2a, 2b, and 4. They are the substrate, not features of any one stage.

What this pipeline is really optimising. Not any single objective — four different ones, in sequence and in parallel. It is optimising a trajectory through capability space: teach format, then teach correctness under verification, then teach interaction under execution, then reconcile. Each stage's objective would be a poor objective for the stage before it. That staging is the actual design, and it is why "just do RL on everything" is not the same paper.
Why can the paper get away with transmitting only the teacher's log-probability of the sampled token, instead of full or top-64 logits?

Chapter 9: The Scoreboard, Read Honestly

Every model report's results section is written by people who want the model to look good. That is fine and expected; the reader's job is to read the table rather than the prose. This chapter puts all four evaluation tables in front of you with the losses marked, and then says what each one actually supports.

The comparison set is seven other frontier models: Qwen3.5-397B-A17B, DeepSeek-V4-pro, Kimi-K2.7-Code, GLM-5.2, GPT-5.5, Gemini-3.1-Pro, and Claude-Opus-4.8. Some are open-weight, some are not, and the paper's own convention distinguishes "best among open-sourced models" from "best among all models" — a distinction we will keep, because it changes almost every conclusion.

Table 2 — scientific benchmarks

BenchmarkIntern-S2-
Preview-397B
Qwen3.5-
397B-A17B
DeepSeek-
V4-pro
Kimi-
K2.7-Code
GLM-
5.2
GPT-
5.5
Gemini-
3.1-Pro
Claude-
Opus-4.8
Who wins
Biology-Instructions56.924.499.147.686.3410.5213.876.78Intern, by 43 points
Mol-Instructions52.3711.6512.0624.5619.5840.4938.8438.35Intern
MolecularIQ61.4941.4844.4352.8160.9176.4138.9466.78GPT-5.5. Intern best open
SciReasoner63.9745.0251.1151.6951.4561.1560.3558.00Intern
TOMG-Bench65.6654.0657.6358.2857.8969.8962.6761.38GPT-5.5. Intern best open
MP2067.886.156.758.401.5016.1216.7515.60Intern, by 51 points
ProteinBinder-94.361.641.881.922.012.132.212.40Intern — but read the scale
Multimodal
XLRS-Bench51.9750.1149.9050.9654.2751.84Gemini. Intern best open
MicroVQA68.8168.7161.0463.6371.0261.80Gemini. Intern best open by 0.10
SFE61.6762.9750.7652.0959.5759.08Qwen3.5 — Intern second
ObsCrisis-Bench26.0719.2232.6328.3325.7124.24Kimi — Intern third
Agentic
SciCode49.1146.3547.5343.4951.9755.9254.4456.21Claude — Intern fifth
SGI-Bench49.3744.4445.7050.6352.4142.7745.2849.06GLM — Intern third
ResearchClawBench18.4415.8613.6915.4023.3517.0014.5421.74GLM — Intern third

Now read it properly, because there are two completely different stories in that table.

Story one: the domain-native tasks are not close. Biology-Instructions 56.92 against a best-competitor 13.87 — a factor of 4.1. MP20 67.88 against 16.75 — a factor of 4.1 again. Mol-Instructions 52.37 against 40.49. These are not "leading" margins, they are different-capability margins. The obvious explanation is also the correct one: these benchmarks require reading and generating biological sequences and crystal structures, and this is the only model in the table whose pre-training and SFT were built around them. A general model is not slightly worse at multi-omics sequence analysis; it is guessing.
Story two: on general agentic science, it is mid-table. SciCode 49.11 (fifth of eight). SGI-Bench 49.37 (third). ResearchClawBench 18.44 (third). The paper's own summary is accurate and unusually restrained: on science-oriented agentic tasks it "generally surpasses DeepSeek-V4-Pro and Qwen3.5-397B, ranking second only to GLM-5.2." Second among the open models it names, not first overall.

And ProteinBinder-9 deserves a special note. Intern scores 4.36 and the field scores between 1.64 and 2.40. That is the best result in the column and it is also, in absolute terms, a pass rate of about four percent on de novo protein binder design. The benchmark asks a system to "generate protein binders that satisfy a predefined binding interface and pass a multi-stage structural and physicochemical evaluation pipeline," with candidates assessed using RFdiffusion and AlphaFold 3 and then filtered on interface confidence, binding energy, and molecular contacts. Winning a benchmark where every model is near the floor tells you the ordering is right and very little about whether the capability is usable.

Table 3 — general benchmarks

BenchmarkIntern-S2-
Preview-397B
Qwen3.5-
397B-A17B
DeepSeek-
V4-pro
Kimi-
K2.7-Code
GLM-
5.2
GPT-
5.5
Gemini-
3.1-Pro
Claude-
Opus-4.8
Who wins
MMLU Pro89.7587.8086.8687.1087.2288.2091.0090.12Gemini. Intern best open
SimpleQA-Verified69.9054.8046.6038.6037.9064.3075.6043.30Gemini. Intern best open by 15
AdvancedIF74.4475.4973.8376.1775.7676.2079.7872.88Gemini. Intern sixth
HMMT-202691.5787.8891.7690.3492.5097.0694.7095.36GPT-5.5. Intern sixth
Multimodal
MMMU Pro80.4680.2977.9281.6883.9976.88Gemini. Intern best open by 0.17
ChartQAPro69.6568.6154.8669.2371.1858.65Gemini. Intern best open
Agentic
SkillsBench50.0335.5849.5355.6353.1949.5937.2054.40Kimi — Intern fourth
TerminalBench 2.167.4251.3064.0066.2977.9079.4073.8084.60Claude — Intern fifth
SWE-Bench-Pro61.5643.5555.4057.5962.1058.6054.2069.20Claude. Intern third
SWE-Bench-Multilingual81.6765.0072.4478.5682.0073.3344.0077.00GLM by 0.33 — Intern second
WildClawBench44.6834.5043.7046.8954.2058.2040.8064.72Claude — Intern fifth

The paper's summary of this table — "the best results among open-source models on MMLU-Pro (89.75), SimpleQA-Verified (69.90), MMMU-Pro (80.46), and ChartQAPro (69.65)" and, on agentic tasks, "consistently outperforms Qwen3.5-397B and demonstrates performance comparable to that of Kimi-K2.7-Code" — is accurate. It is also carefully scoped, and the scoping is where the information is.

Two rows are worth more than the rest. SimpleQA-Verified: 69.90. That benchmark evaluates short-form factual recall without retrieval tools, on 1,000 human-verified prompts, with an autorater that separates correct, incorrect, and not-attempted. Every other open model in the table is between 37.90 and 54.80. Intern is 15 points clear of the next open model and closer to Gemini-3.1-Pro (75.60) than to Qwen3.5 (54.80). That is a pre-training-corpus result, not a post-training one, and it is the clearest evidence in the paper that the Chapter 3 data engines did something. AdvancedIF: 74.44, sixth of eight. That benchmark scores a response only when it satisfies all applicable criteria from a rubric of up to twenty, across single-turn, multi-turn, and system-prompt steerability. Being sixth of eight — and fourth of the five open models — on strict multi-criteria instruction following, while leading on knowledge, is a real and specific weakness — and it is exactly the sort of thing an adaptive length regulariser that rewards concision might be expected to make slightly worse.

What each scientific benchmark actually asks

A score is meaningless without knowing what was scored. §5.1.1 describes each benchmark, and the descriptions change how you read the numbers — particularly the ones where Intern's margin is enormous.

BenchmarkWhat it asks, from §5.1.1ScaleWhy the margin is what it is
Biology-Instructions"Multi-omics" sequence understanding — genomic, transcriptomic, and proteomic data, combining sequence prediction with reasoning21 tasksRequires reading nucleotide and amino-acid strings at character resolution. General models score 4–14
Mol-InstructionsMolecule-oriented, protein-oriented, and biomolecular-text tasksLarge instruction setSame story, one domain over
MolecularIQ"Reason faithfully over molecular graphs represented as SMILES" — counting, indexing, constrained generation, with symbolic verification5,111 questions, 849 held-out moleculesSymbolically verifiable, so no partial credit for plausible-sounding answers. GPT-5.5 leads at 76.41
SciReasonerScientific reasoning across 9 domains and 149 concrete tasks, ten sub-benchmarks, mixed formats including "protocol-based procedural questions"149 tasksThe broadest scientific reasoning test here, and Intern leads it outright at 63.97
TOMG-BenchNatural-language-guided molecule generation: editing, property optimisation, customised generation, automatically checked for validity and constraint satisfaction5,000 samples per subtaskGeneration, not recognition — and validity is machine-checked
MP20Conditional crystal structure generation — "predicting precise atomic coordinates and lattice parameters from chemical compositions under physical constraints such as periodicity and symmetry"27,136 train / 9,046 test, no chain-of-thought annotationsEmitting valid crystallography. Every general model is under 17; Intern is 67.88
ProteinBinder-9De novo protein binder design against 9 targets, graded by a pipeline using RFdiffusion and AlphaFold 3, then filtered on interface confidence, binding energy, and molecular contacts9 targetsEveryone is near the floor. Intern's 4.36 is the best of a very low field
Notice how many of these are machine-verifiable. MolecularIQ uses symbolic verification on molecular graphs. TOMG-Bench runs an automated framework checking "whether generated molecules are valid, satisfy the requested structural or property constraints, and retain appropriate similarity or novelty." MP20 has ground-truth structural targets. ProteinBinder-9 runs a multi-stage structural and physicochemical evaluation. These are exactly the "verifiable objectives" Chapter 0 described — which means they are not only evaluation sets, they are the shape of thing the RL stage could train against. When a paper's benchmark suite and its reward design have the same character, you should expect the training to transfer to the evaluation unusually well. That is a strength and a caveat at once.

Worked example 27: the multimodal rows have holes in them

Look again at the multimodal blocks of Tables 2 and 3 and count the dashes. DeepSeek-V4-pro and GLM-5.2 have no entry on XLRS-Bench, MicroVQA, SFE, ObsCrisis-Bench, MMMU-Pro, or ChartQAPro — six rows, two models, twelve missing cells.

That matters for how you read "best among open-sourced models." On MMMU-Pro, Intern's 80.46 is compared against Qwen3.5's 80.29 and Kimi's 77.92, and GLM-5.2 — which beats Intern on SGI-Bench, ResearchClawBench, TerminalBench, SWE-Bench-Pro, and SWE-Bench-Multilingual — simply is not in the column. The lead is real over the models that were measured. It is silent about the two that were not.

The likely and unremarkable explanation is that those models are text-only or their multimodal variants were unavailable. The reading instruction stands regardless: a dash is not a zero and it is not a loss; it is an absence, and an absence narrows the claim.

The two multimodal losses, examined

Two scientific-multimodal rows go against the model, and they are worth a look because they are the only places in Table 2 where a general model beats it on perception.

BenchmarkInternWinnerWhat the benchmark demandsA plausible reading
SFE61.67Qwen3.5-397B-A17B, 62.97"830 verified visual question answering pairs across 66 multimodal tasks" spanning five disciplines, using "authentic raw scientific data formats"A 1.30-point gap on 830 items is about 11 questions, against a binomial standard error of roughly √(0.62×0.38/830) = 1.68 points. Statistically a tie
ObsCrisis-Bench26.07Kimi-K2.7-Code, 32.63Multimodal reasoning about extreme weather and geophysical crises from multispectral satellite observations plus optional weather-station measurements; 4,202 VQA samples, 127 events, eight disaster categories, 61 countries, across multiple observation timestepsA 6.56-point gap on 4,202 items is real — the standard error is about 0.68 points, so this is roughly ten sigma. A genuine loss

ObsCrisis-Bench is the interesting one, because it is the benchmark in the table that most resembles the paper's own thesis: heterogeneous evidence (multispectral imagery plus optional numerical station measurements), across multiple timesteps, requiring "early warning, event-type and timing prediction, impact assessment, and post-event recovery analysis." A model with a dedicated time-series encoder ought to be advantaged here. It scores fourth of six models with a number, and the whole field is under 33.

What that suggests, stated as a hypothesis rather than a finding. The time-series modules are evaluated on SciTS, where the signal is presented as a signal. ObsCrisis-Bench presents evidence in whatever format its authors chose, which may or may not route through the numerical lane. Having a capability and having the plumbing that reaches it are different things, and a benchmark that does not hand your specialised encoder its input in the form it wants will not measure the encoder at all. The paper does not discuss this row; we are reading a gap, not a claim.

Table 4 — time-series understanding on SciTS (F1)

This is where the architecture chapter cashes out, and the margins are enormous.

ModelASU01ASU03BIU01BIU03EAU01MEU01NEU06PHU01PHU04RAU01RAU02
GPT-4.1-mini (text)67.215.60.212.767.044.016.124.052.724.610.6
Gemini2.5-Flash (text)64.116.31.512.467.660.95.820.764.820.913.5
DeepSeek-V3 (text)1.112.30.05.840.259.313.628.950.719.44.2
GPT-5-mini (VL)65.718.90.817.967.630.413.321.447.824.39.1
Gemini2.5-Flash (VL)61.615.20.98.372.564.111.622.759.031.611.3
Intern-S1-Pro (1T)98.075.920.888.399.565.671.336.893.2
Intern-S2-Preview-397B97.191.036.598.3100.081.870.266.999.988.460.2

Three separate claims live in that table, and they are worth separating.

Claim 1 — modelling the numbers beats describing them. Look at BIU01: every general model scores between 0.0 and 1.5 F1. Both Intern models — the only two with a dedicated time-series encoder — score 20.8 and 36.5. The paper's reading: this highlights "the importance of directly modelling the underlying time series rather than relying solely on textual descriptions or visualized signals." Note also that the vision-language variants do not rescue it: GPT-5-mini scores 0.8 looking at a plot of the signal. A picture of the data is not the data.

Claim 2 — the smaller model beat the bigger one, and you can count it. Nine tasks are supported by both Intern models. Intern-S2-Preview-397B wins seven: ASU03 (75.9 → 91.0), BIU01 (20.8 → 36.5), BIU03 (88.3 → 98.3), EAU01 (99.5 → 100.0), MEU01 (65.6 → 81.8), PHU01 (36.8 → 66.9), PHU04 (93.2 → 99.9). It loses two: ASU01 (98.0 → 97.1) and NEU06 (71.3 → 70.2), both by about one point. Seven of nine, at "less than half the number of parameters." The single largest jump is PHU01, 36.8 to 66.9 — the paper calls this out by name.

Claim 3 — two tasks are new. RAU01 and RAU02 are blank for Intern-S1-Pro. These are the radar tasks — "radar coding-scheme classification and mode-and-modulation classification, which was not supported by Intern-S1-Pro." S2 scores 88.4 and 60.2 against general-model baselines in the 4–32 range. That capability is a direct consequence of the Chapter 1 change that made the encoder handle "high-frequency but short sequence lengths."

Table 5 — forecasting on SciTS: MAPE, with the success rate in brackets

This is the most instructive table in the paper, and the reason is the parenthesis.

ModelENG02ENG03MEG03NEG03PHG02URG01URG05
GPT-4.1-mini (text)125.0 (1.4)8.3 (96.0)42.1 (49.6)95.2 (96.4)1.1e3 (94.2)320.6 (18.6)126.6 (100)
Gemini2.5-Flash (text)72.5 (5.9)9.6 (99.0)62.2 (57.9)63.5 (99.2)110.8 (99.0)246.0 (23.3)98.6 (100)
DeepSeek-V3 (text)117.2 (46.1)7.7 (98.0)46.4 (30.9)4.3 (3.1)200.1 (92.2)350.0 (18.6)296.7 (93.0)
GPT-5-mini (VL)56.1 (4.5)11.2 (76.0)37.6 (51.8)74.3 (97.2)155.3 (97.4)182.1 (58.1)71.1 (72.9)
Gemini2.5-Flash (VL)103.9 (7.4)15.6 (53.0)53.1 (37.2)185.2 (36.9)351.9 (16.3)114.6 (91.2)
Moirai-Large121.2 (100)12.8 (100)51.7 (100)59.1 (100)116.9 (100)294.7 (100)74.6 (100)
TimeMoE-Large70.4 (100)11.6 (100)39.0 (100)70.1 (100)80.2 (100)218.4 (100)84.4 (100)
Chronos-bolt-Base73.7 (100)12.0 (100)41.5 (100)78.5 (100)109.3 (100)139.3 (100)70.6 (100)
UniTS70.1 (100)12.8 (100)42.0 (100)95.2 (46.4)135.9 (44.1)389.7 (100)
TimeOmni68.6 (100)7.4 (100)37.5 (100)78.7 (100)163.0 (100)247.0 (100)174.0 (100)
Intern-S2-Preview-397B60.2 (100)7.1 (100)32.8 (100)59.2 (100)72.2 (100)138.9 (100)60.6 (100)

Lower MAPE is better; higher success rate is better.

Worked example 28: why the parenthesis destroys three rows

Look at ENG02. GPT-5-mini reports a MAPE of 56.1, which is lower — better — than Intern's 60.2. If you read only the first number, the general vision-language model wins that column.

Now read the second number: 4.5. It produced a usable forecast on 4.5% of the cases. The 56.1 is the error on the 4.5% it managed, which is a conditional average over a self-selected sample — the easy ones, the short horizons, the cases where the output length happened to fit. Intern's 60.2 is the error over 100% of them.

Make the comparison honest by asking a question that does not depend on which subset was attempted: on 1,000 forecasting requests, how many produce a usable answer at all?

Model on ENG02MAPE on attemptedSuccess rateUsable forecasts per 1,000 requests
GPT-4.1-mini125.01.4%14
GPT-5-mini (VL)56.14.5%45
Gemini2.5-Flash (text)72.55.9%59
DeepSeek-V3117.246.1%461
TimeMoE-Large70.4100%1,000
Intern-S2-Preview-397B60.2100%1,000

The paper explains the failures precisely: "Text and Vision-Language LLMs often exhibit low success rates because long prediction horizons can exceed their output capacity, while strict sequence-length and formatting requirements frequently lead to instruction-following failures. Moreover, generating forecasts through discrete text tokens can compromise numerical precision."

Every one of those three failure modes is what Chapter 1's Lane 4 was built to remove. Output capacity: a numerical branch emits values, not thousands of numerals. Formatting failures: there is no format to get wrong. Precision: values are values. And the horizon predictor — that unglamorous module with 99% accuracy — is what turns "forecast the next two seconds" into an integer without an instruction-following failure.

The lesson that outlives this paper. A metric computed only over successes is a conditional metric, and comparing conditional metrics across systems with different coverage compares different populations. Whenever you see a quality score next to a coverage number, multiply. Whenever you see a quality score with no coverage number, go and find one — someone chose not to print it.

Against the specialised forecasters, which all achieve 100% success by construction, Intern wins six of the seven columns outright — ENG02, ENG03, MEG03, PHG02, URG01, URG05 — and on NEG03 it posts 59.2 against Moirai-Large's 59.1, a gap of 0.1. Winning six of seven against dedicated time-series models, while also being a 397-billion-parameter language model that reads PDFs, is the strongest single result in the report. The paper adds one more data point: on GIFT-Eval, "a benchmark for general time series forecasting," it achieves "a competitive zero-shot MASE of 0.785."

Worked example 29: aggregate the SciTS understanding table

Table 4 has eleven columns and it is easy to lose the shape. Average the F1 scores over the nine tasks both Intern models support — ASU01, ASU03, BIU01, BIU03, EAU01, MEU01, NEU06, PHU01, PHU04:

Intern-S1-Pro (1T): 98.0 + 75.9 + 20.8 + 88.3 + 99.5 + 65.6 + 71.3 + 36.8 + 93.2.

Running: 98.0, 173.9, 194.7, 283.0, 382.5, 448.1, 519.4, 556.2, 649.4. Divide by 9:

649.4 / 9 = 72.16

Intern-S2-Preview-397B: 97.1 + 91.0 + 36.5 + 98.3 + 100.0 + 81.8 + 70.2 + 66.9 + 99.9.

Running: 97.1, 188.1, 224.6, 322.9, 422.9, 504.7, 574.9, 641.8, 741.7. Divide by 9:

741.7 / 9 = 82.41

A gain of 10.25 F1 points, at roughly 40% of the parameters. And the strongest general-purpose baseline on the same nine tasks — take Gemini2.5-Flash in its text configuration: 64.1 + 16.3 + 1.5 + 12.4 + 67.6 + 60.9 + 5.8 + 20.7 + 64.8 = 314.1, so 314.1 / 9 = 34.90.

SystemMean F1 over the 9 shared tasksGap to Intern-S2
Gemini2.5-Flash (text)34.90−47.51
Intern-S1-Pro (1T)72.16−10.25
Intern-S2-Preview-397B82.41

Two different comparisons live in that column and they should be read differently. The 47-point gap to a general model is an architecture gap — one system models the signal, the other reads a description of it. The 10-point gap to the predecessor is a refinement gap: same idea, better encoder, half the parameters. Chapter 1's channel-wise Transformer and adaptive patching are what that ten points is made of.

The forecasting columns, counted

Against the five specialised forecasters — all of which achieve 100% success by construction, since they are purpose-built numerical models — here is who wins each column of Table 5, by lowest MAPE.

TaskBest specialistIts MAPEIntern's MAPEWinner
ENG02TimeOmni68.660.2Intern, by 8.4
ENG03TimeOmni7.47.1Intern, by 0.3
MEG03TimeOmni37.532.8Intern, by 4.7
NEG03Moirai-Large59.159.2Moirai, by 0.1
PHG02TimeMoE-Large80.272.2Intern, by 8.0
URG01Chronos-bolt-Base139.3138.9Intern, by 0.4
URG05Chronos-bolt-Base70.660.6Intern, by 10.0

Six of seven, with the loss being a tenth of a point. And note which specialist is strongest changes column by column — TimeOmni three times, Chronos twice, Moirai and TimeMoE once each — while one general-purpose foundation model is at or near the top of every column. That is the strongest form the result can take: not "we beat the best baseline" but "we beat a different best baseline in each domain."

The caveat that keeps this honest. These are seven tasks from one benchmark suite, SciTS, on which the model's time-series modules were presumably developed. The independent check is the last line of §5.3: on GIFT-Eval, "a benchmark for general time series forecasting," it reports a zero-shot MASE of 0.785 — described as "competitive," not leading. A specialised result on the home benchmark plus a competitive result off it is the correct shape of evidence, and it is worth noticing that the paper reports both.

What the whole scoreboard supports, in one paragraph

Domain-native scientific tasks: dominant, by margins that indicate a capability difference rather than a tuning difference. Time series: dominant, understanding and forecasting alike, with a smaller model beating its trillion-parameter predecessor seven times out of nine. General knowledge and factuality: best among open models, behind Gemini-3.1-Pro. Multimodal: best among open models by margins running from 0.10 to 1.9 points, behind Gemini-3.1-Pro. Strict instruction following: a genuine weakness — sixth of eight, fourth of five open models. Competition mathematics: sixth, on a 33-problem benchmark. Agentic coding, terminal, and research: competitive, frequently second among the open models, generally behind Claude-Opus-4.8 and GLM-5.2 — though it does beat Claude on SWE-Bench-Multilingual (81.67 against 77.00) and edges it on SGI-Bench (49.37 against 49.06). That is a specialist that has not given up being a generalist — which is precisely what the Chapter 8 distillation stage was for.

What the general and agentic benchmarks actually ask

Same treatment for Table 3, because two of its rows are far more informative than their numbers suggest once you know the protocol.

BenchmarkWhat it asks, from §5.1.2ScaleWhat Intern's score means
MMLU-ProMMLU with more choices and "more challenging, reasoning-intensive questions"Broad subject coverage89.75, best open. Knowledge is intact after all four training stages
SimpleQA-VerifiedShort-form factuality "without access to retrieval tools," on prompts deduplicated, topic-balanced, source-reconciled, ambiguity-removed and adversarially filtered; the autorater separates correct, incorrect, and not-attempted1,000 human-verified prompts69.90 — 15 points clear of the next open model. A pre-training result
AdvancedIFInstruction following under "complex single-turn instructions, multi-turn carried context, and system-prompt steerability." Rubrics of up to 20 criteria; "a response succeeds only when it satisfies all applicable criteria"1,645 human-written prompts74.44, sixth of eight and fourth of five open models. The genuine weakness
HMMT-202633 problems from the February 2026 Harvard–MIT tournament via MathArena, "evaluated soon after the competition" so it is a relatively fresh test33 problems91.57. Note the tiny n — one problem is 3.03 points
SkillsBenchWhether "structured packages of procedural knowledge improve the performance of language-model agents," using matched evaluations with and without Skills87 tasks, 8 domains50.03. Evaluated on OpenClaw 2026.5.7
Terminal-Bench 2.1Agents on "89 difficult, realistic tasks executed in isolated command-line environments," each with a dedicated environment, human reference solution, and automated tests89 tasks67.42. Evaluated on Terminus 2; some results from Artificial Analysis
SWE-Bench Pro"Long-horizon, enterprise-oriented" tasks that "may require hours or days of professional work," across public, held-out, and commercial sets1,865 problems, 41 repositories61.56. Evaluated on Mini-SWE-Agent, with the official image modified to close a git-log leak
SWE-bench MultilingualIssue resolution beyond Python across nine languages, requiring both fail-to-pass and pass-to-pass tests300 tasks, 42 repositories81.67, second by 0.33
Two protocol notes that change how comparable these are. First, the agentic rows each name a harness — OpenClaw 2026.5.7, Terminus 2, Mini-SWE-Agent, ResearchHarness v0.0.49. Chapter 6 told us the harness "determines the interaction policy and context construction," so an agentic score is a property of the model-and-harness pair, not of the model. Second, HMMT-2026 has 33 problems: the gap between Intern's 91.57 and DeepSeek-V4-pro's 91.76 is 0.19 points, which on 33 problems is 0.06 of a question. That is not a difference; it is the same score, reported twice.

Worked example 30: count the wins instead of reading the prose

Prose summaries in results sections are selection functions. Do the counting yourself. Across the 25 benchmark rows in Tables 2 and 3, here is where Intern-S2-Preview-397B lands:

OutcomeCountRows, with Intern's overall rank
Best of all eight models5Biology-Instructions, Mol-Instructions, SciReasoner, MP20, ProteinBinder-9
Best among open models, behind a closed one8TOMG-Bench (2), XLRS-Bench (2), MicroVQA (2), SimpleQA-Verified (2), ChartQAPro (2), MolecularIQ (3), MMLU-Pro (3), MMMU-Pro (3)
Top three overall, but another open model is ahead6SFE (2), SWE-Bench-Multilingual (2), ObsCrisis-Bench (3), SGI-Bench (3), ResearchClawBench (3), SWE-Bench-Pro (3)
Fourth to sixth overall6SkillsBench (4), SciCode (5), TerminalBench 2.1 (5), WildClawBench (5), AdvancedIF (6), HMMT-2026 (6)

Check the arithmetic: 5 + 8 + 6 + 6 = 25 rows, which is Table 2's fourteen plus Table 3's eleven. Thirteen of the twenty-five — 52% — are "best overall or best open." That is a strong result and it is not a clean sweep.

And the distribution of the other twelve is informative. Of the six rows where Intern places fourth to sixth, five are agentic or strict instruction-following benchmarks — SkillsBench, SciCode, TerminalBench, WildClawBench, AdvancedIF. The single exception is HMMT-2026, competition mathematics, on 33 problems. Not one of the twelve is a knowledge, science, or perception benchmark.

The diagnosis that pattern supports. Chapters 3, 5, and 8 built knowledge and reasoning, and the scoreboard says they worked. Chapters 6 and 7 built agentic capability, and the scoreboard says the infrastructure works — the model is competitive everywhere, beating Qwen3.5 consistently — but that Claude-Opus-4.8 and GLM-5.2 are still ahead on long-horizon interactive work. Agentic RL is the newest of the four stages and the one with the fewest published training tokens. That is a reasonable place for a preview system to be behind.

Worked example 31: what "leading" means when the margin is 0.10

Two rows in the tables are claimed as leads and deserve to be read with a ruler on them. MicroVQA: Intern 68.81, Qwen3.5 68.71 — a gap of 0.10. MMMU-Pro: Intern 80.46, Qwen3.5 80.29 — a gap of 0.17.

MicroVQA "consists of 1,042 expert-curated multiple-choice questions." A gap of 0.10 percentage points on 1,042 items is:

0.0010 × 1,042 = 1.04 questions

One question. Now put an error bar on it. For a binomial proportion at p ≈ 0.69 with n = 1,042, the standard error is

√( p(1−p) / n ) = √( 0.69 × 0.31 / 1042 ) = √( 0.2139 / 1042 ) = √0.0002053 = 0.01433 = 1.43 percentage points

The claimed lead is 0.10 points against a one-sigma sampling error of 1.43 points — roughly one fourteenth of a standard error. These two systems are, on this benchmark, indistinguishable.

This is not a criticism of the paper, which reports the number and calls it "best performance among open-sourced models" — which is literally true. It is a reading instruction. A 43-point margin on Biology-Instructions and a 0.10-point margin on MicroVQA are both "wins" in a table and they are not the same kind of fact. Whenever you meet a lead, divide it by √(p(1−p)/n) before you believe anything about it. Where n is not published, treat any sub-point margin as a tie.

The Memory Decoder result, held to the same standard

Apply the discipline to Chapter 2's headline as well. The +3.40 average on Biology-Instructions came from 21 tasks, so the per-task deltas are the sample. Fourteen positive, seven negative. The positive deltas average +6.24 and the negative ones −2.22. The largest single move, +16.01 on promoter–enhancer interaction, contributes 16.01 / 21 = 0.76 points of the 3.40 — 22% of the whole gain from one task out of twenty-one.

Drop the top three gains (+16.01, +10.57, +10.13 = 36.71) and the average gain falls from 3.40 to (71.56 − 36.71)/21 = 34.85/21 = +1.66. Still positive, still real, half the headline. The honest sentence is: the memory produces large gains on a handful of nucleotide-sequence tasks, small gains on many, and small regressions on a third of the benchmark.

A checklist for reading any model report

This chapter has been an exercise in one skill, and it generalises. Six questions, in the order they are worth asking:

#QuestionWhat it caught here
1Is the comparison set "all models" or a subset? Which subset does each claim use?Almost every general-benchmark lead is "among open models," with Gemini-3.1-Pro ahead
2Is there a coverage or attempt-rate number next to the quality number?Table 5's success rates invert three apparent losses
3Divide each margin by its sampling error. Which "wins" survive?MicroVQA and MMMU-Pro are ties
4Which rows are missing, or marked with a dash?DeepSeek-V4-pro and GLM-5.2 have no multimodal numbers at all
5Is the aggregate carried by a few components?Three of 21 tasks supply half the Memory Decoder gain
6What is reported as a figure rather than a table?The no-regression claim, the length-regularisation ablation, and the agentic reward curves — all shapes

Run those six over any report, including the ones you write, and most of what a results section can hide stops being hidden.

On SciTS task ENG02, GPT-5-mini reports MAPE 56.1 while Intern-S2-Preview-397B reports 60.2. Why is that not a loss for Intern?

Chapter 10: Connections, Limits, and the Cheat Sheet

Intern-S2-Preview is a system report, and the right way to hold a system report in memory is not as one idea but as a set of independently reusable mechanisms plus a claim that they compose. Here is that set, each pointing at where you can go deeper.

Where every mechanism connects

Mechanism in this paperThe idea underneathGo deeper
Sparse MoE backbone, R3 routing replayConditional computation with a discrete router — and every problem that a discrete choice createsMixture of experts · CS336 MoE · DeepSeek-V3
Memory Decoder fusion, pfinal = (1−λ)pS2 + λpmemCombining a parametric memory with a frozen base at the outputRAG · Vector embeddings · Knowledge distillation
Q-Former compression in the time-series encoderLearned fixed-size pooling by cross-attending learnable queriesInternVL · Vision-language models
Numerical forecasting branch, horizon predictorEmitting numbers as numbers, and why text tokenisers are bad at real valuesTime-series forecasting
Contrastive next-latent prediction (Visual Pre-training)Identify rather than reconstruct — avoiding the conditional-mean collapse of L2Contrastive learning · CLAP
Importance ratio ρ, clipping, staleness boundLearning from data your current policy did not generateImportance sampling · Policy gradients · RL policy gradients
Leave-one-out advantage, dynamic sampling, GEPOGroup-relative RL without a value modelDAPO · DeepSeek-R1 · DeepSeekMath (GRPO)
Speculative decoding with an online draft modelLossless acceleration by rejection sampling, and what changes when the target movesSpeculative decoding
Muon optimizerMatrix-aware updates instead of coordinate-wise adaptivityThe Polar Express (Muon) · LLM optimizers · Optimizers
Harness × task, TITO, PrefixTree trace storeTurning a real agent runtime into RL experienceCode as agent harness · The agent loop · Agent architectures
Skill-state graph task synthesisGenerating solvable-by-construction tasks by typed compositionAgent skills · Tools and sandboxing
Verifier integrity, all-correct semanticsReward hacking, and closing the channel rather than punishing the behaviourReward alignment · Agent evaluation · Agent evaluation survey
On-policy distillation with sampled-token transferReverse-KL supervision on student-visited states, and why the payload can be O(H)On-policy distillation survey · On-policy distillation · Distillation scaling laws
The overall model familyFrontier open-weight systems built the same wayKimi K2 · InternVL · Qwen2.5-Omni

The lineage this sits in

None of this appeared from nowhere. The paper's own citation trail sketches a fairly clean lineage, and knowing it tells you what to read next.

ThreadThe stepsWhat this paper adds
The Intern lineInternVL and InternImage (perception) → Intern-S1 and Intern-S1-Pro (scientific multimodal, 1T) → Intern-S2-Preview-397BAgentic training; a forecasting branch; a memory path; half the parameters
Group-relative RLPPO → GRPO (DeepSeekMath) → DAPO's dynamic sampling → leave-one-out REINFORCE → GEPOEntropy-regime rebalancing so heterogeneous task mixtures stay comparable
RL systems at scaleSynchronous rollout → co-located partial rollout → full disaggregation → co-located partial rollout with per-token off-policy correction, R3, and BKL maskingAn MoE-aware consistency story between two execution engines
Agent trainingAgent-FLAN (agent tuning data) → Lagent (framework) → T-Eval and CIBench (stepwise evaluation) → MindSearch (long-horizon search) → SciExplore → harness × taskTraining inside unmodified third-party runtimes, with a lossless action-to-token mapping
Memory-augmented LMskNN-LM style retrieval → Memory Decoder (NeurIPS 2025) → Intern-MemDec-4B on a frozen 397BA demonstration at frontier scale, with a 21-task audit including its regressions
DistillationHard-label distillation → soft-logit distillation → on-policy distillation → multi-teacher → two broad experts, sampled-token transferAn O(H) payload, licensed by shared SFT ancestry

If you are building X, take Y from this paper

The most useful thing to carry away from a system report is a set of borrowable decisions. Sorted by what you might be building:

If you are building…Take thisBecause
An RL trainer for a large modelPartial rollout with a per-token behaviour version, a hard staleness cap, and a detached clipped weightThe long tail of generation lengths will otherwise idle your cluster, and PPO clipping will delete exactly the tokens you paid to keep
Anything with two execution enginesR3-style replay of discrete decisions, plus a per-sample consistency maskDiscrete choices do not degrade gracefully across implementations — they flip
A multi-task RL mixtureGroup-level entropy as a diagnostic before you touch anything elseIt costs nothing — you already have the log-probabilities — and it tells you whether your advantage scales are even comparable
Any reweighting of advantagesThe normaliser from Equation (15)Any reweighting silently changes the balance between reward and punishment unless you restore the mass
An agent RL loopSeparate the harness from the task; store the session as a prefix tree; keep semantic and token views apartH + T units of work instead of H·T, and a lossless path from an action to its tokens
Any executable-reward environmentThe whole leakage table — sanitise history, withhold graders, overlay canonical tests after the agent stops, and track infrastructure failures separatelyReward hacking is the default outcome, not a rare adversarial event
A domain specialisation of a good general modelOutput-level fusion with a per-token router, before you consider fine-tuningλ = 0 is a hard floor: the worst case is "no change"
A document ingestion pipelineVisual gain as a filter, and reading-order reassembly instead of caption pairingCounterfactual utility is a definition of quality you can actually compute
Anything that outputs numbersA numerical head with an explicit horizon predictorTable 5's success-rate column is what happens when you do not
A distillation stageShared ancestry, a teacher-trajectory warmup, and sampled-token transferEach one licenses the next; the O(H) payload is not independently available

The honest limits

The paper's conclusion volunteers most of these, which is worth acknowledging: "Intern-S2-Preview remains a preview system; future work should improve reliability over longer scientific workflows, expand domain-specific memories and task environments, strengthen verifiers, and deepen integration with specialized scientific tools."

LimitEvidence in the paperWhich chapter it comes from
Memory specialisation is not uniform7 of 21 Biology-Instructions tasks regressed, four of them protein property-prediction tasksCh 2 — one memory has one centre of mass
The no-regression claim is a shape, not a tableCross-domain behaviour is reported as a radar plot; no per-benchmark deltas are printedCh 2
Strict instruction following is weakAdvancedIF 74.44, sixth of eight, and fourth of the five open modelsCh 9
General agentic coding and terminal work lags the leadersTerminalBench 67.42 vs 84.60; WildClawBench 44.68 vs 64.72; SciCode 49.11 vs 56.21Ch 9
De novo design is near the floor for everyoneProteinBinder-9 best-in-class score is 4.36Ch 9
Several hyperparameters are unpublishedα, γ, τ for length regularisation; GEPO's coefficients and thresholds; β and αs for Memory Decoder; εIS and φ; the vocabulary size; layer counts and expert countsCh 2, 4, 5, 8 — reproduction from this report alone is not possible
Reward curves are not comparable across harnessesThe paper says so itself, explicitlyCh 7
"Preview"The name

Every mechanism, and the one sentence that justifies it

A compression of the whole lesson: each design decision paired with the single reason it exists. If you can reconstruct the right-hand column from the left, you have the paper.

DecisionThe reason, in one sentence
Channel-wise Transformer instead of mean poolingA mean over the channel axis is permutation-invariant, so it cannot represent propagation direction — three physically distinct states pool to one vector
Adaptive patch lengthA constant output token budget with an input-proportional receptive field is the only kind of encoder you can drop into a fixed context window without per-domain configuration
A numerical forecasting branchA text decoder quantises real values through its digit vocabulary and has no notion that 0.037 and 0.038 are adjacent
Convex combination of probabilities, not logitsLogit mixing is a geometric mean, which is multiplicative — a small specialist could never override a confident generalist
A frozen visual encoder in Visual Pre-trainingIf the target could move, the cheapest way to reduce a contrastive loss is for the encoder to collapse every patch onto one vector
Contrastive next-latent, not L2 regressionSquared error on a continuous target is minimised by the conditional mean, which for document imagery is a grey smudge
Visual gain as a filterWhen you cannot define quality directly, define it as the loss reduction it causes on a task you can measure
Pause instead of abortA rollout 40,000 tokens deep represents 40,000 forward passes, and discarding it burns all of them
A detached clipped weight, not PPO clippingPPO's min/clip zeroes the gradient for tokens outside the trust region, and pause-and-resume manufactures exactly those tokens by design
Rollout Routing ReplayA discrete top-k over experts has no tolerance: a 10−6 logit difference makes the two engines compute different functions
A bidirectional KL maskEach single direction of KL is blind in a different place, so the conjunction of two one-sided tests is the symmetric admission rule
Leave-one-out baselineIncluding a sample in its own baseline correlates the two and biases the estimator
GEPO's entropy branchesAdvantages of equal magnitude from different entropy regimes cause updates of very different sizes, so they are not comparable
The length normaliserWithout it, reweighting silently changes the reward-to-punishment balance per query, depending on how spread out that query's lengths happened to be
Length regularisation only on positives, only above a pass-rate thresholdAn incorrect response may fail for many reasons, and a hard query still needs exploration
Online draft trainingThe target policy moves every step, so a fixed draft model's acceptance rate decays throughout training
The LK loss with an acceptance-dependent mixtureTotal variation is the acceptance rate but optimises badly when far away; forward KL has smooth gradients but is a proxy
Harness × taskH + T units of integration work instead of H·T, and a new harness becomes one thin adapter
Token-in–token-outRe-tokenising a rendered string is not guaranteed to reproduce the sampled token sequence, and one merged token corrupts the gradient
The PrefixTreeStore each context delta once, carry the loss mask with it, and preserve the map from an agent action to its exact token span
Loss-masking tool observationsOtherwise you are doing maximum likelihood on your environment's output format, teaching the model to hallucinate plausible tracebacks
Marking bad steps skip, not deleting themDelete the error and the recovery that followed becomes an unmotivated non-sequitur
Process weights on positives onlySoftening the penalty on well-formed steps inside failures rewards format over correctness, and format is far easier to optimise
Overlaying canonical tests after the agent stopsIt converts "prevent the agent from touching the tests" into "it does not matter what it touched"
All-correct semanticsA gradient that rewards 414 of 415 tests teaches a systematic tolerance for collateral damage
Two experts, not twentyEach teacher is a full RL run at 397B, and teachers start overlapping after the first few domains
Reverse KL on student statesMode-seeking is what you want from a policy you will sample once, in production, on a real task
Sampled-token-only teacher transferShared SFT ancestry plus warmup makes surprising tokens rare, and 0.5 MB per trajectory instead of 34 MB is the difference between running and not
A frozen proximal student in the advantageOtherwise the target drifts across the eight mini-batch steps of the same batch

Six questions this paper leaves open

The most useful thing a reader can extract from a system report is the list of experiments nobody has run yet. Each of these is answerable and none of them is answered here.

QuestionWhy it mattersWhat would settle it
How do the two experts score before distillation?It is the only way to know what consolidation cost. The paper reports the unified model and no expert baselinesTwo extra columns in Table 3
Do multiple memories compose?The architecture's headline promise is plug-and-play modularity, demonstrated with exactly one memoryAttach a chemistry memory and a biology memory at once and re-run both benchmarks
What does the router actually learn?The regressions in §5.3 look like router error, not memory error — but λt is never plottedA histogram of λt by task, split by whether that task gained or lost
How much of the agentic score is harness-specific?Trained inside real harnesses, evaluated inside real harnesses. Some skill is scaffold knowledgeEvaluate on a harness the model never trained inside
Does the BKL mask ever bite hard?φ and the masked-token fraction are both unpublished. If the mask silently drops 5% of tokens, that is a different algorithmReport the masked fraction over training
What does adaptive length regularisation cost on hard queries?Figure 8's ablation is at 35B on aggregate reward. The mechanism is explicitly gated on pass rate, so its risk lives in the tailSplit the ablation by query difficulty

A glossary of every term this lesson bolded

TermOne lineFirst appeared
Agentic foundation modelA model trained inside a loop with an environment, tools, and an executable verifier — not merely queriedCh 0
Verifiable rewardA reward produced by running a program, not by a learned preference modelCh 0
Q-FormerA small Transformer with a fixed set of learnable queries that cross-attend into a variable-length input, giving content-aware pooling to a constant token countCh 1
Horizon predictorThe module that reads a forecasting instruction in English and outputs how many values to emit — a numerical head has no stop tokenCh 1
Memory DecoderA separately trained model whose next-token distribution is fused with a frozen backbone's, weighted per token by a routerCh 2
Retrieval distributionA distance-weighted vote over the next tokens stored by a prefix's nearest neighbours in a token-level datastoreCh 2
PerplexityThe exponential of the average per-token cross-entropy: PPL = eH, so H = ln(PPL)Ch 3
Visual gainPPL(text only) − PPL(interleaved) — a counterfactual measure of whether an image helps predict the page's textCh 3
Partial rolloutPausing in-flight generations at the batch boundary and resuming them after the update, instead of aborting or waitingCh 4
Importance samplingReweighting a sample by how much more likely it is under the target policy than under the one that produced itCh 4
Rollout Routing Replay (R3)Recording the rollout engine's expert selections and replaying them during training, so both engines compute the same functionCh 4
Bidirectional binary KLKL on the two-outcome question "was it this token or anything else?", required to pass a threshold in both directionsCh 4
Speculative decodingA cheap draft model proposes K tokens; the policy verifies them in one pass by exact rejection sampling, so the output distribution is unchangedCh 4
Draft modelThe small proposer. Here it is trained online, because the policy it is chasing keeps movingCh 4
AdvantageThe coefficient that multiplies log π in a policy gradient — a reward with a baseline subtractedCh 5
Leave-one-out baselineThe mean of the other rewards in the group, excluded from its own sample so it stays uncorrelatedCh 5
Group-level entropyTotal sequence surprisal averaged over a group's responses — the diagnostic GEPO uses to decide which branch firesCh 5
Dynamic samplingDiscarding and resampling any group whose rewards are all identical, since every advantage in it is zeroCh 5
HarnessHow an agent is instantiated, driven, and observed — the control loop, prompts, tool protocol, stop ruleCh 6
TaskThe initial environment, the executable objective, and the verifier-defined outcomeCh 6
Token-in–token-out (TITO)Serving that reuses the recorded tokenised prefix and captures exact output token IDs, so a black-box harness's session is still differentiableCh 6
PrefixTreeA per-session trie of context deltas with longest-prefix matching — storage sharing, loss masks, and action-to-token-span mapping in one structureCh 6
Process weightA per-message coefficient in [−1, 1] that can withhold or reverse positive credit, and never softens a punishmentCh 7
All-correct semanticsBinary scoring requiring both fail-to-pass and pass-to-pass checks — 414 of 415 tests scores zeroCh 7
On-policy distillationThe student generates the trajectory; the teacher scores the student's own states. Reverse KL, so mode-seekingCh 8
Proximal studentThe frozen snapshot the distillation advantage is measured against, so the target does not move across mini-batch stepsCh 8

Every equation, on one page

EqStatementWhat it is for
(1)pret(y|ct) ∝ ∑N(kt) 1[y=vj] exp(−d/τ)The retrieval teacher for the memory
(2)Lmem = βLKL + (1−β)LCECompress retrieval into parameters, anchored to gold
(3)pfinal = (1−λt)pS2 + λtpmemToken-level fusion with a frozen backbone
(4)Lrouter = LCE + αs st λtTrain λ with a signed, corpus-keyed prior
(5)–(6)U = RasterScan{zi | mi=1}; ût+1 = ψ([Φθ(Winu≤t)]t)Page → foreground patch sequence → next-latent prediction
(7)–(8)stj = cosine/τ; LVP = −(1/|B|)∑log pttContrastive scoring — identify, do not reconstruct
(9)L = λtextLCE + λvisLVPText and visual objectives interleaved
(10)–(11)ρ = πθbeh; ρ̄ = clip(ρ, 1−εlow, 1+εhigh)Correct pause-and-resume staleness with bounded variance
(12)–(13)DBKL(p‖q) = p log(p/q) + (1−p)log((1−p)/(1−q)); mask if both directions ≤ φDelete tokens where the two engines disagree
(14)–(17)Pq = {Âi>0}; Ãi = (∑Â/∑wÂ)wiÂi; wi = α+(1−α)(1−normalised length)γPrefer short correct answers, mass-preserving, positives only
(18)–(24)αt,k = ∑min(p,q) = 1−DTV; LLK = λkDKL + (1−λk)DTV; λk = e−ηᾱTrain a draft model online, targeting acceptance directly
(25)–(26)Hg(x) = −(1/K)∑it log π; branch-wise attenuationGEPO — make advantages comparable across entropy regimes
(27)–(28)ALOO = Ri − mean(others); Ã = Rlen(RGEPO(ALOO))The baseline, and the composition order
(29)LRL = −E[(1/G)∑(1/|y|)∑ m · sg[ρ̄] · Ã · log πθ]The unified reasoning-RL objective
(30)Ãi,k,t = wi,kAi if Ai>0, else AiProcess weights withhold credit, never soften punishment
(31)–(32)Maximise E[log πT − log πθ] ≡ minimise DKLθ ‖ πT) on student statesOn-policy distillation, reverse KL, mode-seeking
(33)–(36)ÂOPD = sg[log πT − log πprox]; same clipped-REINFORCE formDistillation reusing the whole RL stack

The numbers worth remembering

NumberWhat it is
397BThe main model's parameter count — against Intern-S1-Pro's 1T, "less than half"
56.92 → 60.32Biology-Instructions average, frozen backbone → with Intern-MemDec-4B. 14 tasks up, 7 down
240,000 → 300,000Maximum time-series input length, with 5–6× faster inference at 20% of the memory
256k / 512Pre-training chunk size and overlap; also the maximum sequence length in distillation
3Policy updates of staleness after which a partial rollout is discarded
65,536Maximum generation length in reasoning RL — the source of the straggler problem
8,192 / 8Completed responses per rollout batch, and mini-batch update steps per batch
K = 4, η = 3Draft positions and the LK mixing exponent for speculative decoding
2× / 1.7×Speculative-decoding speedup on rollout generation and end to end — implying rollout was about 82% of wall clock
214,854 / 62,280Executable coding and terminal tasks, and the environments they live in. 43.5% of tasks sit in 9 environments
160Optimization steps shown in the agentic reward trajectories of Figure 11
O(HV) → O(H)Distillation payload reduction — about 0.5 MB instead of 34 MB per 256K trajectory versus top-64
99%Horizon-predictor accuracy — the reason every forecasting success rate is 100
0.785Zero-shot MASE on GIFT-Eval
7 of 9SciTS understanding tasks where the 397B model beat the 1T predecessor

The five sentences to carry out of this paper

If you remember nothing else, remember these. Each is a claim you can now defend from first principles.

#The sentenceWhere it was earned
1An agentic model is one whose training signal came from an execution, not from a preference. That single change makes the reward a program, and therefore an attack surfaceCh 0, Ch 7
2Modelling numbers as numbers beats describing them. Every general model scores 0.0–1.5 F1 on SciTS BIU01; the two models with a time-series encoder score 20.8 and 36.5. A picture of the data is not the dataCh 1, Ch 9
3Reweighting advantages without restoring the mass is a bug. The normaliser in Equation (15) is what turns a length preference into a reallocation rather than a silent, per-query change to the reward/punishment balanceCh 5
4A quality metric without a coverage number is a conditional average over a self-selected subset. MAPE 56.1 at 4.5% success is worse than MAPE 60.2 at 100%Ch 9
5Efficiency tricks are load-bearing on assumptions made stages earlier. The O(H) distillation payload is only sufficient because both teachers share an SFT ancestor with the studentCh 8

Build the intuitions yourself — a weekend checklist

Almost none of this needs 397 billion parameters to understand. Every mechanism has a toy version.

MechanismToy version you can build todayThe thing you will learn
Memory fusionTwo small language models, one general and one fine-tuned on a niche corpus. Fuse their next-token distributions with a hand-set λ and sweep itHow little memory weight is needed to break a tie, and how quickly a high λ wrecks general text
LOO advantageA NumPy function over a reward vector. Check it sums to zeroHow the baseline automatically makes the rare outcome the informative one
Length regularisationImplement Equations (15)–(17) and assert that the positive mass is preservedWhy the normaliser is not optional — remove it and watch the positive/negative balance drift per query
Bidirectional binary KLTwenty lines. Plot DBKL(p‖q) and DBKL(q‖p) over a grid of (p,q)Where each direction is blind, and why the conjunction is the right admission rule
Speculative acceptanceTwo small models. Measure ∑min(p,q) empirically and compare it with your observed acceptance rateThat Equation (21) is an identity, not an approximation
PrefixTree trace storeA trie over token-ID lists with longest-prefix insertion. Store ten rollouts of one promptHow much storage prefix sharing saves, and how the loss mask rides along with the tree
Verifier integrityGive a coding agent a repo with the tests writable, and watch what it doesThat reward hacking is not a rare adversarial event. It is the default

References

  1. Intern-S2-Preview Team, Shanghai AI Laboratory. "Intern-S2-Preview: Scientific Agentic Foundation Model," 2026 — arXiv:2608.13505. The paper this lesson is built on. Weights: huggingface.co/internlm/Intern-S2-Preview; agentic RL framework: github.com/InternLM/xtuner.
  2. Bai, L. et al. "Intern-S1: A Scientific Multimodal Foundation Model," 2025 — arXiv:2508.15763. Reference [8]. The predecessor line; Intern-S1-Pro is the control throughout the evaluation.
  3. Cao, J. et al. "Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language Models," NeurIPS 2025 — reference [12]. The mechanism of Chapter 2.
  4. Cheng, G., Lyu, C., Gao, S., Zhang, W., Chen, K. "Group Entropy-Controlled Policy Optimization," 2026 — arXiv:2607.16850. Reference [21]. GEPO, from the same lab.
  5. Yu, Q. et al. "DAPO: An Open-Source LLM Reinforcement Learning System at Scale," 2025 — reference [96]. The dynamic-sampling rule that filters all-identical reward groups.
  6. Shao, Z. et al. "DeepSeekMath," 2024 — reference [65]. The group-relative optimisation paradigm the agentic credit assignment follows.
  7. Chen, C. et al. "Accelerating Large Language Model Decoding with Speculative Sampling," 2023 — arXiv:2302.01318. Reference [14], with Leviathan et al. as [43]. The lossless verification procedure Chapter 4 relies on.
  8. Aksu, T. et al. "GIFT-Eval: A Benchmark for General Time Series Forecasting Model Evaluation," 2024 — arXiv:2410.10393. Reference [4]. Where the 0.785 zero-shot MASE was measured.
  9. Ansari, A. F. et al. "Chronos: Learning the Language of Time Series," TMLR 2024 — reference [5]; Woo, G. et al. (Moirai) — [85]; Shi, X. et al. (TimeMoE) — [68]. The specialised forecasters in Table 5.
  10. Burgess, J. et al. "MicroVQA," 2025 — arXiv:2503.13399. Reference [11]; Bartmann, C. et al. "MolecularIQ," 2026 — arXiv:2601.15279, reference [9]. Two of the scientific benchmarks in Table 2.
  11. Badertdinov, I. et al. "SWE-rebench V2," 2026 — arXiv:2602.23866, reference [6]; Bai, F. et al. "ClawGym," 2026 — arXiv:2604.26904, reference [7]. Two of the seven task sources in Table 1.
  12. Chen, Z. et al. "Agent-FLAN," ACL Findings 2024 — [19]; "T-Eval," ACL 2024 — [17]; "MindSearch," 2024 — arXiv:2407.20183, [18]. The lab's own agent-learning lineage that the harness × task abstraction grew out of.
  13. Achiam, J. et al. "GPT-4 Technical Report," 2023 — arXiv:2303.08774. Reference [2], cited in §1 as the general-purpose family the paper positions against.
  14. Abramson, J. et al. "Accurate structure prediction of biomolecular interactions with AlphaFold 3," Nature 630, 2024 — reference [1]; Watson, J. L. et al. (RFdiffusion) — reference [82]. The two tools inside ProteinBinder-9's grading pipeline — worth knowing, because they define what a score of 4.36 on that benchmark means.
  15. Aggarwal, P. and Welleck, S. "L1: Controlling How Long a Reasoning Model Thinks with Reinforcement Learning," 2025 — arXiv:2503.04697. Reference [3]. The reward-based approach to length control that §4.3.2 explicitly chooses not to use.
  16. Chen, X. et al. "Do Not Think That Much for 2+3=? On the Overthinking of o1-like LLMs," 2024 — arXiv:2412.21187. Reference [16]. The named symptom that adaptive length regularisation exists to treat.
  17. Cui, G. et al. "The Entropy Mechanism of Reinforcement Learning for Reasoning Language Models," 2025 — arXiv:2505.22617, reference [22]; Cheng, D. et al. "Reasoning with Exploration: An Entropy Perspective," AAAI 2026, reference [20]. The entropy literature GEPO is a response to.
  18. Yang, A. et al. (Gated DeltaNet) — reference [95]. Named in the paper's FP32 precision list, which is the only place the backbone's use of gated linear attention is visible.
  19. Wang, Y. et al. "SciCode," 2024 — reference [75]; "SGI-Bench," reference [90]; "ResearchClawBench," reference [91]. The three science-agentic benchmarks that set the current ceiling on end-to-end research automation.

A closing note on what this paper is evidence for

Stand back from the tables. The claim a report like this can actually support is narrower than "we built a better model," and it is more interesting.

It is evidence that a scientific specialist need not be a narrow one. The model that scores 56.92 on multi-omics sequence analysis — against a field between 4.49 and 13.87 — also scores 89.75 on MMLU-Pro and 61.56 on SWE-Bench Pro. Ten years of intuition said those trade against each other. The staged pipeline of Chapter 8 is the mechanism by which they did not, and the two-expert distillation is the specific step that made it affordable.

It is also evidence that the interesting frontier has moved from the model to the loop around it. Two of this paper's four architecture pages are about input and output paths for signals. Twenty of its thirty content pages are about rollout scheduling, numerical consistency between engines, credit assignment across a session tree, and stopping an optimiser from cheating a test harness. If you had told a researcher in 2020 that a frontier model report would spend two thirds of its length on those subjects, they would have thought you were describing a different field. They would have been right, and the field is this one now.

What to read next, in order

If this paper interested you, there is a natural reading order that builds the background it assumes rather than the background it cites.

OrderReadWhy here
1Policy gradients, then importance samplingChapters 4 and 5 are unreadable without both, and readable to the last symbol with them
2DeepSeekMath for GRPO, then DAPOThe group-relative family this paper's Equation (27) belongs to, and the dynamic-sampling rule it adopts verbatim
3DeepSeek-R1The long-chain-of-thought RL regime whose overthinking problem Chapter 5's length regulariser exists to fix
4Mixture of expertsEverything R3 does only makes sense once you have seen a top-k router
5Speculative decodingChapter 4's Equation (21) is an identity you should meet in its original setting first
6Agent architectures, then the agent loopChapter 6 is about turning these into RL environments; know what they are first
7On-policy distillation, then the surveyChapter 8's reverse-KL argument in its own habitat
8InternVLThe perception lineage this model's Lane 2 descends from, from the same lab
9Time-series forecastingSo Table 5's specialised baselines — Moirai, TimeMoE, Chronos, UniTS — stop being names
10Reward alignmentChapter 7 read from the other direction: what happens when the reward channel is not sealed
Cross-domain bridge
This paper is a distributed-systems paper wearing a machine-learning hat
Read Chapters 4 through 8 again with the words replaced. Partial rollout is checkpoint and resume with bounded staleness. R3 is deterministic replay for reproducibility across two runtimes. The bidirectional-KL mask is a consistency check between replicas, with divergent records dropped. The PrefixTree is structural sharing in a persistent data structure. TITO is an adapter that preserves the wire format while capturing a side channel. Verifier integrity is privilege separation, with grading artefacts applied after the untrusted process exits. Every one of those has a decades-old literature, and the paper's real skill is recognising which one each machine-learning problem actually was. If you have built a job scheduler or a replicated log, you already have the instincts — see distributed data storage and storage and retrieval.
"What I cannot create, I do not understand."
You cannot train a 397B model this weekend. You can implement Equations (15) through (17) and assert the mass invariant, write bidirectional binary KL in twenty lines, and build a PrefixTree over ten rollouts of one prompt. Do those three and the paper stops being a report and becomes a set of tools.
Exit gate — teach it back before you leave.

Without scrolling up: (1) explain why pause-and-resume forces the behaviour policy to be indexed by both trajectory and token position, and write the resulting importance ratio; (2) state what PPO-style clipping does to a token with ρ = 8 that the paper's detached clipped weight does not; (3) compute the leave-one-out advantages for a group of 8 with 5 correct, and check they sum to zero; (4) explain what the leading fraction in Equation (15) preserves and why removing it would be a bug rather than a simplification; (5) explain why process weights apply only to positive advantages; (6) explain, using ENG02, why a MAPE of 56.1 can be worse than a MAPE of 60.2. If any of the six stalls, its chapter is one tap away.

Which sentence best captures what this paper contributes?