Abstract
Reinforcement Learning from AI Feedback (RLAIF) is a powerful technique for aligning Large Language Models (LLMs), yet it often suffers from reward sparsity, particularly in tasks like personalized search query generation. Standard Proximal Policy Optimization (PPO) typically assigns a single reward to an entire sequence, making precise credit assignment difficult. This paper introduces Token-level Proximal Policy Optimization (TPPO), a framework that provides dense feedback for every token. By utilizing a teacher model to generate word-level rewards and mapping them to tokens, TPPO achieves more stable training and significantly higher relevance in generated queries. Evaluations on both open-source and industrial datasets demonstrate that TPPO outperforms standard PPO and supervised fine-tuning across multiple metrics.
Introduction: The Challenge of Sparse Rewards
In modern web search, personalized query generation assists users by suggesting relevant search terms based on their historical behavior. While Large Language Models (LLMs) excel at generating fluent text, fine-tuning them via Reinforcement Learning (RL) to align with specific user intents remains a significant challenge.
The primary bottleneck is reward sparsity. In a traditional PPO setup, the model generates a complete response and receives a single scalar reward at the end. This creates a "credit assignment" problem: if a generated query is mostly accurate but contains a single hallucinated or irrelevant word, the sentence-level score fails to pinpoint the specific error. This lack of granularity leads to unstable training, slow convergence, and sub-optimal alignment.
The TPPO Framework
To address these limitations, the authors propose Token-level Proximal Policy Optimization (TPPO). The framework densifies the reward signal by providing feedback for every individual token, bridging the gap between the token-by-token generation process and the reinforcement signal.
1. Token-Level Reward Labeling
The process begins by using a high-capacity "teacher" model (e.g., LLaMA 3-70B) to evaluate generated queries. Instead of a single score, the teacher labels individual words as relevant (2), irrelevant (1), or neutral/separator (0). To ensure the system is tokenizer-agnostic, these labels are initially assigned at the word level and subsequently mapped to the specific tokens used by the target LLM.
2. Hybrid Reward Model Training
The reward model is trained using a dual-objective loss function:
- Local Loss: A cross-entropy objective that trains the model to predict the category of each token.
- Global Loss: A Mean Squared Error (MSE) objective that ensures the average of the token-level rewards aligns with the overall sentence-level quality score.
3. Token-level PPO Algorithm
The standard PPO algorithm is modified to ingest these per-token rewards. To prevent the model from "reward hacking"—such as generating excessively long strings of relevant words—the authors implement a Length-weighted penalty. This heuristic scales down rewards once a target query length is exceeded, balancing relevance with conciseness.
Experimental Evaluation
The researchers evaluated TPPO against two primary benchmarks:
- AOL Dataset: An open-source collection of ~20 million web queries, filtered to 27k samples where user history is used to predict target queries.
- Industrial Dataset: A large-scale dataset from the Bing search engine (200k samples) containing rich user interaction data, including clicks, visits, and purchases.
Key Results
- Superior Relevance: On the AOL dataset, TPPO achieved a 50.00% relevance rate, significantly higher than standard PPO (47.65%) and Supervised Fine-Tuning (41.25%).
- Win Rates: In head-to-head comparisons judged by LLaMA 3-70B, TPPO consistently outperformed standard PPO with a win rate advantage of 2% to 8%.
- Training Stability: TPPO demonstrated much smoother training curves with lower variance. By providing a "breadcrumb trail" of rewards, the value function more accurately estimates the future impact of specific word choices, leading to faster convergence.
Conclusion and Future Work
TPPO demonstrates that dense, token-level rewards are essential for stable and effective RL alignment in text generation tasks. By matching the reward frequency to the action frequency, the model overcomes the credit assignment problem inherent in traditional PPO.
While the current implementation relies on a computationally expensive teacher model for labeling, future research will focus on improving the efficiency of the labeling pipeline. Additionally, the authors suggest that the benefits of token-level rewards could extend beyond query generation to other complex NLP tasks such as summarization and multi-step reasoning.
Summary updated