An emerging solution for explaining Transformer-based models is to use vector-based analysis on how the representations are formed. However, providing a faithful vector-based explanation for a multi-layer model could be challenging in three aspects: (1) Incorporating all components into the analysis, (2) Aggregating the layer dynamics to determine the information flow and mixture throughout the entire model, and (3) Identifying the connection between the vector-based analysis and the model's predictions. In this paper, we present DecompX to tackle these challenges. DecompX is based on the construction of decomposed token representations and their successive propagation throughout the model without mixing them in between layers. Additionally, our proposal provides multiple advantages over existing solutions for its inclusion of all encoder components (especially nonlinear feed-forward networks) and the classification head. The former allows acquiring precise vectors while the latter transforms the decomposition into meaningful prediction-based values, eliminating the need for norm- or summation-based vector aggregation. According to the standard faithfulness evaluations, DecompX consistently outperforms existing gradient-based and vector-based approaches on various datasets. Our code is available at https://github.com/mohsenfayyaz/DecompX.
翻译:解释基于Transformer的模型的新兴方法是使用基于向量的分析来理解表示的形成过程。然而,为多层模型提供忠实的基于向量的解释在三个方面具有挑战性:(1)将所有组件纳入分析;(2)聚合层间动态以确定整个模型中的信息流与混合;(3)建立基于向量的分析与模型预测之间的关联。本文提出DecompX以应对这些挑战。DecompX基于分解的令牌表示及其在整个模型中的连续传播构建,在层间不混合这些表示。此外,我们的方案相比现有方法具有多重优势,因其涵盖了所有编码器组件(尤其是非线性前馈网络)和分类头。前者可获取精确向量,后者则将分解转换为有意义的基于预测的值,从而消除了需要基于范数或基于求和的向量聚合。根据标准忠实性评估,DecompX在各种数据集上持续优于现有的基于梯度和基于向量的方法。我们的代码已开源至 https://github.com/mohsenfayyaz/DecompX。