Update min_lr and max_lr default values to better defaults#45168
Update min_lr and max_lr default values to better defaults#45168w601sxs wants to merge 1 commit intohuggingface:mainfrom
Conversation
Based on our experimentation min and max lr for LLMs need to be set properly as defaults. Please refer to paper. For the broader community 1e-7 to 1e-4 are decent defaults
|
Agree that 1.0 seems like a very large LR! 1e-4 seems low for a max, though, can you give us the paper reference for GreedyLR's preferred range? |
Thanks @Rocketknight1 - I am the first author of the paper. It depends on the kind of experiment and other settings (https://arxiv.org/pdf/2512.14527#page=13.19) . For smaller models and certain conditions we can go higher. For pretraining experiments in the paper we set the initial LR to 2e-4, with min_LR bound set to 10% of the initial LR (2e-5). In general across all types of models, we think the range from 1e-7 to 1e-4 by default gives good results. Also sharing some recent models and their LRs to justify the range (although they did not use greedyLR - either fixed LR, manually updated LR, used linear or cosine decay in the range):
1e-4 to 1e-7 should work generally, and users can update the min/max if required. Hope this helps! |
|
Let us know what you think @Rocketknight1 ^ |
Rocketknight1
left a comment
There was a problem hiding this comment.
Trusting you on the values, in that case, and happy to accept this PR!
|
@w601sxs it seems like the style checkers are complaining, can you try |
Based on our experimentation min and max lr for LLMs need to be set properly as defaults. Please refer to paper. For the broader community 1e-7 to 1e-4 are decent defaults
What does this PR do?
Fixes # (issue) Very high max lr and not low enough min lr defaults
Code Agent Policy
The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result,
we ask that new users do not submit pure code agent PRs at this time.
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.
PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously.
This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result,
this policy is likely to be updated regularly in the near future. For more information, please read
CONTRIBUTING.md.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
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.