训练超参。
TrainingConfig
01 Syntax
02 Properties
| Name | Overloads | Summary |
|---|---|---|
| LearningRate | 1 | 峰值学习率。 |
| MinLearningRate | 1 | cosine 衰减的下界。 |
| WarmupSteps | 1 | 学习率线性 warmup 的步数。 |
| TotalSteps | 1 | 计划的总步数(用于 cosine 衰减)。 |
| MaxGradNorm | 1 | 全局梯度范数上限;<= 0 表示不裁剪。 |
| UseCosineDecay | 1 | 是否启用 cosine 衰减(关闭则 warmup 之后保持恒定学习率)。 |
| MaxTrustedGradientNorm | 1 | Upper bound for the trusted gradient norm; when it is exceeded the step is considered out of control and the parameter update is skipped. |
03 Members
峰值学习率。
cosine 衰减的下界。
学习率线性 warmup 的步数。
计划的总步数(用于 cosine 衰减)。
全局梯度范数上限;<= 0 表示不裁剪。
是否启用 cosine 衰减(关闭则 warmup 之后保持恒定学习率)。
Upper bound for the trusted gradient norm; when it is exceeded the step is considered out of control and the parameter update is skipped.
This is a safety net rather than the normal path. In practice a 200 million parameter model produced a global gradient norm spike of 7.8e36 during tool call SFT, and the gradient became NaN on the following step. The forward pass was still finite (the loss of that step was normal), only the gradient was broken, so dropping the update of that step lets training continue, whereas forcing the update would push the parameters to NaN in one step.
The threshold is intentionally loose (1e6 by default) so that only clearly broken steps are intercepted and normal large gradients are left untouched. The number of skipped steps is recorded in LMTrainer.SkippedSteps instead of being silently swallowed.