Token-level Proximal Policy Optimization for Query Generation

Yichen Ouyang, Lu Wang, Fangkai Yang, Pu Zhao, Cheng Huang, Jianfeng Liu, Bochen Pang, Yaming Yang, Yuefeng Zhan, Hao Sun, Qingwei Lin, Saravan Rajmohan, Weiwei Deng, Dongmei Zhang, Feng Sun2025

Abstract: Yichen Ouyang, Lu Wang, Fangkai Yang, Pu Zhao, Chenghua Huang, Jianfeng Liu, Bochen Pang, Yaming Yang, Yuefeng Zhan, Hao Sun, Qingwei Lin, Saravan Rajmohan, Weiwei Deng, Dongmei Zhang, Feng Sun. Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing.

2025.

Introduction

Personalized search query generation relies on Large Language Models (LLMs) to predict user intent based on historical data. While Reinforcement Learning from AI Feedback (RLAIF) is a standard fine-tuning approach, it typically relies on sentence-level rewards. In this paradigm, a reward model provides a single score for an entire generated sequence. This leads to two primary challenges: the "credit assignment" problem, where the model cannot discern which specific words contributed to a high or low score, and training instability caused by high variance in the advantage signal. To address these, researchers have developed Token-level Proximal Policy Optimization (TPPO).

Methodology

TPPO shifts the feedback mechanism from the sentence level to the token (word-piece) level, providing granular rewards for every step of the generation process. This alignment more closely mirrors how LLMs actually produce text—one token at a time.

Comparison between standard sentence-level PPO and the proposed token-level TPPO approach.

The TPPO Framework

The framework is implemented in three distinct stages:

  1. Token-level Reward Labeling: A high-capacity "teacher" model (such as LLaMA 3-70B) analyzes generated queries and labels individual words as relevant, irrelevant, or zero-reward. These word-level labels are subsequently mapped to the model's specific tokens.
  2. Hybrid Reward Model: A Longformer-based reward model is trained to predict these token-level scores. It utilizes a hybrid loss function combining local loss (per-token label accuracy) and global loss (ensuring the aggregate token rewards align with overall sentence quality).
  3. Length-weighted Penalty (LWP): To prevent "reward hacking"—where the model generates excessively long queries to accumulate more points—a logistic-based penalty devalues tokens produced beyond an expected length.
The two-phase process for collecting word-level rewards and converting them into token-level rewards for the reward model.

Experimental Evaluation

The researchers evaluated TPPO using two major datasets:

  • AOL Dataset: A public search log dataset containing 27,000 data points.
  • Industrial Dataset: A large-scale dataset from Bing containing 200,000 samples, including complex user signals like clicks and site visits.

Validation of the AI-generated feedback showed a 91.18% agreement rate between LLaMA 3’s token-level labels and human judgments, confirming that automated feedback can reliably substitute for expensive human annotation.

Key Results and Insights

TPPO demonstrated superior performance over both Supervised Fine-Tuning (SFT) and standard sentence-level PPO across several metrics:

  • Relevance and Win Rates: TPPO achieved a 2% to 4% increase in query relevance and win rates that were 2% to 8% higher than traditional PPO methods.
  • Training Stability: By providing dense rewards, TPPO significantly reduced the variance of the advantage function. Training curves indicated faster convergence and more consistent performance improvements compared to the erratic nature of sparse reward systems.
  • Industrial Impact: The model has been successfully integrated into a production search engine environment, proving its efficacy in real-world, high-scale applications.

Conclusion

By solving the credit assignment problem through granular feedback, TPPO offers a more stable and effective path for fine-tuning LLMs in specialized tasks like query generation. While currently optimized for search, future work will explore the generalizability of token-level rewards to other domains such as long-form summarization and multi-turn dialogue.

Summary updated

BibTeX
@misc{ouyang2025token,
  author = {Yichen Ouyang and Lu Wang and Fangkai Yang and Pu Zhao and Cheng Huang and Jianfeng Liu and Bochen Pang and Yaming Yang and Yuefeng Zhan and Hao Sun and Qingwei Lin and Saravan Rajmohan and Weiwei Deng and Dongmei Zhang and Feng Sun},
  title = {{Token-level Proximal Policy Optimization for Query Generation}},
  year = {2025},
  doi = {10.18653/v1/2025.emnlp-main.1589},
}
Figure