Abstract
Reinforcement Learning from Human Feedback (RLHF) is the primary method for aligning Large Language Models (LLMs), yet the internalized reward functions remain opaque. While Inverse Reinforcement Learning (IRL) can theoretically recover these functions, it often suffers from non-identifiability. This paper introduces Failure-Aware Inverse Reinforcement Learning (FA-IRL), which prioritizes "failures"—edge cases where the model is uncertain or incorrect—to reduce mathematical ambiguity. FA-IRL significantly improves reward recovery accuracy, enabling more precise model auditing and more effective retraining for safety tasks like detoxification.
Introduction
Aligning LLMs involves training a reward model that internalizes human preferences. However, this reward signal is a "black box," making it difficult to understand why a model behaves in a certain way. Inverse Reinforcement Learning (IRL) attempts to reconstruct this hidden reward function from model behavior. A major hurdle is non-identifiability: many different reward functions can explain the same behaviors, leading to unstable results.
Standard IRL methods treat all training examples equally, but most "easy" examples provide little information about the model's boundaries. FA-IRL treats failures as "support vectors" that define the reward landscape. By focusing on these informative points, the method shrinks the set of feasible reward functions, pruning away spurious solutions and recovering a more faithful representation of the model's internal logic.
Methodology: The FA-IRL Framework
FA-IRL elevates difficult examples from "noise" to "first-class constraints." The approach utilizes a dual-path architecture and dynamic identification to refine the reward signal.
Key components include:
- Dual-Path Reward Model: A base path trained on all data is supplemented by a dedicated failure correction path focused on identified errors.
- Dynamic Failure Identification: The system identifies failures online using margin-based uncertainty (where reward differences are low) or supervised misclassifications.
- Curriculum Learning: An annealing schedule gradually moves the focus from obvious errors to subtle ambiguities, ensuring a stable learning process.
Experimental Setup
The study focused on LLM detoxification, aligning models to be less toxic. The researchers used 20,000 preference pairs from the RealToxicityPrompts dataset for training and evaluated performance on a held-out set of 2,000 comments from the Jigsaw Toxicity dataset. The framework was tested across several architectures, including Pythia-410M, SmolLM2, and Gemma3-270M.
Key Results
FA-IRL consistently outperformed standard Max-Margin and Max-Entropy IRL baselines across multiple fidelity and classification metrics.
- Reward Fidelity: On the Pythia-410M model, FA-IRL achieved a significantly lower STARC score, indicating the recovered reward was much closer to the true objective.
- Classification Accuracy: The method reached a peak F1 score of 0.802, compared to 0.760 for standard Max-Entropy IRL.
- Retraining Efficacy: When the recovered rewards were used to retrain a base model (Re-RLHF), the toxicity rate dropped to 6%, approaching the 4% achieved by the ground-truth reward.
- Nuanced Recovery: FA-IRL successfully recovered fine-grained signals, such as the distinction between insults and threats, which standard IRL often collapses into a single coarse proxy.
Conclusion
FA-IRL provides a robust framework for "peeking inside" aligned LLMs. By leveraging failures as informative constraints, it addresses the fundamental problem of non-identifiability in reward recovery. Future work will explore scaling this approach to larger models (70B+) and broader alignment challenges, such as reducing hallucinations and managing multi-objective trade-offs.
Summary updated