Expanding the Action Space of LLMs to Reason Beyond Language

Zhongqi Yue, Weishi Wang, Yundaichuan Zhan, Juncheng Li, Daniel Dahlmeier, Fredrik D. Johansson · Submission to ICLR 2026 · Rejected

TL;DR

Current LLM agents interact with tools by outputting special text strings (like JSON or custom XML tags) that external parsers must interpret, tangling natural language reasoning with mechanical control. This paper introduces ExpA (Expanded Action space), which adds native non-vocabulary actions directly to the LLM's classification head, and EARL (ExpA Reinforcement Learning), a training algorithm using counterfactual rollouts to encourage exploring external tools. The framework enables robust, parser-free tool use and contingent planning, outperforming vocabulary-constrained baselines and even discovering an efficient sorting algorithm from scratch.

What Problem Does This Paper Address?

When large language models (LLMs) interact with tools, calculators, or simulators, they are typically confined to predicting tokens from their fixed text vocabulary $\mathcal{V}$. To invoke a tool, an LLM must format its request in a rigid syntax (e.g., <calculator> 12 + 6 </calculator>), which an external parser detects, executes, and pastes back into context.

This standard paradigm introduces several friction points:

  1. Coupled duties: It forces the language head to balance expressive reasoning and rigid syntactic control simultaneously.
  2. Parser brittleness and hallucination: Small syntax errors crash executions, and models often perform intermediate calculations in text before passing erroneous numbers to tools.
  3. Exploration bottleneck in RL: Base models without fine-tuned demonstrations (Zero-RL) rarely stumble into the exact syntactic patterns needed to trigger external environments, making exploration difficult.

Methods

The authors propose internalizing tool actions into the model rather than funneling everything through text:

  • Expanded Action Space (ExpA): The model’s final projection head is expanded from $|\mathcal{V}|$ to $|\mathcal{V} \cup \mathcal{E}|$, where $\mathcal{E}$ contains transition/routing actions $g_i$ (to enter environment $i$) and environment-specific action sets $\mathcal{E}_i$ (e.g., pressing calculator keys or issuing a swap command). Crucially, unlike multimodal token expansion, these actions are never fed back as input embeddings—only their resulting environment observations re-enter the context in $\mathcal{V}$, keeping the design lightweight.
  • Semantic Weight Initialization: New action logits are initialized using the pre-trained weights of their textual descriptions (e.g., the action logit for calling the calculator is initialized to the representation of the word "calculate"), giving the model an immediate intuitive prior.
  • EARL & Counterfactual Policy Optimization (CPO): Because pre-trained models rarely take routing actions spontaneously, EARL constructs counterfactual trajectories during rollout. It identifies plausible intermediate steps (where the model placed high probability on a description like "calculate") and forcibly injects a routing action $g_i$. If the original trajectory achieved zero reward, the model updates based on the counterfactual trajectory's advantage, aggressively teaching it when and how to invoke external environments.
       [Language Reasoning State] (et = 0)
                   │
            Selects at = gi
                   ▼
     [External Environment i] (et = i)
      - Restricts actions to Ei
      - Environment returns observation ot ∈ V
      - Exits back to language when done

Datasets

The authors evaluate EARL across two domains requiring multi-turn interaction and contingent planning:

  1. Calc-Bench (New benchmark): Four arithmetic reasoning datasets using a calculator tool:
  2. Arithmetic: Out-of-distribution operand counts (up to 7) and natural-language paraphrased math problems.
  3. Countdown: Finding an equation matching a target number from 4 given numbers; requires reactive trial-and-error planning over up to 7,680 combinations.
  4. GSM8K*: A rewritten variant of GSM8K with scaled-up numbers to reduce memorization and demand exact computation.
  5. Count: Counting items in symbolic sequences (tests whether tool learning interferes with basic linguistic capability).
  6. Partially Observed Sorting: The agent must sort an array of hidden numbers (Sort-2 through Sort-5) by querying pairwise comparisons and executing swaps, receiving rewards only when the final hidden state is sorted.

Key Insights and Ideas

  • Decoupling reasoning from execution: By separating tool control into dedicated action tokens, the model's text generation focuses purely on planning and interpreting results.
  • Self-directed contingent planning: In the Countdown task, models trained with EARL produced significantly more adaptive planning phrases (e.g., "not close", "far from target", "let's try another combination") rather than brute-forcing random expressions.
  • Algorithm discovery via language + RL: On Sort-4, EARL learned a clean, deterministic decision tree that uses one element as a pivot, performs necessary comparisons, and executes the minimum required swaps—matching the theoretical minimum number of swaps and requiring only ~70 training steps, compared to the millions required by low-level assembly approaches like AlphaDev.

Key Results

  • Calc-Bench Performance: On Qwen-2.5-7B-Instruct, EARL achieved 78.69% overall exact match (EM), significantly outperforming Prompt+GRPO (68.23%), Prompt+CPO (66.72%), SFT+GRPO (62.48%), and zero-shot GPT-4o (39.74%).
  • Contingent Planning (Countdown): On Qwen-2.5-7B, EARL reached 84.25% on Countdown, a +23.5% absolute improvement over Prompt+GRPO (60.70%).
  • Base Models Without Prompts: With ExpA and CPO, base models (without instruction tuning or explicit tool prompts) scored 74.56% on Countdown, whereas prompt-based GRPO collapsed without instruction tuning (51.15%).
  • Sorting Efficiency: On Sort-4, EARL achieved 100% accuracy. Its pruned decision tree variant ($\text{EARL}^*$) required an average of 1.917 swaps (matching the theoretical optimum) and 4.833 comparisons (beating insertion sort at 4.917 and GCC's built-in routine at 5.000).

Limitations and Future Work

  • Model Scale: Evaluations were restricted to the Qwen-2.5 family up to 7B parameters; behavior on frontier-scale models remains untested.
  • Continual Action Expansion: The study initializes action weights from static token embeddings, but optimal strategies for adding actions continually over lifetime learning were not explored.
  • Environment Complexity: Tested environments (calculators, comparative sorting) have relatively small, discrete action sets. Evaluating ExpA in complex, multimodal settings (e.g., robotic control or open-web navigation) remains open for future research.

Summary updated

BibTeX
@inproceedings{yue2025expanding,
  author = {Zhongqi Yue and Weishi Wang and Yundaichuan Zhan and Juncheng Li and Daniel Dahlmeier and Fredrik D. Johansson},
  title = {{Expanding the Action Space of LLMs to Reason Beyond Language}},
  booktitle = {MATH-AI @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=bwgXoqzBJE},
}
Figure