Repository navigation
Conversation
Add the Unbiased Reward Model (URM) loss and its normalized variant α-URM from "Unbiased Alignment for Large Language Models with Noisy Preferences" (ICML 2026, https://huggingface.co/papers/2607.03248). - RewardConfig: new `loss_type` ("sigmoid" by default, "urm" or "alpha_urm") and `label_smoothing` (assumed label-flip probability) fields. - Docs, paper index entry and tests for both losses. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`loss_type="urm"` now implements the normalized form of the URM loss (α-URM in the paper), which keeps the maximum gradient magnitude at 1 as for the Bradley-Terry loss. The separate `alpha_urm` loss type is removed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
5 of 8 tasks
…er index entry Same adjustments as the ones made to the UDPO docs in huggingface#8211. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds the Unbiased Reward Model (URM) loss to
RewardTrainerasloss_type="urm", from our ICML 2026 paper Unbiased Alignment for Large Language Models with Noisy Preferences. This is theRewardTrainerhalf of #8175, split out as requested there. TheDPOTrainerhalf (UDPO) is in #8211.URM corrects the Bradley-Terry loss for preference labels flipped with probability ε. This PR implements its normalized form, called α-URM in the paper:
The constant α keeps the maximum gradient magnitude at 1, as for the Bradley-Terry loss. This is the variant that the paper recommends to practitioners; the unnormalized loss (Eq. 10) only differs by this constant.
Changes:
RewardConfig: newloss_type("sigmoid"by default, or"urm") andlabel_smoothingfields.label_smoothingis ε, asloss_type="robust"uses it inDPOConfig.RewardTrainer: the log term is computed in log space aslogaddexp(logsigmoid(Δ), log(a) + logsigmoid(-Δ))for numerical stability, andlabel_smoothing=0.0recovers"sigmoid". The default loss is unchanged: the margin is now subtracted before the loss branch, which computes the same expression as before. AValueErroris raised whenlabel_smoothingis outside [0.0, 0.5), because a ≥ 1 no longer prefers the chosen completions.reward_trainer.mdand apaper_index.mdentry.label_smoothingrange check.Part of #8175
Before submitting
AI writing disclosure
We welcome the use of AI tools to help with contributions. For transparency and to help us improve our review process, please indicate the level of AI involvement in this PR.
Who can review?
@qgallouedec, as requested in #8175.
Note
Medium Risk
Changes reward-model training loss paths and adds hyperparameter validation; default sigmoid training is preserved but new options affect alignment-critical reward training.
Overview
Adds URM (α-URM) noisy-preference training to
RewardTrainervia newRewardConfigoptionsloss_type="urm"andlabel_smoothing(flip probability ε).The trainer now selects between the existing Bradley-Terry (
"sigmoid") objective and the normalized URM loss, with log-space stabilization, margin handling shared across both, and aValueErrorwhen ε is outside[0.0, 0.5). Default behavior stays"sigmoid"withlabel_smoothing=0.0.Documentation covers the loss table and paper recipe in
reward_trainer.mdandpaper_index.md. Tests cover URM training, closed-form eval loss, and invalidlabel_smoothing.Reviewed by Cursor Bugbot for commit 49778c9. Bugbot is set up for automated code reviews on this repo. Configure here.