TL;DR
X-Tree is a novel method that automatically discovers hierarchical, reusable action sequences (skills) from agent trajectories without requiring expensive LLM calls. By tokenizing experience into a deterministic "experience tree" and integrating it into training rewards and contexts, agents achieve significantly higher success rates and better generalization on complex tasks while using the same data budget.
What Problem Does This Paper Address?
Training multi-step agents (like those that navigate the web or solve scientific problems) is notoriously data-inefficient. Most current methods treat a sequence of actions as a "flat" stream, where every individual action token is weighted equally during training. This ignores the natural hierarchy of human behavior—we don't just think in individual clicks; we think in routines like "fill out this form" or "search for a product."
While some recent research uses LLMs to summarize these routines into "skill libraries," these summaries are usually just provided in the prompt (in-context). This means the knowledge never actually enters the model's weights, limiting generalization. Furthermore, using LLMs to generate these abstractions is costly and difficult to control. X-Tree asks: How can we extract the most insight from a finite set of experience without relying on an LLM to explain it to us?
Methods
The authors propose X-Tree, a method to "tokenize" experience inspired by how Byte-Pair Encoding (BPE) tokenizes text.
- Canonicalization: Raw actions are simplified into "typed tokens" (e.g.,
fill(date_from)becomestype<date>). This removes noise and makes recurring patterns visible. - X-Score Mining: Instead of just counting frequency (like BPE), X-Tree uses a new metric called $\mathcal{X}$-Score to decide which actions to merge into a "skill" node. This score balances three factors:
- Recurrence: How often the sequence appears.
- Length: How much the sequence compresses the data.
- Success: How often the sequence appears in successful trajectories.
- Hierarchical Merging: Adjacent actions with high $\mathcal{X}$-Scores are merged into nodes, which can then be merged into even larger nodes, creating a tree of reusable experience.
The authors integrate X-Tree into three training settings:
- Offline RL: Each X-Tree node becomes a training instance. The agent is rewarded for completing the "skill" correctly, with a bonus scaled by the node's depth in the tree.
- Online RLVR: During active exploration, the agent receives an adaptive skill bonus for executing known X-Tree skills. This bonus is strongest when the agent is struggling and fades away as the agent starts succeeding at the main task.
- OPSD (On-Policy Self-Distillation): The X-Tree acts as "privileged context" for a teacher model, which then guides the student model's learning.
Datasets
The method was evaluated across three diverse environments:
- WebArena: A realistic web environment for autonomous agents.
- ScienceWorld: A text-based environment for scientific reasoning and experimentation.
- WebShop: A benchmark for online shopping tasks.
Testing was performed across three model scales (1.5B, 3B, and 7B/14B parameters), primarily using the Qwen2.5-Instruct family.
Key Insights and Ideas
- Hierarchy is in the Data: You don't need a "smarter" model to tell you what the important sub-tasks are. Simple statistical mining of successful trajectories can recover meaningful behavioral hierarchies.
- The "Aha" Moment for Rewards: In Reinforcement Learning, agents often suffer from "sparse rewards" (they only get a signal at the very end). X-Tree provides a "dense" signal by rewarding the completion of sub-skills, which keeps the learning process alive even when the agent hasn't solved the full task yet.
- Depth Matters: The authors found that rewarding deeper nodes (more complex compositions) is more effective than rewarding all nodes equally. This encourages the model to consolidate atomic actions into longer, more useful routines.
- LLM-Parity at Zero Cost: X-Tree-mined skills performed on par with (and sometimes better than) skill libraries written by GPT-4 or GPT-o3, despite requiring zero LLM calls to generate.
Key Results
X-Tree consistently outperformed standard training recipes across all benchmarks:
- WebArena: Achieved a 4.5% absolute increase in success rate (SR) over full-data SFT.
- ScienceWorld: Improved SR by up to 5.8%, showing particularly strong gains on held-out (unseen) tasks.
- WebShop: Improved success by 4.1% and graded scores by 4.6%.
Ablation studies (shown in the table below) confirmed that the specific structure of the X-Tree is vital; replacing it with random spans or a random tree significantly degraded performance.
Limitations and Future Work
- Static Mining: Currently, the X-Tree is mined once from a fixed pool of data. The authors suggest that mining in a loop—where the agent's own new trajectories are used to update the tree—could lead to even better performance.
- Reorganization vs. Synthesis: X-Tree only reorganizes existing experience. It cannot "invent" new skills that weren't already present in the training data.
- Integration Synergy: The paper evaluated the three integrations (Offline, Online, OPSD) separately. Future work could explore combining them into a single, unified training pipeline.
Summary updated