模型检查点 · 保存的是当时状态,不是永久冠军Model Checkpoint · A Saved State Is Not a Permanent Winner
training state → saved snapshot → independent evaluation →
selected release
模型检查点(Model
Checkpoint)是在训练途中保存参数及相关状态、供恢复或评估的版本快照。它连接训练过程、版本选择与可复现交付。A model checkpoint is a saved snapshot of parameters and related
training state used for recovery or evaluation. It connects training
progress, version selection, and reproducible delivery.
01 · 先从日常问题开始01 · Start with an everyday question
手机自动保存了五个版本,你会因为最后一个时间最新,就认定它一定最好吗?Your phone saved five versions. Does the newest timestamp
automatically make the last one best?
▣
02拖选检查点,对照验证损失和样例输出Select a Checkpoint and Compare Validation Loss and Output
拖动检查点时间轴drag checkpoint timeline
验证损失Validation loss
—
lower is better
样例正确率Sample accuracy
—
fixed toy set
恢复成本Resume cost
—
toy minutes
03一个检查点至少保存四类状态A Checkpoint Saves at Least Four Kinds of State
把刚才的变化拆开Map the change to parts
01 · PARAM
参数Parameters
保存当时模型数值,使该版本可被准确恢复。Store model values so that exact version can be restored.
02 · OPT
优化状态Optimizer state
若要继续训练,还需保存更新器进度等相关状态。Continuing training also requires optimizer progress and related
state.
03 · STEP
训练位置Training position
记录处理到哪个批次,防止恢复后重复或跳过数据。Record batch position to avoid repeating or skipping data after
resume.
04 · EVAL
独立评估Independent evaluation
最佳检查点由固定验证证据选择,不由时间戳决定。Select the best checkpoint with fixed validation evidence, not
timestamp.
04最小选择规则:在固定验证集上取低损失Minimal Selection Rule: Choose Lower Fixed-Set Loss
k* = arg min Lval(k)
k* = arg mink Lval(k)
五个玩具损失固定为
0.62、0.44、0.31、0.35、0.43,因此第 3
个优于最新的第 5 个。Toy losses are fixed at 0.62, 0.44, 0.31, 0.35, and 0.43, so
checkpoint 3 beats the latest checkpoint 5.
途中保存状态Save during training版本可恢复version becomes recoverable
固定集评估Evaluate on fixed set比较同一量尺use the same yardstick
标记最佳版本Mark the best version最佳不等于最新best is not latest
05边界实验:只选最新检查点Boundary Test: Select the Latest Checkpoint Only
主动制造失败Create a failure
第 5 个版本更新,却已从最佳点回退Checkpoint 5 is newer but has regressed from the best
一键选择最新版本。验证损失从最佳 0.31 回升到
0.43,固定样例正确率也下降。Select the latest snapshot. Validation loss rises from the best
0.31 to 0.43 and fixed-sample accuracy drops.
尚未执行。先在上方改变主变量。Not run yet. Change the main variable above first.
✗ 最新检查点一定最好。The latest checkpoint is always best.
→ ✓ 用固定验证证据选择,而不是看时间戳。Select with fixed validation evidence, not
timestamp.
✗ 只存模型文件就一定能续训。A model file alone always resumes training.
→ ✓ 续训还需要优化状态和训练位置。Resuming also needs optimizer state and training
position.
✗ 检查点分数可跨不同测试条件直接比。Checkpoint scores compare across different test
conditions.
→ ✓ 比较必须使用同一数据与量尺。Comparisons require the same data and yardstick.
06 · 一句话带走06 · One line to keep
模型检查点保存训练途中的参数与相关状态,供恢复和评估;发布应选固定验证证据最好的版本,而不是机械选择最新版本。A checkpoint saves parameters and related training state for
recovery and evaluation. Release the version with the best
fixed-set evidence, not automatically the newest.