Abstract
Reinforcement Learning from Human Feedback (RLHF) is the prevailing approach to ensure Large Language Models (LLMs) align with human values. However, existing RLHF methods require a high computational cost, one main reason being that RLHF assigns both the generation and alignment tasks to the LLM simultaneously. In this paper, we introduce Proxy-RLHF, which decouples the generation and alignment processes of LLMs, achieving alignment with human values at a much lower computational cost. We start with a novel Markov Decision Process (MDP) designed for the alignment process and employ Reinforcement Learning (RL) to train a streamlined proxy model that oversees the token generation of the LLM, without altering the LLM itself. Experiments show that our method achieves a comparable level of alignment with only 1% of the training parameters of other methods.
Introduction
Reinforcement Learning from Human Feedback (RLHF) has become the industry standard for ensuring that Large Language Models (LLMs) are both helpful and safe. Despite its success, standard RLHF implementations (such as PPO) are computationally expensive, often requiring the simultaneous maintenance of four distinct model versions in memory: the policy, reward, value, and reference models. This burden stems from the fact that traditional RLHF forces the LLM to simultaneously manage two distinct tasks: generation (linguistic competence) and alignment (adherence to human values).
We propose that these tasks should be decoupled. By treating the LLM as a frozen generator and introducing a lightweight "supervisor" to filter its output, we can achieve high-quality alignment with a fraction of the resources.
Methodology
The core of our framework is Proxy-RLHF, which reformulates alignment as a token-level supervision task within a novel Markov Decision Process (MDP).
The Proxy Model
Instead of fine-tuning the multi-billion parameter LLM, we train a tiny 2-layer Multi-Layer Perceptron (MLP) with approximately 30 million parameters. This proxy model utilizes the hidden states of the frozen LLM as input to make a binary decision for each generated token: Accept or Reject.
Stable Knowledge-Aware Module (SKAM)
A significant risk in token-level filtering is forcing the LLM into "irrational" states—outputting tokens to which it assigns near-zero probability. To mitigate this, we introduce the Stable Knowledge-Aware Module (SKAM). SKAM employs two primary constraints:
- Ordered Sampling: The LLM generates candidate tokens in descending order of probability. If the proxy rejects the top token, the system moves to the next most likely candidate.
- Action Space Restriction: We define a hyperparameter $p_t$. If the average probability of the remaining vocabulary falls below this threshold, the proxy is forced to "Accept." This ensures the output remains within the LLM's original knowledge scope, preventing the generation of gibberish or repetitive text.
Experimental Setup
We evaluated Proxy-RLHF using the Anthropic HH-RLHF (Helpful and Harmless) dataset, specifically focusing on the helpfulness subset. Our base model was Alpaca-7B (a Llama-7B variant). The proxy was trained on 36,000 prompts and tested on 1,899 prompts.
Key Results
Proxy-RLHF demonstrates staggering efficiency gains over standard RLHF and Direct Preference Optimization (DPO). As shown in the table below, our method requires 400x less GPU memory and only 0.2% of the trainable parameters of standard PPO.
| Method | Trainable Parameters | GPU Memory Required | Win Rate vs. SFT |
|---|---|---|---|
| RLHF (PPO) | 13.35B | 198.87 GB | 61.24% |
| DPO | 6.74B | 100.41 GB | 42.65% |
| Proxy-RLHF (Ours) | 0.03B | 0.5 GB | 63.24% |
Beyond efficiency, Proxy-RLHF achieved a 63.24% win rate against the Supervised Fine-Tuning (SFT) baseline when evaluated by GPT-4, outperforming both PPO and DPO. Furthermore, the model exhibited high data efficiency, reaching near-peak performance with as few as 2,000 training samples.
Conclusion and Future Work
Proxy-RLHF proves that alignment does not require altering the fundamental weights of an LLM. By "piggybacking" on the LLM's internal hidden states, a tiny proxy can effectively steer a giant model toward human preferences. While highly effective for helpfulness in 7B-class models, future work will explore the scalability of this filtering approach to 70B+ models and its robustness in high-stakes safety alignment scenarios.
Summary updated