Self-Supervised On-Policy Reinforcement Learning via Contrastive Proximal Policy Optimisation

Asim Osman, Sasha Abramowitz, Mark Bergh, Ulrich Armel Mbou Sob, Ruan John de Kock, Omayma Mahjoub, Oussama Hidaoui, Noah De Nicola, Arnol Manuel Fokam, Felix Chalumeau, Daniel Rajaonarivonivelomanantsoa, Siddarth Singh, Refiloe Shabe, Juan Claude Formanek, Simon Verster Du Toit, Arnu Pretorius

TL;DR

This paper introduces Contrastive Proximal Policy Optimisation (CPPO), the first on-policy contrastive reinforcement learning (RL) algorithm. By deriving policy advantages directly from self-supervised contrastive Q-values, CPPO completely bypasses the need for hand-crafted reward functions, replay buffers, or target networks. It bridges the gap between reward-free learning and modern, highly parallelized on-policy training pipelines, matching or outperforming traditional reward-based PPO across a variety of complex tasks.

What Problem Does This Paper Address?

Designing reward functions in reinforcement learning is notoriously difficult. Sparse rewards lead to poor exploration, while dense rewards often introduce specification bias, leading to "reward hacking" where agents maximize rewards without achieving the actual goal.

Contrastive Reinforcement Learning (CRL) offers a elegant alternative: instead of maximizing a scalar reward, the agent learns a goal-conditioned Q-function by mapping state-action pairs and achieved goals into a shared latent space using a contrastive objective (InfoNCE).

However, prior to this paper, all existing CRL methods were strictly off-policy (typically built on top of Soft Actor-Critic (SAC) or Deep Q-Networks (DQN)). This created a major disconnect. Modern RL relies heavily on on-policy methods like Proximal Policy Optimization (PPO) because they are stable, easy to implement, and highly compatible with massively parallel simulators. Furthermore, off-policy methods struggle in discrete action spaces and cooperative multi-agent reinforcement learning (MARL), where on-policy paradigms dominate.

Methods

The authors introduce CPPO, an on-policy contrastive RL algorithm that integrates seamlessly into standard PPO pipelines. CPPO uses three networks:

  1. Policy Network ($\pi_\theta$): Maps observations and goals to action distributions.
  2. State-Action Encoder ($\phi_\xi$): Maps observation-action pairs to a $d$-dimensional representation space.
  3. Goal Encoder ($\psi_\omega$): Maps goals to the same $d$-dimensional space.

Instead of using Generalized Advantage Estimation (GAE) which requires explicit rewards and a learned value network, CPPO computes policy advantages directly from contrastive Q-values:

  • Q-Value Calculation: Defined as the negative $L_2$ distance between the state-action representation and the target goal representation:
    $$Q(o, a, g^*) = -\|\phi(o, a) - \psi(g^*)\|_2$$
  • Value Calculation ($V$): For discrete actions, this is computed exactly as the expected Q-value over all actions. For continuous actions, it is approximated via Monte Carlo sampling.
  • Advantage ($A$): Simply computed as $A = Q - V$.

Training happens in two alternating phases per iteration:

  1. Encoder Update: The encoders are optimized using the InfoNCE loss on hindsight-relabeled rollout data.
  2. Policy Update: The policy is updated using standard PPO clipped surrogate objectives driven by the contrastive advantages.

For multi-agent settings, the authors extend this to ICPPO (Independent CPPO), utilizing independent learning with full parameter sharing.

Datasets

The authors evaluated CPPO across 18 JAX-native tasks spanning single-agent, multi-agent, discrete, and continuous domains:

  • Navix: Single-agent, discrete grid-world environments (Empty, DoorKey, FourRooms).
  • JaxGCRL Suite: Single-agent, continuous control tasks built on the Brax physics engine (Reacher, Ant, Ant U-Maze).
  • SMAX: Multi-agent, discrete StarCraft-inspired cooperative scenarios.
  • Connector: Multi-agent, discrete grid-world path-finding tasks.
  • JaxNav: Multi-agent, continuous 2D navigation for differential-drive robots.

Key Insights and Ideas

  • Goal Specification is More Forgiving Than Reward Engineering: One of the paper's most compelling insights is that defining a goal is significantly more robust than tuning a reward function. The authors tested various granularities of goal definitions against various reward functions. While minor tweaks to reward functions caused massive performance drops, even very coarse goal representations allowed CPPO to succeed.
Figure 3: Reward- vs Goal-design sensitivity on Connector 10×10 and SMAX (smacv2_10_units). For each environment, the reward panel shows IPPO trained under several hand-crafted reward variants, and the goal panel shows ICPPO trained under different goal representations. The reward range far exceeds the goal spread on both environments.
  • Superior Scaling in Complex Environments: As coordination complexity and environment size grow (e.g., in the multi-agent Connector environment), standard reward-based PPO degrades rapidly due to compounding errors in bootstrapped value targets. CPPO scales significantly better because its contrastive objective supervises returns directly rather than chaining through value regressions.
Figure 4: Connector scaling: per-task learning curves across four grid sizes. All methods are similar at 5×5; ICPPO’s advantage widens as coordination complexity grows.
  • Native Discrete Action Handling: Unlike previous multi-agent contrastive methods that relied on biased continuous relaxations (like Gumbel-Softmax) to handle discrete actions, CPPO calculates exact state values natively, leading to cleaner gradients and superior performance.

Key Results

CPPO was benchmarked against existing off-policy contrastive methods (CSAC, CDQN, ICSAC) and traditional reward-based PPO/IPPO.

  • Vs. Contrastive Baselines: CPPO significantly outperformed previous CRL baselines in 14 out of 18 tasks, showing massive improvements in discrete and multi-agent settings.
  • Vs. Hand-Crafted Dense Rewards: Despite receiving no reward signal, CPPO matched or exceeded the performance of reward-engineered PPO/IPPO in 12 out of 18 tasks.
Per-environment IQM sample-efficiency curves

The main exception was single-agent continuous control (JaxGCRL), where off-policy SAC-based contrastive methods maintained an edge. The authors attribute this to the high variance introduced by Monte Carlo sampling when estimating the continuous state value $V$.

Limitations and Future Work

  • Continuous Control Variance: CPPO currently trails off-policy methods in single-agent continuous control due to the variance of Monte Carlo value estimation. Finding a lower-variance value estimator for continuous action spaces remains an open challenge.
  • Centralized MARL Critics: While the independent multi-agent version (ICPPO) performed remarkably well, extending the framework to include a centralized critic (akin to MAPPO) is a promising avenue for future research to handle even tighter multi-agent coordination.

Summary updated

BibTeX
@inproceedings{osman2026self,
  author = {Asim Osman and Sasha Abramowitz and Mark Bergh and Ulrich Armel Mbou Sob and Ruan John de Kock and Omayma Mahjoub and Oussama Hidaoui and Noah De Nicola and Arnol Manuel Fokam and Felix Chalumeau and Daniel Rajaonarivonivelomanantsoa and Siddarth Singh and Refiloe Shabe and Juan Claude Formanek and Simon Verster Du Toit and Arnu Pretorius},
  title = {{Self-Supervised On-Policy Reinforcement Learning via Contrastive Proximal Policy Optimisation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=A91croHbNN},
}
Figure