Skip to content

Conversation

@t1101675
Copy link
Contributor

What does this PR do?

Fix the convergence issues of MiniLLMTrainer. It can now smoothly optimize the Reverse KL Divergence between the teacher and the student:

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.

@t1101675
Copy link
Contributor Author

@qgallouedec I have reduced #4731 to only fixing the convergence of the MiniLLM trainer.

if self.args.gradient_accumulation_steps % generate_every != 0 or (
self.use_vllm and self.vllm_importance_sampling_correction
):
) or self.args.always_track_old_logps:
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure to understand why you need this? When self.args.gradient_accumulation_steps % generate_every == 0, then old_per_token_logps == per_token_logps, why not just using per_token_logps.detach()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice comments! I have removed always_track_old_logps.

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