Skip to content
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

Fixed logging issue in rloo_trainer.py that where generate_completions() is not reflective of actual model generations #2679

Closed
wants to merge 1 commit into from

Conversation

swkarlekar
Copy link

What does this PR do?

Issue:

there is a bug in the generations that get logged as model checkpoints. Specifically, rloo_trainer.py's generate_completions() is not reflective of actual model generations, which seems to not be the desired behavior. In particular the temperature in generate_completions is set to 0.01.

   def generate_completions(self, sampling: bool = False):
        args = self.args
        processing_class = self.processing_class
        generation_config = **GenerationConfig(
            max_new_tokens=self.args.response_length,
            temperature=(0.01 + 1e-7),
            top_k=0.0,
            top_p=1.0,
            do_sample=True,
        )**
...

temperature=(0.01 + 1e-7),

The generation_completions()'s temperature is not the same as that used in train():

...
        generation_config = GenerationConfig(
            max_new_tokens=args.response_length,
            temperature=(args.temperature + 1e-7),
            top_k=0.0,
            top_p=1.0,
            do_sample=True,
        )
...

temperature=(args.temperature + 1e-7),

This results in logging of model checkpoints that are different from what gets used in the actual RLOO process.

Fix:

Adjusted the arguments in the generation_config in generate_completions() to use self.args.temperature instead of the hardcoded value 0.01.

Fixes # (issue)

#2678

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.

@swkarlekar swkarlekar changed the title Fixed logging issue that where generate_completions() is not reflective of actual model generations Fixed logging issue in rloo_trainer.py that where generate_completions() is not reflective of actual model generations Jan 28, 2025
@swkarlekar swkarlekar closed this Jan 28, 2025
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.

1 participant