均值交叉熵会误导模型评估,中位数更准。
When Mean CE Fails: Median CE Can Better Track Language Model Quality

- 用中位数交叉熵替代均值,更真实反映模型性能
- 实验显示中位数能更好追踪事实记忆与生成质量
- 适合关注模型真实表现而非单纯指标的开发者
均值交叉熵是语言模型的标准验证指标,但在训练过程中可能无法准确追踪模型质量。我们在两个常见场景中验证:一是在 Qwen2.5-1.5B 的合成事实学习微调中,均值 CE 在初始学习阶段后显著上升,而保留事实召回率却接近峰值;二是在 TinyStories 的 top-K 蒸馏中,减小 K 值使中位数 CE 下降但均值 CE 上升;顶5学生模型获得最高 LLM-judge 分数,并在中位数 CE 上超越教师模型,尽管其均值 CE 最差。两种情况下,中位数 CE 与任务表现的相关性远高于均值。分析发现,训练重塑了每标记交叉熵分布:小 K 蒸馏使分布两端质量更高,降低中位数、抬高均值;而 Qwen 微调中,批量迅速饱和,尾部在后期持续拉长。任务评估指标对批量更敏感,对尾部不敏感。建议报告少量分位数交叉熵,通过一致性判断分布变化,并低成本诊断均值与中位数冲突时的模型选择问题。
原文摘要 · Abstract (English)
Mean cross-entropy is the standard validation metric for language models, but it can fail to track model quality during training. We examine this in two common scenarios. First, in Qwen2.5-1.5B SFT on synthetic fact-learning, we find that mean CE rises substantially after the initial learning phase while held-out fact-recall accuracy remains near its peak. Second, we find that in top-K distillation on TinyStories, decreasing K improves median CE while worsening mean CE; the Top-5 student attains the highest LLM-judge score and crosses below its teacher on median CE, despite having the worst mean CE. In both cases, median CE correlates much more closely with task performance than does mean CE. Analyzing how bulk and tail percentile CE move during training reveals that training reshapes the empirical per-token CE distribution. In top-K distillation, smaller K yields a distribution with more mass at both extremes, decreasing the median and increasing the mean. In Qwen SFT, the bulk saturates quickly while the tail extends in the latter half of training. In both, the task-evaluation metric appears more sensitive to the bulk than to the tail. Practically, we recommend reporting a small set of percentile CE summaries alongside the mean, and using concordance among them as a tool to keep track of distribution reshaping, as well as a low-cost diagnostic for when mean and median CE disagree on model selection.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。