arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.19208cs.CL
收藏

LitCab:面向短文本与长文本响应的轻量级语言模型校准

LitCab: Lightweight Language Model Calibration over Short- and Long-form Responses

University of Michigan(密歇根大学);Computer Science and Engineering(计算机科学与工程学院)

Xin Liu, Muhammad Khalifa, Lu Wang

AI总结:

LitCab通过单一线性层预测偏置项并添加到输出logits,仅增加不到2%参数即可显著提升语言模型校准,在CaT基准上平均ECE降低30%。

摘要:

当模型的概率估计与输出正确的实际可能性一致时,该模型被认为是校准良好的。校准语言模型(LMs)至关重要,因为它在检测和缓解语言模型的幻觉以及构建更可信的模型方面发挥着重要作用。然而,标准的校准技术可能并不适合语言模型校准。例如,温度缩放等后处理方法不会对候选生成进行重新排序。另一方面,基于训练的方法需要对整个模型进行微调,这对于大规模语言模型来说是不切实际的。我们提出了LitCab,一种轻量级校准机制,由一个单一的线性层组成,该层接收输入文本表示并预测一个偏置项,然后将该偏置项添加到语言模型输出的logits中。LitCab仅通过增加不到原始模型参数的2%来改善模型校准。为了进行评估,我们构建了CaT,一个包含八个文本生成任务的基准,涵盖从短短语到段落的响应。我们使用Llama2-7B测试了LitCab,它在所有任务上都改善了校准,平均ECE分数降低了多达30%。我们进一步使用GPT和LLaMA家族的多个流行的开源语言模型进行了全面评估,得出以下关键发现:(i)同一家族中较大的模型在短生成任务上表现出更好的校准,但在较长任务上不一定如此。(ii)GPT家族模型尽管参数少得多,但相比LLaMA、Llama2和Vicuna模型表现出更优越的校准。(iii)使用有限目的(如对话)的样本对预训练模型(如LLaMA)进行微调可能导致更差的校准,这凸显了微调设置对语言模型校准的重要性。

英文摘要:

A model is considered well-calibrated when its probability estimate aligns with the actual likelihood of the output being correct. Calibrating language models (LMs) is crucial, as it plays a vital role in detecting and mitigating hallucinations of LMs as well as building more trustworthy models. However, standard calibration techniques may not be suited for LM calibration. For instance, post-processing methods such as temperature scaling do not reorder the candidate generations. On the other hand, training-based methods require fine-tuning the entire model, which is impractical for LMs of large scale. We present LitCab, a lightweight calibration mechanism consisting of a single linear layer that takes the input text representation and predicts a bias term, which is then added to the LM output logits. LitCab improves model calibration by only adding < 2% of the original model parameters. For evaluation, we construct CaT, a benchmark consisting of eight text generation tasks, covering responses ranging from short phrases to paragraphs. We test LitCab with Llama2-7B, where it improves calibration across all tasks, reducing the average ECE score by as large as 30%. We further conduct a comprehensive evaluation with multiple popular open-sourced LMs from GPT and LLaMA families, yielding the following key findings: (i) Larger models within the same family exhibit better calibration on tasks with short generation tasks, but not necessarily for longer ones. (ii) GPT-family models show superior calibration compared to LLaMA, Llama2, and Vicuna models, despite having much fewer parameters. (iii) Fine-tuning pretrained model (e.g., LLaMA) with samples of limited purpose (e.g., conversations) may lead to worse calibration, highlighting the importance of fine-tuning setups for calibrating LMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑