RL2R: RL with Reference-Based Rewards
Note: RL2R was previously released as RefAlign. Repository names on the Hugging Face Hub keep the old naming.
GitHub repository: https://github.com/mzhaoshuai/RL2R/tree/alignment
This is the model aligned with SimPO described in the paper Reinforcement Learning with Reference-Based Rewards for Language Model Reasoning and Alignment.
Abstract: Reinforcement learning (RL) powers two major lines of large language model (LLM) post-training: reasoning, which elicits deliberate, verifiable problem solving, and alignment, which steers models toward helpful, harmless, and honest behavior. Both hinge on reward design. Reasoning relies on rule-based verification of final answers, whose binary feedback is blind to intermediate derivations, whereas process reward models (PRMs) require step-level annotations too costly to scale. Alignment depends on reward models (RMs) trained on binary preference pairs, making both data collection and model training resource-intensive. We propose RL2R (formerly RefAlign), reinforcement learning with reference-based rewards, as a unified and inexpensive alternative. Using pre-existing or distilled references, RL2R measures semantic similarity with lightweight metrics such as BERTScore between a sampled generation and a reference answer or solution. Similarity preserves ordinal quality signals that binary feedback discards: responses closer to the reference earn higher rewards, and sound derivations receive credit even when the final conclusion is wrong. For mathematical reasoning, augmenting rule-based verification with answer- and step-level similarity provides low-cost process supervision and outperforms answer-only verification. For alignment, a critic-free REINFORCE-style instantiation covers general preference, safety, and confidence tasks on par with RM-based methods. Reference-based rewards thus offer a cost-effective, versatile reward source spanning reasoning and alignment.
The code for the RefAlign framework, including training and evaluation scripts, can be found on the official GitHub repository: https://github.com/mzhaoshuai/RL2R/tree/alignment.
The training data is mzhaoshuai/Llama-3.3-70B-Inst-awq_ultrafeedback_1in3.
When conducting alignment with SimPO, the reward function is BERTScore. The alignment is conducted in an online manner.
| Hyper-Parameters | Value |
|---|---|
| LR | 3e-7 |
| Batch Size | 120 |
| Epoch | 1 |
| Prompt Length | 512 |
| Generation Length | 1024 |
| Sampled Generations (K) | 3 |
| BertScore Model | bart-large-mnli |
| SimPO beta | 2.5 |
| SimPO beta/gamma | 0.3 |