Skip to content

Conversation

ginkyenglee
Copy link
Contributor

What does this PR do?

Problem: When use_liger_loss=True and precompute_ref_log_probs=True, the trainer still computes and attaches unused reference log probability columns (ref_chosen_logps, ref_rejected_logps). This results in unnecessary overhead.

Solution: Force-disable args.precompute_ref_log_probs (set to False) when use_liger_loss=True, and emit a warning log to inform the user.

Impact: Limited to the DPOTrainer initialization path for the Liger loss setting. The change is backward compatible and does not affect other training modes.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@kashif
Copy link
Collaborator

kashif commented Sep 4, 2025

shall we add this in the dpo config's post init?

@ginkyenglee
Copy link
Contributor Author

shall we add this in the dpo config's post init?

I moved this to DPOConfig.__post_init__ in the latest push.

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