Skip to content

Align KTO with DPO: Align error for Liger with precompute_ref_logps#6270

Merged
albertvillanova merged 2 commits into
mainfrom
align-kto-dpo-error-liger-precompute_ref_logps
Jul 3, 2026
Merged

Align KTO with DPO: Align error for Liger with precompute_ref_logps#6270
albertvillanova merged 2 commits into
mainfrom
align-kto-dpo-error-liger-precompute_ref_logps

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Jul 3, 2026

Copy link
Copy Markdown
Member

Align KTO with DPO: Align error for Liger with precompute_ref_logps.

Part of:

This PR makes a small update to the error message in the __init__ method of KTOTrainer to clarify the usage restrictions when using the Liger KTO loss with precompute_ref_logps, aligned with DPOTrainer.

Changes

  • Improved the error message to more clearly explain that Liger KTO loss does not support precomputing reference log probabilities, and to suggest disabling precompute_ref_log_probs or setting use_liger_kernel to False.

Note

Low Risk
Copy-only change to an initialization error message; no training or runtime logic is modified.

Overview
Updates the ValueError raised in KTOTrainer.__init__ when use_liger_kernel=True and precompute_ref_log_probs=True are used together.

The message now states that Liger KTO loss does not support precomputing reference log probabilities, and tells users to either turn off precompute_ref_log_probs or set use_liger_kernel to False—matching DPOTrainer’s wording for the same incompatible combination. Validation behavior is unchanged.

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

@bot-ci-comment

bot-ci-comment Bot commented Jul 3, 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 merged commit d65bc11 into main Jul 3, 2026
5 checks passed
@albertvillanova albertvillanova deleted the align-kto-dpo-error-liger-precompute_ref_logps branch July 3, 2026 16:02
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