Reducing the Probability of Undesirable Outputs in Language Models Using Probabilistic Inference

Stephen Zhao, Aidan Li, Rob Brekelmans, Roger Grosse

TL;DR

Standard reinforcement learning methods for language model alignment optimize for average performance, which often leaves rare, catastrophic failure modes unaddressed. To fix this, the authors introduce RePULSe, a training framework that uses a learned proposal model to actively sample and suppress low-reward outputs. This approach significantly reduces the probability of undesirable behaviors and improves adversarial robustness without sacrificing average model performance.

What Problem Does This Paper Address?

When aligning Large Language Models (LMs) using Reinforcement Learning from Human Feedback (RLHF), algorithms typically sample outputs directly from the current model and update parameters based on the received rewards.

This creates a paradox: as the model improves and becomes safer, the probability of generating bad or harmful outputs shrinks. Because these undesirable outputs are rarely sampled anymore, they stop receiving direct gradient updates. Consequently, the model never explicitly learns to suppress the remaining rare failure modes hidden in the tail of its distribution. This leaves the model vulnerable to edge-case failures and targeted adversarial "jailbreak" attacks.

While you can penalize low rewards more harshly by transforming the reward function, doing so usually degrades the model's average-case performance. The authors aim to break this trade-off by actively hunting for and eliminating these rare, low-reward sequences.

Methods

The authors propose RePULSe (Reducing the Probability of Undesirable Low-reward Sequences). Instead of relying solely on standard RL optimization, RePULSe augments the training objective with an explicit unlearning loss:

  1. Target Distribution ($\sigma_\theta$): The authors define a mathematical target distribution that intentionally amplifies the low-reward regions of the current LM policy (e.g., using negative temperature scaling, where lower-reward outputs receive higher probability mass).
  2. Learned Proposal Model ($q_\xi$): Because exact sampling from this target distribution is intractable, they train a separate proposal language model to approximate it. Crucially, they train this model using a mass-covering KL divergence (via a modified Contrastive Twist Learning objective). This ensures the proposal model learns to find all different types of bad outputs, rather than collapsing onto just one.
  3. Suppression Loss ($L_u$): During training, the framework draws approximate low-reward samples from the proposal model, uses Self-Normalized Importance Sampling (SNIS) to weight them correctly, and applies gradient ascent to directly minimize their log-probability in the main language model.

This dual-engine approach allows the model to maximize average rewards via standard RL while simultaneously executing targeted suppression of its worst-case outputs.

Datasets

The authors evaluated RePULSe across three distinct settings:

  • Toy Experiment: Conducted using DistilGPT2 on a single prompt ("This man is a") to analytically calculate the exact probability of generating a hand-selected list of offensive words.
  • Realistic Scaling Experiments: Trained on a dataset of 20,000 prompts consisting of a mix of adversarial prompts from the ALERT dataset and non-adversarial prompts from the OpenRLHF collection (primarily UltraFeedback).
  • Setting 1: Evaluated using SmolLM-135M-Instruct paired with a DeBERTa-v3 reward model.
  • Setting 2: Evaluated using Llama-3.2-1B-Instruct paired with a Skywork-Reward-V2 model.

Key Insights and Ideas

  • The Vanishing Gradient Problem for Safety: Standard RL alignment suffers from diminishing returns for safety because a model cannot learn from mistakes it stops making during training.
  • Mass-Covering vs. Mode-Seeking: When training a model to generate good text, you want it to find the absolute best answers (mode-seeking). However, when training a proposal model to find vulnerabilities, it must find every possible way the model can fail (mass-covering).
  • Smart Compute Allocation: RePULSe requires roughly double the compute per training step due to the proposal network. However, the authors show that shifting compute toward finding and suppressing failures yields a fundamentally better Pareto frontier than simply training a standard RL baseline for twice as long.

Key Results

In the toy experiment, RePULSe monotonically drove down the total probability of generating bad words to a level orders of magnitude lower than standard PPO or REINFORCE, all while maintaining an identical average reward.

Figure 1: Toy experiment: number of samples drawn vs. log total probability of bad outputs based on analytic calculation on a list of bad words. RePULSe (blue dashed line) achieves much lower total probability of a bad output com- pared to baselines.

In more realistic settings, RePULSe successfully pushed out the Pareto frontier. For any given level of average return, RePULSe achieved a lower total probability of bad outputs (defined by conservative reward thresholds) compared to standard RL and reward-transformation baselines.

Figure 3: Setting 1. Plot shows average return (including KL divergence) vs. total probability of bad outputs (r(s0:T ) < −5) estimated from pθ samples, evaluated on 10,000 held-out prompts with 5 samples each. Each point is an average over 10 seeds with 95% confidence intervals for both axes. RePULSe improves the Pareto fron- tier at lower probabilities of bad outputs.

Furthermore, the authors tested the models against a Greedy Coordinate Gradient (GCG) adversarial attack. RePULSe significantly reduced the success rate of these jailbreak attacks, demonstrating superior adversarial robustness.

Figure 5: Setting 1. Average return vs. GCG attack success rate, evaluated on 10 held-out prompts, measured by any of 1000 pθ samples having r(s0:T ) < −5. Each point is an average over 10 seeds with 95% confidence intervals for both axes. RePULSe achieves an improved fron- tier with better robustness over baselines.

Limitations and Future Work

  • Compute Overhead: Generating samples from a separate proposal network effectively doubles the computational cost per training step.
  • Convergence Dependency: The benefits of RePULSe are most pronounced when the model is trained close to convergence; early in training, standard RL is still highly effective on its own.
  • Dual-Use Risk: The proposal model $q_\xi$ is explicitly trained to become an effective "jailbreaker" or harm-generator. If a highly capable proposal model were leaked or stolen, it could be maliciously exploited.
  • Future Directions: The authors suggest exploring more advanced exploration schemes to help the proposal model navigate the massive token spaces of frontier-scale language models.

Summary updated

Abstract

Reinforcement learning (RL) has become a predominant technique to align language models (LMs) with human preferences or promote outputs which are deemed to be desirable by a given reward function. Standard RL approaches optimize average reward, while methods explicitly focused on reducing the probability of undesired outputs typically come at a cost to average-case performance. To improve this tradeoff, we introduce RePULSe, a new training method that augments the standard RL loss with an additional loss that uses learned proposals to guide sampling low-reward outputs, and then reduces those outputs' probability. We run experiments demonstrating that RePULSe produces a better tradeoff of expected reward versus the probability of undesired outputs and is more adversarially robust, compared to standard RL alignment approaches and alternatives.
BibTeX
@inproceedings{zhao2025reducing,
  author = {Stephen Zhao and Aidan Li and Rob Brekelmans and Roger Grosse},
  title = {{Reducing the Probability of Undesirable Outputs in Language Models Using Probabilistic Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=BneVLr7iis},
}
Figure