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.
Figures & tables
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.
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.
Environment
Train Tasks
Evaluation Tasks
Length ×
MRCRv2 ( Vodrahalli et al., 2024 )
32K–64K tokens, 2-needle
2M–4M tokens, 8-needle
64 ×
GraphWalks ( OpenAI, 2025b )
≤ 128K tokens
50 samples, 256K–1M tokens
2–8 ×
LongBenchPro ( Chen et al., 2026b )
32K tokens, English
256K tokens, English
8 ×
OOLONG ( Bertsch et al., 2025 )
32K split, trec-coarse
256K split, trec-coarse
8 ×
OOLONG-Pairs ( Zhang et al., 2026a )
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.
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.
Environment
Train Tasks
Evaluation Tasks
OOLONG ( Bertsch et al., 2025 )
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.
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 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.
Benchmark
Evaluation split
Context Length
n
LongReason ( Ling et al., 2025 )
All 128k items
118K
794
OOLONG-Real ( Bertsch et al., 2025 )
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 ( He et al., 2025 )
≥ 500K
675K
206
BrowseComp-Plus ( Chen et al., 2025 )
All queries; full corpus
∼ 456M
830
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.
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
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
[4pt][4pt] + RL (short tasks)
13.1
416.5
35.8%
16.6%
215K / 16K
619K / 50K
[4pt][4pt] + 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
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 C .
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.
Model
RLM Harness
+ recursion hint
+ SFT (recursion synthetic data)
Solve rate (%)
Partial
Full
Partial
Full
Partial
Full
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
[3pt][3pt] 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.
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
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.
Figure 8: 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.
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., 2024 )
QA3, 32K/64K/128K
QA1, 128K
NoCha ( Karpinska et al., 2024 )
–
NoCha evaluation stream (20 examples)
GraphWalks ( OpenAI, 2025b )
128K tokens and shorter
256K–1M tokens
MRCRv2 ( Vodrahalli et al., 2024 )
Two needles, 32K–64K
Eight needles, 2M–4M
Appendix
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
Appendix
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.
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
Appendix
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).
Environment
Real ∣Q∣
Train ∣S∣
J3
H13
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
Appendix
Table 12: Task-description overlap between the clean training export and updated real evaluation splits. ∣S∣ counts distinct descriptions, not trajectories. Larger J3 means more shared wording. H13 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.
p50
p99
Mean
Benchmark
Real
Synth.
Real
Synth.
Real
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 × )
Appendix
Table 13: Seconds per rollout for RLM-27B, real benchmark vs. synthetic environment (lower is bold; the parenthesis is synthetic/real).
p50
p99
Mean
Benchmark
Real
Synth.
Real
Synth.
Real
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 × )
Appendix
Table 14: Seconds per rollout for Qwen3.8-27B , real benchmark vs. synthetic environment (lower is bold; the parenthesis is synthetic/real).
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.
Chains by tasks passed
Per chain
Per RLM call
2nd att.
Setting
0
1
2
3
4
Passed
unlock
handoff
RLM calls
Turns
Sub-calls
(%)
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
Appendix
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.
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
Appendix
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
Appendix
Table 17: Average number of sub-calls per rollout, by benchmark.
Qwen3-30B-A3B
Qwen3.8-27B
Benchmark
Base
+ RL (6 short)
+ RL ( ∼ 20)
+ RL (synth.)
Base
+ RL (6 short)
+ RL (synth.)
RLM-27B
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
Appendix
Table 18: Average root and sub-call input / output tokens in thousands (K = 1,000), rounded to the nearest K.
Figure 10: For each evaluation environment in the length and strategy generalization experiments in Figures 3 , 4 , we plot the mean maximum similarity to a successful training trajectory under each metric. Higher values indicate higher similarity.
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.
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
Appendix
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.
Language-model (LM) harnesses enable LMs to operate effectively over long contexts using additional compute. However, existing long-context evaluations are insufficient for distinguishing modern harnesses, reflected by saturated accuracy across harnesses and largely similar evaluation costs. In this paper, we introduce a benchmark for evaluating both the effectiveness and efficiency of long-context harnesses. Our tasks require diverse retrieval strategies, including lexical search and semantic matching, together with strategic and adaptive reasoning over global and local context. Much of the context is semantically relevant but only a small subset is useful at each step, creating both a challenging search problem and different accuracy--cost tradeoffs across processing strategies. For example, one task requires identifying every person satisfying several conditions using evidence scattered across documents; strategically checking the most selective condition first can narrow the search before verifying the remaining conditions. We evaluate multiple families of frontier language models with four state-of-the-art harnesses. Our benchmarks remain challenging even for strong model--harness combinations: the best reaches 68% macro-average accuracy across four evaluation suites. More importantly, we find that the same underlying model can exhibit markedly different efficiency under different harnesses. Our results establish efficiency as an important axis for long-context evaluation and provide a testbed for developing harnesses that process context strategically rather than exhaustively.
Existing methods enhancing an LLM's long-context reasoning capability often rely on data synthesis and follow-up LLM post-training. However, the data synthesis strategy and the post-training recipes are empirically driven and computationally intensive. In this work, we propose a new framework, dubbed LongCapHarness, to instead harness the underlying capabilities for long-context reasoning. The harnessing process recursively revises and updates capability primitive implementation, capability state and control logic through recursive self-improvement on the development set. With neither data synthesis nor LLM post-training, LongCapHarness is applied to Llama3-8B and transferred to Qwen2.5-3B. LongCapHarness substantially outperforms recent data-synthesis-based baselines on HELMET and RULER benchmarks; its estimated development cost is less than 50% of the estimated training costs of NExtLong and PolicyLong. We hope these results motivate further research into harnessing the latent capabilities of LLMs to solve tasks beyond their explicit training.
The performance of large language model (LLM) systems depends not only on model weights, but also on their harness: the code that determines what information to store, retrieve, and present to the model. Yet harnesses are still designed largely by hand, and existing text optimizers are poorly matched to this setting because they compress feedback too aggressively. We introduce Meta-Harness, an outer-loop system that searches over harness code for LLM applications. It uses an agentic proposer that accesses the source code, scores, and execution traces of all prior candidates through a filesystem. On online text classification, Meta-Harness improves over a state-of-the-art context management system by 7.7 points while using 4x fewer context tokens. On retrieval-augmented math reasoning, a single discovered harness improves accuracy on 200 IMO-level problems by 4.7 points on average across five held-out models. On agentic coding, discovered harnesses surpass the best hand-engineered baselines on TerminalBench-2. Together, these results show that richer access to prior experience can enable automated harness engineering.