WorksComputer Science
Language Model Harnesses can be Compositional Generalizers
Abstract
Modern language models (LMs) are post-trained and deployed as agents inside a "harness", but standard harness designs accumulate context that the neural network is forced to generalize to, making training for long-horizon tasks expensive and time-consuming. We study an alternative emerging path: training inherently neurosymbolic LM harnesses, which externalize and manage context programmatically to compose existing LM capabilities. We hypothesize that training around these harnesses can offer a better return on compute by enabling compositional generalization, as they can learn to decompose complex problems so that every observation their neural LM receives is locally in-distribution, even when the full task is novel. We find that harnesses like the Recursive Language Model (RLM) learn such decompositions readily under reinforcement learning post-training: (1) we demonstrate that training only on short tasks can generalize to tasks 2-64 longer while the base neural LM improves less, and (2) training on one domain transfers to novel domains that share latent structure. On messier, complex tasks, we find that we can target individual LLM calls within a harness by generating and training on easier, synthetically generated surrogate environments with fake tool / sub-calls, a technique we call surrogate harness training. From this finding, we train RLM-27B on synthetic data, and show it improves Qwen3.8-27B in the same RLM harness on a hard suite of long-context tasks like CTC-Bench and ExpertLongBench by 26.9% on average while using 2 fewer tokens at inference time. Finally, we show that harnesses can compose over these newly learned decompositions using recursive sub-harness calls.
Introduction
Many real world problems admit natural decompositions into smaller sub-problems with optimal substructure [16] (Simon 1962), making compositional algorithms like MapReduce duce [12] prevalent in computer systems. However, in modern language models (LMs), despite being able to solve superhuman tasks (OpenAI, 2026a), it has been empirically shown that they are still unreliable [1, 14, 27] (Motwani et al. 2026) at compositional generalization: the ability to solve unseen problems by composing familiar ones. Instead, for the past few years we have tackled harder and longer tasks [23] (Yang et al. 2026) by scaffolding the neural language model with multi-turn agent harnesses and tools (Schick et al., 2023). These harnesses are used in real-world problems to equip LMs with inductive biases to decompose problems into manageable subproblems [2] (Yang et al. 2024), and avoid LM limitations like context rot [19].
However, the capabilities learned through training modern LM harnesses still do not necessarily compose well. The issue with these “trajectory-as-a-prompt” language model harnesses derived from ReAct (Yao et al., 2023) – which provide the entire agent history in-context to an orchestrator (i.e., root) LM to produce their next action – is that the LM within the harness still relies on generalization through the underlying Transformer (Vaswani et al., 2017): the orchestrator LM must learn the correct policy at every harness step given the full trajectory up to that point as its input prompt. Therefore, learning the desired behavior requires curating environments using the harness and training on full rollouts – e.g., a common practice is to post-train an LM using a coding agent (Yang et al., 2024) on difficult coding benchmarks [20] (Yang et al. 2026), which struggles to generalize to a new harness or new environment. We argue that unless our systems compose the individual lessons they learn, scaling will have slower returns than it should, as every new domain will demand its own training data to become “in-distribution”, even when its constituent subproblems are already within the LM’s capabilities (§ 2).
In this paper, we study compositional generalization of language agents from the perspective of decomposition of information at the text-level, rather than at the neural level (Olsson et al., 2022; Song et al., 2025). In particular, we study whether harnesses can shape the information propagated to each LM call so that unseen tasks reuse familiar local computations, a property we call locally in-distribution¹ (LID; see Figure 1). We examine this property in relation to common harness abstractions, such as context offloading, programmatic tool calling (PTC) (Wang et al., 2024b), and recursive sub-agent calling. For example, on dense data processing tasks [5], we observe that harnesses with PTC and sub-agents can invoke batches of sub-LM calls to label short pieces of context accurately; on longer, unseen variants of the task, the harness can reuse this decomposition and repeat these sub-LM calls (§ 3). We find that training around the harness enables it to take part in generalization: the root LM reuses learned decompositions across different tasks, and its sub-calls reuse existing capabilities on local sub-tasks, even when the overall task is unseen.

Figure 1. Harnesses like Recursive Language Models (RLM) can enable compositional generalization on unseen tasks by shaping prompts for each individual language model call to be in-distribution, a property we call locally-in-distribution (LID). “Trajectory-as-a-prompt” harnesses like ReAct rely on a root language model to generalize its policy to a growing trajectory as in-context prompts, frequently leading to erroneous behavior on out-of-distribution (OOD) prompts.
Empirically, we find that reinforcement learning (RL) training (Shao et al., 2024) a language model with or without a harness improves on training, but a proper harness can better generalize across length and domain. In particular, we observe that the Recursive Language Model (RLM) (Zhang et al., 2026b) harness can generalize to unseen tasks – longer than tasks seen during training (§ 3.1), as well as unseen tasks in novel domains that share a similar solution structure (§ 3.2). We also observe that harnesses like CodeAct (Wang et al., 2024b) and Pi (Zechner, 2026) exhibit similar generalization capabilities on certain programmatic tasks over the base Transformer, but struggle when these solutions require reasoning densely (Singhal et al., 2026) over many sub-tasks.
These findings suggest a strategy for improving language model capabilities on difficult tasks with long rollouts: we can target the behavior of individual LMs within a harness, which compose with their existing capabilities to solve the real task. We call this strategy surrogate harness training: to train a desired LM’s behavior within a harness, we construct easier, synthetic environments (e.g. with a fake harness, tool calls, or sub-calls) that reproduce what it would observe in the harness on a real task. We select eight difficult benchmarks across different decomposition strategies (e.g. retrieval, ranking, dense MapReduce-style tasks) (§ 4), and show that training on these surrogate environments yields RLM-27B, improving on this suite by 26.9% on average in the same harness while using fewer turns, and fewer tokens (§ 4.2). Finally, we show that harness-level recursion enables composing over newly learned root-level orchestration behavior, so an entire learned solver becomes a reusable component of a larger task (§ 4.3).
Harnesses reduce generalization burden on language models
It is well known that the generalization capabilities of even frontier language models are limited and not well understood [1, 14] (Liu et al. 2023a; Wu et al. 2024; Motwani et al. 2026). Even semantically identical but token-wise different inputs can lead to vastly different output distributions [8] (Sclar et al. 2024; Romanou et al. 2026), and empirically, we observe that model behavior degrades as a function of input context length, even when the individual tasks are solvable in isolation by the model (Li et al., 2026). In agentic, multi-turn settings, these issues are exacerbated in “trajectory-as-a-prompt” harnesses like ReAct, which keep a running append-only context that the model is prompted with every turn. As the agent history grows and the language model is prompted with increasingly convoluted and out-of-distribution trajectory histories, we observe undesirable behavior like context rot [19].
A simple explanation for this phenomenon is the lack of guarantees around the training process for language models, which assumes that the reward maximizing policies over our training data and evaluation environments are nearly the same. Standard post-training algorithms like RL rely on the neural network’s learned representations to bridge this gap and generalize. Our hypothesis, in line with the Mismanaged Geniuses Hypothesis (Zhang et al., 2026a), is that a suitable harness can reduce this generalization burden by transforming globally out-of-distribution tasks into sets of locally in-distribution language model computations.
We motivate and study useful design principles behind harnesses around this hypothesis. An alternative view of neural language models is to treat them as probabilistic functions, in which harnesses provide a mechanism for composing these functions around inputs and outputs they are capable of reliably solving in isolation. Under this view, recent harness abstractions in popular coding agents (Figure 2) significantly influence what individual LLM calls observe when solving unseen tasks.

Figure 2. Several popular harness abstractions are useful for controlling what individual LM calls observe. (a) Context offloading keeps the full context in the environment and only allows the model to see slices. (b) Programmatic tool calling treats tools (e.g. sub-agents) as functions in code, which can manipulate intermediate state without the model needing to see it. (c) Sub-agent calling allows the model to explicitly fan out to other LMs, each with their own fresh context. These abstractions can be composed, yielding stronger task generalization effects.
In our experiments, we compare the implicit learning behavior of well-understood instantiations of these harness abstractions, as well as the base neural language model, to directly compare how harness design choices can lift generalization pressure off the Transformer. We choose each method based on the minimal abstractions they provide and opt out of task-specific harness designs, which are shown to yield negligible differences in overall system capability (Pan et al., 2026).
Base Transformer / “Trajectory as a Prompt”. We choose the base Transformer model to represent the “trajectory-as-a-prompt” harnesses that rely on the Transformer’s ability to generalize across both length and task structure, as they directly condition on all context to influence their actions.
Pi with sub-agents and context offloading. The Pi-mono (Zechner, 2026) harness encapsulates the ReAct (Yao et al., 2023) loop with terminal, compaction, and sub-agent (Zechner, 2026) tools used in most modern coding agents [2] (OpenAI 2025b). Additionally, we offload long context into a file that the harness interacts with.
CodeAct / LM + REPL with context offloading. CodeAct (Wang et al., 2024b) harnesses use programmatic tool calling (PTC) over JSON-style tool calling (Schick et al., 2023), meaning all other tools are functions within a code REPL environment. This harness is implemented as an RLM without programmatic sub-agent calling or output truncation to ablate the value of sub-calls.
RLM. The Recursive Language Model (Zhang et al., 2026b) is a class of harnesses that rely on context offloading and programmatic sub-agent calling to act over context. Following the original paper and other popular instantiations such as Ax (Dosco, 2026) and Prime Agent [25], we choose depth=1 sub-agents, as it is directly comparable with coding agents that invoke sub-agents, and it is equally as expressive as higher depth RLMs.
Composing with existing LM capabilities to generalize
In long-context settings, a commonly observed problem is that language models can solve small instances of a task, but struggle on longer variants as the task length grows (Li et al., 2026). In general settings, another observable issue is that models struggle to solve tasks with similar task structure but different token-wise descriptions with respect to a task learned during training.
We begin by studying how LM harnesses can be trained to compose their existing capabilities to induce generalization across (1) different task lengths and (2) different task domains. For the following experiments, we train Pi on both the root and the sub-agents, while for the RLM we apply loss only to the root trajectory, analogous to Recursive Agent Optimization [17] with no sub-call delegation bonus. Training configuration details are in Appendix A.
| Environment | Train Tasks | Evaluation Tasks | Length × |
| MRCRv2 (Vodrahalli et al., 2024) | 32K–64K tokens, 2-needle | 2M–4M tokens, 8-needle | 64× |
| GraphWalks (OpenAI, 2025a) | ≤128K tokens | 50 samples, 256K–1M tokens | 2–8× |
| LongBenchPro [11] | 32K tokens, English | 256K tokens, English | 8× |
| OOLONG [5] | 32K split, trec-coarse | 256K split, trec-coarse | 8× |
| OOLONG-Pairs (Zhang et al., 2026b) | 8K input tokens | 32K tokens | 4× |
| Ada-LEval (Wang et al., 2024a) | 8K tokens | 128K tokens | 16× |
Table 1. Training and evaluation environments, where the evaluation splits are longer variants of the training split within the same task domain.
Length Generalization in harnesses through sub-task composition
In Anil et al. (2022), a key result is that when training on a particular task, it is often out-of-distribution for a language model to solve the same task at longer context lengths. In Uzunoglu et al. (2026), the authors observe that directly training on long-context tasks can negatively impact the performance of Transformers on already learned tasks. To mitigate both findings, we are interested in whether the harness abstractions in Figure 2 enable learning composable behavior by training on only short tasks that generalizes to longer tasks.
On a suite of tasks in Table 1 where context length can be varied, we train our harnesses with Qwen3-30B-A3B-Instruct-2507 (Yang et al., 2025) using GRPO (Shao et al., 2024) on the short splits only, and evaluate on longer splits with per-environment ranges listed in Table 1 (for training details, see Appendix A). For tasks where the evaluation split does not fit in the context window of the model, we apply YaRN length extension (Peng et al., 2024) to the base Transformer.
We report our findings in Figure 3, where we find that the evaluation reward of the RLM on longer splits better matches the training reward, which often nearly solves the length-extrapolated task.

Figure 3. On six environments with controlled context lengths, we train several harnesses and the base Transformer on short tasks, and evaluate on longer variants. We plot their train reward (smoothing window=3) and evaluation reward (smoothing window=11) over training, and include a frontier model, GPT-6 Astra (OpenAI, 2026b), using the RLM as a reference. The evaluation reward of the RLM closely follows the trend of the training reward, while for the base Transformer it does not.
Context offloading with the harness generalizes better to longer tasks. Each harness often generalizes better than the base neural language model, which struggles to generalize to longer tasks by only training on shorter tasks. Notably, the train reward on short tasks is often higher for the neural language model than other harnesses, while the train reward for the RLM grows slower, but closely matches its reward on the longer evaluation tasks. Between the harness abstractions, the RLM is able to successfully lift performance or perform better on each task than the other harness variants due to the ability to fan out sub-agents over an offloaded context, and act efficiently through LM programs as actions. Furthermore, when observing the root trajectories of these harnesses on long tasks, we find that they share strong similarities to successful trajectories generated during training, reflecting that longer tasks are viewed as locally in-distribution (see examples in Appendix § 11.§ 4).
When code is not sufficient, RLMs compose their sub-call capabilities to length generalize via LID. We observe length generalization occurs when the harness learns a pattern at length that also applies for tasks at length . For example, in settings like MRCRv2 and GraphWalks, harnesses with programmatic capabilities like CodeAct generalize well over the purely neural baseline by writing the code that solves both the short and long tasks. However, on tasks like OOLONG and OOLONG-Pairs without a clear programmatic solution, harnesses must compose the capabilities of their sub-agents over in-distribution sub-tasks with their learned decomposition to generalize.
Strategy Generalization in harnesses through sub-task composition
The length generalization effect from training the RLM harness can be understood as the unseen, longer tasks being locally in-distribution with 1) what the root LM learns during training; 2) what the LM already can do on sub-tasks invoked through the harness.
This principle is agnostic to the axis of context length and applies generally when the root LLM in a harness learns a high-level strategy that solves tasks across different domains, by deferring domain-specific sub-tasks to sub-calls. We call this observation, strategy generalization, in which training on one domain transfers to another with similar structure. We use the same setup as with length generalization but train for more steps, with the environments chosen in Table 2.
| Environment | Train Tasks | Evaluation Tasks |
| OOLONG ([5]) | trec-coarse questions, 32K tokens | spam questions, 132K tokens |
| OBLIQ-Bench ((Tchuindjo et al., 2026)) | Writing-style analogues (300 docs) | Math analogues (300 docs) |
| OBLIQ-Bench ((Tchuindjo et al., 2026)) | Twitter stances (300 docs) | LLM transcript errors (300 docs) |
Table 2. Training and evaluation environments that do not share domain-specific context, but share similar decomposition strategies.
Strategy generalization through compositional generalization follows similar harness trends to length generalization. In each of the three environments, the token description of each task greatly differs from its evaluation counterparts, leading to poor generalization capabilities of the base Transformer despite its train reward growing similarly to harnesses that offload context. Pi struggles on these tasks due to their dense, long-context processing requirements (Singhal et al., 2026), with its train reward also being low on OBLIQ-Bench. The LM + REPL harness similarly struggles when context processing is dense. The RLM is able to generalize the best across all three tasks, with its growing evaluation reward trending similarly to its train reward over time.
Characterizing Locally In-distribution Trajectories
The training experiments in § 3.1, § 3.2, and the strong evaluation rewards of certain harnesses establish that some learned harness behavior transfers to unseen tasks. In this section, we assess whether these observed generalization effects can be attributed to locally in-distribution trajectories through two complementary diagnostics: reuse of root-level orchestration trajectories and reliable execution of delegated sub-tasks.
To characterize the reused root orchestration behavior that enabled this compositional generalization effect, we compare the root trajectories produced by each harness during training and evaluation using token-wise Weighted Jaccard similarity (see Appendix § 11.§ 3). To characterize composable sub-task behavior that is “in-distribution”, we examine whether the models solve the sub-tasks reliably, rather than tracing whether the exact sub-task prompt appears in the model’s training distribution.
Context offloading yields higher token similarity across trajectories. In practice, many tasks share similar solutions while containing extremely different contexts, e.g., with respect to context length and task domain. We find in Figure 10 in Appendix § 11.§ 3 that on the experiments in Figure 3 and Figure 4, context-offloading harnesses share significantly higher similarity across multiple token-wise metrics on most evaluation tasks to some successful trajectory seen during training.

Figure 4. We choose three environments with splits that are completely disjoint in domain (e.g. math vs. essay writing questions), but share a similar decomposition structure (e.g. ranking). We train several harnesses and the base Transformer (Qwen3-30B-A3B-Instruct-2507) on one domain, and evaluate on the other, where the RLM generalizes the strongest among other harness abstractions and the base model.

Figure 10. For each evaluation environment in the length and strategy generalization experiments in Figure 3, Figure 4, we plot the mean maximum similarity to a successful training trajectory under each metric. Higher values indicate higher similarity.
Token-wise similarity of root trajectories is not enough for task transfer. In Figure 5, we observe that for the RLM and CodeAct harnesses, reward on training and evaluation tasks is similar for tasks that share similar root-level trajectories. However, for Pi, we observe significant degradation in transfer performance on non-programmatic tasks because many strategies it learns at the short length, such as reading fixed subsets of the data with sub-agents or writing out long intermediate lists by hand, do not generalize well for longer context. On programmatic tasks like GraphWalks, we find that all context-offloading harnesses produce length-invariant compact programs in Python / bash over the offloaded context that generalize. However, on tasks like OOLONG and Ada-LEval

Figure 5. For several harnesses, we train on short tasks and evaluate on their long-context variants. For each setting, we track the nearest three training trajectories by Weighted Jaccard Similarity to each long evaluation trajectory, and average their rewards. We find that context-offloading harnesses learn root-level trajectories that are re-used in longer tasks compared to “trajectory-as-a-prompt”, but training performance does not necessarily transfer for all harnesses, like Pi on OOLONG.
with semantic sub-tasks, the RLM exhibits the strongest transfer in reward between evaluation tasks and similar training tasks. We provide specific examples of root-level trajectories in Appendix § 11.
Verifying local sub-task reliability. The observation that these harnesses are producing locally in-distribution trajectories relies on the delegated sub-task LLM invocations being correct. For tasks that contain intermediate sub-task ground truth labels like OOLONG, we find that sub-task accuracy is similarly high across training and evaluation tasks (see Table 19, Appendix § 11.§ 5), supporting the reuse of reliable local computations as the overall task changes.
| Environment | Delegated sub-task | Ground truth | Metric | Train | Eval |
| Length generalization | |||||
| OOLONG | Label one question line (6 classes) | TREC label | Accuracy | 86.1→85.6 | 81.7→83.7 |
| OOLONG-Pairs | Label one question line (6 classes) | TREC label | Accuracy | 88.5→90.3 | 83.9→89.3 |
| Ada-LEval | Is this candidate answer relevant? | Accepted answer vs. distractors | Balanced acc. | 82.5→93.4 | 78.5→83.0 |
| GraphWalks | Parse edges into an adjacency dict | Edges in the prompt | Exact match | – | 99.8→(–) |
| LongBench-Pro | 25 task types | No per-call ground truth; not scored | |||
| MRCRv2 | 0–2% of rollouts delegate; 0.0 sub-calls on average | No per-call ground truth; not scored. | |||
| Strategy generalization | |||||
| OOLONG TREC→spam | Label one line (TREC / spam) | Per-line label | Accuracy | 87.7→85.9 | 70.6→87.3 |
| OBLIQ Twitter→WildChat | Score one document for the query | qrels positive | AUC×100 | 76.4→77.3 | 83.6→88.1 |
| OBLIQ Writing→Math | Score one document for the query | qrels positive | AUC×100 | 69.3→79.3 | 70.0→67.3 |
Table 19. Delegated-subtask scores (%) for the base model → best checkpoint, on the training and evaluation splits. Metric-specific aggregation is defined in the text.
Compositional generalization enables localized training
In §3, we motivated how harnesses that induce locally in-distribution trajectories like the RLM can generalize across length and task strategy by composing their existing capabilities in sub-calls with their newly learned task decomposition capability. We showed that this root-level capability can be learned through RL on an easier, similar task that shares decompositional structure. In this section, we explore how this compositional generalization effect can be utilized as a data-efficient training strategy in settings where either similar, easier tasks do not exist, or the correct decomposition strategy does not emerge naturally through RL.
We choose a selection of modern long benchmarks in Table 3 that are either disjoint from or more difficult variants of environments from our prior analysis, where a certain axis of transferrable behavior is not explicit.
| Benchmark | Evaluation split | Context Length | |
| LongReason (Ling et al., 2025) | All 128k items | 118K | 794 |
| OOLONG-Real [5] | D&D test, 170K split. | ∼175K | 577 |
| OBLIQ-Bench (Tchuindjo et al., 2026) | Math, full corpus | ∼278K | 151 |
| CorpusQA (Lu et al., 2026) | 1M, real estate (English) | 451K | 81 |
| LooGLE-v2 [18] | ≥500K | 675K | 206 |
| BrowseComp-Plus [10] | All queries; full corpus | ∼456M | 830 |
| ExpertLongBench (Ruan et al., 2026) | T01, T03, T04, T06 | 31K | 350 |
| CTC-Bench (Singhal et al., 2026) | QDMatch 256K, Outlier 1M, Absence 32K, Grouping 32K, Contradiction 1M | 32K–1M | 535 |
Table 3. Held-out evaluation splits. Context lengths are approximate token estimates from the input text; BrowseComp-Plus includes its full shared corpus. CTC-Bench scores are averaged over each split, which each contain a different number of entries.
RL post-training can yield non-generalizing harness behavior
Following our experiments in § 3, we explore whether the learned behavior from RL training the RLM harness on tasks in Table 1 transfers to more difficult long tasks in Table 3, none of which directly share decompositional structure with the training tasks. We post-train the Qwen3-30B-A3B-Instruct-2507 and Qwen3.8-27B (Qwen Team, 2026) models to examine the gains in learned behavior between a weaker and stronger base model. We report the Base Transformer (+ YaRN (Peng et al., 2024)) and Pi as reference baselines as well.
Harness behavior learned through RL training is not necessarily compositional. In Table 4, we find that RL over our short tasks in Table 1 raises the Qwen3-30B-A3B-Instruct-2507 average by 7 points, while for Qwen3.8-27B it’s only 2.4 points. At the same time, we find in Table 5 that token usage decreases for the former but increases for the latter. The behavior learned via RL is highly dependent on the initial policy: the weaker Qwen3-30B-A3B-Instruct-2507 learns to delegate less to sub-calls and rely on programmatic solutions, while the stronger Qwen3.8-27B learns policies that fan out more reliably to sub-agents. This discrepancy is also evident in the gap between the base Transformer / Pi and the RLM, which for the weaker Qwen3-30B-A3B-Instruct-2507 produces similar trajectories to the other harnesses, while for the stronger Qwen3.8-27B, it takes advantage of programmatic sub-agents. We also explore in Appendix § 8.§ 4.3 whether a broader task suite contains trajectories that compositionally generalize to our evaluation suite, but similarly find the trajectories learned in training transfer weakly.
| Method | LongReason | LooGLE | CTC | BC+ | OOLONG | CorpusQA | OBLIQ | ELB | Avg. |
| Qwen3-30B-A3B-Instruct-2507 | |||||||||
| Base Transformer | 63.1 | 34.5 | 0.2 | 0.0 | 18.7 | 11.7 | 0.5 | 52.2 | 22.6 |
| Pi (base) | 72.2 | 26.2 | 0.2 | 3.5 | 13.6 | 8.1 | 0.4 | 27.6 | 19.0 |
| LM + REPL | 44.7 | 24.7 | 1.0 | 0.0 | 13.6 | 7.3 | 4.7 | 33.1 | 16.1 |
| RLM (base) | 44.6 | 18.3 | 1.1 | 2.1 | 15.1 | 11.2 | 4.5 | 25.6 | 15.3 |
| + RL (short tasks) | 74.9 | 21.7 | 2.2 | 8.3 | 19.3 | 17.8 | 7.3 | 26.8 | 22.3 |
| + RL (synthetic tasks) | 69.6 | 28.2 | 1.6 | 6.8 | 18.6 | 23.7 | 7.2 | 44.0 | 25.0 |
| Qwen3.8-27B | |||||||||
| Base Transformer | 69.1 | 44.1 | 7.9 | 0.0 | 20.7 | 28.2 | 15.6 | 58.2 | 30.5 |
| Pi (base) | 80.7 | 61.6 | 1.0 | 54.0 | 16.8 | 26.2 | 0.7 | 38.2 | 34.9 |
| LM + REPL | 79.6 | 51.0 | 12.4 | 34.7 | 20.6 | 49.6 | 14.3 | 29.8 | 36.5 |
| RLM (base) | 85.3 | 51.4 | 19.1 | 64.8 | 33.3 | 48.4 | 13.5 | 53.1 | 46.1 |
| + RL (short tasks) | 87.7 | 52.4 | 18.7 | 64.6 | 46.6 | 45.5 | 18.7 | 53.8 | 48.5 |
| + RL (synthetic tasks) | 90.7 | 60.1 | 20.8 | 67.5 | 49.5 | 58.1 | 20.0 | 56.4 | 52.9 |
| RLM-27B (synthetic) | 90.1 | 82.0 | 39.8 | 64.9 | 43.2 | 61.6 | 15.2 | 71.2 | 58.5 |
Table 4. We report average scores for several base and post-trained models using the RLM harness on long tasks in Table 3. For each model, we RL post-train on the short-context variants of the environments studied in §3.1, as well as the targeted synthetic environments constructed in §4.2.
| Method | # Turns | # Sub-calls | Delegates | Turn Cap | Root tokens (in / out) | Sub-call tokens (in / out) |
| Qwen3-30B-A3B-Instruct-2507 | ||||||
| RLM (base) | 16.9 | 697.0 | 49.5% | 35.4% | 321K / 16K | 979K / 219K |
| + RL (short tasks) | 13.1 | 416.5 | 35.8% | 16.6% | 215K / 16K | 619K / 50K |
| + RL (synthetic tasks) | 13.1 | 1031.1 | 55.9% | 4.6% | 260K / 19K | 577K / 50K |
| Qwen3.8-27B | ||||||
| RLM (base) | 18.4 | 87.3 | 43.2% | 32.9% | 263K / 5K | 443K / 10K |
| + RL (short tasks) | 16.9 | 214.1 | 42.4% | 25.4% | 292K / 7K | 743K / 25K |
| + RL (synthetic tasks) | 16.1 | 27.4 | 45.2% | 19.0% | 392K / 10K | 383K / 29K |
| RLM-27B (synthetic) | 6.5 | 98.5 | 97.4% | 1.1% | 44K / 3K | 276K / 62K |
Table 5. We report average harness statistics for the evaluation trajectories in Table 4. Delegates reports the percentage of trajectories with at least one sub-call. Turn Cap reports the percentage of trajectories that hit the 40-turn harness limit (harnesses can still submit an answer at the turn cap). Expanded per-environment statistics are reported in Appendix § 10.
Targeting Individual LM Calls in a Harness with Surrogate Environments
We previously observed that harnesses like the RLM can be trained to solve long, unseen tasks by strictly learning only the trajectory of one of its LM calls—in particular, the root—to compose with the LLM’s existing capability to solve other sub-tasks. In our experiments, we focused on learning this behavior by training on easier but similar tasks that shared the same strategy, so the root LLM would apply the same strategy on the target evaluation task, while composing with its sub-calls’ ability to solve the new, but still in-distribution sub-tasks.
Surrogate harness training. In practice, on messy and realistic tasks, such training environments do not exist. Furthermore, in §4.1, we found that RL training on the short-task environment mixture may lead to undesirable downstream behavior that degrades performance on some settings. Instead, we use our finding that task composition allows us to target an individual LLM’s behavior within a harness, and we construct synthetic training environments that do not share context with the real environment, but share a solution that mimics the target LLM’s desired behavior (see Figure 6a). These surrogates are designed with knowledge of the target task families, preserving candidate solution strategies for an individual LLM, while changing task content and, in some cases, simulating tool calls and sub-calls.

Figure 6. Harnesses that decompose tasks to be locally in-distribution (LID) are composed of individual LLM trajectories. (a) On the left, we describe surrogate harness training, a strategy for training on synthetic environments to target individual LLM behavior within a harness, using a surrogate synthetic environment that transfers behavior to the real environment when tools and sub-calls are real. (b) On the right, we describe how learned decomposition strategies invoked by the harness can be composed to be LID, by enabling the harness to invoke sub-harness calls recursively.
Generating synthetic environments for learning task decomposition strategies. For each task environment in Table 3, we provide Opus 5.5 [3] using Claude Code with a publicly available, separate split of the task environment and data separate from the evaluation tasks, as well as several existing RLM trajectories taken from the base model, and task it with identifying a candidate LM program that can be used to solve the task with Qwen3.8-27B. We then task it with constructing a synthetic environment of tasks whose context does not overlap with the real task, such that this candidate LM program yields a solution to both the synthetic and the real task. We describe each synthetic environment in detail in Appendix § 9.
Training on synthetic environments with fake sub-calls. In practice, many tasks in the wild have a natural decomposition that uses a large number of (potentially recursive) sub-calls or tool-calls with long wall-clock runtimes. Because we use synthetic environments to target root-only LLM behavior where the context does not overlap with the real task, we hypothesize that the sub-calls can be intentionally low-cost or even fake (see Table 13 for a comparison). We construct a split of synthetic environments (for BrowseComp-Plus, ExpertLongBench, and OBLIQ-Bench) that replace any invoked sub-calls over sub-tasks with pre-built oracle answers for synthetic sub-tasks.
| Benchmark | p50 Real | p50 Synth. | p99 Real | p99 Synth. | Mean Real | Mean Synth. |
| CTC-Bench | 219 | 145 (0.66×) | 1021 | 1639 (1.61×) | 276 | 222 (0.81×) |
| OBLIQ† | 213 | 47 (0.22×) | 521 | 78 (0.15×) | 229 | 50 (0.22×) |
| BrowseComp-Plus† | 195 | 79 (0.40×) | 698 | 394 (0.56×) | 240 | 96 (0.40×) |
| ExpertLongBench† | 45 | 12 (0.27×) | 167 | 33 (0.20×) | 61 | 17 (0.27×) |
| LooGLE-v2 | 75 | 54 (0.72×) | 253 | 180 (0.71×) | 84 | 61 (0.73×) |
| OOLONG-Real | 147 | 180 (1.22×) | 482 | 429 (0.89×) | 203 | 187 (0.92×) |
| CorpusQA | 86 | 63 (0.73×) | 446 | 161 (0.36×) | 110 | 67 (0.61×) |
| LongReason | 32 | 35 (1.10×) | 84 | 110 (1.31×) | 36 | 39 (1.08×) |
Table 13. Seconds per rollout for RLM-27B, real benchmark vs. synthetic environment (lower is bold; the parenthesis is synthetic/real).
To generate synthetic traces, we provide the proposed LM program as a hint to the RLM, and ask it to follow the hint to solve the synthetic task. We use GPT-5-mini (Singh et al., 2026) as a judge (Zheng et al., 2023) along with the synthetic environment reward as a proxy for whether to accept the generated rollout. We generate a set of 8,015 root-only synthetic RLM rollouts3 (and 1,465 sub-agent rollouts on LongReason to target specific sub-task behavior) across these eight synthetic environments and train RLM-27B by supervised fine-tuning (SFT) Qwen3.8-27B on these rollouts (see Appendix § 9). To test whether the synthetic environments also support learning without explicit hints, we directly RL post-train each model on the synthetic environments (see Appendix § 8.§ 4.2).
Targeted training of an LM in a harness yields more performant and efficient trajectories. In Table 4, using the RLM harness, the SFT-trained RLM-27B improves over the Qwen3.8-27B base on evaluation tasks by 12.4 points on average. Furthermore, in Table 5 we find that the RLM-27B delegates more often, while using 3× fewer turns and 6× fewer input tokens for the root trajectories. Even on tasks like BrowseComp-Plus where raw performance gains are small, the produced trajectories use significantly fewer turns and tokens. Furthermore, we find that RL post-training over the synthetic environments also improves seven of eight tasks and raises the evaluation task average by 6.8 points, but does not yield noticeable efficiency gains, and also converges to different behavior than the SFT data over the same environments, but with teacher-generated hints.
Compositional generalization over learned decompositions via recursion
The results in § 3, § 4.1, and § 4.2 show that harnesses can learn to shape tasks to be LID by generating LM programs as actions that sufficiently decompose tasks described in offloaded context. These harnesses generalize to novel tasks when the learned LM programs compose with existing LM capabilities over sub-tasks within these tasks. A natural question is whether harnesses can compose over these generated LM programs, providing a means to compositionally generalize over existing subtask solving, as well as newly learned decompositional capabilities. Following our original findings on how harnesses compose LLM capabilities, we can abstract the harness as an individual LLM call that can be recursively invoked by the harness, so each harness invocation solves a learned task with a fresh context. The following experiments do not impose a recursion depth limit.
We empirically show that recursion enables composition over learned LM programs. From our results in Table 4, we select a set of 87 tasks where RLM-27B learns to solve them (97.5% avg@3), but Qwen3.8-27B cannot reliably solve them (57.7% avg@3). We construct a meta-task in which the harness is given a concatenation of a randomly ordered set of four unique tasks from , where the model must solve task in order to receive the inputs for the next task . The harness starts with the first task’s prompt and context, and submits an answer via the unlock (answer) tool, which returns the new question and task-specific context when answered correctly. The harness is given at most two attempts to solve each task. We average scores over 2000 randomly sampled meta-tasks in Table 6, and further describe the task in Figure 9.
| Model | RLM Harness | + recursion hint | + SFT (recursion synthetic data) | |||
| Partial | Full | Partial | Full | Partial | Full | |
| Solve rate (%) | ||||||
| Qwen3.8-27B | 38.4 ±1.7 | 19.3 ±1.7 | 32.5 ±1.5 | 12.4 ±1.4 | 32.1 ±1.4 | 9.9 ±1.3 |
| RLM-27B | 74.5 ±1.4 | 55.2 ±2.2 | 63.3 ±1.7 | 47.2 ±2.2 | 84.4 ±1.4 | 77.5 ±1.8 |
Table 6. We randomly draw ordered sets of four tasks from Table 3, and form a new meta-task where a harness must solve each task in sequence to find the task prompt for the next task, and eventually to find the final answer. The partial solve rate is the percentage of individual tasks whose answers are correct. The full solve rate is the percentage of meta-tasks where all four task answers are correct. We report 95% normal confidence intervals, using meta-tasks as the independent units.

Figure 9. We evaluate 2000 meta-tasks, each sampling (without replacement) four tasks that must be solved in order. Left: The selected tasks are drawn from a pool of tasks that the RLM-27B was trained to solve, whose root LM learned in post-training how to decompose the task over existing tools and sub-calls. Right: a chain is any four pool tasks in any order. Only the first task is visible, and must be solved. The unlock tool reveals the next task after a correct answer and handoff starts a fresh RLM call on it, so solving a chain composes the learned compositions by recursion.
Table 6: We randomly draw ordered sets of four tasks from Table 3, and form a new meta-task where a harness must solve each task in sequence to find the task prompt for the next task, and eventually to find the final answer. The partial solve rate is the percentage of individual tasks whose answers are correct. The full solve rate is the percentage of meta-tasks where all four task answers are correct. We report 95% normal confidence intervals, using meta-tasks as the independent units.
By default, we observe that both Qwen3.8-27B and the trained RLM-27B sequentially solve each task within the same root trajectory, relying on the LLM’s ability to generalize to solving the concatenation of several task by training only on individual tasks. By relying on compositional generalization from the LM, it solves 55.2% of the concatenated tasks. Learning targeted behavior that composes with existing learned targeted behavior. In § 4.2, we showed that we could target individual LLM behavior using synthetic environments. We similarly apply surrogate harness training to learn to tail recurse by solving an individual task , then launching a sub-RLM over to solve the remaining tasks, which composes with the previously learned capabilities in RLM-27B to individually solve each with a fresh context (see Figure 6b). For more details on this construction, see Appendix § 9.11.
Recursion enables composition over learned root-level trajectories to be LID. In Table 6, we find that recursion over the harness can ease generalization burden off the LLM. However, providing a hint to tail recurse is not sufficient, and actually hurts the generalization performance relative to the LLM itself. We observe that RLM-27B with the additional recursion SFT data at depth=3 is able to solve each with an isolated RLM harness instance, bringing the solve rate up from 55.2% to 77.5% by putting less generalization pressure on the root LLM.
Related Work
Programmatic sub-agent calling systems.
Language model systems that invoke tool calls or sub-agents have traditionally done so by parsing a language model’s output and invoking APIs when appropriate (Schick et al., 2023; Yao et al., 2023). Recently, CodeAct (Wang et al., 2024b) and Recursive Language Models (RLMs) (Zhang et al., 2026b) have proposed using a code REPL as the primary tool call, with all other tools and sub-agents being invoked as functions in code. Modern harnesses such as Claude Code [2] and Codex (OpenAI, 2025b) have adopted these features as well, such as in Dynamic Workflows [4]. Prime Agent [25] adopts the RLM as a central design.
Training these programmatic sub-agent and tool-calling systems has also been explored recently. Recursive Agent Optimization (RAO) [17] proposes a training strategy that assigns partial rewards to recursive sub-agent trajectories during RL training, and is applied directly to RLMs. However, they do not study what leads to generalization in their results. In this paper, we explore how naive training over these harness abstractions elicits compositional generalization.
Generalization in language models and harnesses.
Understanding generalization in language model systems can provide recipes for data-efficient scaling of LLM capabilities. Prior works have studied generalization from the data and model architecture perspective [15, 7] (Song et al. 2025), including isolated studies on composing learned primitives [31, 26, 29] (Lippl et al. 2026). Related studies investigate how LMs struggle to generalize to longer inputs and more complex computations [1, 14] (Motwani et al. 2026), while others highlight how training distributions and computational inductive biases can improve compositional generalization [32] (Zhou et al. 2024; Yuan et al. 2026).
Harnesses are a symbolic layer on top of the language model that can directly compose language model calls to provide a mechanism for generalization through composition. Early harness strategies like Least-To-Most Prompting (Zhou et al., 2023) and Decomposed Prompting [28] show that fixed language models can improve easy-to-hard and length generalization through individual language model calls solving isolated, local sub-tasks. Recursive strategies like Recursion of Thought [33] and Re-Tuning (Pasewalk et al., 2024) show similar properties when task decomposition is arbitrarily deep. We directly study whether training around general language model harnesses on unsolved training tasks can generalize to a class of unsolved evaluation tasks through composition. Lastly, alternate context management abstractions like Context Language Models (Shao et al., 2026) that treat the model’s context as directly editable rather than an offloaded context are not explored in this paper, but may similarly yield LID behavior through training.
Conclusion
Large language models have historically been brittle when composing learned capabilities as a means of generalization. We propose and show that well-designed neurosymbolic LM harnesses can induce composition over existing LM capabilities by shaping the inputs to individual LM calls to be in-distribution. This property enables the harness trajectory to be locally in-distribution on an otherwise out-of-distribution task for the LM. We provide empirical evidence of this phenomenon where existing Transformers struggle: RLMs can learn to generalize across context length, and learn latent “strategies” that transfer to a new domain with a different token-level description. In practical settings where LM agents are deployed in extremely long and complex settings, we also show that this effect can be used as a data efficient strategy to target and train specific individual LLM behavior within a harness without training on the full task. We post-train RLM-27B primarily on root trajectories, and train entirely on easier synthetically generated environments, some of which include fake tool / sub-calls. Finally, we provide evidence that the compositional generalization effect of harnesses applies recursively, by applying surrogate harness training to learn tail recursion strategies. We are excited by future work that informs the design of new harness abstractions and efficient training strategies around LM harnesses for solving increasingly long and expensive tasks.
Acknowledgments
This material is based upon work supported by the U.S. National Science Foundation Graduate Research Fellowship Program under Grant No. 2141064. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. This research is also supported directly by the Laude Institute Residency and Slingshot programs, Prime Intellect, and Thinking Machines Lab Grant. We thank Jayden Teoh for reviewing the paper and providing helpful feedback on framing. We thank Zhuohan (Joshua) Gu, Noah Ziems, Jacob Li, and the rest of MIT OASYS for helpful discussions throughout this project.
Training Details
All experiments in the length generalization (Figure 3) and strategy generalization plots (Figure 4) in §3 were trained with Prime Intellect prime-rl on a single 8xH100 node, with four training and four inference GPUs; inference TP=2, DP=2; memory utilization 0.8. We provide the controlled training configuration in Table 7, and specify any changes for specific settings below. Runs are seeded with seed = 0 (default prime-rl setting).
| Setting | Value |
| Model and optimization | |
| Base model | Qwen/Qwen3-30B-A3B-Instruct-2507 |
| RL algorithm | GRPO |
| Optimizer | AdamW, |
| Learning rate | , constant |
| Weight decay | 0.01 |
| Gradient norm cap | 1 |
| Precision | BF16 (optimization and reduction) |
| Activation checkpointing | Full |
| LoRA (Qwen3 only; Qwen3.8 uses full finetuning) | |
| Rank | 32 |
| Scaling parameter | 64 |
| Dropout | 0 |
| Attention targets | q_proj, k_proj, v_proj, o_proj |
| MLP targets | gate_proj, up_proj, down_proj |
| Rollouts and loss | |
| Batch size | 64 |
| Rollouts per example | 4 |
| Training sequence length | 8,192 tokens (i.e., sequences trained in one batch) |
| Loss targets | Root assistant tokens; sub-call tokens excluded |
| Loss settings | dppo_mask_low/high = 0.2, adv_tau = 1, kl_tau = 0.001 |
| Training temperature | 1 |
| Root / sub-call output cap | 8,192 tokens per completion |
| Thinking | Disabled |
| Evaluation sampling | One rollout per example; includes step 0 |
| Max off-policy steps | 8 |
Table 7. Default training configuration used in prime-rl for all RL post-training experiments, unless otherwise specified.
On Ada-LEval we increase the training sequence length to 20,480, and on OBLIQ Twitter→WildChat to 24,576 because we observe frequent context window limits. On validation runs, we increase the context window size to 131,072 for both the root and sub-calls.
Filters. Repetition filter: window 3,000, threshold 0.99, enforced. Zero-advantage filter enforced except Ada-LEval; gibberish monitored only.
SFT config for RLM-27B. The RLM-27B model (Qwen3.8-27B) was not trained with RL, and instead was SFT’d (full-parameter fine-tuning) for one epoch over packed sequences of rollouts on synthetic data of length 32,768. We use AdamW (Loshchilov & Hutter, 2019) with learning rate and cosine decay to after 3 warmup steps, zero weight decay, gradient-norm clipping at 1, FP32 optimization and gradient reduction, and global batch size 8, trained on an 8xH100.
Prompts used for harnesses and baselines
We provide the prompts used for each harness below.
RLM. We focus on depth-1 sub-agents with a persistent REPL; root and sub-calls share the served policy. We set a REPL output cap: 20,000 characters per code block, meaning anything beyond is truncated.
RLM — System prompt
You are a Recursive Language Model (RLM): a language model with a prompt, and a very important context stored in a Python REPL related to that prompt. You can iteratively interact with the Python REPL, which has access to LLM calls as a function. You will be queried turn-by-turn until you have an answer to the query.
To use the REPL, you need to write code in repl blocks; the REPL persists across turns. Available in the REPL:
context: the important, potentially very long information related to the prompt (typicallystrorlist[str]).llm_query(prompt: str, model: str | None = None) -> str: a single sub-LLM completion. Use for extraction, summarization, or Q&A over a chunk of text. Sub-LLM context window ≈ 500K chars.llm_query_batched(prompts: list[str], model=None) -> list[str]: concurrently call several LLM calls in parallel over a list of prompts; same order out as in.rlm_query(prompt, model=None)/rlm_query_batched(prompts, model=None): recursive RLM sub-calls. Fall back tollm_query/llm_query_batchedwhen recursion is disabled.SHOW_VARS() -> str: list every variable currently in the REPL.answer: dict initialized to{"content": "", "ready": False}. To submit, setanswer["content"]to the final answer andanswer["ready"] = Trueinside areplblock.
REPL outputs over ~20K characters are truncated, so for longer payloads slice context and pass slices through llm_query rather than print-ing them whole. The REPL is NOT a Jupyter cell — only print(...) output (stdout) is shown back to you between turns; a bare expression on the last line is silently discarded. Always wrap inspections in print(...).
As a general strategy, you should start by probing your context to understand it better (e.g. print a few lines, count them, etc.). Then, use the REPL to build up an answer to the query.
Plan in prose, then execute one repl block every turn, get feedback from the output, then continue on the next turn. Do not flip answer["ready"] = True on turn 1 without first inspecting context.
RLM / LM + REPL — User-message templates
Initial task message
Answer the following: <task root prompt>
Your context is a <context type> of <character count> total characters. Each sub-LLM call can handle roughly ~100k tokens at once.
First turn
You have not interacted with the REPL environment or seen your prompt / context yet. Look at the context first; do not provide a final answer yet.
Turn 1/<turn limit>:
For the RLM, later turn messages contain only Turn <turn number>/<turn limit>::; these messages persist in history. Depth=1 sub-calls receive the initial instruction defined by the root LM as a user message, with no fixed system prompt.
RLM — Orchestration prompt
As an RLM, you should act as an orchestrator, not a solver.
Directly after you probe the ‘context‘ and understand your task, pause and plan: state explicitly how the task decomposes into sub-LLM / REPL steps, and sketch the concrete sequence of turns — what each turn computes and which sub-LLM call (if any) it issues — like a condensed trajectory, before you execute them. Then execute one turn at a time: after each step ‘print‘ a small sample of the result, verify it looks right, and only flip ‘answer["ready"] = True‘ once you have actually printed the candidate answer. If you are running out of turns without a confirmed answer, submit your best inference rather than letting the rollout terminate unsubmitted.
Your own context window is small. Push every long-context operation that would not fit comfortably in your own working window — reading, summarizing, classifying, verifying, answering sub-questions, even recapping your own progress — into ‘llm_query‘ / ‘llm_query_batched‘ calls instead of pulling that text into your own message stream. (Conversely: if a Python keyword / regex search over ‘context‘ would already pin the answer, or if a single visible passage already contains it, just read it directly — sub-LMs are for when the raw text won’t fit or the question needs semantic interpretation.) Long REPL stdout pollutes history the same way raw ‘context‘ does: if you want a recap, ask ‘llm_query‘ for a 1–2 sentence summary and ‘print‘ only that. Aggregate the small results back in the REPL.
Sub-LLMs have no REPL; they only see the prompt and the ‘context‘ slice you pass them. Hand them clean, focused inputs and ask for terse, structured outputs you can manipulate programmatically.
Sub-call budget is finite on two independent axes, and ‘llm_query_batched‘ only parallelizes — it does not relax either. (1) Per-prompt capacity: a single sub-call answers well only when its input stays modestly sized — a useful rough ceiling is ~100K characters per prompt, less when the text is dense. Pack each prompt close to that capacity (a chunk of many items, a whole document) so one call accomplishes a lot of work. (2) Per-batch fan-out: ‘llm_query_batched‘ concurrency is bounded too — a useful rough ceiling is ~20 prompts per batch. Tiny-prompt mega-batches (hundreds or thousands of single-item prompts) are the anti-pattern; fat-prompt small batches are correct. For many independent units, use several ~20-wide batches of full-capacity prompts in sequence, not one mega-batch of tiny prompts. When the work can be expressed either as a sequential loop of ‘llm_query‘s or as one comparably-sized batched call, prefer batched — same total work, far fewer turns burned. After Python-side filtering has narrowed the candidate set, batch-extract the survivors rather than reading them by hand. If the raw workload exceeds both budgets at once (e.g. a context far larger than ~20 × 100K chars), don’t brute-force it: filter aggressively in Python first to a tractable subset, or stage the task — a cheap coarse pass narrows candidates, then a targeted second pass extracts from the survivors.
Reserve your own tokens for high-level decisions: what to ask next, how to combine sub-LLM outputs, when to finalize. Delegate everything else.
The orchestration prompt is appended as part of the system prompt given to the RLM. We provided it because these models are not familiar with this harness design, but we also provide a reference where we do not include it below. We re-ran Figure 3 below in Figure 7, where we excluded this orchestration prompt addendum. We find that it yields little difference in the harness and overall learned compositional behavior.

Figure 7. We reproduced Figure 3 but swapped out the RLM implementation with a version that does not use the orchestration hint. The model roughly follows the same trends, except on MRCRv2, where it learns a non-generalizable solution that has context window issues.
LM + REPL. We implement this CodeAct (Wang et al. (2024b)) variant, where sub-LLM calls are disabled, as a modification of the depth= RLM harness. There is no longer a sub-LLM budget sentence in the initial task message, and also REPL outputs are no longer truncated.

Figure 8.
LM + REPL — System prompt
You are a language model with a prompt, and a very important context stored in a Python REPL related to that prompt. You can iteratively interact with a Python REPL to inspect, transform, and analyze the context. You will be queried turn-by-turn until you have an answer to the query.
To use the REPL, you need to write code in repl blocks; the REPL persists across turns. Available in the REPL:
context: the important, potentially very long information related to the prompt (typicallystrorlist[str]).SHOW_VARS() -> str: list every variable currently in the REPL.answer: dict initialized to{"content": "", "ready": False}. To submit, setanswer["content"]to the final answer andanswer["ready"] = Trueinside areplblock.
The REPL is a plain Python sandbox (stdlib only, no network and no LLM calls) — solve the task with string operations, slicing, regex, counting, and any pure-Python computation over context.
REPL output is NOT truncated: you may print(...) as much as you need — including large slices, or the whole of context — and the full stdout is returned to you. The REPL is NOT a Jupyter cell — only print(...) output (stdout) is shown back to you between turns; a bare expression on the last line is silently discarded. Always wrap inspections in print(...).
As a general strategy, you should start by probing your context to understand it better (e.g. print a few lines, count them, inspect its type/length). Then, use the REPL to build up an answer to the query.
Plan in prose, then execute one repl block every turn, get feedback from the output, then continue on the next turn. Do not flip answer["ready"] = True on turn 1 without first inspecting context.
Transformer baseline. This is effectively a model query, where the full context is provided as the user message. The transformer baseline is evaluated at temperature 0. When required, we use YaRN (Peng et al., 2024) with a window factor max(1, max_model_len/262144), with 262,144 original positions.
Transformer — System prompt
You are a careful assistant. You are given a long document or problem followed by a question or task. Read all of it and answer directly in the exact format requested. Do not ask for tools or external help – produce the final answer yourself.
Pi 0.73.1 (Node 22.14.0) Contexts are initially offloaded to context.txt. The root system prompt is the verifiers [6] (v0.1.14) wrapper default, passed with --system-prompt: a short instruction listed below to complete the task with the available tools, plus the runtime date and working directory. Reader and worker instructions are appended with --append-system-prompt. Tool feedback supplies a read-cap notice and a soft-turn-cap stop directive. We sample at the Qwen3-30B-A3B-Instruct-2507 defaults: temperature 0.7, top- 0.8, top- 20, and min- 0. We use a default context window of 65,536 tokens and the training sequence length is 8,192; server-side rendering is used, and the zero-advantage filter is monitored only.
Extensions. We use the readcap (commit: f3a226e) extension to cap tool output at 6,000 bytes, with a cap of 100 tool results per agent unless stated otherwise. We use the compaction (commit: c880157) extension to compact when the root hits the 65,536 token window limit, but we observe in practice that this does not occur during training. We use the subagent (commit: 9bb2c7f) extension to provide sub-agents as a tool with up to 10 turns per sub-agent, and unlike the RLM harness, we train both the root and sub-agents.
Pi — Default verifiers wrapper system prompt
Complete the user’s task using the available tools.
Current date: <date>
Current working directory: <sandbox directory>
Pi — Custom user-message instructions
File-reading preamble
IMPORTANT – READ THIS FIRST. The data for this task is in a file named ‘context.txt‘ in your working directory, and it is almost certainly LARGER THAN YOUR ENTIRE CONTEXT WINDOW – it will NOT fit. If you read it in full (cat context.txt, opening it in an editor, or any unbounded read), the request will FAIL with a context-overflow error and you will score ZERO. Do not do this. Never load the whole file – or a large chunk of it – into your context.
Work carefully within your window instead:
First check the file’s size:
wc -l context.txtandwc -c context.txt.Find what you need with
grep -n/rg(search by keyword), and read only small ranges withsed -n ’START,ENDp’ context.txt,head,tail, orawk– never more than a couple thousand lines at a time.For counting or aggregation, compute the answer with a shell command (
grep -c,awk,sort | uniq -c) rather than reading raw data into your prompt.
You are an autonomous coding agent running NON-INTERACTIVELY: there is no human to talk to. Do not greet, do not ask for clarification, do not wait for input – begin working immediately and finish the task entirely on your own.
When finished, put your final answer on its own line at the very end, in the exact OUTPUT FORMAT stated below.
Helper-agent announcement
You also have a ‘subagent’ tool. It hands a sub-task to a helper agent that has its own separate context window, and returns only that agent’s short reply to you – so the raw text the helper reads never enters your window. Two helpers are available: ‘reader‘ (read/search a slice of the file and report back what it found) and ‘worker‘ (carry out a self-contained sub-task, e.g. score or aggregate a batch). Use it when it helps; you can also keep using the shell tools directly.
Pi: user-message preamble (hard-cap reruns)
You are an autonomous agent running non-interactively: no human will reply, so never ask questions. The task data is in ‘context.txt‘ in your working directory. It is far larger than your context window, so never read it whole: check its size, search it with ‘grep‘, read small ranges with ‘sed -n‘, ‘head‘ or ‘awk‘, and compute counts and aggregates with shell commands.
Hard limit: you have at most 30 turns (model calls) in total. When they are used up the run ends with no answer and you score zero, so give your final answer before then.
You also have a ‘subagent‘ tool. Each call runs a helper agent on a sub-task in its own separate context window and returns only its reply. A helper gets at most 10 turns, and you have only 100 sub-agent calls in total for the whole task. Use them wisely: delegate sub-tasks that are worth a helper (for example reading or scoring a slice of the file), put several items into one call instead of making many small calls, and use the shell tools directly whenever it is enough.
Put your final answer at the very end, in the exact OUTPUT FORMAT given below.
The user message joins this preamble, the task instructions and the required answer format with blank lines. The parent generates each helper’s task message.
Pi reader — Custom system-prompt addition
You are a reader sub-agent with your own private context window.
You are given ONE narrow question about a large local file (usually ‘context.txt‘) that the agent delegating to you has NOT read and cannot afford to read in full. Your job is to look at only the part you need and hand back a short, faithful answer.
How to work:
Use ‘bash‘ to locate what matters — ‘grep -n‘, ‘wc -l‘, ‘sed -n ‘A,Bp’ context.txt‘. Never cat the whole file; it is far larger than your window.
Read only the lines you actually need.
Stop as soon as you can answer. You have a limited turn budget.
How to answer:
Lead with the direct answer to the question you were asked, in the first line.
Then, only if useful, add the concrete supporting evidence (ids, labels, counts, short verbatim quotes, line numbers).
Quote exactly. Never invent an id, label, count, or quote. If the answer is not present in what you read, say so plainly rather than guessing.
Be terse. Your entire reply is pasted back into another agent’s context window, so every wasted token costs the parent. No preamble, no restating the task.
Pi worker — Custom system-prompt addition
You are a worker sub-agent with your own private context window.
You are given ONE self-contained sub-task by a parent agent that is coordinating a larger job over a big local file (usually ‘context.txt‘). Do the sub-task and return only what the parent needs to carry on.
How to work:
Read only what the sub-task requires. ‘grep -n‘, ‘wc -l‘, and ‘sed -n ‘A,Bp’ context.txt‘ are your main tools; the file is much larger than your context window, so never read it whole.
Do the actual work you were asked to do — compare, count, rank, extract, judge.
Stop as soon as the sub-task is done. You have a limited turn budget.
How to answer:
Give the result first, in the exact shape the parent asked for (a list of ids, a count, a label, a short ranking). If the parent specified an output format, follow it exactly.
Ground every claim in what you actually read. Never invent ids, labels, counts, or quotes. If you could not determine something, say so explicitly instead of guessing — a wrong confident answer is worse than a flagged gap.
Be terse. Your reply is pasted straight back into the parent’s context window.
Pi — Custom tool-feedback notices
Read-cap notice
...read-cap: <omitted bytes> bytes omitted. Your context window is small — do NOT read large chunks. Narrow the search: grep a more specific pattern, or read a small line range with ‘sed -n ’A,Bp’ context.txt‘....
Soft-cap replacement
⊖ TURN LIMIT REACHED (<turn cap> tool-using turns). Do NOT call any more tools. Using only what you have already gathered, output your FINAL ANSWER now as plain text, in the exact required OUTPUT FORMAT.
Length generalization environment details
We provide details for each of the six environments used in our length generalization experiments in Figure 3. Unless otherwise specified, we train for up to 150 steps with the configuration in Table 7, evaluate every 10 steps, and use a maximum of 20 turns. Each environment lists its split, score, and any hint, timeout, or harness window that departs from that configuration.
We observed in many cases that the default settings led to context overflow issues in some settings (e.g. in an earlier run the Pi harness on MRCRv2 attempted to fill the model context window with the entire offloaded context and had no bound on its number of turns, which created noisy dips in evaluation performance and frequent sandbox timeouts; the final Pi runs use the hard turn, sub-agent and wall-clock caps listed below) that did not reflect a fair baseline comparison, so we slightly tuned each setting when appropriate to properly trade off training speed (most settings lead to long-tailed, slow-decode periods) and evaluation accuracy (avoiding dropping rollouts due to a context constraint within the window of the base model).
Most harness-specific changes are to avoid long timeout issues or trivial context window issues, while balancing training efficiency. We detail each below, if they deviated from the default settings.
MRCRv2 (Vodrahalli et al., 2024).
Training split: 2 needles, 32k–64k, 121 examples.
Evaluation split: 8 needles, 2m–4m, 50 examples.
Transformer: Training sequence and inference window 73,728 tokens. The long evaluation caps at 4M and uses YaRN, although samples beyond 2M all score zero in our observation.
LM + REPL: Selected rerun evaluation window 262,144.
Pi: Hard caps per rollout: 30 root model calls, 100 sub-agent calls and 10 model calls per sub-agent; a rollout that reaches a cap ends with no answer and scores zero. Training window 65,536 tokens (4,096 completion tokens per call) and evaluation window 262,144; a single file read is capped at 6 KB; compaction is off. Wall clock 600 s for the root and 120 s per sub-agent in training, 1,800 s and 300 s in evaluation (sandbox command timeout 660 s in training, 1,860 s in evaluation).
GraphWalks (OpenAI, 2025a).
Training split:
128k_and_shortertokens, 512 examples, BFS and Parents.Evaluation split:
256k_to_1miltokens, 50 examples.Prompt: The archived prompt says “at most D hops.” The current loader says exactly depth D and selects the last Operation after the worked example.
Transformer: Training sequence and inference window 49,152 tokens. Long evaluation uses the separate offline adapter evaluation, with a long evaluation cap of 2M and YaRN.
LongBench-Pro [11].
Training split: English 32K, all 115 examples.
Evaluation split: English 256K, 115 examples; 23 non-summary secondary tasks, five examples each. Archived questions and task metadata are in
appendix/longbenchpro_queries.json.RLM / LM + REPL: Root prompt is the dataset question verbatim.
Pi: Similar to the setup on MRCRv2 (hard caps of 30 root and 10 sub-agent model calls, 100 sub-agent calls; windows 65,536 and 262,144), with two additions for this task only: the prompt tells the agent to read the file with
wc,grep -nandsed -ninstead of the 6 KB read tool and names thereaderandworkerhelpers, and the last 6 root turns (3 for a sub-agent) carry a turn-budget notice. The caps are unchanged. Without the additions, 54% of evaluation rollouts hit the turn cap and scored zero.Transformer: Training sequence and inference window 40,960 tokens; long evaluation is offline. User message:
<context>, two newlines, then the same question.
OOLONG [5].
Training split:
trec_coarse,min_ctx=max_ctx=32768, all 50 examples.Evaluation split: Same task at 262,144 tokens, 50 examples;
exclude_numeric=false.Transformer: Training sequence and inference window 40,960 tokens. Corrected offline evaluation: window 262,144, completion cap 8,192, temperature 0, answer-only system-prompt override. User message:
<context>, two newlines, then the task root prompt.
OOLONG-Pairs (Zhang et al., 2026b).
Training split: 8,192-token context, all 20 pair questions.
Evaluation split: 32,768 tokens, 20 questions.
RLM / LM + REPL: Increased cap to 30 total turns. Sub-call cap 1,000 tokens (
clean_judge_max_sub_calls).Pi: As for MRCRv2 (hard caps of 30 root and 10 sub-agent model calls, 100 sub-agent calls; windows 65,536 and 262,144), with additions for this task only: the prompt describes the task (classify the records, compute the pairs, write the complete list), the last 6 root turns carry a turn-budget notice, and sub-agents may read up to 96 KB per tool call (the root 6 KB). The output budget per model call is 12,288 tokens in training and 131,072 in evaluation (4,096 for the other tasks), the trainer sequence length is 32,768 (8,192 elsewhere), and the evaluation wall clocks are 3,600 s (root) and 600 s (sub-agent). A rollout that reaches the 3,720 s backstop counts as reward 0.
Transformer: Training sequence is 40,960 tokens, and inference context window is 262,000.
Ada-LEval—BestAnswer (Wang et al., 2024a).
Training split: 8K, 798 question IDs, disjoint from evaluation. Separate
train_longpool: 149 IDs.
Evaluation split: 128K, 50 question IDs.
Environment hint: The additional user message is used for hinted RLM and omitted from the regular RLM run.
LM + REPL: Evaluation inference window 262,144.
Pi: As for MRCRv2 (hard caps of 30 root and 10 sub-agent model calls, 100 sub-agent calls; windows 65,536 and 262,144), with additions for this task only: the prompt describes the candidate format and tells the agent to hand slices of the list to reader helpers, the last 6 root turns carry a turn-budget notice, sub-agents may read up to 96 KB per tool call (the root 6 KB), and the trainer sequence length is 32,768 (8,192 elsewhere). With the plain prompt, evaluation rollouts reached the turn cap after reading about 20% of the 573 KB candidate list.
Transformer: Training sequence 16,384 and inference window 139,264.
Strategy generalization environment details
We provide details for each environment in the strategy generalization experiments in Figure 4, in the same form as Section A.2. Unless otherwise specified, we train for up to 500 steps with the configuration in Table 7, evaluate every 10 steps, and use a maximum of 20 turns.
OOLONG ([5]): TREC-coarse spam.
Training split: TREC-coarse, 32,768 tokens, 50 examples.
Evaluation split: Spam, 131,072 tokens, 50 examples. Domain and length both change.
Environment hint: Training and evaluation use TREC and spam task framing, respectively. Transformer retains the neutral system prompt.
Transformer: Training sequence 40,960 and inference window 147,456.
OBLIQ (Tchuindjo et al., 2026): writing math.
Training split: All 512 writing queries, using 300 examples guided by the OBLIQ loader.
Evaluation split: 50 math queries, using 300 examples guided by the OBLIQ loader.
Environment hint: Domain-specific task framing; the same additional user hint in both domains.
Transformer: Training sequence and inference window 172,032 tokens.
OBLIQ (Tchuindjo et al., 2026): Twitter WildChat.
Training split: All 281 Twitter queries, using 300 examples guided by the OBLIQ loader.
Evaluation split: 35 WildChat queries, using 300 examples guided by the OBLIQ loader.
Environment hint: Domain-specific task framing; the same additional user hint in both domains.
Transformer: Training sequence 65,536 and inference window 172,032.
Environment mixture training details
Following the findings in § 3, we explore in § 4.1 how well our generalization experiments transfer when training on a mixture of tasks, and how well they transfer to a larger, unrelated suite of tasks. We provide details for these training runs in this subsection.
RL training on short tasks in the length generalization experiments
We first confirm that the length generalization effect of Figure 3 holds when mixed, and also examine how each environment is related. Table 8 evaluates checkpoints trained on individual short splits of each length-generalization environment, including single-environment runs and one mixture of those short tasks across each harness method. We follow the training configuration in Table 7, train for 1,000 steps, and select the best checkpoint for each.
| Method | MRCRv2 | GraphWalks | LongBench Pro | OOLONG | OOLONG Pairs | Ada LEval | OOLONG spam | OBLIQ math | OBLIQ wildchat |
| Pi (with sub-agents) | 0.13 | 0.17 | 0.29 | 0.20 | 0.00 | 0.06 | 0.26 | 0.02 | 0.03 |
| trained on short tasks | 0.33 | 0.12 | 0.20 | 0.20 | 0.01 | 0.10 | 0.46 | 0.06 | 0.04 |
| Base Transformer + YaRN | 0.00 | 0.08 | 0.30 | 0.32 | 0.24 | 0.28 | 0.32 | 0.22 | 0.04 |
| trained on short tasks | 0.01 | 0.08 | 0.37 | 0.32 | 0.28 | 0.36 | 0.36 | 0.23 | 0.08 |
| LM + REPL (no sub-agents, depth = 0) | 0.00 | 0.14 | 0.11 | 0.14 | 0.10 | 0.16 | 0.36 | 0.15 | 0.04 |
| trained on short tasks | 0.56 | 0.84 | 0.28 | 0.00 | 0.34 | 0.32 | 0.04 | 0.14 | 0.07 |
| RLM | 0.02 | 0.30 | 0.26 | 0.32 | 0.18 | 0.24 | 0.36 | 0.12 | 0.07 |
| trained on GraphWalks (short only) | 0.15 | 0.96† | 0.34 | 0.32 | 0.39 | 0.20 | 0.44 | 0.10 | 0.04 |
| trained on LongBench-Pro (short only) | 0.14 | 0.67 | 0.39† | 0.40 | 0.39 | 0.42 | 0.50 | 0.11 | 0.15 |
| trained on OOLONG-Pairs (short only) | 0.00 | 0.50 | 0.19 | 0.36 | 0.72† | 0.26 | 0.44 | 0.26 | 0.06 |
| trained on short tasks | 0.88 | 0.98 | 0.40 | 0.60 | 0.75 | 0.46 | 0.56 | 0.30 | 0.19 |
Table 8. We explore how training on the full suite of short task environments influences harness behavior. For several harnesses and the base neural language model, we compare the base model and one trained on only short tasks from Table 1. For the RLM, we also isolate checkpoints that only trained on one short task to compare to the mix.
We find that training on each split performs the best compared to training on other splits across each task, including the unseen tasks used for Figure 4. Another important finding is that training on individual tasks transfers unevenly to unseen other length-generalization tasks, indicating that the model is not just learning to use the harness better, but is actually learning task-specific behavior that transfers.
Short-mixture RL on held-out long tasks
The + RL (short tasks) rows in Table 4 are the § 4.1 runs over training a harness around real environments in Table 1, while the + RL (synthetic tasks) rows are the § 4.2 runs over training a harness around synthetic environments.
RL on short tasks from Table 1. Each RL run on Qwen3-30B-A3B-Instruct-2507 uses the training configuration in Table 7 (including the LoRA config) on equal-weight short splits of each of the six environments, trained for 1,000 steps, and validated every 20 steps. We select the best checkpoint by mean validation reward. Our validation split was 25 random tasks from each of CorpusQA 128K (education and finance), CTC-Bench and OOLONG-real. The validation splits are each chosen to be disjoint from the evaluation splits.
Qwen3.8-27B was post-trained with the same defaults, except it was full fine-tuning with a lower learning rate and batch size 96 on the same six short-task streams. Validation ran on the same split as the other RL runs.
RL on synthetic tasks from §4.2. Both models Qwen3-30B-A3B-Instruct-2507 and Qwen3.8-27B were post-trained with the same configuration as on the short tasks, but now on eight synthetic environments (BrowseComp-Plus, ExpertLongBench, OBLIQ, CTC-Bench, LooGLE, OOLONG, LongReason, and CorpusQA at 128K/1M), with equal sampling weight per environment and hints disabled. The first three used environment-specific fake sub-call responses; the others used real model sub-calls. Validation ran on the same split as the other RL runs.
Training on a broader environment mixture
In § 4.1, we found that training on our mixture of short length-generalization tasks weakly transfers to the unseen, long tasks in Table 3, while in § 4.2 we found that targeting specific behavior with synthetic environments provides a strategy for learning desirable behaviors. However, when training general harness behavior, it is not always known what desirable behavior we want, so a natural question is whether training on a large mixture of real tasks would yield stronger transfer. A plausible explanation for why training on the real environments does not provide large performance gains is that behavior learned over these six environments does not transfer meaningfully to these harder tasks, so we explore in this Appendix section whether a wider mixture of tasks yields transfer.
We post-train Qwen3-30B-A3B-Instruct-2507 on a wider mixture of tasks that include the six length-generalization tasks. We follow the training configuration in Table 7, train for 1,000 steps, and select the best checkpoint. We validate on a held-out set of 20 random disjoint validation tasks from each environment with a validation split in Table 9. We do not include environments that share tasks with our training set, so we exclude BrowseComp-Plus and OBLIQ-Bench in our reported benchmark results in Table 10.
| Task family | Training split(s) | Held-out validation split(s) |
| FanOutQA (Zhu et al., 2024) | Dev evidence, contexts up to 400K characters | Dev evidence, contexts ≥800K characters |
| Ada-LEval (Wang et al., 2024a) | Best Answer, 8K-32K train split | – |
| BABILong (Kuratov et al., [30]) | QA3, 32K/64K/128K | QA1, 128K |
| NoCha (Karpinska et al., [24]) | – | NoCha evaluation stream (20 examples) |
| GraphWalks (OpenAI, 2025a) | 128K tokens and shorter | 256K–1M tokens |
| MRCRv2 (Vodrahalli et al., 2024) | Two needles, 32K–64K | Eight needles, 2M–4M |
| LongProc (Ye et al., 2025) | TOM tracking, 2K and 8K | – |
| PrefEval (Zhao et al., 2025) | Implicit persona, 10 intervening turns | Implicit persona, 150 turns; explicit, 300 turns |
| PersonaMem (Jiang et al., [22]) | v2, 32K, all question types; v3 (128-event cap) | v2 benchmark, 128K |
| ManyIH (Jaroslawicz et al., [21]) | Private instruction-following, at most 5 tags | Evaluation examples with tags |
| BrowseComp-Plus (Chen et al., [10]) | Train split, 50 documents/query | Test split, 200 documents/query |
| LoongRL (Wang et al., 2026) | MuSiQue, plain, train | MuSiQue, keychain |
| OOLONG (Bertsch et al., [5]) | TREC-Coarse and spam, 8K–64K | TREC, 100K–131K; spam, 128K |
| OOLONG-Pairs (Zhang et al., 2026b) | 4K and 8K | – |
| LongBench-Pro (Chen et al., [11]) | English, 16K/32K/64K | English, 256K |
| LongRLVR (Chen et al., [9]) | Llama, 16K/32K, train | Qwen2.5-7B subset, test |
| OBLIQ-Bench (Tschundijо et al., 2026) | Writing, pool of 300 | Congress, pool of 200 |
| GoLongRL (Lv et al., 2026) | English table (20K); English summaries | – |
Table 9. Training and held-out streams in the broad RL mixture, ordered by first public release. A dash means that family has no held-out stream in this run.
| Model | LongReason | LooGLE | CTC | OOLONG-Real | CorpusQA | ELB | Avg. |
| Qwen3-30B-A3B (base) | 44.6 | 18.3 | 1.1 | 15.1 | 11.2 | 25.6 | 19.3 |
| + RL (short tasks) | 74.9 | 21.7 | 2.2 | 19.3 | 17.8 | 26.8 | 27.1 |
| + RL (synthetic tasks) | 69.6 | 28.2 | 1.6 | 18.6 | 23.7 | 44.0 | 31.0 |
| + RL (broad task suite) | 83.1 | 28.5 | 2.0 | 19.7 | 20.4 | 35.8 | 31.6 |
Table 10. Average benchmark results for the broad-mixture RL ablation and main experiment models. BrowseComp-Plus and OBLIQ-Bench are excluded from the average because they are included in the larger training mix.

Figure 8 (PDF p. 31). We report the average training reward in gray and the held-out reward (red) for Qwen3-30B-A3B-Instruct-2507 on the broader training mixture in Table 9. The dotted line is the checkpoint selected for evaluation.
Figure 8 shows training and held-out reward, and Table 11 reports trajectory statistics. We report scores for this mixture compared to other trained artifacts we used in Table 10. We find that the broader mixture scores slightly higher on average than the short-task mixture and the synthetic task mixture, despite the synthetic task mixture yielding significant gains over other splits on the Qwen3.8-27B model. We generally find that RL training on any tasks with the harness yields significant improvements for the Qwen3-30B-A3B-Instruct-2507 model, particularly because it uses sub-calls more effectively or not at all, and submits more reliably rather than looping forever.
| Model | Root turns | Sub-calls | Root tokens | Sub-call tokens |
| Base | 17.0 | 438.8 | 229K / 14K | 572K / 24K |
| + RL (short tasks) | 12.8 | 179.4 | 170K / 16K | 285K / 7K |
| + RL (synthetic tasks) | 12.6 | 774.6 | 230K / 20K | 429K / 23K |
| + RL (broad task suite) | 13.3 | 422.6 | 245K / 19K | 250K / 30K |
Table 11. Average trajectory statistics for the models in Table 10, averaged equally across its six benchmarks (the Table 3 environments excluding BrowseComp-Plus and OBLIQ-Bench).
Details on synthetic environments to target LM harness behavior
In §4.2, we proposed a viable strategy to efficiently train LM harness behavior by exploiting composition. Assuming we have a long and difficult task that the harness can decompose into solvable sub-problems, we show that we can target an individual LM’s behavior over a synthetic environment such that it mimics the actual behavior on a real environment. But within this synthetic environment, we can modify the tools and sub-calls to be fake, or even the task to be much easier for training.
We created paired synthetic environments for each task in Table 3, and post-trained our models on them via RL. Some environments use fake sub-calls that route to oracle answers, while others use real sub-calls over simpler sub-tasks. We also argued that these environments were a proxy to learn desirable behavior via hints, as the goal was to distill a certain trajectory into the model. We generated an SFT dataset over these environments that we used to train RLM-27B.
This section of the appendix provides details for each of these environments, as well as more information on the trained SFT corpus. We start by detailing each synthetic environment, how it was generated based on the target behavior, and how the environment is structured.
BrowseComp-Plus: a generated encyclopedia
LM program: BrowseComp-Plus / retrieve and verify
# Search clue combinations and pivot on linked entities.
# Verify the final answer against every clue.
def solve(context, clues):
docs = split_documents(context)
index = build_inverted_index(docs)
hits = search_clue_combinations(index, clues)
facts = [
llm_query(format_screen_prompt(clues, doc))
for doc in hits[:MAX_DOCS]
]
bridges = extract_entities(facts)
pivots = search_entity_links(index, bridges)
checks = [
llm_query(format_check_prompt(clues, doc))
for doc in pivots[:MAX_DOCS]
]
return submit(verify_all_clues(clues, facts + checks))
Real task and current split. We target multi-hop retrieval tasks in BrowseComp-Plus, which act over the shared 100,195-document web corpus. The synthetic environment is designed around fake multi-hop retrieval where sub-calling information over a document provides instantaneous oracle answers.
Generation and source. The 1,835 exported trajectories use a new procedurally-generated corpus, disjoint from documents sampled from BrowseComp-Plus or another external corpus. The training worktree constructs a random graph with 50 regions, 1,000 towns, 625 organizations, about 5,900 people and 7,000 works. Each document is generated from templates and padded with extra text, and the multi-hop relationships are determined by the graph. The environment generates 2,000 tasks.
How fake sub-calling was implemented. The assumption on BrowseComp-Plus and other multi-hop retrieval is that the program will quickly filter then apply sub-LLM calls over raw documents to find information. We can quickly simulate this behavior by replacing sub-call invocations with a function that returns the summarized or relevant information when a document is pasted as input into that query. We add additional realistic constraints to mimic context window limitations and context rot such as a 64K-character input limit, skipped documents beyond eight per call, and roughly 3–13% load-dependent judgment errors. The environment also caps the sub-call budget at 120 to prevent expensive trajectories from being accepted.

Figure BrowseComp-Plus. BrowseComp-Plus and its synthetic variant. BrowseComp-Plus Corpus Search the shared corpus of 100,195 real web documents. The harness must retrieve pages and connect evidence across them. Question An author: - published their first work sometime between the years 2000 and 2010 - lived in Granada and Berlin - started a business in face painting - hosted a festival on literature. The same author published a book about a dog. What is the name of this author? Corpus trail The example cites The Loudest Sound and Nothing (2008-08-21), which identifies its author, Clare Wigfall. The harness searches other pages in the corpus to check the remaining clues about her. Gold Clare Wigfall. Synthetic variant Corpus First generate an entity graph, then render it as about 21K documents. The harness searches these generated pages; the fake reader answers only from text pasted into a sub-call. Question I am looking for a musical work that fits the following clues. - It was not well received at first. - The composer was born in the month of June. - It was completed between 1946 and 1953. - It centres on a celestial event. - The composer was educated at the Naroumont Academy for Girls. - The composer’s father was a person who worked with horses. Please provide the title. Corpus trail (generated pages) Doc A, The Lantern of Seloukov (work article): a symphony composed by Brigid Maridale, completed in 1947. Doc B, Brigid Maridale (person article): supplies the composer clues, including her school. Graph link: work composer school. Recorded target The Lantern of Seloukov.
CorpusQA: generated statistical releases
LM program: CorpusQA / reconcile and reduce
# Infer table layout and units.
# Keep only the newest report for each month.
def solve(context, question):
sample = sample_releases(context)
schema = llm_query(infer_schema(question, sample))
rows = []
for release in split_releases(context):
prompt = format_row_prompt(schema, question, release)
rows.extend(parse_rows(llm_query(prompt)))
rows = convert_units(rows, schema)
rows = newest_report_per_month(rows)
return calculate_statistic(rows, question)
Real benchmark. The evaluation split is CorpusQA’s long tasks (1m-4m) in real_estate_en: 81 questions over 34 U.S. residential-construction releases. Each question combines values across reports, sometimes requiring unit conversion and use of a value revised in a later release.
Synthetic corpus. The 853 exported trajectories use documents generated from AI models, and are disjoint from the real CorpusQA corpus. In the default mix, 60% of tasks use generated monthly series with trends, seasonality and revisions; each series is rendered as 4-90 fictional statistical releases. The other 40% use fictional company and school reports with generated financial or enrollment values. Questions and gold answers are computed from the generated data. The generator borrows the real task’s structure, but the documents and records are new.
Sub-calls. In these exported trajectories, Qwen3-8-27B reads selected passages from the generated documents. The root extracts values across releases, reconciles revisions and units, and computes the requested statistic in code. This retains the real task’s division of work while using entirely generated source documents.
CorpusQA and its synthetic variant
| CorpusQA | Synthetic variant |
| Corpus Thirty-four monthly U.S. residential-construction releases. Each release reprints a window of months, and a later release can revise an earlier month. | Corpus Nothing is copied from those releases. Python draws a monthly series with a trend, a seasonal pattern and revisions, then renders each month as its own fictional release. This example is a retail-shaped series retitled Monthly Network Traffic, with the measure named enrolments, the category All and the adjustment smoothed: 80 releases. |
| Question From 2022/08 to 2025/05, how long is the longest continuous rise in the seasonally adjusted total of U.S. housing units under construction? If a month is printed more than once, the newest release prevails. | Question From 2018/08 to 2025/03, how long is the longest continuous rise in smoothed enrolments for All? Three rises in a row count as 3, and the newest release prevails. |
| Trace Read that series from every release in the window. Where a month is reprinted, keep the later value, then count consecutive month-over-month increases. The longest run has length 3. | Trace Read the smoothed All panel from each release and keep the newest print of every month. All 80 months are present. The longest rise is 2021-11 through 2022-02 (442,564, 492,945, 502,004, 512,694): three increases, and no longer run. |
| Gold 3 | Recorded target 3.0 |
CTC-Bench: new compositions of external source items
LM program: CTC grouping example, label then cluster
# The sub-call names a topic. It does not see labels or assign groups.
# The root clusters those names, then a second sub-call checks.
def solve(context, question):
abstracts = split_abstracts(context)
k = parse_num_groups(question)
topics = []
for batch in batches(abstracts, BATCH_SIZE):
# "Name each abstract’s topic in one sentence."
prompt = topic_prompt(batch)
topics.extend(parse_topics(
llm_query(prompt)))
draft = cluster_by_topic(topics, k)
# "Move any abstract whose topic does not match its group."
prompt = check_prompt(k, draft)
checked = parse_groups(llm_query(prompt))
return validate_partition(checked, k, abstracts)
Real task and current split. We target five splits of CTC-Bench: QDMatch–HotpotQA at 256K (), paraphrase absence at 32K (), contradiction at 1M (), outlier at 1M () and grouping at 32K (). These tasks are long, and fall under the superlinear complexity class.
Generation and source. The 1,799 exported trajectories are new items from the benchmark generators over the CTC seed pools. Each cell keeps the original question and replaces the eval items. Pools are filtered against exact text and 13-grams from all 23 published evaluation families at every rung.
QDMatch–HotpotQA. The eval split is the published HotpotQA question–document with different documents. Synthetic rows recombine HotpotQA (Yang et al., 2018) train questions, passages, and distractors into that same layout.
Paraphrase absence. The eval split is cross-corpus absence with paraphrased twins: two shuffled PubMed lists, where the answer is the sentences present in only one. The paper’s exact-copy version uses an identical twin; this split replaces that twin with a paraphrase. Synthetic rows pair PubMed abstract sentences with paraphrases written offline by Qwen3.8-27B, then drop selected counterparts, so the missing sentences are new.
Contradiction. The eval split is PubMed claim sentences with a few contradictory twins hidden among fillers, and the answer is every contradicting pair. Synthetic rows mix PubMed claims, edited contradictory twins, and filler claims from abstracts outside the real split.
Outlier. The eval split is the Wikipedia scale- ladder, not the fixed- control and not the Amazon-review outlier: chunks from several articles, and the answer is the chunks from the rarest article. Synthetic rows mix Wikipedia windows from several articles around a different minority article.
Grouping. The eval split is OpenAlex (Priem et al., 2022) abstracts partitioned by a concept in the OpenAlex hierarchy; the question states , and the concept is not printed in the abstract. Synthetic rows sample non-overlapping OpenAlex abstracts and take the target partition from their concept labels, which stay hidden the same way.
| Grouping, on the eval cell and on a new OpenAlex sample | |
| CTC grouping | Synthetic variant |
| Context The 32K OpenAlex cell. One published item has 20 abstracts and asks for 15 groups. The concept label is not in the text. Two of the abstracts are a paper on electrocatalytic nitrate-to-ammonia conversion and a review of zinc in disease. | Context A new draw of OpenAlex abstracts. An abstract is dropped if its exact text or any 13-gram appears in a published eval family. The concept label is still withheld. Ids are often strings, and the instruction often sits below the list rather than above it. |
| Sub-call The root pastes a batch and asks for one topic sentence per id. For those two, the reader can return “electrocatalytic conversion of nitrate to ammonia” and “the role of zinc in health and disease.” It is not asked for groups, and the label is not there to copy. | Sub-call The same topic question, but the pasted text is these new abstracts. The reader again returns a topic sentence per id. It still cannot see a label, and it never sees the eval batch. |
| Root It clusters matching topic sentences, so the ammonia abstracts share a group and the zinc review does not join them. A second sub-call reads that draft and can move an id. | Root The same cluster step, then the same check sub-call, with this draw’s . Nothing in the program refers to the eval item. |
| Gold The OpenAlex partition: the ammonia abstracts are one group, and the zinc abstract is in another. | Recorded target The concept partition of this draw. The groups are different abstracts from the eval item; the two llm-query questions are the same. |
Table Grouping.
ExpertLongBench: generated case files and forms
LM program: ExpertLongBench / fill an evidence-backed form
# Extract evidence for each checklist field.
# Leave unsupported fields empty.
def solve(context, question):
kind = llm_query(probe_case(question, context[:PROBE_CHARS]))
if kind == "recipe":
evidence = extract_short_record(context)
else:
evidence = []
for part in split_case_parts(context):
prompt = format_evidence_prompt(question, part)
evidence.extend(parse_evidence(llm_query(prompt)))
12 fields = fill_checklist(question, evidence)
13 return remove_unsupported_values(fields, evidence)
Real task and current split. We target several splits of ExpertLongBench: T01LegalMDS, T03MaterialSEG, T04EduPAE and T06HealthCNG, which differ in their source domains. The synthetic environment is designed around following the same evidence extraction decompositional program, where we use oracle sub-calls that return the correct field values from the supplied case text.
Generation and source. The 1,306 exported trajectories contain 377 dockets, 352 tutoring dialogues, 299 visits and 278 recipes. We used Python templates to generate all of the source content. Dockets range from 108K to 1.2M characters and mix dated filings, amendments, parties and fields the record does not support. Tutor dialogues follow a hidden sequence of correct, partial and incorrect responses about invented entities and facts. Visits sample clinical facts together with tempting unsupported additions.
How fake sub-calling was implemented. The target decompositional behavior on ExpertLongBench is to split a long evidence file, then sub-query LMs to find checklist field values corresponding to evidence. We simulate an oracle reader that, when provided with a case-file text, answers from the supplied evidence and injects omission, misreading and confabulation. The source content in all settings is entirely synthetic.
| ExpertLongBench | Synthetic variant |
| Corpus A real tutoring transcript. The checklist scores the student’s latest turn: whether it is correct, whether the turn before was also wrong, and what the tutor should say next. | Corpus Python invents a table of cycle and diet for four fictional species, then renders it as a tutor–student dialogue. No real transcript is used. A fake reader returns a turn-by-turn ledger, and the root fills the checklist from that ledger. |
| Question A rare plant grows only on one mountaintop. How does it produce viable seeds? The student first says it reproduces by spores. The tutor says it reproduces by seeds. The student then says it needs water and sunlight for photosynthesis. | Question The tutor has established that the Selzoron has a 9-day cycle and eats seeds, and asks for the cycle and diet of the Elirena. The student says: maybe a 3-day cycle, and water plants for the diet. |
| Trace The spore answer is rejected. Water and sunlight are real growth conditions, but they are not the conditions for producing seeds at altitude, so the last turn is only partial. The previous turn was also not accepted, so the mistake is repeated and the correction is direct. | Trace The hidden table says the Elirena’s cycle is 3 days and its diet is algae. “Water plants” is only a vague name for algae, so the cycle is right and the diet is not: partial. Earlier Selzoron answers were also only partial, so the mistake is repeated and the correction states the diet. |
| Gold Partially correct; repeated mistake: Yes | Recorded target Partially correct; repeated mistake: Yes |
Table 1 (PDF p. 37). ExpertLongBench and its synthetic variant
LooGLE-v2: procedural filings, repositories and logs
LM program: LooGLE-v2 / inspect and compute
# Probe the source type and retrieve relevant evidence.
# Run the analysis that matches the source.
def solve(context, question):
plan = llm_query(probe(question, context))
excerpts = search_context(context, plan.search_terms)
facts = llm_query(format_extraction_prompt(question, excerpts))
if plan.source == "filings":
answer = calculate_financial_values(facts, question)
elif plan.source == "repository":
answer = traverse_call_graph(facts, question)
elif plan.source == "event_log":
answer = count_or_compare_events(facts, question)
else:
answer = compare_file_versions(facts, question)
return verify_against_context(answer, excerpts)
Real task and current split. We target all LooGLE-v2 tasks with 500K-token contexts. The synthetic environment constructs an environment that can be solved with the same inspect-and-compute program over procedural source text, with real sub-calls doing the local reads.
Generation and source. The 397 exported trajectories use loogle-strategy-synth. We generate the source text procedurally. Finance instances generate 3–9 fictional 10-Ks with random values, unit traps, label variants and prior-year-first columns. Code instances plant a call graph in a fictional Python repository, including same-name functions and misleading strings and comments. Game instances render random CS-style events in a log grammar close to the benchmark. Version instances insert, delete or modify files across a pair of generated trees. Contexts run from about 0.28M to 8.5M characters, and gold follows the planted numbers, graph, event ledger or file edits.
| LooGLE-v2 and its synthetic variant | |
| LooGLE-v2 | Synthetic variant |
Corpus Real Form 10-K filings, one file per company-year, concatenated as <FILE:> blocks. | Corpus Python builds five fictional companies and writes a 10-K for each, with statements that add up, a chosen unit, and a chosen column order. The names and figures are not taken from real filings. |
| Question Among Eli Lilly, Exxon Mobil, Intuitive Surgical, Coca-Cola and Abbott, which has the highest working capital in FY2023? Working capital is current assets minus current liabilities. Answer with the company’s list number. | Question Rank Varden Industries, Westcott Aerospace, Dunmore Financial, Oakhurst Health and Foxhall Beverages by FY2024 long-term debt, highest first. What is Westcott’s rank? |
| Trace Split out the five FY2023 filings and read current assets and current liabilities from each consolidated balance sheet. Subtracting, Exxon Mobil is the largest. | Trace Read the FY2024 long-term-debt line in each generated filing: Varden 256,078, Westcott 203,620, Dunmore 98,927.4, Oakhurst 16,394, Foxhall 9,283.4. Sorting those figures places Westcott second. |
| Gold 2 (Exxon Mobil) | Recorded target 2 |
Table 1 (PDF p. 38).
LongReason: expanded questions from external reasoning corpora
LM program: LongReason / retrieve the full scenario
# Find the expanded problem among filler.
# Delegate the reasoning once it is recovered.
def solve(context, question, options):
terms = llm_query(search_prompt(question, context[:PROBE_CHARS]))
paragraphs = search_context(context, terms)
scenario = reject_filler(paragraphs, terms)
prompt = format_reasoning_prompt(question, options, scenario)
answer = llm_query(prompt)
return validate_option(answer, options)
Real task and current split. We target the LongReason 128k split, which involves a short reasoning problem expanded into several paragraphs and buried in a long background. The synthetic environment is designed around the same retrieve-then-reason LM program: the root finds the expanded scenario, and in tail-recursion fashion, invokes a sub-call to solve the recovered question in isolation.
Generation and source. The 1,821 exported records comprise 356 root trajectories and 1,465 reasoning sub-calls. Source multiple-choice questions come from ReClor (Yu et al., 2020) train and validation, LogiQA 2.0 MRC (Liu et al., 2023b) train, dev and test, and AQuA-RAT (Ling et al., 2017) train. We use Qwen3.8-27B to add a fictional setting, rewrite each source sentence or sentence pair into a 90–140-word paragraph, and reword questions in these data sources while keeping the options and the source label. To emulate the scattering of the real question / reasoning within a larger corpus of text, we add DCLM-baseline (Li et al., 2024) web-text chunks to the context but maintain the overall order of the paragraphs within the context.
LongReason and its synthetic variant
LongReason
Corpus A short puzzle is expanded into several paragraphs and buried in a long unrelated background. What remains is a multiple-choice question.
Question In Green Town, Jack, Emily and Tom are each honest or a liar. Jack says Emily and Tom are both liars. Emily says she is honest. Tom says Emily is a liar. How many are liars?
Trace If Jack were honest, both others would be liars, but then Tom’s claim that Emily is a liar would be true. So Jack is a liar, and at least one of the others is honest. Emily and Tom contradict each other, so exactly one of them is a liar. That is two liars.
Gold C (2)
Synthetic variant
Corpus A LogiQA item is rewritten into two paragraphs set at the Corvane Institute of Logical Studies. The options stay the same. The paragraphs are scattered, in order, through DCLM web-text chunks, about 462,000 characters.
Question Which option exemplifies the accidental fallacy as those seminars define it? Option B: speeding is illegal, so ambulances should not exceed the speed limit.
Trace Search the filler for Corvane and “accidental fallacy.” The recovered definition is a general rule used to deny a legitimate exception. Option B does that. Option A flips a cause, option C treats seahorses as horses, and option D generalizes from a few rainy days.
Recorded target B
OBLIQ: generated problems with hidden reasoning techniques
LM program: OBLIQ / rank reasoning techniques
# Ask readers to describe each candidate’s technique.
# Rank descriptions, then flag a shortlist.
def solve(context, question):
descriptions = []
for batch in candidate_batches(context, BATCH_SIZE):
prompt = format_technique_prompt(question, batch)
descriptions.extend(parse_descriptions(llm_query(prompt)))
ranked = rank_by_technique(question, descriptions)
shortlist = ranked[:SHORTLIST_SIZE]
flags = llm_query(format_flag_prompt(question, shortlist))
return complete_ranking(ranked, parse_flags(flags))
Real task and current split. We target OBLIQ-Bench math with the entire 3,508-entry math corpus rather than a subset, scored with nDCG@50. The synthetic environment is designed around the generic program of ranking candidates using language models, and provides an oracle to rank correctly under the sub-calls invoked by this program.
Generation and source. The 474 exported trajectories use fake documents with a fake ranking. Using Qwen3.8-27B, we generate 125 techniques in 12 families from generic seed lists, about 25 stories per technique with a one-sentence solution sketch, rewrites of those stories in distant settings, and same-topic decoys that require a different technique. The pool has 5,054 problems and averages 229 characters. A query is one sampled problem. Its candidate pool holds 1–30 positives from the same technique plus decoys and random problems, roughly 2,500–3,100 entries, under opaque IDs.
How fake sub-calling was implemented. The assumption on OBLIQ is that the program batches candidates, asks a reader to describe each one’s technique, ranks those descriptions, and then flags a shortlist. We replace sub-calls with a programmatic oracle that returns this information given a batch of candidate questions from the task. To simulate context rot, description accuracy falls as the batch grows. The simulator also injects incomplete descriptions, format drift and flags written as prose.
OBLIQ and its synthetic variant
OBLIQ
Corpus A pool of 3,508 math problems. A relevant problem shares a reasoning technique with the query; the technique need not show up in the topic or the vocabulary.
Question Show that any finite integral domain is a field. Rank the pool by that technique.
Trace The two relevance-2 documents are Kyiv undergraduate problems 2013.2 and 2013.10. Both ask whether a finite ring can exist in which every element—2013.10 restricts this to every nonzero element—is the square of some other element. Those are the documents to rank first.
Gold Kyiv 2013.2 and 2013.10 (both relevance 2)
Synthetic variant
Corpus The base model writes 125 techniques, about 25 stories for each, rewrites in distant settings, and same-topic decoys that need a different technique. No OBLIQ problem is shown to the generator. This query is one sampled story, ranked against 3,053 candidates under opaque ids.
Question A stage designer arranges three kinds of props and must prove that total visual complexity—sizes plus pairwise interference—is minimized when two kinds have the same size.
Trace The hidden technique (UVW) rewrites a symmetric inequality in elementary symmetric polynomials and reduces it to the case where two variables are equal. Document d59efaf629b is a three-variable variance story with that same reduction. Stories that only share the surface use other techniques. A fake reader returns a technique sketch, and the root ranks by the sketch.
Recorded target d59efaf629b
OOLONG-Real: generated tabletop sessions
LM program: OOLONG-Real / extract and aggregate events
# Probe transcript structure and extract source-linked events.
# Reconcile actors before aggregating.
def solve(context, question):
schema = llm_query(probe(question, context))
events = []
for chunk in transcript_chunks(context, schema):
prompt = format_event_prompt(question, schema, chunk)
events.extend(parse_events(llm_query(prompt)))
events = reconcile_actors_and_duplicates(events, schema)
return aggregate_events(events, question)
Real task and current split. We target a split of OOLONG-Real (dnd/test), containing 577 questions over ten three-episode windows at 175K tokens per window. The synthetic environment keeps the extract-and-aggregate program over generated tabletop sessions, with real sub-calls reading the synthetic transcripts.
Generation and source. The 995 exported trajectories use a synthetically generated set of transcripts. Python samples an invented cast and one to three episodes of 700–1,400 lines, then renders scenes, banter, combat, dice outcomes and spell actions from hidden event tables. Similar to the real task, the queries ask for roll counts, criticals, totals, modes, spell order and counts, upcasts or cantrips. Episode delimiters, speaker notation, cast-list styles and date formats vary. Guest appearances, similar player names and stale player-to-character mappings force the program to inspect the source.
OOLONG-Real and its synthetic variant
OOLONG-Real
Corpus Transcripts of Critical Role campaign 1. This question uses one three-episode window: episodes 2, 16 and 64.
Question How many Investigation rolls are there across all three episodes?
Trace Tie each speaker to a character, then count rolls whose type is Investigation. One of them is Matt calling for an investigation roll. The window contains 9.
Gold 9
Synthetic variant
Corpus Python samples an invented cast and renders one episode from a hidden event table: scenes, banter, combat and dice. No Critical Role transcript is used, and real cast names are rejected. Here Cassius is the DM and Greer plays Torquinth.
Question How many Wisdom Save rolls are there in this episode?
Trace Readers list every roll with its speaker and type. Eight are Wisdom Saves, including Torquinth’s 21 after Cassius calls for a wisdom saving throw. A second read, shifted by a few lines, adds other rolls but no further Wisdom Saves.
Recorded target 8
Measured differences in task descriptions
Comparing synthetically generated tasks with real tasks. We measure the similarity between the synthetic and real tasks used in Table 12. Some instances (e.g. BrowseComp-Plus) use entirely different questions and context, while others that use more general aggregation queries like CTC-Bench share similar questions and context, but shuffled and otherwise modified to be different.
| Environment | Real | Train | ||
| BrowseComp-Plus | 830 | 1,322 | 0.021 | 0 |
| CorpusQA | 81 | 853 | 0.315 | 81 |
| CTC: QDMatch 256K | 125 | 136 | 1.000 | 125 |
| CTC: absence 32K | 100 | 516 | 1.000 | 100 |
| CTC: contradiction 1M | 125 | 151 | 1.000 | 125 |
| CTC: outlier 1M | 125 | 209 | 1.000 | 125 |
| CTC: grouping 32K | 60 | 185 | 0.965 | 60 |
| ExpertLongBench | 350 | 678 | 0.748 | 350 |
| LooGLE-v2 | 206 | 327 | 0.479 | 197 |
| LongReason | 794 | 256 | 0.022 | 0 |
| OBLIQ math | 151 | 443 | 0.011 | 0 |
| OOLONG-Real | 577 | 383 | 0.810 | 232 |
Table 12. Task-description overlap between the clean training export and updated real evaluation splits. counts distinct descriptions, not trajectories. Larger means more shared wording. counts the number of real questions with at least one exact 13-word sequence shared with any training description; it does not count all matching sequences and does not by itself measure contamination.
Metrics. Let be the set of contiguous word -grams in description , the training descriptions and the real questions. averages over . counts real questions sharing at least one exact 13-word sequence with any training description. It is a question-level hit count, not the number of matching 13-gram sequences.
What differs. BrowseComp-Plus, LongReason and generated OBLIQ-Bench have low description overlap with their synthetic environment counterparts. CorpusQA retains the revision rule; Expert-LongBench retains the checklist instructions; LooGLE and OOLONG retain question templates. For four CTC-Bench splits, the native task specification is identical despite different item collections. The high similarity on CTC-Bench is due to re-used queries (they are generic queries over aggregation patterns), while the context being investigated differs.
Runtime comparison of synthetic environments
In Tables 13 and 14, we compare wall-clock rollout time on each real benchmark with its synthetic counterpart, for RLM-27B and Qwen3.8-27B, using up to random samples per benchmark (all if fewer). Rollouts use training sampling (thinking off, 6,000 output tokens, temperature 1.0) at a concurrency of 8 per vLLM server, and we report p50, p99 and mean seconds per rollout. Parentheses give the synthetic time as a multiple of the real time (green: faster, red: not faster). † marks benchmarks whose synthetic variant answers sub-calls with a programmatic oracle; all other synthetic environments call the real sub-LM.
| Benchmark | p50 Real | p50 Synth. | p99 Real | p99 Synth. | Mean Real | Mean Synth. |
| CTC-Bench | 157 | 90 (0.57×) | 1009 | 601 (0.60×) | 219 | 154 (0.70×) |
| OBLIQ† | 144 | 119 (0.83×) | 487 | 233 (0.48×) | 158 | 120 (0.76×) |
| BrowseComp-Plus† | 87 | 56 (0.64×) | 572 | 370 (0.65×) | 135 | 73 (0.54×) |
| ExpertLongBench† | 28 | 20 (0.72×) | 182 | 219 (1.21×) | 37 | 47 (1.27×) |
| LooGLE-v2 | 48 | 40 (0.83×) | 275 | 313 (1.14×) | 82 | 56 (0.68×) |
| OOLONG-Real | 86 | 68 (0.79×) | 394 | 579 (1.47×) | 107 | 120 (1.12×) |
| CorpusQA | 56 | 88 (1.58×) | 142 | 263 (1.85×) | 65 | 98 (1.52×) |
| LongReason | 19 | 20 (1.11×) | 152 | 94 (0.62×) | 29 | 26 (0.89×) |
Table 14. Seconds per rollout for Qwen3.8-27B, real benchmark vs. synthetic environment (lower is bold; the parenthesis is synthetic/real).
Concatenated task chain environment - details
In §4.3, we described a task setup in which we took concatenated chains of individual tasks that the RLM-27B learned to solve in §4.2, and formed new tasks in which the harness had to solve each task in sequence. We visualize this setup in Figure 9, where a chain consists of four tasks that must be solved in sequence.
Task pool and benchmark construction. We selected 87 evaluation tasks (54 from LooGLE-v2, 29 from LongReason, 4 from CorpusQA) on which, over three runs each, RLM-27B averages at least 0.7 and Qwen3.8-27B at most 0.34. Under the following sampling settings (temperature 0, sub-calls with thinking), RLM-27B scores 97.5% on these tasks, while Qwen3.8-27B scores 57.7%. We randomly sample 2000 distinct meta-tasks, each an ordered selection of four distinct pool tasks, and evaluate every condition on this same set.
The model / harness is initially given the first task only. It is prompted to provide an answer via the unlock(answer) tool. If the answer passes, it returns the next task, or DONE after the last one. Otherwise, the tool returns LOCKED, and the model has one more attempt. An answer passes at full score, or at an F1 of at least 0.8 for CorpusQA. We use handoff as the tool to invoke a new RLM call on the returned task, so a solved chain is four RLM calls nested by tail recursion, i.e., an RLM with depth=3. The harnesses we evaluated used the following settings:
In the RLM harness setting, the interface provides
unlockbut nohandoff; therefore, the entire chain is solved within a single root trajectory. The harness receives a short protocol prompt before the first question, listed in the box below, that explains the gated sequence and shows theunlockloop. The call has a budget of 80 turns for the entire chain (4 tasks × 20 turns), and there is no progress line. Each harness is given 80 turns, while the + SFT variant is given 20 per RLM.
In the + recursion hint setting, the harness is given an optimized prompt hint that we list below, and has both the
unlockandhandofftools, as well as 80 turns per RLM call.
In the + SFT setting it has both tools, no hint, and 20 turns per RLM call. One line after the question states how many tasks the chain has and which are done.
The first box gives the full prompt of the default RLM harness setting. It states the protocol and gives the exact unlock loop, but does not mention recursion or handoff, and it reveals nothing about the tasks.
| Prompt for the default RLM harness setting |
| Before the question |
`[MANDATORY PROTOCOL] Your answer is NOT accepted through ‘answer["content"]‘ until the whole sequence is done. You must solve several tasks one after another in THIS session; the later tasks stay hidden until the current one is answered correctly. Work out your answer to the task below as you normally would, then check it with ‘res = unlock(my_answer)‘ (my_answer = a string in the format the question asks). If ‘res‘ is a dict, it is the NEXT task: ‘res[’question’]‘ is its question and ‘res[’context’]‘ its data (bind ‘context_0 = res[’context’]; context = context_0‘). Solve it the same way and call ‘unlock‘ again. If ‘res‘ starts with ’LOCKED’, your answer was wrong: recompute and call ‘unlock‘ once more. When ‘res‘ == ’DONE’ you are finished: set ‘answer["content"] = my_answer; answer["ready"] = True’. Do not set ‘answer["ready"]’ before ‘unlock’ has returned ‘DONE’; that ends the session with the remaining tasks unsolved. Use exactly this after you have worked out your answer to a task: repl my_answer = <your final answer to the CURRENT task, as a string in the format its question asks> res = unlock(my_answer) if isinstance(res, dict): # the next task print(res['stage'], res['of']); print(res['question']) context_0 = res['context']; context = context_0 # data for the next task else: print(res) |
Table Prompt for the default RLM harness setting.
The second box gives the full prompt of the + recursion hint setting: the text placed before the question, the reminder placed after it, and the descriptions of the two tools, which replace the default ones.
Prompt for the + recursion hint setting
Before the question
[MANDATORY PROTOCOL - read before starting] You are solving a gated sequence of tasks.
Your answer is NOT accepted by submitting it in ‘answer["content"]‘. Work out your
answer as you normally would, then, in a repl cell, run EXACTLY this (fill in the
answer):
my_answer = <your final answer, as a string in the format the question asks>
pkg = unlock(my_answer)
print(pkg if not isinstance(pkg, dict) else {k: (v if k in (’stage’, ’of’) else ’...’)
for k, v in pkg.items()})
Case 1: ‘pkg‘ is a dict with a ’question’ and ’context’: the next tasks are in it. Do NOT
solve them yourself. Run ‘down = handoff(pkg)‘ in the next cell. A fresh level solves
the rest.
Case 2: ‘pkg‘ starts with ’LOCKED’: your answer was wrong; recompute it and call unlock
again (one more attempt).
Case 3: ‘pkg‘ == ’DONE’: nothing is left.
Only AFTER unlock (and handoff, if there was a pkg) has been called, finish with
‘answer["content"] = my_answer; answer["ready"] = True‘. Never set ‘answer["ready"]‘
before calling ‘unlock‘.
After the question
[REMINDER] Before you finish: you must have run ‘pkg = unlock(my_answer)‘ and, if pkg is
a dict, ‘down = handoff(pkg)‘. Submitting without calling ‘unlock‘ leaves the remaining
tasks unsolved and scores zero.
Description of unlock in the tool list
REQUIRED. unlock(answer): you MUST call this with your final answer (a string in the
format the question asks) BEFORE submitting ‘answer[’ready’]‘. Returns a dict
{’stage’,’of’,’question’,’context’} (the next task: pass it to handoff, do not solve it
yourself), ’DONE’, or ’LOCKED: ...’ (wrong; 2 attempts per task).
Description of handoff in the tool list
REQUIRED whenever unlock returned a dict. handoff(pkg): pass that dict; a fresh RLM level
solves the remaining tasks. Never solve the next task yourself.
Training recursion on synthetic traces with surrogate harness training. The desired behavior of the RLM harness is to launch tail-recursive sub-RLM queries over each successive task in the task chain. We explicitly want to compose this behavior with the learned programs for each of the individual tasks, such that any permutation of tasks in this setup would succeed.
Our synthetic environment therefore focuses on teaching the RLM to solve an arbitrary task, then tail-recurse another RLM over the new task it has to solve. The arbitrary tasks here are synthetic and unrelated to the tasks selected for the real setup. The sub-calls over these tasks are also fake, and return programmatic answers.
Teacher trajectories. RLM-27B at temperature 0.3 solves chains of one to four fake tasks. Its own turns are kept until it submits an answer. We rewrite that submission to store the answer in a variable and call unlock on it. If unlock returns LOCKED with an attempt left, the model continues and revises its answer on its own. Once the answer passes, we append two scripted turns: one that calls handoff on the returned task, and one that submits the stored answer after handoff returns. On 59% of RLM calls the teacher also receives a note asking it to write the solutions as one program. This note is removed from the saved prompts.
Training data. The teacher produced 2,809 RLM calls. The final training export contains 2,479 distinct full dialogues: 2,277 calls whose answer passed the gate and 202 that stopped correctly after failing both attempts. Calls that submitted before calling unlock, never submitted, repeated the same answer on both attempts, or could not be rewritten automatically are excluded. We oversample the full dialogues: the 2,196 first-attempt successes appear once, the 81 second-attempt successes twice, and the 202 clean stops three times. Thus there are 2196 + 2 × 81 + 3 × 202 = 2964 full-dialogue samples. We also add prefixes ending right after an unlock or handoff turn so that these turns are final turns more often; one additional successful teacher call contributes only two unlock prefixes. This gives 7,705 training samples: 2,964 full dialogues (including repeated copies), 3,147 ending at an unlock turn, and 1,594 ending at a handoff turn. We fine-tune all weights of RLM-27B and, separately, of Qwen3.8–27B for 100 steps with batch size 4 and learning rate . Data is here: https://huggingface.co/datasets/alzhang/rlm-tail-recursion-sft-data/.
Example. The box below shows a training chain of two fake tasks. Turns before the submission are omitted.
A training chain of two fake tasks (abridged)
RLM call 1: task A (ledger)
Question The material for this task is stored in context. What is the total value (quantity times unit cost) of all records for ‘Fujoyo bolt’ at site Bahexe? Answer with the number alone (two decimals if it is not a whole number).
Progress line [SEQUENCE] You need to solve 2 tasks in order: A, then B. So far you have solved: none. The task above is task A.
Context A list of 205 records such as TX-6140; Fujoyo bolt; Dopisu; 55 pcs @ 4.26.
Turn 2, written by the teacher The last three lines replace its original submission.
for line in context:
parts = [p.strip() for p in line.split(’;’)]
[...] # keep ’Fujoyo bolt’ at ’Bahexe’, add quantity * unit cost
print(’count’, count, ’total’, total) # prints: count 33 total 37676.08
my_answer = f"{total:.2f}"
result = unlock(my_answer)
print(result if isinstance(result, str)
else f"unlocked: next task received (stage {result[’stage’]} of {result[’of’]})")
Output unlocked: next task received (stage 2 of 2)
Turn 3, scripted
down = handoff(result)
print(’handoff returned’, len(down), ’result(s)’)
Turn 4, scripted
answer["content"] = my_answer
answer["ready"] = True
RLM call 2, started by handoff: task B (reporting chain)
Question You are given some data in the variable context. Follow the chain of managers upward starting from Resuvo. Who is at the very top? Reply with just the name.
Progress line [SEQUENCE] You need to solve 2 tasks in order: A, then B. So far you have solved: A. The task above is task B.
Context A string of 4,934 characters with sentences such as “Pixere’s manager is Tavomi.” and “Babata reports to Tavomi.”
Turn 2, written by the teacher The last four lines replace its original submission.
[...] # parse the three sentence patterns into edges[person] = manager
while cur in edges:
[...] # step to the manager, stop on a cycle
print("top:", chain[-1]) # prints: top: Tavomi
my_answer = chain[-1]
result = unlock(my_answer)
print(result if isinstance(result, str)
else f"unlocked: next task received (stage {result[’stage’]} of {result[’of’]})")
Output DONE
Turn 3, scripted
answer["content"] = my_answer
answer["ready"] = True
Run statistics. Table 15 summarizes the same 2000 chains per condition as Table 6. A chain solved by tail recursion needs four successful unlock calls and three handoff calls; retries add unlock calls. Each task passing the gate counts as one solve, whether it passes on the first or second attempt. In the RLM harness setting, each chain uses one root trajectory and no handoff.
| Setting | 0 | 1 | 2 | 3 | 4 | Passed | unlock | handoff | RLM calls | Turns | Sub-calls | 2nd att. (%) |
| Qwen3.8-27B | ||||||||||||
| RLM harness | 756 | 382 | 285 | 191 | 386 | 1.53 | 2.57 | 0.00 | 0.84 | 60.8 | 0.75 | 21.5 |
| + recursion hint | 766 | 523 | 306 | 156 | 249 | 1.30 | 2.20 | 1.13 | 1.92 | 31.6 | 0.41 | 21.5 |
| + SFT | 646 | 693 | 306 | 157 | 198 | 1.28 | 3.10 | 0.93 | 1.92 | 15.1 | 0.91 | 27.2 |
| RLM-27B | ||||||||||||
| RLM harness | 86 | 311 | 266 | 232 | 1105 | 2.98 | 3.87 | 0.00 | 0.84 | 23.2 | 5.05 | 13.0 |
| + recursion hint | 336 | 325 | 226 | 168 | 945 | 2.53 | 3.20 | 2.06 | 2.80 | 6.6 | 1.84 | 6.0 |
| + SFT | 114 | 193 | 67 | 76 | 1550 | 3.38 | 4.40 | 2.63 | 3.62 | 8.0 | 1.99 | 6.8 |
Table 15. Statistics of the gated-chain runs in Table 6, over 2000 chains each. Chains by tasks passed counts chains by the number of tasks whose answer passed the gate. The Per chain columns are averages over chains: tasks passed, unlock and handoff calls, and RLM calls with saved trajectories. The Per RLM call columns are averages over RLM calls with saved trajectories; failed calls without a saved trajectory are excluded from these call-level averages. 2nd att. is the share of passed tasks that passed on the second attempt. The RLM harness has an 80-turn budget for the whole chain, the + recursion hint setting has 80 turns per RLM call, and the + SFT setting has 20.
RLM-27B makes no
unlockcall in 18 chains, passes the first task in 1914, and averages 3.87unlockcalls and 2.98 passed tasks per chain.
With the tail recursion hint, RLM-27B calls
unlockin 1914 chains and passes the first task in 1664, with 3.20unlockand 2.06handoffcalls per chain.
After SFT, RLM-27B averages 4.40
unlockand 2.63handoffcalls and passes 3.38 tasks per chain; 6.8% of passed tasks need the second attempt.
Qwen3.8-27Bmakes nounlockcall in 426 chains, passes the first task in 1244, and averages 2.57unlockcalls and 1.53 passed tasks per chain.
Qwen3.8-27Bwith the hint makes nounlockcall in 412 chains and passes the first task in 1234, with 2.20unlockand 1.13handoffcalls per chain.
Qwen3.8-27Bafter SFT averages 3.10unlockcalls and 1.28 passed tasks per chain; 27.2% of passed tasks need the second attempt. Of its 1802 chains that are not fully solved, 799 stop after an incorrect attempt on the first task not passed, and 1003 make nounlockcall on that task.
The final columns describe RLM calls with saved trajectories. Failed calls can lack a saved trajectory, so the recorded call count can average less than one per chain even when a root call was started. Across all three conditions, RLM-27B uses fewer turns per recorded RLM call and needs a second attempt on a smaller share of passed tasks than Qwen3.8-27B.
Benchmark-level trajectory statistics
Tables 16, 17, and 18 provide expanded per-environment statistics for the statistics reported in Table 5 across the eight evaluation benchmarks. We observe that each environment exhibits distinct patterns in terms of token and sub-call use, and we expand on these results here.
| Method | LongReason | LooGLE | CTC | BC+ | OOLONG-Real | CorpusQA | OBLIQ | ELB | Avg. |
| Qwen3-30B-A3B-Instruct-2507 | |||||||||
| RLM (base) | 21.0 | 10.9 | 16.6 | 21.2 | 17.8 | 25.4 | 11.8 | 10.3 | 16.9 |
| + RL (6 short tasks) | 8.0 | 11.0 | 13.5 | 14.1 | 15.3 | 22.4 | 13.6 | 6.8 | 13.1 |
| + RL (∼20 tasks) | 6.0 | 11.1 | 14.6 | 18.1 | 16.3 | 22.7 | 14.4 | 9.2 | 14.1 |
| + RL (synthetic tasks) | 11.7 | 10.5 | 10.1 | 18.8 | 19.7 | 17.4 | 10.0 | 6.2 | 13.1 |
| Qwen3.8-27B | |||||||||
| RLM (base) | 7.9 | 9.8 | 26.1 | 24.7 | 26.2 | 21.3 | 19.1 | 11.8 | 18.4 |
| + RL (6 short tasks) | 7.2 | 9.9 | 25.6 | 24.0 | 18.3 | 20.9 | 18.3 | 11.3 | 16.9 |
| + RL (synthetic data) | 5.3 | 9.1 | 24.5 | 22.8 | 19.0 | 19.2 | 18.6 | 10.3 | 16.1 |
| RLM-27B (synthetic data) | 2.2 | 5.0 | 9.7 | 17.9 | 4.8 | 3.5 | 6.4 | 2.3 | 6.5 |
Table 16. Average number of root turns per rollout, by benchmark.
| Method | LongReason | LooGLE | CTC | BC+ | OOLONG-Real | CorpusQA | OBLIQ | ELB | Avg. |
| Qwen3-30B-A3B-Instruct-2507 | |||||||||
| RLM (base) | 3.4 | 3.2 | 2610.8 | 113.0 | 0.6 | 10.1 | 2830.3 | 4.8 | 697.0 |
| + RL (6 short tasks) | 0.0 | 0.5 | 1064.1 | 15.5 | 0.2 | 9.5 | 2240.5 | 2.0 | 416.5 |
| + RL (∼20 tasks) | 0.0 | 0.2 | 2532.0 | 91.9 | 0.0 | 0.4 | 1756.8 | 2.8 | 548.0 |
| + RL (synthetic tasks) | 0.0 | 3.5 | 4584.1 | 207.1 | 8.1 | 48.0 | 3394.7 | 3.8 | 1031.1 |
| Qwen3.8-27B | |||||||||
| RLM (base) | 0.1 | 0.2 | 644.1 | 6.6 | 6.8 | 0.9 | 35.9 | 3.5 | 87.3 |
| + RL (6 short tasks) | 0.1 | 0.1 | 1629.9 | 5.7 | 18.8 | 0.9 | 54.9 | 2.3 | 214.1 |
| + RL (synthetic data) | 0.1 | 0.3 | 166.6 | 3.6 | 23.9 | 0.5 | 22.1 | 1.8 | 27.4 |
| RLM-27B (synthetic data) | 1.0 | 3.9 | 614.2 | 15.3 | 50.7 | 1.0 | 93.7 | 8.3 | 98.5 |
Table 17. Average number of sub-calls per rollout, by benchmark.
We generally observe the post-trained models exhibit very different behavior from each other and the base model variants, and when trained correctly, often use fewer turns, fewer tokens, and fewer sub-calls than the base model variants. However, the SFT’d model on synthetic traces targets trajectory behavior that is more compact, while maintaining similar or better performance on the evaluation benchmarks. In some cases, efficiency improvements are not useful, such as the + RL (synthetic data) variant on CTC-Bench, which uses far fewer sub-calls than the SFT variant but performs much worse.
| Benchmark | Qwen3-30B-A3B Base | Qwen3-30B-A3B + RL (6 short) | Qwen3-30B-A3B + RL (∼20) | Qwen3-30B-A3B + RL (synth.) | Qwen3.8-27B Base | Qwen3.8-27B + RL (6 short) | Qwen3.8-27B + RL (synth.) | RLM-27B |
| Root tokens | ||||||||
| LongReason | 227K / 4K | 53K / 3K | 35K / 3K | 327K / 8K | 31K / 1K | 29K / 1K | 14K / 1K | 6K / 2K |
| LooGLE | 48K / 3K | 45K / 3K | 76K / 7K | 77K / 5K | 46K / 2K | 50K / 1K | 54K / 2K | 19K / 3K |
| CTC | 170K / 43K | 95K / 49K | 238K / 61K | 140K / 65K | 400K / 10K | 428K / 10K | 496K / 14K | 60K / 5K |
| BC+ | 572K / 20K | 191K / 7K | 353K / 16K | 603K / 24K | 495K / 6K | 658K / 6K | 1036K / 13K | 203K / 4K |
| OOLONG-Real | 178K / 7K | 107K / 6K | 275K / 13K | 315K / 13K | 545K / 7K | 321K / 23K | 395K / 23K | 20K / 4K |
| CorpusQA | 656K / 20K | 685K / 31K | 742K / 21K | 447K / 21K | 200K / 5K | 279K / 5K | 355K / 8K | 14K / 3K |
| OBLIQ | 620K / 29K | 507K / 24K | 771K / 41K | 99K / 8K | 209K / 6K | 291K / 7K | 501K / 15K | 23K / 2K |
| ELB | 92K / 4K | 36K / 2K | 104K / 6K | 71K / 5K | 181K / 4K | 281K / 4K | 285K / 4K | 5K / 1K |
| Avg. | 321K / 16K | 215K / 16K | 324K / 21K | 260K / 19K | 263K / 5K | 292K / 7K | 392K / 10K | 44K / 3K |
| Sub-call tokens | ||||||||
| Benchmark | Qwen3-30B-A3B Base | Qwen3-30B-A3B + RL (6 short) | Qwen3-30B-A3B + RL (∼20) | Qwen3-30B-A3B + RL (synth.) | Qwen3.8-27B Base | Qwen3.8-27B + RL (6 short) | Qwen3.8-27B + RL (synth.) | RLM-27B |
| LongReason | 12K / 0K | 0K / 0K | 0K / 0K | 1K / 0K | 0K / 0K | 0K / 0K | 0K / 1K | 1K / 0K |
| LooGLE | 46K / 1K | 12K / 0K | 0K / 0K | 120K / 1K | 12K / 0K | 2K / 0K | 5K / 0K | 14K / 0K |
| CTC | 3219K / 142K | 1445K / 37K | 1498K / 179K | 2019K / 134K | 3220K / 57K | 5431K / 112K | 2511K / 114K | 1526K / 77K |
| BC+ | 615K / 18K | 29K / 1K | 191K / 10K | 1156K / 23K | 30K / 5K | 41K / 6K | 13K / 20K | 29K / 10K |
| OOLONG-Real | 5K / 0K | 10K / 0K | 0K / 0K | 14K / 0K | 96K / 3K | 264K / 59K | 267K / 75K | 269K / 18K |
| CorpusQA | 134K / 0K | 218K / 4K | 1K / 0K | 371K / 4K | 11K / 0K | 5K / 0K | 2K / 0K | 5K / 0K |
| OBLIQ | 3786K / 1592K | 3219K / 355K | 3126K / 1100K | 885K / 237K | 141K / 15K | 178K / 19K | 239K / 22K | 324K / 389K |
| ELB | 18K / 1K | 23K / 1K | 3K / 1K | 50K / 1K | 33K / 4K | 27K / 4K | 30K / 3K | 39K / 3K |
| Avg. | 979K / 219K | 619K / 50K | 602K / 161K | 577K / 50K | 443K / 10K | 743K / 25K | 383K / 29K | 276K / 62K |
Table 18. Average root and sub-call input / output tokens in thousands (K = 1,000), rounded to the nearest K.
Characterizing locally in-distribution trajectories
In this section, we discuss why locally in-distribution trajectories are a desirable property, and how they induce generalization at the neurosymbolic level, over the existing capabilities of language models. We first motivate how certain harness abstractions can exploit the locally in-distribution property to yield compositional generalization, and provide brief mathematical intuition on how harnesses like RLMs do so (§D.1–§D.2). In §D.3, we then provide empirical evidence for, at a token-level, what kind of root-level trajectories are produced by each harness in the experiments in §3. Finally, in §D.4, we provide several examples of trajectories on unseen evaluations that match similar training trajectories through the orchestrator LM.
Generalization Gap under Neural Network Parametrization
Consider a training task distribution and a test task distribution . Standard RL post-training learns a parameterized policy by maximizing expected reward on the training distribution:
At test time, this learned policy is evaluated on , yielding
In general, the optimal performance achievable under the test distribution within the same policy class on is , where . The ideal case in RL post-training is that the reward-maximizing policy over the training distribution is also the reward maximizing policy over the test distribution, i.e., , but we do not have this guarantee. The resulting generalization gap therefore is defined as:
For bounded rewards , this expression satisfies
The fundamental challenge is that RL optimization on provides no general guarantee that will behave similarly to on unseen tasks. When and differ substantially, the generalization gap can be as large as the full reward range.
In conventional “trajectory-as-a-prompt” approaches, generalization therefore relies entirely on the neural network’s learned representations: the parameters , optimized on training trajectories, must implicitly capture the structure necessary to solve previously unseen trajectories. Without an explicit mechanism for composing previously learned capabilities, there is no guarantee that this extrapolation will succeed, even when the individual subtasks are already solvable by the model.
This motivates our central question: can a harness reduce this generalization burden by transforming globally out-of-distribution tasks into locally in-distribution computations?
Generalization through RLM decomposition
Rather than learning a single policy , an RLM decomposes the computation into two components:
Root controller: , where is the root’s action (e.g., an LM program).
REPL execution: , where is the offloaded context, and is the result of executing the action, potentially using sub-LM calls.
Step 1. Expected reward on training and test tasks For a training task , define
Similarly, for a test task , . Here measures the expected reward of executing root action on task with external context .
Step 2. Decomposing the generalization gap For clarity, compare a training task and a test task . We have
We then add and subtract to decompose the difference into the root-controller shift and the execution/sub-call shift.
Assuming , we obtain
The same bound applies to after averaging over paired training and test tasks under any coupling of and .
Theoretical Insight: The key observation is that the full task distributions need not be similar. Instead, RLMs can learn higher-level abstractions that decompose different tasks into similar root-level actions, whose execution through programmatic REPL operations and sub-LLM calls remains effective across both distributions.
We characterize this through two conditions.
Condition 1 — Root-level abstraction transfers.
The root controller learns a shared decomposition strategy, producing similar high-level actions even when the underlying tasks and are substantially different.
Condition 2 — The learned abstraction remains reward-effective.
For the root actions selected with high probability, the corresponding executions must achieve high reward on both training and test tasks. This requires that the underlying programmatic operations and sub-LM capabilities remain effective on the unseen context. Importantly, matching root actions is insufficient if their execution fails on the test task.
Generalization guarantee Suppose the root-controller shift and execution shift are bounded by and , respectively. From our previous decomposition,
Let denote the training suboptimality gap of the learned RLM, measuring how far its expected training reward is from the maximum possible reward. Thus
Its test performance therefore satisfies
Key takeaway: RLMs can generalize across globally different task distributions by learning a shared high-level decomposition, provided that the resulting actions compose existing capabilities that remain successful on unseen tasks. This captures the essential distinction: LID generalization requires not only similar decompositions, but also preservation of their reward-generating capabilities.
Main takeaway Unlike conventional RL, where generalization relies on a single neural policy extrapolating from to , an RLM can transfer performance by preserving a learned root-level decomposition and composing it with existing sub-call capabilities. The task can therefore be globally OOD while the individual computations remain locally in-distribution.
One important subtlety is that matching root actions alone is insufficient. We also need their sub-call execution steps (i.e., ) to remain effective on the new tasks. This is precisely why the second term matters, especially for tasks involving semantic subcalls rather than deterministic programs.
The above analysis considers a single root action followed by REPL execution. The extension to multi-step trajectories follows the same principle (with an added persistent REPL state), with the generalization gap bounded by the accumulation of root-controller policy shifts and REPL execution errors across steps, accounting for their dependence on preceding interactions.
Token-level trajectory similarity of harnesses
In §3.3, we argued that certain harness abstractions enable their individual LM calls to see similar trajectories on different tasks that share some structure. We showed that under a token-wise weighted Jaccard similarity metric, the root controller trajectory of context-offloading harnesses was similar, where we could see a trend between trajectory similarity and transferred performance to novel tasks. In this section, we explore other distance metrics.
Let and be the token sequences of a training and evaluation trajectory, with lengths and . Tokens use the analysis code’s lowercased word/code tokenizer, not the model’s BPE tokenizer. Let be the set of distinct consecutive token triples, the count of token , and the token-level Levenshtein distance. The plots in Figure 10 report similarity ; the corresponding distance is .
| Metric | Similarity | What it measures |
| Edit | One minus the minimum number of token insertions, deletions and substitutions, divided by the longer length. Sensitive to order. | |
| Contain | Fraction of evaluation triples also present in training. Asymmetric: extra training text is not penalized. | |
| Jaccard | Shared triples relative to all distinct triples. Symmetric; captures local phrasing but ignores global order and repeated occurrences. | |
| Weighted Jaccard | Overlap in token counts. Repetition and length imbalance matter; token order does not. Uses unigrams in this implementation. | |
| Length | Length-only reference. Equal-length trajectories score 1 even when their contents differ completely. |
Table 20.
Figure 11 extends this comparison to RLM trajectories from different training environments.

Figure 11. Cross-task harness trajectory similarity. For each evaluation environment in the length generalization experiments in Figure 3, we also check how similar RLM trajectories on evaluation tasks are to unrelated tasks. We look at cross-task trajectory similarity: we plot the mean maximum similarity of trajectories in each long evaluation setting, to its closest training trajectory in each training environment, even those unrelated to the target evaluation task. Across all tasks, there is a higher similarity for harness trajectories transferring from a shorter variant to the longer variant of the same environment versus shorter variants of different tasks.
Trajectory comparisons and examples
We show six pairs of root trajectories, listed in the table below. Each pair contains one evaluation trajectory from the checkpoint used in Figure 5 and one training trajectory from the same run. The training trajectory is one of the nearest neighbors of the evaluation trajectory under weighted Jaccard similarity, among all training trajectories collected up to that checkpoint. The examples illustrate the behaviors discussed in the main text. They are not a random sample.
Reading the examples. Each example starts on a new page with the two tasks, their rewards, and a short description of what we observe. The two trajectories follow, with training on the left and evaluation on the right. Turns that match are placed side by side, and a blank cell means the other trajectory has no matching turn. The background color separates the text the model writes, the code or tool calls it issues, and the output it gets back. Lines that send a request to a sub-call or sub-agent are marked in amber.
What is not shown. We show only the root trajectory. The initial prompt, the long context, and the content of the sub-calls are left out. Long blocks are shortened, and each omission states how many lines were removed. Similarities are computed on the full trajectories, before any shortening.
| Ex. | Harness | Environment (train eval) | Train | Eval | Similarity |
| 1 | RLM | GraphWalks (256K–1M) | 1.00 | 1.00 | 0.63 |
| 2 | RLM | OOLONG (787 6,374 questions) | 1.00 | 1.00 | 0.60 |
| 3 | Pi | GraphWalks (256K–1M) | 1.00 | 1.00 | 0.71 |
| 4 | Pi | OOLONG-Pairs (188 787 questions) | 0.03 | 0.004 | 0.67 |
| 5 | Pi | OOLONG (787 6,374 questions) | 1.00 | 0.00 | 0.92 |
| 6 | RLM | OBLIQ (Twitter WildChat) | 0.91 | 0.77 | 0.71 |
Table 1 (PDF p. 54).
model text; code or tool call; sub-call request; returned output
Example 1. RLM on GraphWalks: a programmatic task solved directly
TRAIN F1 1.00
Context. Edge list, 110,213 characters.
Task. Find the parents of node 25b2822c2f.
Gold. 2 parent nodes.
Trajectory. 3 root turns, 0 sub-calls.
EVAL F1 1.00
Context. Edge list, 437,413 characters.
Task. Find the parents of node a96b65a721.
Gold. 10 parent nodes.
Trajectory. 3 root turns, 0 sub-calls.
Similarity. Weighted Jaccard 0.63, the nearest of 8,448 training trajectories in this run (checkpoint at step 131).
What we observe. The task is programmatic, so the root solves it directly by printing the start and end of the context, extracting the answer with one line of string processing, and submitting this answer. Neither trajectory makes a sub-call. The evaluation context is 4x longer, the root program is length-invariant, so the root strategy generalizes without needing to compose with sub-call capabilities.
TRAIN · turn 1
Understood. I will begin by inspecting the ‘context‘ to
understand its structure. Since ‘context‘ is a string of
110,284 characters containing a directed graph in edge
[... 4 lines omitted ...]
few lines of ‘context‘ to inspect the format.
print(context[:500])
print("\n... (truncated)\n")
print(context[-500:])
This will help me confirm:
1. The format of the edge list (one ‘A -> B‘ per line).
2. The presence and format of the ‘Operation:‘ line.
[... 2 lines omitted ...]
Let’s begin.
You will be given a graph as a list of directed edges. All
→ nodes are at least degree 1. You will also get a
→ description of an operation to perform on the graph.
[... 19 lines omitted ...]
Final Answer: []EVAL · turn 1
Understood. I will begin by inspecting the ‘context‘ to
understand its structure, particularly the edge list and
the operation specification.
[... 5 lines omitted ...]
last 500 characters of ‘context‘ to examine the structure.
print(context[:500])
print("\n... (middle omitted) ...\n")
print(context[-500:])
You will be given a graph as a list of directed edges. All
→ nodes are at least degree 1. You will also get a
→ description of an operation to perform on the graph.
[... 19 lines omitted ...]
Final Answer: []TRAIN · turn 2
The ‘context‘ has been successfully inspected. Here’s what
we know:
- The graph is provided as a list of directed edges (one
[... 28 lines omitted ...]
destination ‘25b2822c2f‘. Le …
# Split context into lines
lines = context.splitlines()
# Filter lines where the edge ends with ‘25b2822c2f’
parents = [
line.split(" -> ")[0]
for line in lines
if " -> " in line
and line.split(" -> ")[1].strip() == "25b2822c2f"
]
# Print a sample to verify
print(
f"Found {len(parents)} parent nodes. First 5:
{parents[:5]}"
)
This will give us the list of nodes that point to
‘25b2822c2f‘. We’ll then submit them as the final answer.
Proceeding.
Found 2 parent nodes. First 5: ['959a55f7f5f', '45f31d16b1']EVAL · turn 2
The context has been successfully inspected. From the
output:
- The graph is given as a list of directed edges, one per
[... 31 lines omitted ...]
Let’s do that now.
import re
# Find all lines where a96b65a721 is the target
(right-hand side)
pattern = r'(.*?) -> a96b65a721'
matches = re.findall(pattern, context)
print(
f"Found {len(matches)} edges pointing to a96b65a721."
)
print("Sample matches:", matches[:10]) # Show first 10Found 10 edges pointing to a96b65a721.
Sample matches: ['fa7cddaf1a', 'eefc9e10eb', '0d0871f080',
'd94e18a8ad', '17e23e50be', 'd1e94f46e6',
'77369e37b2', 'c61fbef63d', 'e37b08dd30', 'b2004314aa']TRAIN · turn 3
We successfully extracted the parents of node ‘25b2822c2f‘
by filtering the edge list for lines where the destination
is ‘25b2822c2f‘. The result is:
[... 5 lines omitted ...]
list of node IDs.
answer["content"] = parents
answer["ready"] = True[no output]EVAL · turn 3
The regex search successfully found 10 edges where
‘a96b65a721‘ is the target node. The source nodes (i.e.,
the parents) are correctly extracted.
[... 5 lines omitted ...]
We can now submit the result as a Python list.
answer["content"] = answer
answer["ready"] = True
print("Final answer submitted:", answer["content"])Final answer submitted: ['fa7cddaf1a', 'eefc9e10eb',
'0d0871f080', 'd94e18a8ad', '17e23e50be', 'd1e94f46e6',
'77369e37b2', 'c61fbef63d', 'e37b08dd30', 'b2004314aa']Example 2. RLM on OOLONG: the same root program, with more sub-calls
TRAIN Score 1.00
Context. 787 questions, 78,138 characters.
Task. Is label ‘location’ more or less common than ‘human being’?
Gold. less common than.
Trajectory. 8 root turns, 41 sub-calls
EVAL Score 1.00
Context. 6,374 questions, 618,252 characters.
Task. Is label ‘human being’ more or less common than ‘entity’?
Gold. more common than.
Trajectory. 7 root turns, 321 sub-calls
Similarity. Weighted Jaccard 0.60, the second-nearest of 6,528 training trajectories in this run (checkpoint at step 101). The nearest (0.60) runs the same program with batches of 30 and one failed cell.
What we observe. The root LLM writes the same LM program in both trajectories: split the context into questions, send them to sub-calls in batches of 20 for labeling, count the returned labels, and compare. The 8x longer evaluation context changes how many sub-calls run (41 vs. 321), but the overall program strategy is the same. The actual work each sub-call performs is also unique and different, but it relies on the existing capability for the LLM to solve these sub-tasks without additional training.
TRAIN · turn 1
Plan:
1. First, inspect the ‘context‘ to understand its
structure. Since it’s a string with thousands of lines,
[... 21 lines omitted ...]
its format. Turn 1: Probe the context to understand its structure.
print(context[:500]) # First 500 chars for inspection
The following lines contain 787 general-knowledge
questions, one per line. Each question has an answer that
can be described as one of 6 categories: ’location’,
[... 6 lines omitted ...]
Date: Apr 18, 2022
TRAIN · turn 2
The context has been revealed: it’s a dataset of 787 general-knowledge questions, each with an associated label among six categories. However, the actual data (the
lines. sample 1 …
lines = context.strip().split('\n')
# Find where the actual data starts -- skip metadata lines
# We know the first few lines are header. Let’s search for
# the first occurrence of a line starting with a digit or
# `User ID`
# Or look for expected structure: e.g., "123456789\tWhat
# is the capital of France?"
start_idx = 0
for i, line in enumerate(lines):
if len(line.strip()) > 0 and (
line.strip()
.split('\t')[0]
.replace(',', '')
.isdigit()
or line.startswith('User ID')
):
start_idx = (
i + 1
)
[... 9 lines omitted ...]
if line.strip()
]
# Print the first 5 data lines
data_lines[:5]
[no output]
TRAIN · turn 3
The output shows ‘data_lines‘ contains the actual dataset lines, but we haven’t printed them yet. Now I’ll print the first few to inspect the format. Turn 3: Print the first 5 lines of ‘data_lines‘ to see if labels are included.
print(data_lines[:5])
["The following lines contain 787 general-knowledge
questions, one per line. Each question has an answer that
can be described as one of 6 categories: ’location’,
[... 10 lines omitted ...]
for chicken pox ?"]
EVAL · turn 1
Plan:
1. First, inspect the ‘context‘ to understand its
structure. Since it contains thousands of
[... 20 lines omitted ...]
Turn 1: Probe the context to understand its structure.
print(
context[:500]
) # Show first 500 characters to inspect format
The following lines contain 6374 general-knowledge
questions, one per line. Each question has an answer that
can be described as one of 6 categories: ’numeric value’,
[... 6 lines omitted ...]
Date: May 21, 20
EVAL · turn 2
The context starts with a header, then contains 6374 lines of data, each with a User ID and a question. The header says "The following lines contain 6374 general-knowledge questions, one per line. Each question
[...] 11 lines omitted ...
sample 10 lines to verify parsing.
# Split context by lines
lines = context.strip().split('\n')
# Find the first line that is not part of the header -- it
# should start with a user ID
# Assume we end when we see a line that looks like:
# "user123456: What is the capital of France?"
# So we can skip lines until we find one that has a colon
data_lines = []
for line in lines:
if ':' in line and len(line.split(':')) >= 2:
data_lines.append(line)
# Sample 10 lines
print(data_lines[:10])
["The following lines contain 6374 general-knowledge
questions, one per line. Each question has an answer that
can be described as one of 6 categories: ’numeric value’,
[... 17 lines omitted ...]
|| Instance: Who won the first World Series ?"]
TRAIN · turn 4
The data lines are in the format:
‘Date: ... || User: ... || Instance: <question>‘
But no label is present in the text -- only the metadata).
questions = []
for line in data_lines:
if ’Instance:’ in line:
# Split by ’Instance:’ and take the rest
q = line.split(’Instance:’, 1)[1].strip()
questions.append(q)
else:
# Fallback: try to extract anything after the last ’||’
parts = line.split(’||’)
if len(parts) >= 2:
q = parts[-1].strip()
questions.append(q)
print(f"Extracted {len(questions)} questions.")
print(f"Sample: {questions[:3]}")
Extracted 787 questions.
Sample: [’What does NAFTA stand for ?’, ’What does A&W of root beer fame stand for ?’, ’What is the name of the vaccine for chicken pox ?’]
EVAL · turn 3
The data lines are not properly parsed -- the header is still present, and the format is inconsistent. The lines contain metadata like "Date: ...", "User: ...", "Instance: ..."
import re
questions = []
for line in data_lines:
# Match the part after "Instance: "
match = re.search(r’Instance:\s*(.+)’, line)
if match:
questions.append(match.group(1).strip())
# Sample first 10 questions
print(questions[:10])
[’What is the difference between fatalism and determinism ?’, ’How many years did Shea & Gould practice law in Los Angeles ?’, ’What is the quantity of American soldiers [... 6 lines omitted ...] wrote a book called Cruel Shoes ?’]
TRAIN · turn 5
We have extracted 787 questions. Now, we will batch-process them into chunks of 20 (to fit within the ‘llm_query_batched‘ concurrency limit), and classify each [... 10 lines omitted ...]
Turn 5: Create a sample prompt and run on first batch.
from itertools import zip_longest
def grouper(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return zip_longest(*args, fillvalue=fillvalue)
# Create batched prompts
batch_size = 20
batches = list(grouper(questions, batch_size))
# Generate a prompt for one batch
prompt_template = """
Classify the answer of each of these questions into one of:
- ’location’
- ’human being’
- ’entity’
- ’abbreviation’
- ’numeric value’
- ’description and abstract concept’
Output a JSON list of labels, one per question, in the [... 20 lines omitted ...]
print(f"Batch size: {len(first_batch)}\n")
# Run the batched LLM call
results = llm_query_batched([prompt])
print("First result:\n", results[0])
Prompt preview:
Classify the answer of each of these questions into one of:
’location’
[... 39 lines omitted ...]
EVAL · turn 4
Now that I have the questions, I need to classify each one into one of the six categories: ’numeric value’, ’entity’, ’location’, ’description and abstract concept’, [... 4 lines omitted ...]
Turn 5: Create a sample prompt and run on first batch.
def make_classification_prompt(questions):
prompt = """Classify each of the following questions
into one of these categories:
- ’numeric value’: if the answer is a number (e.g., "How
many people live in Tokyo?").
- ’entity’: if the answer is a concrete thing (e.g., "What
is the name of the largest river?").
- ’location’: if the answer is a place (e.g., "Where is
the Eiffel Tower?").
- ’description and abstract concept’: if the answer is a
definition or abstract idea (e.g., "What is democracy?").
- ’abbreviation’: if the answer is an acronym (e.g., "What
does NASA stand for?").
- ’human being’: if the answer is a person (e.g., "Who
wrote Hamlet?").
Return the label for each question in JSON format:
[{"question": "...", "label": "..."}]
"""
return prompt
prompt = make_classification_prompt(sample_questions)
# Use llm_query to get classification
classification_result = llm_query(prompt)
print(classification_result)
[
{
"question": "What is the difference between fatalism
[... 21 lines omitted ...]
}
]
TRAIN · turn 6
The LLM is returning a list of labels in JSON format (well-formed), and the output matches the expected structure.
[... 26 lines omitted ...]
# Build list of prompts for all batches
prompts = []
for batch in batches:
# Skip nulls from padding
questions_in_batch = [
q for q in batch if q is not None
]
questions_str = "\n".join(
f"Question: {q}" for q in questions_in_batch
)
prompt = prompt_template.format(
questions=questions_str
)
prompts.append(prompt)
# Now run all at once
print(
f"Preparing {len(prompts)} prompts for batched LLM
call..."
)
# Run batched LLM call
results = llm_query_batched(prompts)
print(f"Received {len(results)} results.")
print(f"Sample result:\n{results[0][:200]}...")
Preparing 40 prompts for batched LLM call.
EVAL · turn 5
The classification works correctly on the sample. Now I’ll write a function to batch process the full list of questions.
[... 8 lines omitted ...]
Turn 5: Prepare batches and process them.
from typing import List, Dict
def make_batch_prompts(
questions: List[str], batch_size: int = 20
) -> List[str]:
prompts = []
for i in range(0, len(questions), batch_size):
batch = questions[i:i + batch_size]
prompt = make_classification_prompt(batch)
prompts.append(prompt)
return prompts
# Split all questions into batches
batch_prompts = make_batch_prompts(questions)
# Run batch classification
print(
f"Processing {len(batch_prompts)} batches of up to 20
questions each."
)
classification_results = llm_query_batched(batch_prompts)
[... 12 lines omitted ...]
# Count labels
from collections import Counter
label_counts = Counter(all_labels)
print(f"Label counts: {dict(label_counts)}")
Processing 319 batches of up to 20 questions each.
First prompt preview: Classify the answer of each of these questions into one of: [… 24 lines omitted …] "numeric value…
Label counts: {'description and abstract concept': 1428, 'numeric value': 1001, 'location': 990, 'abbreviation': 939, 'human being': 1442, 'entity': 568, 'country': 6}
TRAIN · turn 7
We have received 40 results, each a JSON list of labels. Now we need to:
Parse each result (as JSON) into a list of strings. [… 2 lines omitted …] Turn 7: Parse results and count labels.
import json
label_counts = {'location': 0, 'human being': 0}
for i, result in enumerate(results):
try:
labels = json.loads(result)
for label in labels:
if label in label_counts:
label_counts[label] += 1
except Exception as e:
print(f"Error parsing result {i}: {result[:100]}")
# Fallback: try to treat result as raw string if JSON
# fails
# But better to not break, just log
print("Label counts:", label_counts)
EVAL · turn 6
I notice a problem: the label ‘’country’‘ appeared in the results, but it’s not one of the six categories. The categories are: ’numeric value’, ’entity’, ’location’, [… 27 lines omitted …] ’entity’ or ’human being’ to verify.
Find a few examples of ’entity’ and ’human being’ from
the full list
We need to re-parse the full classification results to
get the mapping
But we lost the original question-to-label mapping.
Let’s re-run a small batch with full context.
Instead, let’s re-run classification on a small sample
with the original questions and labels
We’ll do a fresh small batch to verify.
Take 10 questions that were classified as ’entity’ or
’human being’ from the full list
But we don’t have the mapping. So let’s re-run
classification on a fresh sample with explicit instruction.
Rebuild a small test batch with known examples
test_questions = [
"Who wrote ’Pride and Prejudice’?",
"What is the name of the largest river in the world?",
"Who was the first president of the United States?",
[… 7 lines omitted …]
]
prompt = make_classification_prompt(test_questions)
result = llm_query(prompt)
print(result)
Label counts: {'location': 108, 'human being': 143}
[
{"question": "Who wrote ’Pride and Prejudice’?",
"label": "human being"},
[… 18 lines omitted …]
]
TRAIN · turn 8
We now have:
‘location‘: 108
‘human being‘: 143 [… 11 lines omitted …] Turn 8: Set answer.
answer["content"] = (
"Answer: location is less common than human being"
)
answer["ready"] = True
[no output]
EVAL · turn 7
The test confirms the classification logic is sound:
"Who wrote..." -> ’human being’
"What is the name of..." -> ’entity’ [… 12 lines omitted …] Turn 7: Finalize answer.
# Correct the label counts
label_counts['location'] += label_counts.pop('country', 0)
# Final comparison
human_being_count = label_counts['human being']
entity_count = label_counts['entity']
if human_being_count > entity_count:
answer["content"] = (
"Answer: human being is more common than entity"
)
elif human_being_count < entity_count:
answer["content"] = (
"Answer: human being is less common than entity"
)
else:
answer["content"] = (
"Answer: human being is same frequency as entity"
)
answer["ready"] = True
print(answer["content"])
Answer: human being is more common than entity
Example 3. Pi on GraphWalks: a programmatic task solved with shell commands
TRAIN F1 1.00 EVAL F1 1.00
Context. context.txt, 4,392 lines, 110,363 bytes. Context. context.txt, 69,912 lines, 1,748,363 bytes.
Task. Return the nodes at exactly depth 4 in a BFS from node 898aef0932. Task. Return the nodes at exactly depth 4 in a BFS from node e57c68e8f2.
Gold. 1 node (a385d7d1e5). Gold. 1 node (a0604c9d9e).
Trajectory. 9 turns, 9 tool calls, 0 sub-agent calls Trajectory. 9 turns, 9 tool calls, 0 sub-agent calls
Similarity. Weighted Jaccard 0.71, the nearest of 9,600 training trajectories in this run (checkpoint at step 150).
What we observe. Even without programmatic sub-agent calling capabilities, harnesses like Pi can also exhibit generalization. Pi solves the programmatic task directly without sub-agents, here with shell commands: find the operation line, then run one grep per breadth-first search hop. The sequence of commands is the same on a 16x longer file. Only the node IDs and line numbers differ. The whole-file read in turn 3 is cut off by the tool and is not needed for the answer.
TRAIN · turn 1
$ wc -l context.txt
4392 context.txt
$ wc -c context.txt
110363 context.txt
EVAL · turn 1
$ wc -l context.txt
69912 context.txt
$ wc -c context.txt
1748363 context.txt
TRAIN · turn 2
$ grep -n ’Operation:’ context.txt
15:Operation:
20:Operation:
25:Operation:
30:Operation:
4386:Operation:
EVAL · turn 2
$ grep -n ’Operation:’ context.txt
15:Operation:
20:Operation:
25:Operation:
30:Operation:
69906:Operation:
TRAIN · turn 3
read(path="context.txt", offset=1, limit=4385)
You will be given a graph as a list of directed edges. All
→nodes are at least degree 1. You will also get a
→description of an operation to perform on the graph.
[… 232 lines omitted …]
→continue.]
EVAL · turn 3
read(path="context.txt", offset=1, limit=69905)
You will be given a graph as a list of directed edges. All
→nodes are at least degree 1. You will also get a
→description of an operation to perform on the graph.
[… 232 lines omitted …]
→continue.]
TRAIN · turn 4
read(path="context.txt", offset=4386, limit=10)
Operation:
Perform a BFS from node 898aef0932 and return only the
→nodes at exactly depth 4 (not nodes at intermediate
[… 10 lines omitted …]
Final Answer: []
EVAL · turn 4
read(path="context.txt", offset=69906, limit=10)
Operation:
Perform a BFS from node e57c68e8f2 and return only the
→nodes at exactly depth 4 (not nodes at intermediate
[… 10 lines omitted …]
Final Answer: []
TRAIN · turn 5
$ grep -n ’898aef0932 ->’ context.txt
3719:898aef0932 -> 537de305e9
EVAL · turn 5
$ grep -n ’e57c68e8f2 ->’ context.txt
66594:e57c68e8f2 -> 66fab71491
TRAIN · turn 6
$ grep -n ’537de305e9 ->’ context.txt
1896:537de305e9 -> 2675be118
EVAL · turn 6
$ grep -n ’66fab71491 ->’ context.txt
62319:66fab71491 -> b03f7cc8
TRAIN · turn 7
$ grep -n ’2675be118 ->’ context.txt
1731:2675be118 -> deb54ff41
EVAL · turn 7
$ grep -n ’be03f76cc8 ->’ context.txt
25789:be03f76cc8 -> fc48e06c4f
TRAIN · turn 8
$ grep -n ’deb54ff41 ->’ context.txt
2010:deb54ff41 -> a385d7d1e5
EVAL · turn 8
$ grep -n ’fc48e06c4f ->’ context.txt
33241:fc48e06c4f -> a0604c9d9e
TRAIN · turn 9
The BFS from node ’898aef0932’ with depth 4 proceeds as
follows:
- Depth 1: ’537de305e9’ (from ’898aef0932 -> 537de305e9’)
[… 4 lines omitted …]
final answer: ["a385d7d1e5"]
EVAL · turn 9
The BFS from node ’e57c68e8f2’ with depth 4 proceeds as
follows:
- Depth 1: ’66fab71491’ (directly from ’e57c68e8f2’)
[… 4 lines omitted …]
final answer: ["a0604c9d9e"]
Example 4. Pi on OOLONG-Pairs: failure in training and in evaluation
TRAIN F1 0.03
Context. context.txt, 188 questions.
Gold. 75 pairs (4 predicted).
Trajectory. 6 turns, 6 tool calls, 1 sub-agent call
EVAL F1 0.004
Context. context.txt, 787 questions.
Gold. 980 pairs (2 predicted).
Trajectory. 5 turns, 5 tool calls, 1 sub-agent call
Task (both). List all pairs of users where one has at least one ‘abbreviation’ and exactly one ‘human being’ question, and the other has at least one ‘entity’ and at least one ‘numeric value’ question.
Similarity. Weighted Jaccard 0.67, the nearest of 9,600 training trajectories in this run (checkpoint at step 150).
What we observe. When harness behavior between two tasks is similar, and the harness fails on the training task, it naturally also fails on the evaluation task. In this example, Pi reads the file into its own context, asks a single reader sub-agent to label every question, receives a partial list (67 of 188 labels in training, 103 of 787 in evaluation), and computes a few pairs from it. The evaluation trajectory is close to a training trajectory that itself scored 0.03: there is no successful behavior to reuse.
TRAIN · turn 1
wc -c context.txt 19142 context.txt
EVAL · turn 1
wc -c context.txt 76803 context.txt
TRAIN · turn 2
The file has 196 lines and 19,142 bytes, which is small enough to read entirely without overflow. I’ll read the entire file to analyze the data.
read(path="context.txt")
The following lines contain 188 general-knowledge questions, one per line. Each question has an answer that can be described as one of 6 categories: ’numeric value’, [… 133 lines omitted …] →Calculate the exact answer given these datapoints.
EVAL · turn 2
The file has 795 lines and 76,803 bytes, which is small enough to read entirely without overflow. I’ll read the entire file to analyze the data.
read(path="context.txt")
The following lines contain 787 general-knowledge questions, one per line. Each question has an answer that can be described as one of 6 categories: ’location’, [… 135 lines omitted …] →to continue.]
TRAIN · turn 3
The file contains 188 lines of data, each with a user ID and an instance (question). I need to analyze the data to find pairs of user IDs that meet the following criteria:
[… 10 lines omitted …]
labels for each instance.
subagent(agent="reader", task="Parse the 188 lines of data in context.txt to extract user IDs and infer the label for each instance based on the question’s semantics. Return a list of tuples (user_id, label) for all instances.")
The 188 lines in context.txt contain questions with answers categorized as one of: ’numeric value’, ’description and abstract concept’, ’human being’, [… 71 lines omitted …]
EVAL · turn 3
The file contains 795 lines of data, each with a user ID, date, and an instance (question). I need to analyze the data to find pairs of user IDs that meet specific criteria.
[… 6 lines omitted …]
labels for each instance.
subagent(agent="reader", task="Parse the context.txt file to extract user IDs and infer labels for each question based on the question’s semantics. Return a list of tuples (user_id, label) for all instances.")
The file contains 796 lines of data, each with a user ID and a question. Based on the question categories, the labels can be inferred as follows:
[… 73 lines omitted …] ’location’, 64700, ’numeric value’]
TRAIN · turn 4
Now I have the labels for each instance. I’ll analyze the data to find users who meet the criteria:
One user has at least one instance with label
[… 6 lines omitted …]
"abbreviation" and exactly one "human being".
$ python3 -c "from collections import Counter; data = [(98779, ’location’), (85017, ’location’), (13574, ’description and abstract concept’), (82638, ’human [… 41 lines omitted …] print(sorted(valid_users))" [58392]
EVAL · turn 4
Now that I have the list of user IDs and their associated labels, I need to find pairs of user IDs that meet the following criteria:
duplicate pairs and listing the smaller ID first.
[… 12 lines omitted …]
$ python3 -c "from collections import Counter; data = [(44436, ’abbreviation’), (31080, ’abbreviation’), (52632, ’numeric value’), (8940, ’human being’), (33449, [… 65 lines omitted …] sorted(pairs))" (16359, 42371) (42371, 54220)
TRAIN · turn 5
User 58392 has at least one instance with label "abbreviation" and exactly one instance with label "human being". Now I’ll find users who have at least one instance with label "entity" and at least one instance with label "numeric value".
$ python3 -c "from collections import Counter; data = [(98779, ’location’), (85017, ’location’), (13574, ’description and abstract concept’), (82638, ’human [… 36 lines omitted …] numeric_value_users; print(sorted(valid_users))" [14630, 58392, 64261, 90816, 94706]
EVAL · turn 5
I have identified the pairs of user IDs that meet the specified criteria. The pairs are:
(16359, 42371): User 16359 has at least one [… 10 lines omitted …] (42371, 54220)
TRAIN · turn 6
Now I have the users who meet the second criterion: users with at least one "entity" and at least one "numeric value" label. These are users 14630, 58392, 64261, 90816, [… 30 lines omitted …] (58392, 94706)
Example 5. Pi on OOLONG: a copied training trajectory that does not generalize
| TRAIN | Score 1.00 | EVAL | Score 0.00 |
| Context. context.txt, 795 lines, 76,803 bytes. | Context. context.txt, 6,382 lines, 618,252 bytes. | ||
| Gold. more common than. | Gold. less common than. | ||
| Trajectory. 5 turns, 4 tool calls, 2 sub-agent calls | Trajectory. 5 turns, 4 tool calls, 2 sub-agent calls |
Task (both). Is label ‘numeric value’ more or less common than ‘description and abstract concept’?
Similarity. Weighted Jaccard 0.92, the nearest of 6,592 training trajectories in this run (checkpoint at step 102).
What we observe. Task similarity can hurt performance on an evaluation task when behavior from a similar training task transfers, if their decomposition structure differs. In this example, Pi sends the same two requests to a sub-agent and gets back the same two counts (12 and 1), although the evaluation file is 8x longer. It then gives the same answer, which was correct in training and is wrong in evaluation. The issue here is that the sub-calls are not correct in the longer example, so similarity of the root trajectory alone does not establish reliable local execution.
| TRAIN · turn 1 | EVAL · turn 1 |
$ wc -l context.txt | $ wc -l context.txt | |
795 context.txt | 6382 context.txt |
| TRAIN · turn 2 | EVAL · turn 2 |
$ wc -c context.txt | $ wc -c context.txt | |
76803 context.txt | 618252 context.txt |
| TRAIN · turn 3 | EVAL · turn 3 |
subagent(agent="reader", task="Count the number of lines where the label is ’numeric value’ using a shell command") | subagent(agent="reader", task="Count the number of lines where the label is ’numeric value’ using a shell command") |
| The number of lines where the label is ’numeric value’ is 12. | The number of lines where the label is ’numeric value’ is 12. |
| TRAIN · turn 4 | EVAL · turn 4 |
subagent(agent="reader", task="Count the number of lines where the label is ’description and abstract concept’ using a shell command") | subagent(agent="reader", task="Count the number of lines where the label is ’description and abstract concept’ using a shell command") |
| The label ’description and abstract concept’ appears on 1 line in the file. | The label ’description and abstract concept’ appears on 1 line in the file. |
| TRAIN · turn 5 | EVAL · turn 5 |
| Answer: numeric value is more common than description and abstract concept | Answer: numeric value is more common than description and abstract concept |
Example 6. RLM on OBLIQ: the same strategy on a different domain
TRAIN nDCG@50 0.91 EVAL nDCG@50 0.77
Context. 300 tweets, 77,145 characters. Context. 300 Human-AI conversations, 572,017 characters.
Task. Rank tweets that implicitly accuse a Gulf monarchy of duplicitous hedging. Task. Rank conversations where the AI asserts a role-played identity as its real one.
Gold. 3 relevant tweets. Gold. 10 relevant conversations.
Trajectory. 5 root turns, 301 sub-calls Trajectory. 6 root turns, 300 sub-calls
Similarity. Weighted Jaccard 0.71, the nearest of 9,664 training trajectories in this run (checkpoint at step 150).
What we observe. A unique property of context offloading and programmatic sub-agent calling (e.g., the RLM) is that the root model can apply the same strategy, and completely abstract away domain-specific details about the task. For tasks that share similar structure but completely different token descriptions and context, these harnesses can generalize by composing sub-calls that solve independent tasks, while the root program remains the same. In this example, the root program is the same: extract the document IDs, ask one sub-call per document for a 1-10 relevance score, sort, and return the ranking.
TRAIN · turn 1
Plan:
Inspect the structure of ‘context‘ to confirm it is a list of strings formatted as ’--- doc_id: <id> --- <text>’. [... 16 lines omitted ...] validate parsing.
# Confirm context is list of strings, and extract format
# of first document
first_doc = context[0]
print(
first_doc[:500]
) # Show first 500 characters to confirm formatdoc_id: 2034241135288455418
[... 3 lines omitted ...] #israelstrikes #IranWar #EsmailKhatibkilled signs). Convert the nat
EVAL · turn 1
Plan:
Inspect ‘context‘ to understand its structure and confirm the format: each element is a string of the form ‘--- doc_id: <id> --- <text>’. [... 14 lines omitted ...]
print(f"Number of candidate documents: {len(context)}")
print(
f"First few characters of first document:
{context[0][:100]}"
)Number of candidate documents: 300 First few characters of first document: --- doc_id: 175268 [... 2 lines omitted ...] signs). Convert the nat
TRAIN · turn 2
Plan:
Confirm that ‘context‘ is a list of strings in the expected format, with each string containing a ‘doc_id: [... 9 lines omitted ...] Turn 2/20: Extract all doc_ids from ‘context‘ using regex.
import re
def extract_doc_id(doc_str):
match = re.search(r'doc_id:\s*(\S+)', doc_str)
return match.group(1) if match else None
doc_ids = [extract_doc_id(doc) for doc in context]
print(
f"Total documents: {len(context)}, extracted
{len(doc_ids)} IDs"
)
print(f"First few doc_ids: {doc_ids[:5]}")Total documents: 300, extracted 300 IDs First few doc_ids: ['2034241135288455418', '2034282581148283191', '20408696098036687445', '2034279520937648613', '2034244537552421279']
EVAL · turn 2
Plan:
Extract ‘doc_id‘s from each document using regex.
Define a concise, focused prompt for ‘llm_query‘ to [... 6 lines omitted ...]
Turn 2: Extract all doc_ids from ‘context‘.
import re
def extract_doc_id(doc_str: str) -> str:
match = re.search(r'doc_id:\s*(\S+)', doc_str)
if not match:
raise ValueError(
f"Could not extract doc_id from:
{doc_str[:100]}"
)
return match.group(1)
doc_ids = [extract_doc_id(doc) for doc in context]
print(f"Extracted {len(doc_ids)} doc_ids: {doc_ids[:5]}")Extracted 300 doc_ids: ['175268', '173329', '170560', '125984', '219295']
TRAIN · turn 3
Plan:
Define a prompt for ‘llm_query‘ that asks for a relevance score (1-10) for a document chunk, based on [... 10 lines omitted ...]
Turn 3: Define the relevance scoring prompt.
# Define the prompt to score relevance
relevance_prompt_template = """
Assess the relevance of this tweet to the following query,
scoring from 1 to 10 (10 = most relevant, 1 = irrelevant):
Query: Find tweets where users are implicitly accusing a
Gulf monarchy of duplicitous hedging—quietly enabling an
ally’s military action against a nearby rival (e.g., by
hosting foreign forces) and then issuing soft, carefully
worded rebukes to appease that rival and avoid reprisals.
The tweet is:
{text}
Return only a number from 1 to 10, nothing else. Do not
include any explanation or adornment.
Score: """EVAL · turn 3
Plan:
Define a prompt for ‘llm_query‘ that asks for a relevance score (1-10) based on the query. [... 4 lines omitted ...]
Turn 3: Define the scoring prompt.
scoring_prompt_template = """
You are an expert evaluator of AI conversation
transcripts. Your task is to score the relevance of a
given conversation transcript to the following query:
Query:
Find conversations where the AI, after being asked to
role-play, asserts the role as its real
identity—explicitly denying being software or a
chatbot—and continues to interact as a real-life
individual instead of clarifying it’s only pretending.
Score the transcript on a scale of 1 to 10, where:
- 10: The transcript clearly exhibits the described
behaviour: the AI is asked to role-play, then explicitly
denies being software or a chatbot, and continues to act
as a real person, never clarifying it’s pretending.
- 7–9: Strong evidence of the behaviour, but with minor[... 3 lines omitted ...] text=test_doc ) test_score = llm_query(test_prompt) print(f"Test score: {test_score}") Test score: 1
TRAIN · turn 4
Plan:
Batch documents into chunks of 12 for efficient scoring using ‘llm_query_batched‘. [... 7 lines omitted ...] full scoring. Turn 4: Score the first batch of documents.
from tqdm import tqdm # for progress bar
# Build list of (doc_id, text) pairs
doc_pairs = [
(doc_id, doc) for doc_id, doc in zip(doc_ids, context)
]
# Create list of prompts for batched scoring
prompts = []
for doc_id, text in doc_pairs:
prompt = relevance_prompt_template.format(text=text)
prompts.append(prompt)
# Score in batches of 12
batch_size = 12
scores = {}
print("Scoring documents...")
for i in tqdm(range(0, len(prompts), batch_size)):
batch_prompts = prompts[i : i + batch_size]
batch_results = llm_query_batched(batch_prompts)
[... 7 lines omitted ...]
print(
f"Completed scoring. Total scores collected: {len(scores)}"
)
Scoring documents... Completed scoring. Total scores collected: 300 [progress bar omitted]
[... 13 lines omitted ...] Score:
print("Scoring prompt template defined.")
Scoring prompt template defined.
EVAL · turn 4
Plan:
Use ‘llm_query_batched‘ to score a small batch of documents (10-12). [... 7 lines omitted ...] Turn 4: Score the first batch of documents.
from tqdm import tqdm # for progress bar
# Dictionary to store doc_id -> score
relevance_scores = {}
# Helper function to score a single document
def score_document(doc_id: str, transcript: str) -> float:
prompt = scoring_prompt_template.format(
transcript=transcript
)
return float(llm_query(prompt))
# Score first batch
batch_size = 12
batch = context[:batch_size]
batch_ids = doc_ids[:batch_size]
print(f"Scoring first batch of {len(batch)} documents...")
scores = llm_query_batched(
[
scoring_prompt_template.format(transcript=doc)
for doc in batch
]
)
[... 2 lines omitted ...]
# Store results
for doc_id, score in zip(batch_ids, scores):
relevance_scores[doc_id] = float(score)
print(f"Scores for first batch: {relevance_scores}")
Scoring first batch of 12 documents... Scores for first batch: {'175268': 0.0, '173329': 0.0, '170560': 0.0, '125984': 0.0, '219295': 1.0, '54655': 0.0, '221056': 0.0, '176089': 1.0, '249731': 1.0, '85486': 1.0, '23747': 0.0, '28713': 0.0}
EVAL · turn 5
Plan:
Continue scoring remaining documents in batches.
Use ‘tqdm‘ to track progress.
Store scores in ‘relevance_scores‘. Turn 5: Score remaining documents in batches.
# Score remaining documents in batches
for i in tqdm(range(batch_size, len(context), batch_size)):
batch = context[i : i + batch_size]
batch_ids = doc_ids[i : i + batch_size]
prompts = [
scoring_prompt_template.format(transcript=doc)
for doc in batch
]
scores = llm_query_batched(prompts)
for doc_id, score in zip(batch_ids, scores):
relevance_scores[doc_id] = float(score)
print(
f"Scoring complete. Scored {len(relevance_scores)} documents."
)
Scoring complete. Scored 300 documents. [progress bar omitted]
TRAIN · turn 5
Plan:
Sort the ‘scores‘ dictionary by value (relevance score) in descending order. [... 4 lines omitted ...] Turn 5/20: Sort the scores and prepare the final answer.
# Sort by score descending
sorted_doc_ids = sorted(
scores.keys(), key=lambda x: scores[x], reverse=True
)
# Verify first few
print(f"Top 5 doc_ids: {sorted_doc_ids[:5]}")
print(
f"Scores: {[scores[doc_id] for doc_id in
sorted_doc_ids[:5]]}"
)
# Submit final answer
answer["content"] = sorted_doc_ids
answer["ready"] = True
print("Ranking complete.")
Top 5 doc_ids: ['2034306590703342078', '2034316847462433189', '2034303535540641247', '203425853954433442', '203428703150852555'] Scores: [9.0, 8.0, 8.0, 7.0, 7.0] Ranking complete.
EVAL · turn 6
Plan:
Sort the documents by relevance score in descending order. [... 4 lines omitted ...] final answer.
# Sort by score descending
sorted_doc_ids = sorted(
relevance_scores.keys(),
key=lambda x: relevance_scores[x],
reverse=True,
)
# Set answer
answer["content"] = sorted_doc_ids
answer["ready"] = True
print(
f"Final ranking of {len(sorted_doc_ids)} documents created."
)
print(f"Top 5 doc_ids: {sorted_doc_ids[:5]}")
Final ranking of 300 documents created. Top 5 doc_ids: ['9366', '83989', '85835', '171005', '202516']
Verifying local sub-task execution
In harnesses that use a root controller, like the ones we study in § 3, the learned decompositions that invoke sub-calls rely on sub-call correctness to be locally in-distribution. In Table 19, we verify for the RLM (which invokes the most sub-calls) that the sub-tasks its sub-calls are solving are reliably correct.
We verify whether there is a discrepancy between the sub-calls on the shorter train tasks and the longer evaluation tasks, using the rollouts from the length and strategy generalization experiments (Figure 3, Figure 4). Many of these sub-call prompts were programmatically generated by the REPL used.
Not all benchmarks contain oracle sub-call ground truth labels (e.g. LongBench-Pro), and the RLM rarely invokes sub-calls on some benchmarks (e.g. MRCRv2). Table 19 reports delegated-subtask scores for the base model and best checkpoint on the training and evaluation splits. Label-accuracy rows score by correct scored labels divided by all scored labels pooled over the split. GraphWalks exact match is the number of exact adjacency parses divided by scored parse calls. Balanced accuracy is computed from pooled candidate-verdict counts as . For OBLIQ-Bench, is ROC AUC over all numeric document scores pooled across trajectories, with relevant documents as positives and ties contributing 0.5.
References
- [1]Cem Anil, Yuhui Wu, Anders Johan Andreassen, Aitor Lewkowycz, Vedant Misra, Vinay Venkatesh Ramaswesh, Ambrose Slone, Guy Gur-Ari, Ethan Dyer, and Behnam Neyshabur. Exploring length generalization in large language models. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=zSkYVeX7bC4.arxiv.org/abs/2207.04901
- [2]Anthropic. Claude Code. https://www.anthropic.com/product/claude-code, 2025. Accessed: 2026-06-30.
- [3]Anthropic. Introducing Claude Opus 5.5. Anthropic Blog, September 2026a. URL https://www.anthropic.com/claude-opus-5-5. Accessed: 2026-10-27.
- [4]Anthropic. Introducing dynamic workflows in Claude Code, 2026b. URL https://claude.com/blog/introducing-dynamic-workflows-in-claude-code. Accessed: June 2026.
- [5]Amanda Bertsch, Adithya Pratapa, Teruko Mitamura, Graham Neubig, and Matthew R. Gormley. Oolong: Evaluating long context reasoning and aggregation capabilities, 2025. URL https://arxiv.org/abs/2511.02817.
- [6]William Brown. Verifiers: Environments for LLM reinforcement learning. https://github.com/PrimeIntellect-ai/verifiers, 2025.
- [7]Stephanie C.Y. Chan, Adam Santoro, Andrew Kyle Lampinen, Jane X Wang, Aaditya K Singh, Pierre Harvey Richemond, James McClelland, and Felix Hill. Data distributional properties drive emergent in-context learning in transformers. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=lHj-q9BSRjF.arxiv.org/abs/2205.05055
- [8]Anwoy Chatterjee, H S V N S Kowndinya Renduchintala, Sumit Bhatia, and Tanmoy Chakraborty. POSIX: A prompt sensitivity index for large language models. In Yaser Al-Onaizan, Mohit Bansal, and Yun-Nung Chen (eds.), Findings of the Association for Computational Lin-guistics: EMNLP 2024, pp. 14550–14565, Miami, Florida, USA, November 2024. Associa- tion for Computational Linguistics. doi: 10.18653/v1/2024.findings-emnlp.852. URL https://aclanthology.org/2024.findings-emnlp.852/.DOI
- [9]Guanzheng Chen, Michael Qizhe Shieh, and Lidong Bing. LongRIVR: Long-context reinforcement learning requires verifiable context rewards. In The Fourteenth International Conference on Learning Representations, 2026a. URL https://openreview.net/forum?id=omVhYvyTPJ.arxiv.org/abs/2603.02146
- [10]Zijian Chen, Xueguang Ma, Shengyao Zhuang, Ping Nie, Kai Zou, Andrew Liu, Joshua Green, Kshama Patel, Ruoxi Meng, Mingyi Su, Sahel Sharifymoghaddam, Yanxi Li, Haoran Hong, Xinyu Shi, Xuye Liu, Nandan Thakur, Crystina Zhang, Luyu Gao, Wenhu Chen, and Jimmy Lin. BrowseComp-Plus: A more fair and transparent evaluation benchmark of deep-research agent, 2025. URL https://arxiv.org/abs/2508.06600.
- [11]Ziyang Chen, Xing Wu, Junlong Jia, Chaochen Gao, Qi Fu, Debing Zhang, and Songlin Hu. Long-Bench Pro: A more realistic and comprehensive bilingual long-context evaluation benchmark, 2026b. URL https://arxiv.org/abs/2601.02872.
- [12]Jeffrey Dean and Sanjay Ghemawat. MapReduce: simplified data processing on large clusters. Commun. ACM, 51(1):107–113, January 2008. ISSN 0001-0782. doi: 10.1145/1327452.1327492. URL https://doi.org/10.1145/1327452.1327492.
- [14]Nouha Dziri, Ximing Lu, Melanie Sclar, Xiang Lorraine Li, Liwei Jiang, Bill Yuchen Lin, Sean Welleck, Peter West, Chandra Bhagavatula, Ronan Le Bras, Jena D. Hwang, Soumya Sanyal, Xiang Ren, Allyson Ettinger, Zaid Harchaoui, and Yejin Choi. Faith and fate: Limits of transformers on compositionality. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=Fkckkr3ya8.arxiv.org/abs/2305.18654
- [15]Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. A mathematical framework for transformer circuits. Transformer Circuits Thread, 2021. https://transformer-circuits.pub/2021/framework/index.html.
- [16]Eric Elmoznino, Tejas Kasetty, Blaise Agüera y Arcas, Yoshua Bengio, and Guillaume Lajoie. Defining and generating compositional structure, 2026. URL https://arxiv.org/abs/2610.20922.
- [17]Apurva Gandhi, Satyaki Chakraborty, Xiangjun Wang, Aviral Kumar, and Graham Neubig. Recursive agent optimization, 2026. URL https://arxiv.org/abs/2605.06639.
- [18]Ziyuan He, Yuxuan Wang, Jiaqi Li, Kexin Liang, and Muhan Zhang. LooGLE v2: Are LLMs ready for real world long dependency challenges? In The Thirty-ninth Annual Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2025. URL https://openreview.net/forum?id=8ObELfOfB.arxiv.org/abs/2510.22548
- [19]Kelly Hong, Anton Troynikov, and Jeff Huber. Context rot: How increasing input tokens impacts LLM performance. Technical report, Chroma, July 2025. URL https://trychroma.com/research/context-rot.
- [20]Wenqi Huang, Charley Lee, Leonard Tng, and Serena Ge. DeepSWE: Measuring frontier coding agents on original, long-horizon engineering tasks, 2026. URL https://arxiv.org/abs/2607.07946.
- [21]Daniel Jaroslawicz, Brendan Whiting, Parth Shah, and Karime Maamari. How many instructions can LLMs follow at once?, 2025. URL https://arxiv.org/abs/2507.11538.
- [22]Bowen Jiang, Zhuoqun Hao, Young Min Cho, Bryan Li, Yuan Yuan, Sihao Chen, Lyle Ungar, Camillo Jose Taylor, and Dan Roth. Know me, respond to me: Benchmarking LLMs for dynamic user profiling and personalized responses at scale. In Second Conference on Language Modeling, 2025. URL https://openreview.net/forum?id=6ox8XZGoQP.arxiv.org/abs/2504.14225
- [23]Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. SWE-bench: Can language models resolve real-world GitHub issues?, 2024. URL https://arxiv.org/abs/2310.06770.
- [24]Marzena Karpinska, Katherine Thai, Kyle Lo, Tanya Goyal, and Mohit Iyer. One thousand and one pairs: A ”novel” challenge for long-context language models, 2024. URL https://arxiv.org/abs/2406.16264.
- [25]Seth Karten, Alex L. Zhang, Kevin Thomas, Sebastian Müller, Elie Bakouch, Daniel Auras, Mika Senghaas, Fares Obeid, Konstantin Dunas, Johannes Hagemann, and Sami Jaghouar. Prime Agent: A self-improving RLM harness, 2026. URL https://arxiv.org/abs/2608.23552.
- [26]Daniel Keysers, Nathanael Schärli, Nathan Scales, Hylke Buisman, Daniel Furrer, Sergii Kashubin, Nikola Momchev, Danila Sinopelnikov, Lukasz Stafiniak, Tibor Tihon, Dmitry Tsarkov, Xiao Wang, Marc van Zee, and Olivier Bousquet. Measuring compositional generalization: A comprehensive method on realistic data. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=SygcScNNKwR.arxiv.org/abs/1912.09713
- [27]Apoorv Khandelwal and Ellie Pavlick. How do language models compose functions? In The Fortieth Annual Conference on Neural Information Processing Systems, 2026. URL https://openreview.net/forum?id=iuShT9gVLr.arxiv.org/abs/2510.01685
- [28]Tushar Khot, Harsh Trivedi, Matthew Finlayson, Yao Fu, Kyle Richardson, Peter Clark, and Ashish Sabharwal. Decomposed prompting: A modular approach for solving complex tasks. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=n_GnGQzjARy.arxiv.org/abs/2210.02406
- [29]Najoung Kim and Tal Linzen. COGS: A compositional generalization challenge based on semantic interpretation. In Bonnie Webber, Trevor Cohn, Yulan He, and Yang Liu (eds.), Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 9087–9105, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.731. URL https://aclanthology.org/2020.emnlp-main.731/.DOI
- [30]Yuri Kuratov, Aydar Bulatov, Petr Anokhin, Ivan Rodkin, Dmitry Igorevich Sorokin, Artyom Sorokin, and Mikhail Burtsev. BABILong: Testing the limits of LLMs with long context reasoning-in-a-haystack. In The Thirty-eighth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2024. URL https://openreview.net/forum?id=u7m2CG84BQ.arxiv.org/abs/2406.10149
- [31]Brenden Lake and Marco Baroni. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2873–2882. PMLR, 10–15 Jul 2018. URL https://proceedings.mlr.press/v80/lake18a.html.arxiv.org/abs/1711.00350
- [32]Brenden M. Lake and Marco Baroni. Human-like systematic generalization through a meta-learning neural network. Nature, 623(7985):115–121, November 2023. doi: 10.1038/s41586-023-06668-3. URL https://ideas.repec.org/a/nat/nature/v623y2023i7985d10.1038_s41586-023-06668-3.html.DOI
- [33]Soochan Lee and Gunhee Kim. Recursion of thought: A divide-and-conquer approach to multi-context reasoning with language models. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki (eds.), Findings of the Association for Computational Linguistics: ACL 2023, pp. 623–658, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.findings-acl.40. URL https://aclanthology.org/2023.findings-acl.40/.DOI