huggingface / trl

Train transformer language models with reinforcement learning.
http://hf.co/docs/trl
Apache License 2.0
9.86k stars 1.25k forks source link

[RewardTrainer] Change print_rich_table parameters during Reward Model training #2121

Open rmovva opened 1 month ago

rmovva commented 1 month ago

Feature request

The RewardTrainer has a default behavior of printing four chosen & rejected responses along with their logits at every validation iteration. This is implemented in the following line:

L359 in reward_trainer.py

AFAIK there is no parameter to turn off this printing, change num_print_samples, etc. I tried passing it in to the RewardConfig but it's not a recognized parameter. I was wondering if the following functionality could be added:

Motivation

When training a large number of reward models and not actively debugging their training, I do not want or need verbose printing of a rich table.

Your contribution

Not currently, but I will update with a PR if I get a chance.

lewtun commented 1 month ago

Thanks for raising this issue @rmovva - I agree it would be good to disable this and keep the training logs lean. I think a better approach would be the following:

I'm not sure if the callback could be entirely general (i.e. easy to switch between reward modelling or PPO/RLOO), but if it can, then all the better!

saum7800 commented 3 weeks ago

just ran into the same issue myself. I think that makes sense @lewtun . I should be able to make a PR for this over the weekend. Just putting this here incase you know if someone is already working on this, thanks!