TL;DR
The paper introduces ARTIST (Agentic Reasoning and Tool Integration in Self-improving Transformers), a framework that uses outcome-based reinforcement learning to teach LLMs how to autonomously integrate external tools into their reasoning chains. By utilizing Group Relative Policy Optimization (GRPO) and a novel loss-masking strategy, ARTIST eliminates the need for expensive step-by-step human supervision, allowing models to achieve up to a 22% absolute performance boost and outperforming frontier models like GPT-4o on complex math and multi-turn function-calling benchmarks.
What Problem Does This Paper Address?
While Large Language Models (LLMs) excel at text generation, they are fundamentally constrained by their static internal knowledge and text-only reasoning. When faced with tasks requiring precise computation (e.g., high-level mathematics) or real-time interaction (e.g., navigating an operating system or calling APIs), vanilla LLMs frequently hallucinate or fail.
Current approaches to tool integration typically rely on hand-crafted prompts or Supervised Fine-Tuning (SFT) on curated trajectories. However, these methods are brittle: they struggle to scale, fail to generalize to unseen tools, and rarely recover gracefully when a tool returns an error. The authors address this gap by asking: Can an LLM autonomously learn when, how, and which tools to invoke using purely outcome-based rewards?
Methods
ARTIST unifies agentic reasoning, tool integration, and reinforcement learning into a single framework. The core idea is to interleave text-based thinking (<think>), tool queries (<tool_name>), and tool outputs (<output>) directly within the model's generation rollout.
Key components of the methodology include:
- Group Relative Policy Optimization (GRPO): Instead of using a traditional actor-critic setup which requires a separate, costly value function model, ARTIST uses GRPO. It samples a group of outputs for a single prompt and optimizes the policy based on the relative advantage of rewards within that group.
- Loss Masking for Tool Outputs: A major technical challenge in training tool-augmented RL models is preventing the model from trying to gradient-optimize the deterministic outputs returned by the environment (e.g., the text output of a Python print statement). ARTIST solves this by masking out tool-delivered tokens during loss computation, forcing the gradient updates to focus entirely on the model's internal reasoning and tool-use strategies.
- Composite Reward Design: Since the model only receives a reward at the end of a rollout, the authors design a composite reward function. For math, it factors in final answer correctness, strict adherence to tag formatting, and the fraction of successful tool executions. For function calling, it tracks state variable matching and the correct sequencing of function calls.
Datasets
The authors evaluated ARTIST across two primary domains:
- Complex Mathematical Reasoning:
- Training: A curated set of 20,000 math word problems from NuminaMath.
- Evaluation: MATH-500, AIME, AMC, and Olympiad Bench.
- Multi-Turn Function Calling:
- Training: A subset of 100 annotated tasks from the multi-turn category of BFCL v3 (Berkeley Function-Calling Leaderboard).
- Evaluation: BFCL v3 subcategories (Missing Parameters, Missing Function, Long Context) and $\tau$-bench (simulated user-agent dialogues in Airline and Retail domains).
Key Insights and Ideas
- Emergent Agentic Behaviors: Without any step-level supervision, the RL training naturally incentivized advanced agentic traits:
- Self-Correction: In math tasks, if a Python code block threw a variable scope error, the model recognized the failure in its next
<think>block and rewrote the code to define all variables in a single block. In vehicle control tasks, if the engine failed to start because the brake wasn't pressed, the model dynamically pivoted to press the brake first. - Self-Refinement: The model incrementally adjusted its strategies (e.g., trying higher candidate values in a loop) based on intermediate tool feedback.
- Context-Sensitive Tool Economy: Interestingly, on easier datasets (like MATH-500), ARTIST actually reduced its tool usage compared to prompt-based baselines. The model learned to selectively avoid unnecessary tool calls when internal reasoning sufficed, conserving its generation budget for harder problems.
- The Power of Loss Masking: Forcing the model to only learn from tokens it generated—rather than the environment's responses—proved essential for stable policy optimization in interactive environments.
Key Results
ARTIST was benchmarked using 7B and 14B Qwen2.5-Instruct base models, demonstrating substantial improvements over both vanilla bases and prompt-engineered tool baselines:
- Math Benchmarks: On the highly challenging AMC dataset, Qwen2.5-14B-Instruct + ARTIST achieved a 0.550 Pass@1 accuracy, representing a 22% absolute improvement over the base model (0.330) and outperforming GPT-4o (0.430). It achieved similar state-of-the-art boosts on AIME and Olympiad Bench.
- Function Calling Benchmarks: On $\tau$-bench (Airline), ARTIST more than doubled the performance of the base model, jumping from 12% to 26% accuracy, outperforming much larger models like Llama-3-70B (14.8%).
- Reasoning Depth: Metric analysis showed that ARTIST generated 33% more reasoning tokens per tool call compared to prompt-based baselines, indicating a significantly deeper planning phase before executing actions.
Limitations and Future Work
While ARTIST marks a significant step forward for self-improving agents, the authors note a few areas for future development:
- Domain Scaling: The current implementation focuses heavily on Python execution and structured API calling. Extending ARTIST to more open-ended, multimodal, or web-navigation environments remains an open challenge.
- Human Preferences: The reward functions used are entirely programmatic (rule-based and compiler-driven). Integrating human preference feedback (RLHF) into the agentic tool-use loop could improve alignment in conversational settings.
- Safety and Reliability: Operating autonomous agents in live environments introduces risks; future work must explore safety guardrails to prevent harmful or runaway tool-use loops.
Summary updated