CLIPO: Contrastive Learning in Policy Optimization Generalizes RLVR

Sijia Cui, Pengyu Cheng, Jiajun Song, Yongbo Gai, Guojun Zhang, Zhechao Yu, Jianhe Lin, Xiaoxi Jiang, Guanjun JiangarXiv 2026

TL;DR

CLIPO (Contrastive Learning in Policy Optimization) introduces an intra-group contrastive learning mechanism to Reinforcement Learning with Verifiable Rewards (RLVR) for LLMs. By forcing the model to maximize similarity between successful reasoning trajectories and minimize it for failed ones, CLIPO acts as a logical "denoiser." This effectively eliminates process-wrong/outcome-correct hallucinations and significantly boosts model generalization and robustness without requiring expensive step-by-step human annotations.

What Problem Does This Paper Address?

When training Large Language Models (LLMs) to solve complex multi-step reasoning problems, researchers frequently turn to Reinforcement Learning with Verifiable Rewards (RLVR). In this setup, an external environment—like a code compiler or a mathematical equivalence checker—provides objective, binary feedback based entirely on the final answer.

However, this outcome-only reward structure has a major blind spot: process-wrong but outcome-correct rollouts. An LLM can generate a fundamentally flawed chain of logic, make two canceling errors, or simply copy a memorized answer, and still receive a perfect reward. This trains the model to overfit and memorize shortcuts rather than develop genuine reasoning capabilities, causing it to fail when faced with slight distribution shifts. While Process Reward Models (PRMs) can mitigate this by grading intermediate steps, they rely on massive, expensive human annotation efforts that are incredibly difficult to scale.

Methods

CLIPO addresses this limitation by introducing a dense, auxiliary reward signal derived from contrastive learning within each rollout group. The core insight is that while there are infinite ways to make a mistake, successful reasoning paths for a given problem will naturally share a consistent underlying logical structure.

The framework operates as follows:

  1. Trajectory Embedding: A lightweight, learnable contrastive head is appended to the LLM backbone. The token-level hidden states from the final layer of a generated rollout are mean-pooled across the sequence dimension to create a single trajectory-level semantic embedding.
  2. Intra-Group Contrastive Loss: Within a sampled group of rollouts for a single prompt, correct paths are designated as positive instances, while incorrect paths serve as negatives. CLIPO minimizes an InfoNCE loss (or variants like SupCon) to pull correct trajectories closer together in the embedding space while pushing flawed ones away.
  3. Dense Reward Integration: This contrastive loss is flipped, scaled, and integrated directly into the policy optimization step as a dense auxiliary reward ($r_{i}' = r_i + r_i^{CL}$).
Framework of CLIPO

Crucially, CLIPO is algorithm-agnostic and can be seamlessly integrated into existing group-based policy optimization methods like GRPO, GSPO, DAPO, and GMPO.

Datasets

The authors evaluated CLIPO across two distinct experimental tracks of increasing difficulty:

  • Track I (Grade-School & General Reasoning): Models were fine-tuned on the GSM8K dataset (~8,000 high-school-level math problems). Evaluation was conducted on the GSM8K test set, its robust variants designed to test distribution shifts (GSM8K-Symbolic, GSM8K-P1, GSM8K-P2), and broader reasoning suites including CommonsenseQA, TruthfulQA, TheoremQA, and MMLU.
  • Track II (Competition-Level Mathematical Reasoning): Models were trained on the MATH 7.5K dataset and evaluated on MATH500, Math-Perturb (Simple and Hard variants featuring problem alterations), and elite competition challenges like AMC23, AIME, and AIME25.

Key Insights and Ideas

  • Contrastive Learning as a Denoiser: Flawed reasoning steps and hallucinations manifest as sporadic, uncorrelated noise across different rollouts. By enforcing proximity among successful trajectories, CLIPO amplifies the invariant logical flow and filters out the noise.
  • The Necessity of Joint Optimization: A key ablation study revealed that freezing the contrastive head during training leads to consistent performance drops. The head must adapt dynamically alongside the base LLM to accurately capture the nuances of evolving reasoning paths.
  • Sharper Scaling Focuses on Hard Negatives: Lowering the contrastive temperature parameter ($\tau$) from 0.2 down to 0.02 yielded substantial performance gains. A lower temperature forces the model to focus heavily on "hard negatives"—those deceptive rollouts that look superficially correct but ultimately arrive at the wrong answer.

Key Results

CLIPO demonstrated uniform performance gains across multiple base model architectures (including Qwen2.5-3B-Instruct, Llama3.1-8B-Instruct, and DeepSeek-R1-Distill-Qwen-7B) and all four RLVR baselines.

  • Robustness to Distribution Shifts: On Track I, GRPO+CLIPO achieved the highest math-average score (75.35). Notably, it improved performance on the challenging GSM8K-P2 variant by +3.36 points, proving its superior robustness against problem perturbations.
  • Competition-Level Dominance: On Track II, DAPO+CLIPO achieved the highest overall average score of 44.05, outperforming standard DAPO by a clear margin.
  • Clearer Semantic Manifolds: Qualitative t-SNE visualizations confirmed that before training, correct and incorrect reasoning paths are completely entangled. After CLIPO training, correct responses form tight, distinct clusters, validating that the model successfully maps trajectory quality.
The t-SNE visualization of semantic embeddings

Limitations and Future Work

The authors observed a minor performance decrease (-0.11) in the Math-Avg metric when applying CLIPO to the DeepSeek-R1-Distill-Qwen-7B model. They speculate that because this model had already undergone extensive mathematical fine-tuning, training it for the same number of epochs as the other baselines caused mild overfitting.

Looking ahead, the authors note that CLIPO's framework is fundamentally generalizable. Since it does not rely on domain-specific verifiers, future work will explore applying CLIPO to other highly structured, verifiable environments like code generation and agent planning.

Summary updated

BibTeX
@misc{cui2026clipo,
  author = {Sijia Cui and Pengyu Cheng and Jiajun Song and Yongbo Gai and Guojun Zhang and Zhechao Yu and Jianhe Lin and Xiaoxi Jiang and Guanjun Jiang},
  title = {{CLIPO: Contrastive Learning in Policy Optimization Generalizes RLVR}},
  year = {2026},
  eprint = {2603.10101},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.10101},
}
Figure