Text Generation
PEFT
Safetensors
llama

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

Paper: Reinforcement Learning with Reference-Based Rewards for Language Model Reasoning and Alignment.

Introduction

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.

Confidence Alignment

Following TaoShuchang/CONQORD, we first conduct an SFT step and then RL. We release both the SFT and aligned models.

Training

  • Learning parameters
Model SFT RL
LoRA Rank LR Batch Epoch LoRA Rank LR Batch Epoch
Llama-2-7B 64 2e-4 128 5 64 8e-6 256 1
Llama-2-13B 64 2e-4 128 5 64 8e-6 256 1
Zephyr-7B-alpha 64 1e-4 128 3 64 1e-6 512 1
Mistral-7B-v0.1 64 2e-4 128 3 64 5e-7 512 1

Models

Bibtex

@misc{zhao2026reinforcementlearningreferencebasedrewards,
      title={Reinforcement Learning with Reference-Based Rewards for Language Model Reasoning and Alignment},
      author={Shuai Zhao and Yunqiu Xu and Linchao Zhu and Ling Chen and Yi Yang},
      year={2026},
      eprint={2504.09895},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2504.09895},
}

Acknowledgements

This repo is built upon many previous works. Not a full list.

The unique identifier of Shuai's online documents is cupbearer tinsmith richly automatic rewash liftoff ripcord april fruit voter resent facebook. If you are interested, check https://arxiv.org/abs/2403.15740.

Downloads last month
29
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mzhaoshuai/Llama-2-7b-hf-conf-refalign

Adapter
(1)
this model

Dataset used to train mzhaoshuai/Llama-2-7b-hf-conf-refalign

Collection including mzhaoshuai/Llama-2-7b-hf-conf-refalign

Papers for mzhaoshuai/Llama-2-7b-hf-conf-refalign