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

预训练Transformer中自注意力的因果解释

Causal Interpretation of Self-Attention in Pre-Trained Transformers

Intel Labs(英特尔实验室)

Raanan Y. Rohekar, Yaniv Gurwicz, Shami Nisimov

AI总结:

本文将Transformer自注意力解释为估计输入token间结构方程模型的机制,并利用最深注意力层表示的偏相关进行零样本因果发现,在情感分类和推荐任务上验证了该方法。

摘要:

我们提出对Transformer神经网络架构中自注意力的一种因果解释。我们将自注意力解释为一种机制,该机制针对给定的输入符号(token)序列估计一个结构方程模型。该结构方程模型反过来可以被解释为在输入序列的特定上下文下,输入符号之上的因果结构。重要的是,这种解释在存在潜在混杂因素的情况下仍然有效。基于这一解释,我们通过计算输入符号在最深注意力层中对应表示之间的偏相关系数,来估计输入符号之间的条件独立关系。这使得能够利用现有的基于约束的算法来学习输入序列上的因果结构。从这个意义上说,现有的预训练Transformer可以被用于零样本因果发现。我们通过为Transformer在两个任务中的输出提供因果解释来演示该方法:情感分类(NLP)和推荐。

英文摘要:

We propose a causal interpretation of self-attention in the Transformer neural network architecture. We interpret self-attention as a mechanism that estimates a structural equation model for a given input sequence of symbols (tokens). The structural equation model can be interpreted, in turn, as a causal structure over the input symbols under the specific context of the input sequence. Importantly, this interpretation remains valid in the presence of latent confounders. Following this interpretation, we estimate conditional independence relations between input symbols by calculating partial correlations between their corresponding representations in the deepest attention layer. This enables learning the causal structure over an input sequence using existing constraint-based algorithms. In this sense, existing pre-trained Transformers can be utilized for zero-shot causal-discovery. We demonstrate this method by providing causal explanations for the outcomes of Transformers in two tasks: sentiment classification (NLP) and recommendation.

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

↑