Unveiling LLMs: The Evolution of Latent Representations in a Dynamic Knowledge Graph

📄 arXiv: 2404.03623v2 📥 PDF

作者: Marco Bronzini, Carlo Nicolini, Bruno Lepri, Jacopo Staiano, Andrea Passerini

分类: cs.CL, cs.AI, cs.CY

发布日期: 2024-04-04 (更新: 2024-08-06)

备注: Accepted at COLM 2024


💡 一句话要点

提出一种框架以解码LLM中的事实知识用于句子级声明验证

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 事实知识解码 句子级声明验证 动态知识图 可解释性分析

📋 核心要点

  1. 现有方法在理解大型语言模型内部推理和知识利用机制方面存在不足,缺乏对其内部表示的深入分析。
  2. 本研究提出了一种端到端框架,通过激活补丁技术解码LLM中的事实知识,展示其在动态知识图中的演变过程。
  3. 实验结果表明,局部分析揭示了实体中心性和多跳推理的影响,而全局分析显示了知识从词汇演变为声明相关事实的趋势。

📝 摘要(中文)

大型语言模型(LLMs)展现了回忆大量事实知识的能力,但理解其内部推理机制仍是关键研究领域。本研究揭示了LLM在句子级声明验证中内部表示的事实信息。我们提出了一种端到端框架,将嵌入在向量空间中的事实知识解码为一组基础谓词,并展示其在动态知识图中的层级演变。该框架采用激活补丁技术,在推理过程中改变令牌表示,以提取编码知识。通过对两个声明验证数据集中的事实和常识声明进行分析,我们展示了局部和全局的可解释性分析,揭示了LLM推理中的实体中心性及其演变趋势,从而增强了对事实知识解析过程的理解。

🔬 方法详解

问题定义:本研究旨在解决大型语言模型(LLM)在句子级声明验证中,如何有效解码其内部表示的事实知识的问题。现有方法未能深入探讨LLM的推理机制及其知识利用的具体方式。

核心思路:我们提出的框架通过激活补丁技术,在推理过程中动态调整令牌表示,从而提取和解码嵌入的知识。这种设计使得我们无需依赖训练或外部模型,直接从LLM内部获取信息。

技术框架:整体架构包括数据输入、激活补丁处理、知识解码和动态知识图展示四个主要模块。首先,输入数据经过激活补丁处理后,提取出向量空间中的知识,随后将其解码为基础谓词,并在动态知识图中展示其演变。

关键创新:本研究的主要创新在于引入激活补丁技术,能够在推理过程中动态调整令牌表示,从而有效提取LLM内部的编码知识。这一方法与传统依赖训练或外部模型的方式有本质区别。

关键设计:在框架中,我们设计了特定的参数设置以优化激活补丁的效果,并采用了适合的损失函数来确保知识解码的准确性。网络结构方面,重点关注了多层次的表示演变,以便更好地捕捉知识的动态变化。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,局部分析揭示了LLM推理中的实体中心性,且多跳推理显著影响了声明验证的准确性。全局分析表明,知识从词汇向声明相关事实的演变趋势,进一步提升了对LLM内部机制的理解。

🎯 应用场景

该研究的潜在应用领域包括自动化事实检查、智能问答系统和知识图谱构建等。通过深入理解LLM的知识解析过程,可以提升这些系统的准确性和可靠性,具有重要的实际价值和未来影响。

📄 摘要(原文)

Large Language Models (LLMs) demonstrate an impressive capacity to recall a vast range of factual knowledge. However, understanding their underlying reasoning and internal mechanisms in exploiting this knowledge remains a key research area. This work unveils the factual information an LLM represents internally for sentence-level claim verification. We propose an end-to-end framework to decode factual knowledge embedded in token representations from a vector space to a set of ground predicates, showing its layer-wise evolution using a dynamic knowledge graph. Our framework employs activation patching, a vector-level technique that alters a token representation during inference, to extract encoded knowledge. Accordingly, we neither rely on training nor external models. Using factual and common-sense claims from two claim verification datasets, we showcase interpretability analyses at local and global levels. The local analysis highlights entity centrality in LLM reasoning, from claim-related information and multi-hop reasoning to representation errors causing erroneous evaluation. On the other hand, the global reveals trends in the underlying evolution, such as word-based knowledge evolving into claim-related facts. By interpreting semantics from LLM latent representations and enabling graph-related analyses, this work enhances the understanding of the factual knowledge resolution process.