Skip to content

Align KTO with DPO: Align Liger loss naming#6244

Merged
albertvillanova merged 2 commits into
mainfrom
align-kto-dpo-liger-loss-name-fu-6243
Jul 3, 2026
Merged

Align KTO with DPO: Align Liger loss naming#6244
albertvillanova merged 2 commits into
mainfrom
align-kto-dpo-liger-loss-name-fu-6243

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Jul 2, 2026

Copy link
Copy Markdown
Member

Align KTO with DPO: Align Liger loss naming.

Follow-up to:

Part of:

This PR refactors the naming of the Liger loss function attribute in the KTOTrainer class to improve code clarity and consistency. The main change is renaming the attribute from liger_loss_fn to liger_loss and updating its usage accordingly.

Changes

Refactoring for clarity:

  • Renamed the Liger loss function attribute from liger_loss_fn to liger_loss in the KTOTrainer class constructor (__init__) for clearer and more consistent naming.
  • Updated all internal references to use the new attribute name liger_loss instead of liger_loss_fn in the _compute_loss_liger method.

Note

Low Risk
Identifier rename only; no logic, API, or training behavior changes.

Overview
Renames the Liger fused KTO loss attribute on KTOTrainer from liger_loss_fn to liger_loss, and updates the call site in _compute_loss_liger to match. This is a naming-only change so KTO follows the same convention as DPO after #6243; behavior is unchanged.

Reviewed by Cursor Bugbot for commit aba91ad. Bugbot is set up for automated code reviews on this repo. Configure here.

@bot-ci-comment

bot-ci-comment Bot commented Jul 2, 2026

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@albertvillanova albertvillanova enabled auto-merge (squash) July 3, 2026 09:57
@albertvillanova albertvillanova merged commit b7fb4e7 into main Jul 3, 2026
5 checks passed
@albertvillanova albertvillanova deleted the align-kto-dpo-liger-loss-name-fu-6243 branch July 3, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants