为大模型函数调用提供置信度评估,防止错误操作
Uncertainty Quantification for LLM Function-Calling

- 用多样本与单样本方法量化大模型调用函数的不确定性
- 多样本方法在函数调用场景中不如单样本方法稳定
- 通过语法树聚类和语义词元筛选提升置信度评估效果
大语言模型(LLM)正被广泛用于自主完成现实任务,其中函数调用(Function-Calling, FC)是赋予模型工具使用能力的关键范式。然而,若模型错误调用函数,可能带来严重后果,如资金转账或数据删除。因此,在执行前评估模型对函数调用正确性的置信度至关重要。本文首次系统评估了适用于FC场景的不确定性量化(UQ)方法。尽管多样本方法(如语义熵)在自然语言问答任务中表现优异,但在FC场景中其优势并不明显,甚至不如简单的单样本方法。此外,我们发现可通过利用函数调用输出的特性来提升现有UQ方法性能:多样本方法可通过抽象语法树(AST)解析结果进行输出聚类;单样本方法则可仅基于语义有意义的词元计算对数概率不确定性得分。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are increasingly deployed to autonomously solve real-world tasks. A key ingredient for this is the LLM Function-Calling paradigm, a widely used approach for equipping LLMs with tool-use capabilities. However, an LLM calling functions incorrectly can have severe implications, especially when their effects are irreversible, e.g., transferring money or deleting data. Hence, it is of paramount importance to consider the LLM's confidence that a function call solves the task correctly prior to executing it. Uncertainty Quantification (UQ) methods can be used to quantify this confidence and prevent potentially incorrect function calls. In this work, we present what is, to our knowledge, the first evaluation of UQ methods for LLM Function-Calling (FC). While multi-sample UQ methods, such as Semantic Entropy, show strong performance for natural language Q&A tasks, we find that in the FC setting, it offers no clear advantage over simple single-sample UQ methods. Additionally, we find that the particularities of FC outputs can be leveraged to improve the performance of existing UQ methods in this setting. Specifically, multi-sample UQ methods benefit from clustering FC outputs based on their abstract syntax tree parsing, while single-sample UQ methods can be improved by selecting only semantically meaningful tokens when calculating logit-based uncertainty scores.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。