Learning Reusable Agent Subroutines from Experience

arXiv:2606.02994 · cs.AI, cs.CL · Submitted 2026-06-02 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: I'm Tom.

Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.

Tom: Today's paper: "Learning Reusable Agent Subroutines from Experience".

Jane: The gist The central result is that induced libraries outperform the very agent that generated their traces by tens of percentage points across various subtasks,

Tom: First, who's behind it and why it matters.

Title and authors: Tom: They summarize how they take successful ReAct rollouts and run them through four stages to build this library of primitives. First, they filter for correctness, then extract the per-step thought strings, categorize those thoughts using LLMs, and finally synthesize the top K as these typed primitives.

Jane: So they’ve got this pipeline where one LLM call does the naming and clustering of moves, and another LLM call helps group synonyms into five to ten canonical categories if there are more than ten unique labels >

Lu: The central result they show is that induced libraries outperform the very agent that generated those traces, specifically by showing gains like plus forty-four percentage points on RuleArena NBA and plus thirty percentage points on MUSR team allocation >

Meng: Forty-four points is a lot of difference, so if this holds up under real traffic loads, it’s significant. But what about the setup? They use a single fixed configuration across five different subtasks for these comparisons >

Lalam: They even showed that this single fixed configuration beats zero-shot Chain-of-Thought on every subtask and matches or surpasses expert-authored decompositions in terms of performance >

The paper's summary: Tom: The paper highlights a few key improvements over just having an agent generate its own sequence of steps. First, they moved the primitives into reasoning space rather than environment-grounded action space, which changes how they interact with the agent loop >

Jane: That means these primitives are not fixed workflows you have to follow; instead, the agent composes them freely inside a standard ReAct loop at test time >

Lu: They also emphasize that this induction process is a single pass with no online iteration, no MCTS, and no activation steering signals, which places them in a different regime compared to other approaches >

Meng: That’s good—no complex online iteration means faster discovery. But I wonder about the cost. The paper mentions that the per-instance compute for this reasoning primitive induction is around twenty-four percent cheaper than its closest competitor, AWM, which uses about one hundred seventeen thousand tokens versus one hundred fifty-four thousand tokens >

Lalam: They also show that even when using a smaller model like Gemini Flash Lite, the pattern of the source agent outperforming the induced library still holds true across different model families >

The paper's improvements: Tom: So to wrap up, this paper on "Learning Reusable Agent Subroutines from Experience" shows that we can discover reasoning structure without needing expert authoring. They've created typed callables with natural-language docstrings that are inspectable and editable inside a ReAct loop >

Jane: It suggests that instead of baking these routines into model weights, you get an emergent property of how an agent reasons across different instances of a task family >

Lu: The main implication is that this training-free, single-pass route to discovering reasoning structure has previously required expert authoring and now it can be found automatically >

Meng: For deployment, the paper notes that you should pair this induction with human review of the synthesized library and ongoing validation against external ground truth. You can't just drop these in blind >

Lalam: It’s a way to make the agent’s reasoning vocabulary human-readable and individually auditable, which is valuable for high-stakes domains where you need to know exactly how it arrived at a decision >

Conclusion: Tom: So we've covered "Learning Reusable Agent Subroutines from Experience." Basically, they show that instead of just having an agent solve one problem, you can extract its successful reasoning moves and turn them into reusable tools for a whole family of tasks >

Jane: Right. It's about moving those transient scratchpads out of the agent's memory and making them permanent, typed callables that the agent can just plug in whenever it needs that specific type of reasoning >

Lu: The core idea is Reasoning Primitive Induction, a single-pass method where you mine successful ReAct traces, cluster those moves into a library of pseudo-tools based on their frequency >

Meng: I'm still thinking about the deployment side. This sounds like it creates an external knowledge base for the agent. What's the real friction here compared to just feeding it more context?

Lalam: It’s not just context; these are typed callables with natural-language docstrings that have zero handwritten task logic inside them, which makes them really auditable >

Tom: That’s a big deal for inspection. The results are pretty solid on the numbers. They outscore the agent they were trained on by forty-four percentage points on RuleArena NBA and thirty points on MUSR team allocation >

Jane: Forty-four is a significant gap, Tom. It suggests that this recovered structure is actually more reliable than the source policy itself, which is pretty interesting for how we view agent performance >

Lu: I think it’s because this mechanism does implicit aggregation of representative thoughts from many successful rollouts to write a corpus-level specification for each move >

Meng: Forty-four points is a lot. But what about the cost? If this induction process is more expensive than just running the agent normally, it doesn't help us deploy it at scale >

Tom: Well, they did look at that. They found that per-instance compute for this induction method is around twenty-four percent cheaper than a close competitor, AWM >

Lalam: And they showed that even when using a smaller model like Gemini Flash Lite, the pattern of the source agent outperforming the induced library still holds true across different model families >

Jane: So what does this mean for us as people who are just listening? It means we can discover expert-level reasoning structures without needing someone to manually write all those specific steps first >

Tom: Exactly. This training-free, single-pass route to discovering structure has previously required a lot of manual work from experts, and now it seems like we can automate that discovery process >

Lu: The main implication is that this automated discovery of reasoning structure means we don't need those massive expert decompositions anymore if the agent learns how to build its own better tools >

Meng: For deployment, I still think you have to pair this induction with human review of the synthesized library and ongoing validation against external ground truth. You can't just drop these in blind >

Lalam: It’s a way to make the agent’s reasoning vocabulary human-readable and individually auditable, which is valuable for high-stakes domains where you need to know exactly how it arrived at a decision >

Tom: So to wrap up, this paper on "Learning Reusable Agent Subroutines from Experience" shows we can discover reasoning structure without needing expert authoring. They've created typed callables with natural-language docstrings that are inspectable and editable inside a ReAct loop >

Zhihan Lei, Jiarui Yan, Joshua Momo, William W. Cohen

Carnegie Mellon University

cs.AI, cs.CL

Submitted: 2026-06-02

Updated: 2026-10-14

Comments: v2: major revision; method renamed to ARISE, new experiments, rewritten. 28 pages, 15 figures

Code: https://github.com/lexilei/reasoning-primitives

License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/

Importance score: 86/100

The gist: The gist The central result is that induced libraries outperform the very agent that generated their traces by tens of percentage points across various subtasks, showing that recovered reasoning

Key concepts

Reasoning Primitive Induction
A single-pass method that mines successful agent traces. It clusters recurrent reasoning moves and converts them into a compact library of typed pseudo-tools. This library is not a workflow but a reusable vocabulary of recurring moves an agent uses across different task instances.
Reasoning Primitive
A defined unit, represented as (name, signature, description). It is essentially a typed pseudo-tool with no handwritten logic. The signature constrains how the agent can call it, while the description provides natural language semantics for its specific task.
Induced Library
The synthesized artifact resulting from induction. It is a typed inventory of recurring reasoning moves extracted from traces. This library allows agents to compose these primitives freely inside a standard ReAct loop at test time, acting as an emergent property of how the agent reasons.
Typed Pseudo-tools
The format in which the induced primitives are exposed. These are typed callables registered within a ReAct action space. They contain no task-specific logic but carry a fixed input/output signature and a natural language docstring, making them human-readable and auditable.

Terminology

Summary

The gist The central result is that induced libraries outperform the very agent that generated their traces by tens of percentage points across various subtasks, showing that recovered reasoning structure can be more reliable than the source policy itself.

How it works

Reasoning Primitive Induction is a single-pass method that mines successful ReAct traces, clusters recurrent reasoning moves, and converts the most frequent moves into a compact library of typed pseudo-tools The induced artifact is not a workflow to follow or an executable skill to call but the agent’s reusable reasoning vocabulary—a typed inventory of the recurring moves the agent reaches for when reasoning across instances of a task family These primitives are exposed as typed callable pseudo-tools, and a standard ReAct loop composes these primitives at test time. The pipeline uses two free parameters (K, m), three LLM prompts, and one fixed configuration across all benchmarks.

The Induction Pipeline

Algorithm 1 details the four stages of the induction process First, Filter retains rollouts whose final answer matches the ground-truth label. Second, Extract discards actions and observations to keep only per-step Thought strings, producing a flat corpus I of natural-language reasoning sub-steps. Third, Categorize and merge labels using one LLM call for naming and a second LLM call to cluster synonyms into 5–10 canonical categories if the unique label set exceeds ten. Finally, Top-K synthesis sorts canonical categories by frequency, samples representative thoughts from each category based on support threshold m, and prompts an LLM to emit a primitive name and docstring.

Key Findings and Comparisons

The paper demonstrates that induced libraries outperform the source agent that produced their traces by large margins, such as +44pp on RuleArena NBA (30 → 74) The mechanism is described as implicit aggregation, where synthesis sees representative thoughts from many successful rollouts and writes a corpus-level specification of each recurring move. Furthermore, induced libraries significantly surpass expert-authored decompositions on MUSR team allocation (+17pp) and NatPlan meeting planning (+15pp) The discovery-vs-design gap is not driven by the fixed-pipeline versus ReAct dispatch difference, as induced libraries exceed hand-designed primitives at matched dispatch on every cell.

Primitive Design and Deployment

A reasoning primitive is defined as a tuple p = (n, σ, d) containing a name, a typed input/output signature, and a natural-language description In this paper we instantiate primitives as pseudo-tools: typed callables registered in a ReAct action space whose bodies contain no handwritten task logic. The signature σ is fixed by the task-family prompt, constraining the agent’s calling interface while d carries the task-specific semantics. The resulting primitives are exposed as typed pseudo-tools that can be composed freely inside a ReAct loop.

Cost and Generalization

Reasoning primitive induction’s per-instance compute is ∼24% cheaper than its closest multistep competitor AWM (∼117K vs. ∼154K tokens) The authors rule out a pure “more compute” reading by running a same-model SC@N=20 control, which lands 9 to 24pp below reasoning primitive induction on MUSR murder and object. The results hold when applied to Gemini Flash Lite, indicating the source-exceeding pattern reproduces across different model families.

Limitations and Impact

The paper notes that arithmetic-heavy tasks need an external tool, and a hybrid extension routing arithmetic through a deterministic helper while keeping the docstring’s natural-language interface recovers CoT-level performance on airline The induced primitives are typed callables with natural-language docstrings, making the agent’s reasoning vocabulary human-readable and individually auditable Deployment in high-stakes domains should pair induction with human review of the synthesized library and ongoing validation against external ground truth. The trace source uses only generic search/lookup tools, meaning the recovered structure is an emergent property of how an LLM agent reasons across instances of a task family. All paired-∆ confidence intervals against the source agent are strictly positive on the comparable subtasks. The induced library can outperform zero-shot CoT on every comparable cell and match or surpass expert-authored decompositions. The trace source uses only generic search/lookup tools—no benchmark-specific actions, no expert decomposition—so the recovered structure is not a recapitulation of supervisory signal but an emergent property of how an LLM agent reasons across instances of a task family. Each primitive is a typed pseudo-tool with an LLM-interpreted docstring: inspectable, editable, and composable inside a standard ReAct loop, rather than baked into model weights or activation-level steering vectors. Reasoning primitive induction therefore offers a training-free, single-pass route to discovering reasoning structure that has previously required expert authoring. The trace source uses only generic search/lookup tools—no benchmark-specific actions, no expert decomposition—so the recovered structure is not a recapitulation of supervisory signal but an emergent property of how an LLM agent reasons across instances of a task family. Each primitive is a typed pseudo-tool with an LLM-interpreted docstring: inspectable, editable, and composable inside a standard ReAct loop, rather than baked into model weights or activation-level steering vectors. Reasoning primitive induction therefore offers a training-free, single-pass route to discovering reasoning structure that has previously required expert authoring. The trace source uses only generic search/lookup tools—no benchmark-specific actions, no expert decomposition—so the recovered structure is not a recapitulation of supervisory signal but an emergent property of how an LLM agent reasons across instances of a task family. Each primitive is a typed pseudo-tool with an LLM-interpreted docstring: inspectable, editable, and composable inside a standard ReAct loop, rather than baked into model weights or activation-level steering vectors. Reasoning primitive induction therefore offers a training-free, single-pass route to discovering reasoning structure that has previously required expert authoring. The trace source uses only generic search/lookup tools—no benchmark-specific actions, no expert decomposition—so the recovered structure is not a recapitulation of supervisory signal but an emergent property of how an LLM agent reasons across instances of a task family. Each primitive is a typed pseudo-tool with an LLM-interpreted docstring: inspectable, editable, and composable inside a standard ReAct loop, rather than baked into model weights or activation-level steering vectors. Reasoning primitive induction therefore offers a training-free, single-pass route to discovering reasoning structure that has previously required expert authoring. The trace source uses only generic search/lookup tools—no benchmark-specific actions, no expert decomposition—so the recovered structure is not a recapitulation of supervisory signal but an emergent property of how an LLM agent reasons across instances of a task family. Each primitive is a typed pseudo-tool with an LLM-interpreted docstring: inspectable, editable, and composable inside a standard ReAct loop, rather than baked into model weights or activation-level steering vectors. Reasoning primitive induction therefore offers a training-free, single-pass route to discovering reasoning structure that has previously required expert authoring. The trace source uses only generic search/lookup tools—no benchmark-specific actions, no expert decomposition—so the recovered structure is not a recapitulation of supervisory signal but an emergent property of how an LLM agent reasons across instances of a task family. Each primitive is a typed pseudo-tool with an LLM-interpreted docstring: inspectable, editable, and composable inside a standard ReAct loop, rather than baked into model weights or activation-level steering vectors. Reasoning primitive induction therefore offers a training-free, single-pass route to discovering reasoning structure that has previously required expert authoring. The trace source uses only generic search/lookup tools—no benchmark-specific actions, no expert decomposition—so the recovered structure is not a recapitulation of supervisory signal but an emergent property of how an LLM agent reasons across instances of a task family. Each primitive is a typed pseudo-tool with an LLM-interpreted docstring: inspectable, editable, and composable inside a standard ReAct loop, rather than baked into model weights or activation-level steering vectors. Reasoning primitive induction therefore offers a training-free, single-pass route to discovering reasoning structure that has previously required expert authoring. The trace source uses only generic search/lookup tools—no benchmark-specific actions, no expert decomposition—so the recovered structure is not a recapitulation of supervisory signal but an emergent property of how an LLM agent reasons across instances of a task family. Each primitive is a typed pseudo-tool with an LLM-interpreted docstring: inspectable, editable, and composable inside a standard ReAct loop, rather than baked into model weights or activation-level steering vectors <ref:

Improvements for AI systems

  1. textbf Trace-Based Reasoning Primitive Induction for Outperforming Source Agents in Specific Tasks: The improved system can outperform its source agent by up to +44pp on RuleArena NBA and +30pp on MUSR team allocation, by replacing the source agent's inconsistent, per-instance reconstruction with a stable specification deployed as a typed pseudo-tool.

  2. textbf Discovery of Expert-Level Decompositions Without Expert Authoring: The system can match or surpass expert-authored decompositions by synthesizing moves from successful rollouts into typed stubs, achieving this on tasks where manual decomposition is difficult, such as MUSR team allocation (+17pp) and NatPlan meeting planning (+15pp).

  3. textbf Auditable and Editable Reasoning Vocabulary: The system produces typed callables registered in a ReAct action space whose bodies contain no handwritten task logic, meaning the agent's reasoning vocabulary is human-readable and individually auditable, allowing users to edit a docstring to correct a systematic bias.

Sources

Related papers