Hermes

Learning Contextual Reasoning Unlocks Test-Time Scaling

Xinyu Li1,*,†,‡ Mononito Goswami2,*,† Hao Liu2 Nikos Kanakaris2 Langlin Huang3,‡ Prithwish Jana4,‡ Patrick Blöbaum2 Purak Jain2

1Carnegie Mellon University 2AWS AI Labs 3Washington University in St. Louis 4Georgia Institute of Technology

Carnegie Mellon University Amazon Web Services
Washington University in St. Louis Georgia Institute of Technology

*Correspondence to xinyul2@andrew.cmu.edu and mononito@amazon.com
†Equal contribution  ·  ‡Work done during an internship at AWS

TL;DR

Using test-time compute across many context windows requires deciding how to allocate fresh contexts and what information to carry between them. We call this ability contextual reasoning. Existing harnesses prescribe these decisions; Hermes shifts them to the model. Capable models exploit this flexibility to scale with extra compute, while small open models initially struggle. Hermes-Learn closes the gap, inducing adaptive strategies that vary with the problem and the progress of reasoning. The gains generalize across benchmarks and models, extrapolate beyond the compute seen in training, and transfer to other test-time scaling methods.

Contributions

  1. 1

    Contextual Reasoning

    We study contextual reasoning as a model's capability to organize and sustain reasoning over long horizons: deciding how to allocate fresh contexts and what information to carry between them.

    Section 1
  2. 2

    Hermes

    A simple, configurable family of harnesses built on two mechanisms, delegation and digestion, with a steering hierarchy that progressively shifts control from the harness to the model.

    Section 2
  3. 3

    A Learning Framework to Close the Contextual Reasoning Gap

    Capable models turn extra contexts into accuracy under Hermes; smaller open models struggle despite reasonable mathematical reasoning. Hermes-Learn, SFT followed by curriculum RL, closes this gap.

    Section 3
  4. 4

    Adaptive and Generalizable Contextual Reasoning

    Learned strategies adapt to the problem and the current state of reasoning, generalize across benchmarks and model families, scale beyond the compute seen in training, and transfer to other test-time scaling methods.

    Sections 4–5

Hermes Enables Qwen3-4B with Just an 8K Context Length to Reason Flexibly at Inference Time

The problem · AIME 2026, problem 4

Correct answer

The model works in one 8K-token context. It sees the problem and the short reports that come back. A subagent is the same model in a fresh 8K-token context. It sees only the task it was given.

Hermes-Learn Turns Additional Context from a Liability into a Source of Test-Time Scaling

Qwen3-4B on 238 AIME and HMMT problems: % solved, averaged over 16 attempts per problem

37.1 → 16.2

Before training, extra contexts are a liability: with Hermes the model does worse than in one context. Access to additional contexts alone is not enough.

47.3 vs 41.8

After Hermes-Learn it beats one 56K-token context, the same total budget, by 5.5 points, although none of its contexts is longer than 8K tokens.

1 · Contextual Reasoning

Two Complementary Dimensions of Reasoning

“The capacity of the human mind for formulating and solving complex problems is very small compared with the size of the problems …”

Herbert A. Simon, Models of Man

Test-time scaling spends more compute at inference, increasingly across many separate contexts coordinated by a harness. That brings out two complementary dimensions of reasoning.

Mathematical Reasoning

How to make progress given the information available within a context.

Contextual Reasoning

How separate contexts should be allocated, coordinated and reused as reasoning unfolds: whether a fresh context should explore an alternative solution, verify prior work or continue an existing line of reasoning, and what information to carry into it.

The Best Use of Additional Contexts Changes as Reasoning Unfolds

Existing harnesses fix these decisions in advance: Reasoning Cache compresses and continues, Recursive Agent Optimization delegates subproblems. Yet a hard proof may first need several approaches in parallel, then a check of a promising step, then a clean continuation.

This motivates a flexible harness that exposes multiple ways to use additional contexts and lets the model choose among them based on the current state of the solution.

2 · Hermes

Hermes: A Family of Simple, Flexible Harnesses

Hermes progressively shifts contextual reasoning control from the harness to the model.

Design Desiderata

Simple

Only two generic mechanisms, delegation and digestion, to allocate fresh contexts and carry useful information across them.

Flexible

The mechanisms do not prescribe a fixed form of computation. The model decides how additional contexts are used as reasoning unfolds.

Configurable

Steering sets how much guidance the harness gives for delegation, from prescribing a specific strategy to letting the model choose one itself.

Contextual Reasoning via Delegation and Digestion

Two ways to reason beyond one context window: in parallel, by delegating tasks to fresh contexts, and in sequence, by digesting progress into a fresh context.

parallel

Delegation

The agent writes tasks; each runs on the same model in a fresh context that sees only its task, and returns a short report. Subagents may delegate too, up to depth D.

sequential

Digestion

At the end of a window the agent compresses its progress into a digest; the next window starts from the problem plus the digest, for up to W windows.

    Language model (one context) Problem, answer, digest Steering message Harness
    Press Play or pick a phase. Hover over any box for details.

    Configurable Compute: Breadth, Depth and Length

    The root agent takes T steps per window and may launch up to B subagents at each step but the last. Change B, the depth D or the windows W to see the compute grow; every box is one 8K-token context.

    T steps per window3 (fixed: 2 delegation steps + return)
    B subagents per step
    3
    D delegation depth
    1
    W context windows
    1

    7

    context windows, at most

    56K

    tokens of context, at most

    Steerable Control over Delegation

    The agent must also decide what each fresh context is for. Hermes groups delegation strategies into two categories:

    • Search makes progress. Solve the whole problem again with no set approach (Same), with different named approaches (Different), or split it into subproblems (Split).
    • Verify checks the current answer: directly (Answer), through the steps behind it (Steps), or by finding why candidates disagree (Disagreement).

    Three steering levels set who chooses: at L3 the harness names the strategy, at L2 only the category, and at L1 the model picks from every strategy as reasoning unfolds.

      fixed by the harness chosen by the model not offered

      The Goal: Reasoning Well at L1

      L1 is the most flexible harness: the model makes every contextual reasoning decision. We evaluate under L1 and train for it; the steered levels are stepping stones that double as a curriculum.

      Test-Time Scaling with Hermes Relies on Contextual Reasoning

      Given up to seven 8K-token contexts, capable models gain, but Qwen3-4B, the small open model we train, loses more than half its accuracy: the contextual reasoning gap.

      Hermes Enables Test-Time Scaling for Capable Models

      % of 238 AIME and HMMT problems solved, averaged over 16 attempts per problem. One context: a single 8K-token context, no delegation. With Hermes (L1): up to seven 8K-token contexts, and the model decides how to use them.

      3 · Hermes-Learn

      Hermes-Learn: Learning Contextual Reasoning

      Hermes-Learn teaches delegation, deciding what to send to fresh contexts, in two stages. Digestion is not trained; the model relies on its existing ability to summarize.

      Stage I · Supervised Fine-Tuning

      Learn Useful Delegation Behaviors

      Warm-start on successful trajectories from two strong teachers, Claude Sonnet 5 and DeepSeek-V3.2, working under L1 and L2. The model sees effective delegation under different levels of steering.

      Stage II · Reinforcement Learning

      Develop Autonomous Strategy Selection

      The model is rewarded only for a correct final answer, so it learns for itself which delegation strategies pay off. A curriculum over the Hermes hierarchy gives it progressively more control.

      A Curriculum That Progressively Reduces Harness Steering

      RL trains on a mixture of harnesses that shifts over time, from guided L2 episodes to L1, so the model is increasingly given control over its contextual reasoning decisions.

      The Training Mix Shifts from L2 to L1

      L2: the harness sets each step's category (search or verify). L1: the model decides.

      Data Augmentation for Balanced Strategy Coverage

      Competition problems do not exercise delegation strategies evenly, so RL adds 500 synthetic problems whose structures favor different strategies; the same pipeline builds the 88-problem synthetic benchmark.

      Every problem is reworded so that its text never signposts a strategy. Colored letters mark the intermediate values that decide the answer.

      4 · Main Results

      Experimental Setup and Main Results

      Model

      Qwen3-4B

      Instruct-2507

      Training data

      5,239

      math problems, + 500 synthetic for RL

      Context

      8K

      tokens per agent

      Budget

      ≤ 7

      contexts per run (56K tokens)

      Harness

      L1

      the model decides

      Benchmarks

      5

      AIME + HMMT, Synthetic, BeyondAIME, IMO-Answer, FrontierScience

      Metric

      Avg@16

      % solved, over 16 attempts

      Baselines

      2

      one 56K context · GRPO

      We answer four research questions:

      1. Does Hermes-Learn Improve Contextual Reasoning?
      2. What Contextual Reasoning Behaviors Emerge Through Training?
      3. Which Components of the Training Recipe Drive These Improvements? Section 5
      4. Do These Gains Generalize to New Settings? Section 5

      RQ1Does Hermes-Learn Improve Contextual Reasoning?

      Yes: Hermes-Learn enables test-time scaling with Hermes.

      Extra contexts hurt the untrained model on every benchmark; after SFT and RL they help, beating one 56K-token context on all four math benchmarks (out-of-domain FrontierScience roughly ties), while single-context accuracy barely moves.

      RQ2What Contextual Reasoning Behaviors Emerge Through Training?

      Training makes strategy selection problem- and progress-dependent.

      Split stays common only on problems built for decomposition, and the second delegation step often switches to verification.

      Example Rollouts

      Six real rollouts of the trained model. Each plays on its own; Back and Next step through it.

      root agent subagent (fresh 8K context)
      The model's words are quoted and shortened with “…”. Each subagent's own reasoning, thousands of tokens, is not shown. ✓ and ✗ compare an answer with the correct one.

      5 · Analysis

      Analysis and Discussion

      RQ3Which Components of the Training Recipe Drive These Improvements?

      Teacher diversity, curriculum, and synthetic data shape Hermes-Learn.

      Ablations on the pooled benchmark; single-context accuracy barely changes, the differences are under L1.

      (a) Combining Teachers Yields the Strongest SFT Model

      Both teachers together are best (39.9), mostly from more demonstrations: DeepSeek-V3.2 alone reaches 39.3.

      After SFT only. Pooled AIME + HMMT, mean ± 1 sd over 3 seeds.

      (b) Curriculum Provides the Largest Gains When Paired with Synthetic Problems

      Curriculum plus synthetic problems is best (47.3); all recipes are within about 2 sd.

      After SFT + RL, mean ± 1 sd over 3 seeds. Mix interleaves L1 and L2; Curriculum puts L2 first.

      RQ4Do These Gains Generalize to New Settings?

      Yes: Hermes-Learn generalizes beyond its training setting.

      Trained with one configuration, the model scales to more compute, helps other test-time scaling methods, and the recipe transfers to Olmo-3-7B.

      (a) Hermes-Learn Extrapolates to Larger Inference-Time Compute Budgets

      After RL, every extra budget helps although training used none of them; depth 2 reaches 55.6.

      Pooled AIME + HMMT under L1. Each row changes one setting of the training configuration.

      (b) Hermes-Learn Benefits Test-Time Scaling Methods Beyond Hermes

      With L1, the DeepSeekMath Agent goes from 15.1 to 52.5, and RSA from 50.5 to 55.0.

      Pooled AIME + HMMT.

      (c) Hermes-Learn Transfers to a Different Model Family and Scale

      Olmo-3-7B goes from 4.8 with Hermes to 40.6 after Hermes-Learn.

      Olmo-3-7B-Instruct, pooled AIME + HMMT; no sd reported.

      Citation

      @article{li2026hermes,
        title   = {Hermes: Learning Contextual Reasoning Unlocks Test-Time Scaling},
        author  = {Li, Xinyu and Goswami, Mononito and Liu, Hao and Kanakaris, Nikos and
                   Huang, Langlin and Jana, Prithwish and Bl{\"o}baum, Patrick and Jain, Purak},
        journal = {arXiv preprint arXiv:2609.38332},
        year    = {2026},
        url     = {https://arxiv.org/abs/2609.38332}
      }