Skip to main content
QUICK REVIEW

[论文解读] Explaining black box text modules in natural language with language models

Chandan Singh, Aliyah R. Hsu|arXiv (Cornell University)|May 17, 2023
Machine Learning in Materials Science被引用 6
一句话总结

本文提出SASC,一种通过两阶段流程自动为黑箱文本模块(将文本映射到标量值的函数)生成自然语言解释的方法:(1) 使用预训练语言模型总结高激活n-gram;(2) 通过生成合成文本并测试模块响应来评分解释。SASC在合成设置中成功恢复了真实解释,在BERT神经元解释中具有语义意义,并为fMRI体素生成了语义上合理的解释,揭示了大脑区域中不同的选择性模式。

ABSTRACT

Large language models (LLMs) have demonstrated remarkable prediction performance for a growing array of tasks. However, their rapid proliferation and increasing opaqueness have created a growing need for interpretability. Here, we ask whether we can automatically obtain natural language explanations for black box text modules. A "text module" is any function that maps text to a scalar continuous value, such as a submodule within an LLM or a fitted model of a brain region. "Black box" indicates that we only have access to the module's inputs/outputs. We introduce Summarize and Score (SASC), a method that takes in a text module and returns a natural language explanation of the module's selectivity along with a score for how reliable the explanation is. We study SASC in 3 contexts. First, we evaluate SASC on synthetic modules and find that it often recovers ground truth explanations. Second, we use SASC to explain modules found within a pre-trained BERT model, enabling inspection of the model's internals. Finally, we show that SASC can generate explanations for the response of individual fMRI voxels to language stimuli, with potential applications to fine-grained brain mapping. All code for using SASC and reproducing results is made available on Github.

研究动机与目标

  • 为解决大型语言模型(LLMs)及其他黑箱文本模块中的可解释性危机,这些模型的内部机制仍不透明。
  • 开发一种自动化、黑箱方法,无需访问模型内部结构或人工标注,即可生成人类可读的自然语言解释。
  • 在多种领域评估该方法:合成模块、BERT模型内部结构、以及基于fMRI的大脑编码模型。
  • 证明解释在语义上具有意义且与实际模块行为一致,特别是在神经科学应用中。
  • 为医学和认知科学等高风险领域提供可扩展、开源的可解释性工具。

提出的方法

  • SASC采用两阶段流程:首先,从语料库中识别出激活最高的n-gram,并使用预训练语言模型将其总结为候选解释。
  • 其次,通过基于解释生成合成文本,并测量目标模块对这些文本的响应,来评估每个候选解释,从而分配可靠性分数。
  • 该方法使用辅助大语言模型进行总结和文本生成,通过将解释生成与评估解耦,以减少幻觉现象。
  • 对BERT应用字典学习以提取可解释的组件,随后使用SASC解释单个神经元或子模块。
  • 对于fMRI,SASC通过将每个体素的响应视为一个文本模块来解释其响应,使用叙事文本或WikiText作为n-gram语料库。
  • 通过响应一致性对解释可靠性进行评分:分数越高,表示该解释能更可靠地预测模块的强激活。
Figure 1: SASC pipeline for obtaining a natural language explanation given a module f . (i) SASC first generates candidate explanations (using a pre-trained LLM) based on the ngrams that elicit the most positive response from $f$ . (ii) SASC then evaluates each candidate explanation by generating sy
Figure 1: SASC pipeline for obtaining a natural language explanation given a module f . (i) SASC first generates candidate explanations (using a pre-trained LLM) based on the ngrams that elicit the most positive response from $f$ . (ii) SASC then evaluates each candidate explanation by generating sy

实验结果

研究问题

  • RQ1SASC能否在不访问内部模型参数的情况下,自动为黑箱文本模块生成准确、自然语言的解释?
  • RQ2在具有已知底层模式的合成模块中,SASC对真实解释的恢复效果如何?
  • RQ3SASC能否为BERT神经元生成与人工标注解释质量相当的解释?这些解释是否与下游任务的语义一致?
  • RQ4fMRI体素的解释是否反映了有意义的语义选择性?与BERT模块的解释有何不同?
  • RQ5即使n-gram重叠极少,SASC生成的解释能否预测实际的fMRI响应?

主要发现

  • 在合成模块中,SASC在多种实验条件下均以高精度恢复了真实解释,表现出极强的保真度。
  • 对于BERT模块,SASC生成的解释质量与人工标注解释相当,其中许多捕捉到了情感、命名实体等任务相关语义。
  • BERT模块对多样化现象表现出选择性,从单个词语到抽象语义概念,与已知的语言角色一致。
  • fMRI体素解释显著更聚焦于社会概念(如人际关系、家庭),表明大脑中存在与BERT模块不同的功能组织。
  • fMRI体素的解释分数显著高于零,表明解释质量可靠。
  • 仅使用基于距离的预测方法,利用解释文本与实际fMRI响应之间的Spearman相关系数达到0.033 ± 0.002,显著高于零(p < 0.001),表明解释与真实脑活动存在语义上的根基。
Figure 2: Cumulative accuracy at recovering the ground truth explanation increases as a function of explanation score. Error bars show standard error of the mean.
Figure 2: Cumulative accuracy at recovering the ground truth explanation increases as a function of explanation score. Error bars show standard error of the mean.

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。