VerIF: Verification Engineering for Reinforcement Learning in Instruction Following

Hao Peng, Yunjia Qi, Xiaozhi Wang, Bin Xu, Lei Hou, Juanzi Li

Abstract

Reinforcement Learning with Verifiable Rewards (RLVR) has demonstrated significant success in reasoning-heavy domains like mathematics and programming. However, its application to general instruction following has been hindered by the "verification gap"—the difficulty of providing reliable, automated reward signals for subjective or nuanced constraints. This paper introduces VerIF, a hybrid verification engineering framework that combines deterministic Python scripts for hard constraints with distilled reasoning models for soft constraints. Our approach, utilizing the VERINSTRUCT dataset and Group Relative Policy Optimization (GRPO), achieves state-of-the-art performance on instruction-following benchmarks while maintaining or improving general reasoning capabilities.

1. Introduction

While large language models (LLMs) have become increasingly proficient at following complex instructions, training them effectively via Reinforcement Learning (RL) remains a challenge. Unlike math or code, where correctness is easily verifiable, human instructions often involve a mixture of objective "hard" constraints (e.g., word counts, specific keywords) and subjective "soft" constraints (e.g., tone, style, target audience).

Existing RL approaches for instruction following typically focus on hard constraints because they are easily verified by code. However, this narrow focus ignores the semantic nuances that define high-quality human-AI interaction. VerIF addresses this by proposing a dual-path verification system that provides high-fidelity reward signals for the full spectrum of instruction types.

2. Methodology

2.1 The Hybrid Verification Framework

VerIF categorizes instruction constraints into two distinct types, each handled by a specialized verifier:

  • Hard Constraints: These include objective rules such as "must be at least 200 words" or "do not use the word 'the'." Because LLMs frequently struggle with precise counting and character-level constraints, VerIF offloads these tasks to automatically generated Python scripts, ensuring deterministic accuracy.
  • Soft Constraints: These involve qualities like "be imaginative" or "explain it to a five-year-old." VerIF utilizes a "Large Reasoning Model" (specifically QwQ-32B) to judge these constraints. Unlike standard instruct models, reasoning models employ long Chain-of-Thought (CoT) processing to analyze whether a response meets stylistic requirements before assigning a score.

2.2 Algorithm and Distillation

To optimize the policy, we utilize Group Relative Policy Optimization (GRPO). GRPO is particularly efficient as it eliminates the need for a separate value model. To address the computational cost of using a 32B reasoning model as a judge during RL training, we distilled the judgment capabilities of QwQ-32B into a smaller, more efficient IF-Verifier-7B model. This distillation process maintains high judgment accuracy while significantly reducing reward computation latency.

3. The VERINSTRUCT Dataset

We introduce VERINSTRUCT, a dataset comprising approximately 22,000 instances designed for RL training. The dataset was constructed using "constraint back-translation":

  1. Starting with high-quality responses, an LLM "guesses" the complex constraints the response already satisfies.
  2. These constraints are then synthesized into a new, challenging instruction.
  3. Each instance is paired with its corresponding verification method (Python script or LLM-verifier prompt).

4. Experimental Results

4.1 Instruction Following Performance

The impact of VerIF is most evident in IFEval, the gold standard for constraint following. A model initialized from TULU 3 SFT improved its strict prompt-level accuracy from 68.4% to 84.5% after RL training with VerIF. Our 7B models reached state-of-the-art levels, outperforming significantly larger models and even the original TULU 3, which utilized more extensive Direct Preference Optimization (DPO) data.

4.2 Generalization and the Alignment Tax

Crucially, the RL-trained models demonstrated strong generalization to unseen constraint types (e.g., "no punctuation"), despite only being explicitly trained on five primary categories. Furthermore, we observed no "alignment tax." Unlike many fine-tuning methods that degrade a model's mathematical or coding abilities, RL with VerIF preserved or slightly improved performance on benchmarks like GSM8K and MMLU-Pro. This suggests that the RL process encourages the model to better utilize its existing knowledge rather than simply memorizing new patterns.

4.3 Efficiency

The distilled IF-Verifier-7B achieved performance parity with its 32B teacher. In practical terms, this reduced the average reward computation time from 180 seconds to 120 seconds per batch on a single H800 GPU, making the verification process more viable for large-scale training.

5. Discussion and Limitations

While VerIF represents a significant step forward, several challenges remain. The current iteration of VERINSTRUCT is limited to English, and expanding to multilingual instructions is a priority for future work. Additionally, while reasoning models are superior judges, they are not immune to "reward hacking," where a policy model might learn to manipulate the verifier's logic without truly satisfying the prompt. Future research will focus on increasing constraint diversity and further hardening the verifiers against such adversarial behavior.

6. Conclusion

VerIF demonstrates that "verification engineering"—the strategic combination of code-based and model-based rewards—is a powerful paradigm for scaling RL in instruction following. By bridging the gap between hard and soft constraints, we can train models that are not only more precise but also more semantically capable, all while avoiding the performance trade-offs typical of traditional alignment methods.

Summary updated

BibTeX
@misc{peng2025verif,
  author = {Hao Peng and Yunjia Qi and Xiaozhi Wang and Bin Xu and Lei Hou and Juanzi Li},
  title = {{VerIF: Verification Engineering for Reinforcement Learning in Instruction Following}},
  year = {2025},
  eprint = {2506.09942},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.09942},
}
Figure