跳到内容

指标

困惑度 (Perplexity)

Perplexity

衡量语言模型对下一个 token 有多「意外」的指标,数值越低越好;本质是平均 negative log-likelihood 的指数。

登入以收藏
Perplexity(困惑度)衡量语言模型预测一段保留文本的能力。如果模型预期下一个真实 token 的概率高,perplexity 就低;如果模型很意外,perplexity 就高。数学上是 token 平均 negative log-likelihood 的指数。越低越好。 它重要的原因是:perplexity 是 pre-training 和 ablation 阶段最便宜、最可重现的语言模型质量信号。不需要人类、不需要 prompt、不需要任务 eval——只要一份保留语料和一次 forward pass。研究人员会用 perplexity 比较架构、超参数、tokenizer,再决定要不要跑昂贵的下游评估。 举个例子:训练 Llama 3 时,你可以在每个 checkpoint 用一份 Wikipedia 保留数据画 perplexity 曲线。随着模型学习,perplexity 从 ~1000(随机)掉到个位数。当 perplexity 停止下降,等于收敛了或要加更多数据。 注意:perplexity 只能在共用同一 tokenizer 的模型间比较。中文 tokenizer 跟英文 tokenizer 的模型不能直接比 perplexity。而且 perplexity 低不代表下游任务一定好——有些能力(推理、follow 指令)的出现方式 perplexity 抓不到。也要跟 Perplexity 那家搜索引擎公司分开。延伸阅读:cross-entropy loss、evaluation、MMLU、scaling laws。

最后更新: 2026-04-29

We use cookies

Anonymous analytics help us improve the site. You can opt out anytime. Learn more