Reward Learning through Ranking Mean Squared Error

Chaitanya Kharyal, Calarina Muslimani, Matthew E. Taylor

TL;DR

Ranked Return Regression for RL ($\text{R}^4$) is a novel framework that learns reward functions from multi-class human ratings (e.g., "bad," "neutral," "good") rather than rigid binary preferences. By optimizing a unique ranking mean squared error (rMSE) loss through a differentiable sorting operator, $\text{R}^4$ provides strong theoretical guarantees, preserves within-class trajectory diversity, and consistently outperforms existing preference- and rating-based methods on standard robotic benchmarks.

What Problem Does This Paper Address?

In reinforcement learning (RL), designing a reward function manually is often a painful process of trial-and-error that can easily lead to reward misspecification and unintended agent behaviors. To avoid this, researchers often turn to Preference-based RL (PbRL), where humans choose the better of two trajectories. However, binary preferences only provide a single bit of information per comparison and are entirely relative—if both options are terrible, the human can only say they are equally bad, failing to convey absolute quality.

Rating-based RL (RbRL) addresses this by letting humans assign discrete scores (like a 1-5 star scale). Yet, existing RbRL methods treat these ratings as categorical classes using cross-entropy losses. This approach requires predefined, rigid class boundaries and forces all trajectories within a class to cluster around a single midpoint value, completely destroying the natural diversity of behaviors within the same rating category.

Methods

The authors introduce Ranked Return Regression for RL ($\text{R}^4$), which treats human ratings as ordinal targets rather than independent categories.

The training pipeline works as follows:

  1. Sampling: At each training step, $\text{R}^4$ samples one trajectory from each rating class dataset.
  2. Prediction: It computes the predicted discounted returns for these trajectories using the current learned reward model ($\hat{r}_\theta$).
  3. Differentiable Ranking: Instead of standard hard sorting (which breaks gradient propagation), it passes these predicted returns through a differentiable sorting operator to generate continuous "soft ranks."
  4. rMSE Loss: It minimizes the Mean Squared Error between these soft ranks and the actual human-provided ordinal ratings.
Illustration of the R4 training process

Crucially, this formulation eliminates the need for arbitrary hyperparameter tuning for class boundaries and mathematically guarantees a complete and minimal solution set under mild assumptions.

Datasets

The method was evaluated using both simulated and real human feedback across two major benchmark suites:

  • OpenAI Gym: Reacher, Inverted Double Pendulum, and Half Cheetah (used for offline feedback experiments).
  • DeepMind Control Suite (DMC): Walker-walk, Walker-stand, Cheetah-run, Quadruped-walk, Quadruped-run, and Humanoid-stand (used for online feedback experiments).
  • Human-Rated Dataset: The authors conducted an ethics-approved user study with 8 participants rating trajectories in Gym Reacher and Hopper. This heterogeneous, noisy dataset has been open-sourced to benefit future RbRL research.

Key Insights and Ideas

  • Ratings are Ordinal, Not Categorical: Treating "good" and "neutral" as entirely separate classes ignores the fact that "good" is inherently greater than "neutral." $\text{R}^4$ leverages this structure by optimizing for sequence order rather than class alignment.
  • Preserving Within-Class Diversity: Because $\text{R}^4$ focuses on ranking trajectories relative to one another across classes, it does not force trajectories within the same class to have identical predicted returns. This gives the reward model more flexibility.
  • Dynamic Standard Calibration: Humans naturally shift their internal standards as an agent improves (a phenomenon called response shift). $\text{R}^4$ easily accommodates dynamic rating scales—allowing bins to be split or merged during training—something that severely degrades performance in cross-entropy-based RbRL.

Key Results

Offline Feedback

When trained on static, pre-collected datasets of simulated ratings, $\text{R}^4$ consistently led to faster SAC learning or higher final returns compared to standard RbRL across all tested OpenAI Gym domains.

Figure 2. Performance of a SAC agent trained with (1) R4, (2) RbRL, and (3) the environment reward.

Online Feedback

In interactive settings against state-of-the-art preference-based algorithms (PEBBLE, SURF, QPA), $\text{R}^4$ learned significantly faster in three out of six environments and achieved higher final returns in four of them.

Figure 3. Online SAC training using the environment reward or rewards learned from different rating- and preference-based algorithms.

Human-User Study

Real human feedback is notoriously messy. Participants in the user study exhibited massive class imbalances, used varying numbers of rating scales (from 4 to 12 bins), and frequently gave different ratings to trajectories with similar environment returns.

Despite this real-world noise, $\text{R}^4$ significantly outperformed baseline RbRL. Furthermore, participants reported a low cognitive workload score of 2.05 out of 7 on the NASA TLX index, confirming that providing multi-class ratings is highly practical for human supervisors.

Below are examples of the diverse rating distributions provided by different users in the study:

User 1 rating distribution User 3 rating distribution User 4 rating distribution

Limitations and Future Work

While $\text{R}^4$ is mathematically proven to be robust against random label noise (implicitly fitting the conditional expectation of the observed ratings), it remains vulnerable to order-corrupting noise. If a supervisor provides adversarial or systematically inverted ratings (e.g., consistently rating poor trajectories higher than optimal ones), the ranking mechanism will fail.

Future work includes developing explicit defense mechanisms against adversarial feedback and scaling $\text{R}^4$ to more complex, high-dimensional real-world robotic control tasks.

Summary updated

BibTeX
@inproceedings{kharyal2026reward,
  author = {Chaitanya Kharyal and Calarina Muslimani and Matthew E. Taylor},
  title = {{Reward Learning through Ranking Mean Squared Error}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=6wQKBHi0qO},
}
Figure