Synthetic root traces lift RLM-27B 26.9% on a hard long-context suite

Language Model Harnesses can be Compositional Generalizers

Alex L. Zhang, Souradip Chakraborty, Omar Khattab

cs.CL, cs.AI

2026-11-21

After SFT on 8,015 synthetic root rollouts, RLM-27B moves the same harness from 46.1 to 58.5 on eight long-context tasks and uses about half the tokens.

What problem this solves

A harness is the control program wrapped around a language model: it packs context, calls tools, and chooses the next step. ReAct-style designs append the entire trajectory to the prompt, so the root model rereads a longer history on every turn. Past a point that history leaves the training distribution. Long-horizon work then means collecting full rollouts, and a new shell often scraps the policy.

This MIT CSAIL paper moves that burden off the Transformer and onto a symbolic layer. Locally in-distribution, LID, means each call receives a subproblem the network can already solve. The full task can be new. Each glance should look familiar.

Method

Length and strategy runs use Qwen3-30B-A3B-Instruct-2507 and GRPO on short splits only. The harder suite switches to Qwen3.8-27B. The base Transformer reads the full text and uses YaRN when the window is too short. Pi is ReAct plus sub-agents, with long text unloaded to a file. LM+REPL is CodeAct with a code interpreter: it can scan unloaded context and cannot call another model. RLM keeps the long text in a persistent Python REPL. The root model writes programs and passes slices to sub-models through llmquery. Depth is fixed at 1, and the loss covers root tokens only. Dropping the orchestration addendum in the system prompt barely changes the length curves, except on MRCRv2, where the model learns a solution that does not extrapolate and runs into the context window.

MRCRv2 trains at 32K-64K tokens with two needles and evaluates at 2M-4M with eight, a 64× jump. OOLONG, Ada-LEval, and GraphWalks sit between 2× and 16×. Strategy runs keep the decomposition and change the wording: OOLONG moves from trec questions to spam, OBLIQ-Bench from writing style to math.

Harder benchmarks have no short twin, and RL on the short mixture learns habits that do not transfer. Surrogate harness training targets a single call. Opus 5.5 reads a public split and base RLM trajectories, proposes a program Qwen3.8-27B can run, and builds a synthetic environment whose text does not overlap the real task but whose solution is that same program. On BrowseComp-Plus, ExpertLongBench, and OBLIQ-Bench, sub-calls are replaced with canned answers. Traces are generated with the program as a hint and filtered by GPT-5-mini plus the synthetic reward: 8,015 root rollouts and 1,465 LongReason sub-agent rollouts. One epoch of full-parameter SFT yields RLM-27B. The same environments are also used for RL without the hint.

Results

On short tasks the base model often has the higher training reward, then loses it when the input grows. RLM's training reward rises more slowly, and its long-task reward follows that curve. Where a short program is enough, as in MRCRv2 and GraphWalks, CodeAct already beats the plain network. OOLONG has no such program. The gain appears when semantic checks are handed to sub-calls, which is what RLM does. Pi learns to read a fixed subset and write out long lists. Those habits break as length grows. Three domain-shift settings rank the shells the same way. The paper shows reward curves here, not absolute scores per task.

Eight harder benchmarks that do not share those decompositions are scored in the same RLM harness: LongReason, LooGLE-v2, CTC-Bench, BrowseComp-Plus, OOLONG, CorpusQA, OBLIQ-Bench, and ExpertLongBench.

SetupAverage
Qwen3.8-27B, full prompt30.5
Pi34.9
LM+REPL36.5
RLM base46.1
RL on short tasks48.5
RL on synthetic envs52.9
RLM-27B58.5

The step from 46.1 to 58.5 is +12.4 points, +26.9% relative. Most of it is LongReason (51.4 to 82.0), CTC-Bench (19.1 to 39.8), and ExpertLongBench (53.1 to 71.2). BrowseComp-Plus stays at 64.8 versus 64.9. On OOLONG, hint-free synthetic RL scores 49.5, above RLM-27B at 43.2. LM+REPL, which cannot call a sub-model, scores 36.5 against the RLM base at 46.1. The gap is the sub-calls.

Turns fall from 18.4 to 6.5, about a third. Root input tokens fall from 263K to 44K, about a sixth. Trajectories with at least one sub-call rise from 43.2% to 97.4%, and runs that hit the 40-turn cap fall from 32.9% to 1.1%. Root plus sub-call tokens come to about half, in line with the abstract's roughly 2× claim.

The weaker Qwen3-30B-A3B does not follow this pattern. Its RLM base averages 15.3, below a plain prompt at 22.6. Short-task RL reaches 22.3. Synthetic-environment RL reaches 25.0 and clears the plain prompt. On the stronger model, short-task RL only moves 46.1 to 48.5. The weak policy learns to delegate less. The strong one is what actually fans out.

A four-task chain tests whether the new decomposition composes. The pool is 87 items that RLM-27B solves at 97.5% avg@3 and the base model solves unreliably at 57.7%. Each chain unlocks the next prompt only after a correct answer, with two attempts per task, over 2,000 draws. RLM-27B solves all four on 55.2% (±2.2). A prompt that only says to tail-recurse drops that to 47.2%. Extra SFT that teaches the model to finish the current task and launch a sub-RLM on the rest raises the full-solve rate to 77.5% (±1.8) and the partial rate to 84.4%. The same data on untuned Qwen3.8-27B lowers the full-solve rate from 19.3% to 9.9%.

Why it matters

Long-horizon agent data is expensive because the hard trajectories are long. Here the root model only learns to decompose, and local questions stay with skills the network already has. The text can be synthetic, and some sub-calls can be fake. On Qwen3.8-27B the RLM shell alone moves the average from 30.5 to 46.1. Short-task RL adds 2.4. RLM-27B adds another 12.4 and cuts turns to about a third.

RL on short tasks does not hand you a reusable split. The training environment has to target one call.

Limitations

The synthetic environments are written with the target families in view. Opus 5.5 sees a public split and base trajectories, and the candidate program is placed in the generation prompt. RL on those environments without the hint stops at 52.9 and does not save tokens. The 26.9% is closer to distilling a teacher-written program into the root model. RL did not discover these decompositions on its own.

Fake sub-calls assume the sub-model would have been right. The paper checks that only on OOLONG, where intermediate labels exist and sub-task accuracy stays similar from train to eval. BrowseComp-Plus sits on a shared corpus of about 456 million tokens, and the score barely moves. This path does not open deep retrieval.

The 64× length claim is a reward curve, not an accuracy table. The recursion test covers 87 tasks the tuned model can already solve, and merely telling it to tail-recurse makes the chain worse. The main experiments lock depth at 1.

Terms

Source

What people are saying

Related papers

All paper explainers