Language models generate text based on successively sampling the next word. A decoding procedure based on nucleus (top-$p$) sampling chooses from the smallest possible set of words whose cumulative probability exceeds the probability $p$. In this work, we assess whether a top-$p$ set is indeed aligned with its probabilistic meaning in various linguistic contexts. We employ conformal prediction, a calibration procedure that focuses on the construction of minimal prediction sets according to a desired confidence level, to calibrate the parameter $p$ as a function of the entropy of the next word distribution. We find that OPT models are overconfident, and that calibration shows a moderate inverse scaling with model size.
翻译:语言模型基于连续采样下一个词来生成文本。基于核函数(top-$p$)采样的解码过程从累积概率超过阈值$p$的最小可能词集中进行选择。本研究评估了在不同语言上下文中,top-$p$词集是否确实与其概率含义一致。我们采用共形预测(一种校准方法,专注于根据所需置信水平构建最小预测集)来根据下一个词分布的熵校准参数$p$。我们发现OPT模型过于自信,且校准效果与模型大小呈适度的逆缩放关系。