[论文解读] Knowledge-Infused Self Attention Transformers
本文提出了一种系统化、模块化的框架,用于将知识图谱中的外部知识注入到变换器模型的不同组件中——具体而言,是输入嵌入(潜在表征)和自注意力矩阵(归纳偏置)。该方法将知识注入分为浅层、半深层和深层三类,其中深层注入——即在所有层中同时将知识应用于表征和归纳偏置——在使用传统和新型评估指标的GLUE基准测试中表现出更优性能。
Transformer-based language models have achieved impressive success in various natural language processing tasks due to their ability to capture complex dependencies and contextual information using self-attention mechanisms. However, they are not without limitations. These limitations include hallucinations, where they produce incorrect outputs with high confidence, and alignment issues, where they generate unhelpful and unsafe outputs for human users. These limitations stem from the absence of implicit and missing context in the data alone. To address this, researchers have explored augmenting these models with external knowledge from knowledge graphs to provide the necessary additional context. However, the ad-hoc nature of existing methods makes it difficult to properly analyze the effects of knowledge infusion on the many moving parts or components of a transformer. This paper introduces a systematic method for infusing knowledge into different components of a transformer-based model. A modular framework is proposed to identify specific components within the transformer architecture, such as the self-attention mechanism, encoder layers, or the input embedding layer, where knowledge infusion can be applied. Additionally, extensive experiments are conducted on the General Language Understanding Evaluation (GLUE) benchmark tasks, and the findings are reported. This systematic approach aims to facilitate more principled approaches to incorporating knowledge into language model architectures.
研究动机与目标
- 通过整合外部知识来补偿训练数据中缺失或隐含的上下文,以解决大语言模型中的幻觉和对齐问题。
- 克服现有知识注入方法的临时性问题,这些方法缺乏对变换器架构中组件层面影响的系统性分析。
- 开发一种模块化、系统化的知识注入方法,明确区分变换器模块中的归纳偏置(如注意力矩阵)和潜在表征(如嵌入)。
- 使用标准指标(准确率、F1)和新型指标(DE@K、链接预测)对知识注入进行评估,以衡量数据效率和事实一致性。
- 为系统性、组件感知的知识增强语言建模奠定基础,未来可拓展至混合式和选择性注入策略。
提出的方法
- 将变换器组件分类为两类:归纳偏置(如自注意力矩阵)和潜在表征(如输入和中间层嵌入)。
- 提出三种知识注入策略:(i) 浅层(在首个模块的潜在表征中注入知识),(ii) 半深层(在首个模块的注意力矩阵中注入知识),以及 (iii) 深层(在所有模块的表征和注意力矩阵中交错注入知识)。
- 利用知识图谱(ConceptNet 和 WordNet)获取节点嵌入,并将每个输入标记的图嵌入进行求和,形成每个标记的统一图表示。
- 通过可学习的投影层,将图嵌入注入变换器的输入嵌入和注意力矩阵中。
- 在五种预训练模型(BERT、RoBERTa、ELECTRA、XLNet 和 Longformer)上应用注入技术,使用其大尺寸变体进行评估。
- 引入新型评估指标:DE@K(数据效率)和链接预测准确率(事实一致性),分别用于衡量在减少训练数据下的性能表现以及嵌入的事实对齐程度。

实验结果
研究问题
- RQ1系统性地将知识注入变换器的不同组件(潜在表征 vs. 归纳偏置)如何影响自然语言处理任务的下游性能?
- RQ2在减少训练数据(如50%)的情况下,知识注入在多大程度上提升了数据效率?
- RQ3新型评估指标(如链接预测准确率和DE@K)是否能比标准准确率和F1分数更可靠地评估知识注入的效果?
- RQ4哪种知识注入策略(浅层、半深层或深层)在多种变换器架构和GLUE基准任务中均能带来最一致且稳健的性能提升?
- RQ5知识注入是否通过增强事实一致性和上下文理解能力,降低了模型对统计伪影或偶然模式的依赖?
主要发现
- 深层知识注入(即在所有变换器模块中同时将知识应用于潜在表征和归纳偏置)在所有GLUE任务中均取得最高性能。
- 仅使用50%的训练数据时,深层注入模型在GLUE任务上的平均准确率达到81–83,表明其具有强大的数据效率。
- DE@50指标显示,即使在数据有限的情况下,深层注入仍能保持高性能,证明了通过知识集成提升了数据充分性。
- 通过余弦相似度计算的ConceptNet和WordNet嵌入求和后进行链接预测的准确率,显示出知识注入后的一致性提升,验证了事实一致性的增强。
- XLNet在所有设置中均表现最佳,但深层注入为其带来了最显著的相对性能增益,尤其在具有挑战性的任务上。
- 新型评估指标(DE@K 和链接预测)揭示了知识注入有效性的显著提升,这些改进在仅使用标准指标时未能完全体现。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。