arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.11573cs.CLcs.LG
收藏

对黑盒语言模型的令牌重要性可视化

Visualizing token importance for black-box language models

University of Cambridge(剑桥大学)

Paulius Rauba, Qiyao Wei, Mihaela van der Schaar

AI总结:

本文提出DBSA方法,用于可视化黑盒语言模型中各输入令牌的重要性,以评估模型输出对输入的依赖性。

摘要:

我们考虑了对黑盒大型语言模型(LLMs)进行审计的问题,以确保在生产环境中部署时能够可靠地行为,特别是在法律、医疗和监管合规等高风险领域。现有的LLM审计方法往往只关注模型行为的孤立方面,如检测特定的偏见或评估公平性。我们感兴趣于一个更一般的问题--能否了解黑盒LLM的输出如何依赖于每个输入令牌?在现实应用中,依赖于不可访问的API端点的语言模型需要此类工具。然而,这是一个高度非平凡的问题,因为LLM是随机函数(即,由于偶然原因,两个输出会不同),而计算提示级别梯度来近似输入敏感性是不可行的。为了解决这个问题,我们提出了基于分布的敏感性分析(DBSA),这是一种轻量级的模型无关程序,用于评估语言模型输出对每个输入令牌的敏感性,而无需对LLM做出任何分布假设。DBSA被开发为一种实用工具,使从业者能够快速、即插即用地探索LLM对特定输入令牌的依赖性。通过示例说明,我们展示了DBSA如何使用户能够检查LLM输入并发现可能被现有LLM可解释性方法忽略的敏感性。

英文摘要:

We consider the problem of auditing black-box large language models (LLMs) to ensure they behave reliably when deployed in production settings, particularly in high-stakes domains such as legal, medical, and regulatory compliance. Existing approaches for LLM auditing often focus on isolated aspects of model behavior, such as detecting specific biases or evaluating fairness. We are interested in a more general question -- can we understand how the outputs of black-box LLMs depend on each input token? There is a critical need to have such tools in real-world applications that rely on inaccessible API endpoints to language models. However, this is a highly non-trivial problem, as LLMs are stochastic functions (i.e. two outputs will be different by chance), while computing prompt-level gradients to approximate input sensitivity is infeasible. To address this, we propose Distribution-Based Sensitivity Analysis (DBSA), a lightweight model-agnostic procedure to evaluate the sensitivity of the output of a language model for each input token, without making any distributional assumptions about the LLM. DBSA is developed as a practical tool for practitioners, enabling quick, plug-and-play visual exploration of LLMs reliance on specific input tokens. Through illustrative examples, we demonstrate how DBSA can enable users to inspect LLM inputs and find sensitivities that may be overlooked by existing LLM interpretability methods.

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

↑