QLASS: Boosting Language Agent Inference via Q-Guided Stepwise Search

Zongyu Lin, Yao Tang, Xingcheng Yao, Da Yin, Ziniu Hu, Yizhou Sun, Kai-Wei Chang

Introduction

Large Language Models (LLMs) have demonstrated significant potential as autonomous agents capable of solving interactive tasks in diverse domains, from e-commerce to scientific simulation. However, training these agents effectively remains a challenge. Most current approaches rely on outcome-based rewards, providing a binary success or failure signal only at the conclusion of a task. This leads to a severe "credit assignment" problem: in a multi-step trajectory, identifying which specific action led to failure is difficult. While Process Reward Models (PRMs) offer a solution by scoring individual steps, they typically require extensive and costly human annotation.

To address these limitations, we introduce QLASS (Q-guided Language Agent Stepwise Search). QLASS is a framework designed to automatically generate stepwise supervision by estimating the future value (Q-value) of intermediate actions through exploration trees, enabling agents to navigate complex tasks without human-labeled step-by-step rewards.

Methodology

The QLASS framework operates through a four-stage pipeline designed to transition from basic task understanding to sophisticated, Q-guided decision-making.

The four-stage QLASS pipeline: Behavior Cloning, Self-Generation & Tree Construction, Q-Value Extraction/Training, and Q-guided Generation.
  1. Behavior Cloning: A base LLM (e.g., Llama-2) is fine-tuned on a small set of expert trajectories to establish foundational task knowledge.
  2. Self-Generation & Tree Construction: The agent explores the environment to build an exploration tree. By attempting various actions from the same state, the system identifies paths to success. To optimize computation, "Tree Pruning" is employed; branches leading to zero reward are terminated early.
  3. Q-Value Extraction: Utilizing the Bellman Optimality Equation, rewards are propagated backward from leaf nodes to the root. This process assigns a Q-value to every intermediate state-action pair, representing the expected long-term value of that specific step.
  4. QNet Training & Guided Generation: A specialized model, the QNet, is trained to predict these extracted Q-values. During inference, the agent samples multiple potential actions, and the QNet selects the candidate with the highest predicted Q-value.

Experimental Setup

QLASS was evaluated across three complex agent benchmarks:

  • WebShop: An interactive e-commerce environment requiring multi-step navigation to purchase specific items.
  • ALFWorld: A synthetic household environment for completing embodied tasks (e.g., "put a clean knife on the countertop").
  • SciWorld: A complex science simulator for conducting multi-stage experiments.

Results and Discussion

QLASS demonstrated superior performance compared to both open-source and proprietary models. On the WebShop benchmark, a QLASS-enhanced Llama-2-7B achieved a score of 70.3, significantly outperforming GPT-4 (63.2) and GPT-3.5-Turbo (62.4).

Performance comparison on the WebShop benchmark, showing QLASS outperforming the Best-of-N baseline as completion tokens increase.

Beyond raw scores, QLASS showed remarkable generalization capabilities. On "Unseen" tasks in SciWorld, QLASS scored 66.4, a substantial improvement over the standard Supervised Fine-Tuning (SFT) baseline of 53.0. Furthermore, qualitative analysis revealed that QLASS effectively mitigates "nonsense loops"—common failure modes where agents repeat redundant actions—by recognizing their low future value.

Conclusion

QLASS provides a scalable method for improving language agent performance through automated stepwise guidance. By adapting traditional Reinforcement Learning concepts like the Bellman equation to natural language action spaces, it achieves high data efficiency and state-of-the-art results. Future work will focus on reducing the initial reliance on expert data for bootstrapping and optimizing the QNet for even more granular, token-level guidance.

Summary updated

BibTeX
@inproceedings{lin2025qlass,
  author = {Zongyu Lin and Yao Tang and Xingcheng Yao and Da Yin and Ziniu Hu and Yizhou Sun and Kai-Wei Chang},
  title = {{QLASS: Boosting Language Agent Inference via Q-Guided Stepwise Search}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=f6lio2CZIM},
}
Figure