Skip to content

Language Model Harnesses Are Compositional Generalizers

optionalextendedfrontierpaperrubric 8/122026 · Blog post (July 2026) & arXiv paper (November 2026) · ~25 min

Alex L. Zhang, Souradip Chakraborty, Omar Khattab

Read first: Recursive Language Models (RLMs)

Status

TL;DR. This essay argues that the harness, the program between the environment and the language model, is where compositional generalization should live. A good harness reduces unfamiliar or complex problems to calls that are each locally in-distribution for the model, so tasks that the harness handles with the same program look alike to the model. The authors test this by RL-training a recursive language model (RLM): trained on short tasks, it improves on tasks 8–32× longer, and trained on one domain, it transfers to another, while training the same Transformer without the harness barely transfers.

New input versus new program. Start with two illustrative tasks. Task A asks a question over a long log of TREC questions; task B asks a similar question over a long collection of web pages. A harness can solve both with the same control program: split the corpus into chunks, read each chunk with a sub-call, then aggregate the answers. The inputs differ, but the program does not, so the model at the top of the harness sees almost the same trajectory. A task C that needs a different tool sequence (say, search first, then follow links) is not a new input to the same program; it asks for a different program, which is a different and harder generalization claim.

The formal version. The essay writes this as an equivalence relation ∼H\sim_H on tasks: two tasks are equivalent under harness HH when HH reduces them to the same pattern of calls (A and B above). The model then only needs to learn the much smaller quotient set T/∼H\mathcal{T}/\sim_H, one representative per class, rather than every task in T\mathcal{T}.

Why harnesses, not weights. Transformers are unreliable at composing what they learn, so post-training keeps adding environments and longer horizons. The authors propose that the harness carry a higher-level inductive bias: break a state ss that may be huge or unfamiliar into smaller observations oo that the model has effectively seen before.

How the RLM does it.

  • Context offloading. The long input sits in a variable of a REPL (a read-eval-print loop: a code session the model writes into and runs); the root model never reads it directly, so different tasks start from nearly the same prompt.
  • Programmatic sub-calls. Tools and sub-models are functions in the REPL, and their outputs are stored in variables. Task-specific content can flow between sub-calls without entering the root context.

Together these make the root model’s trajectory on BrowseComp-Plus and OOLONG nearly identical in principle (the essay’s Fig. 2), so learning one helps the other.

  • Setup. Qwen3-30B-A3B-Instruct-2507 trained with prime-rl for 150 steps (batch 64, 4 rollouts each), as an RLM, as an RLM with a nudge to decompose, and as a plain Transformer (with YaRN for long inputs).
  • Length generalization (Fig. 6). Six environments (MRCRv2, GraphWalks, LongBenchPro, OOLONG, OOLONG-Pairs, Ada-LEval), training on short splits and evaluating on splits 8–32× longer. RLM evaluation scores rise with training reward; the Transformer’s stay flat even when its training reward is higher. On four tasks the trained 30B RLM approaches or beats GPT-5.5 in the same harness. On MRCRv2 the nudge was needed to find a strategy that generalises.
  • Cross-domain transfer (Fig. 7, 500 steps). OOLONG TREC questions to spam questions; OBLIQ-Bench analogues from writing to math and descriptive search from Twitter stance to WildChat errors (scored by nDCG@10). The RLM’s evaluation curve tracks its training curve; the Transformer improves little beyond learning the answer format.
  • Cost. RLM training takes 1.5–3× longer than the base model on the same tasks, but scales better as tasks get longer.
  • Trajectory similarity (appendix). On five surface metrics, RLM evaluation trajectories are closer to their nearest training trajectory than the Transformer’s are. The authors note these proxies do not capture whether the same strategy is used.

November 2026 full paper update (arXiv 2611.28298)

Section titled “November 2026 full paper update (arXiv 2611.28298)”

On November 20, 2026, Alex L. Zhang, Souradip Chakraborty, and Omar Khattab released the full paper Language Model Harnesses can be Compositional Generalizers (arXiv 2611.28298, HTML), expanding the July 2026 blog post into a scalable RL training recipe:

  • Broader length generalization (2–64×): RL training a neurosymbolic RLM harness on short tasks generalizes to evaluation tasks 2–64× longer via recursive sub-harness calls.
  • Surrogate harness training: Rather than paying the latency and token cost of full live recursion during RL, the paper introduces surrogate harness training—synthetic environments with fake tool and sub-calls that teach the decomposition interface cleanly on short tasks.
  • RLM-27B results: Trained from a Qwen3.8-27B base, RLM-27B improves by 26.9% on average across CTC-Bench and ExpertLongBench while using roughly 2× fewer tokens, composing solutions through recursive sub-harness calls.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Mechanism

    Explain how the two parts of a recursive language model, context offloading and programmatic sub-calls, make the root model's trajectory nearly the same for two tasks that share a decomposition but differ in length or domain, such as BrowseComp-Plus and OOLONG. Why does a ReAct-style agent that appends tool outputs to its context not get this benefit?

    What a strong answer covers
    • Context offloading stores the long input as a variable in a REPL, so the root model sees a short, task-agnostic description instead of the raw text.
    • Programmatic sub-calls run sub-models and tools as functions whose outputs go into variables, so task-specific content need not return to the root context.
    • The root model then writes similar code (chunk, fan out sub-calls, aggregate) for both tasks, so its tokens look alike: the harness groups the tasks into one equivalence class.
    • A ReAct or Claude Code style agent appends every observation to a growing prefix, so long or new-domain tasks produce out-of-distribution contexts (context rot).
    • Each sub-call handles a small piece that is in-distribution on its own, which is what locally in-distribution means.
  2. Derive / compute

    The appendix measures how close evaluation trajectories are to training ones by averaging, over evaluation samples, the minimum distance to any earlier training trajectory, using token edit distance, 3-gram containment, Jaccard, weighted Jaccard and length ratio. Write the 3-gram containment distance and explain why the authors take a minimum over training trajectories, and why a content-blind length ratio is included.

    What a strong answer covers
    • Containment distance = 1 − |N3(eval) ∩ N3(train)| / |N3(eval)|, where N3 is the multiset of word 3-grams; it asks how much of the eval trajectory already appeared in a training trajectory.
    • Taking the minimum over earlier training trajectories finds the nearest seen trajectory, a nearest-neighbour test of whether the eval trajectory is in-distribution.
    • Averaging that nearest distance over eval samples gives one number per checkpoint that can be compared between the RLM and the base Transformer.
    • The length ratio ignores content, so it shows how much of the similarity comes just from the RLM keeping its root context short and stable.
    • All of these are surface proxies; they do not show that the same decomposition strategy is used, which the authors admit.
  3. Critique

    The essay claims about 10× more evaluation lift than training the Transformer directly, for the same training lift. Critique the evidence: what is held fixed, what could explain the gap besides compositional generalization, and what would make the claim stronger?

    What a strong answer covers
    • Same model (Qwen3-30B-A3B-Instruct-2507), same RL recipe and steps, but the RLM uses a different harness and 1.5–3× more training runtime, so compute is not matched.
    • The base Transformer must read 8–32× longer inputs at eval, beyond its training lengths even with YaRN, so part of the gap is plain long-context failure rather than poor composition.
    • For MRCRv2 the RLM needed a nudge to decompose before it learned a strategy that generalised, so success depends on finding the right decomposition.
    • These are the authors' own experiments in a blog post on six length and three cross-domain tasks; independent replication and comparison with other harnesses (e.g. a memory-folding ReAct agent) are missing.
    • Stronger evidence: compute-matched baselines, more seeds, and tasks where the decomposition is not obvious from training.

Done with this page?

Status