Skip to content

🤧 LD-DPO support #3458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 27, 2025
Merged

🤧 LD-DPO support #3458

merged 12 commits into from
May 27, 2025

Conversation

AIR-hl
Copy link
Contributor

@AIR-hl AIR-hl commented May 16, 2025

What does this PR do?

This PR adds LD-DPO implementations to TRL. This paper has been accepted by CoRR 2024

  • Liu W, Bai Y, Han C, et al. Length Desensitization in Directed Preference Optimization[J]. CoRR, 2024.

This paper proposed a novel method aims to desensitize DPO to data length by decoupling explicit length preference, which is relatively insignificant, from the other implicit preferences, thereby enabling more effective learning of the intrinsic preferences

image

image

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 May 16, 2025

congrats! can you also kindly add the method in the dpo documentation with some description?

@AIR-hl
Copy link
Contributor Author

AIR-hl commented May 16, 2025

congrats! can you also kindly add the method in the dpo documentation with some description?

done

@kashif
Copy link
Collaborator

kashif commented May 16, 2025

also you can add a small test too?

@AIR-hl
Copy link
Contributor Author

AIR-hl commented May 16, 2025

also you can add a small test too?

Sorry, i dont know how to test if it is effective. T_T

@kashif
Copy link
Collaborator

kashif commented May 16, 2025

no problem, I can do it

@HuggingFaceDocBuilderDev

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.

@qgallouedec qgallouedec changed the title LD-DPO support 🤧 LD-DPO support May 27, 2025
Copy link
Member

@qgallouedec qgallouedec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@qgallouedec qgallouedec merged commit 4e7f0a5 into huggingface:main May 27, 2025
10 checks passed
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.

4 participants