Understanding how Large Language Models (LLMs) process information from prompts remains a significant challenge. To shed light on this "black box," attention visualization techniques have been developed to capture neuron-level perceptions and interpret how models focus on different parts of input data. However, many existing techniques are tailored to specific model architectures, particularly within the Transformer family, and often require backpropagation, resulting in nearly double the GPU memory usage and increased computational cost. A lightweight, model-agnostic approach for attention visualization remains lacking. In this paper, we introduce a model-agnostic token importance visualization technique to better understand how generative AI systems perceive and prioritize information from input text, without incurring additional computational cost. Our method leverages perturbation-based strategies combined with a three-matrix analytical framework to generate relevance maps that illustrate token-level contributions to model predictions. The framework comprises: (1) the Angular Deviation Matrix, which captures shifts in semantic direction; (2) the Magnitude Deviation Matrix, which measures changes in semantic intensity; and (3) the Dimensional Importance Matrix, which evaluates contributions across individual vector dimensions. By systematically removing each token and measuring the resulting impact across these three complementary dimensions, we derive a composite importance score that provides a nuanced and mathematically grounded measure of token significance. To support reproducibility and foster wider adoption, we provide open-source implementations of all proposed and utilized explainability techniques, with code and resources publicly available at https://github.com/Infosys/Infosys-Responsible-AI-Toolkit


翻译:理解大型语言模型(LLMs)如何从提示中处理信息仍是一个重大挑战。为探究这一“黑箱”,注意力可视化技术已被开发用于捕捉神经元层面的感知,并解释模型如何聚焦于输入数据的不同部分。然而,许多现有技术针对特定模型架构(尤其是Transformer家族)量身定制,且往往依赖反向传播,导致GPU内存占用近乎翻倍并增加计算开销。当前仍缺乏一种轻量级、模型无关的注意力可视化方法。本文提出一种模型无关的令牌重要性可视化技术,以更好理解生成式AI系统如何感知和优先处理输入文本中的信息,且无需额外计算成本。该方法结合基于扰动的策略与三矩阵分析框架,生成展示令牌级对模型预测贡献的相关性图。该框架包含:(1)角偏差矩阵——捕获语义方向变化;(2)幅度偏差矩阵——量化语义强度变化;(3)维度重要性矩阵——评估各向量维度的贡献。通过系统性地移除每个令牌并测量其对这三个互补维度的影响,我们推导出复合重要性分数,从而提供精细化且数学严谨的令牌显著性度量。为支持可复现性并促进广泛应用,我们开源了所有提出及使用的可解释性技术实现,代码与资源公开于https://github.com/Infosys/Infosys-Responsible-AI-Toolkit。

0
下载
关闭预览

相关内容

PEFT A2Z:大型语言与视觉模型的参数高效微调综述
专知会员服务
22+阅读 · 2025年4月22日
大型语言模型的高效提示方法综述
专知会员服务
75+阅读 · 2024年4月2日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
Attention!注意力机制模型最新综述
专知
65+阅读 · 2019年4月8日
PlaNet 简介:用于强化学习的深度规划网络
谷歌开发者
13+阅读 · 2019年3月16日
从Seq2seq到Attention模型到Self Attention(一)
量化投资与机器学习
76+阅读 · 2018年10月8日
深度学习中的注意力机制
人工智能头条
16+阅读 · 2017年11月2日
国家自然科学基金
3+阅读 · 2017年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
25+阅读 · 2014年12月31日
国家自然科学基金
7+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 3月24日
VIP会员
最新内容
对抗环境下超视距目标打击的情报支援
专知会员服务
8+阅读 · 7月22日
《无人机对海面作战影响评估》
专知会员服务
15+阅读 · 7月21日
印度精确打击与指挥架构的断层
专知会员服务
7+阅读 · 7月20日
美空军AI完成F-16战斗机自主空战历史性试飞
专知会员服务
8+阅读 · 7月20日
相关基金
国家自然科学基金
3+阅读 · 2017年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
25+阅读 · 2014年12月31日
国家自然科学基金
7+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员