arXiv:2412.07334cs.CL2024-12Transactions of th…被引 7

用多标记框架解析大模型,让文本生成可解释可控。

Frame Representation Hypothesis: Multi-Token LLM Interpretability and Concept-Guided Text Generation

  • 将词语建模为向量序列帧,捕捉多标记词内部结构
  • 通过概念平均帧实现对生成内容的精准控制,支持1000+概念
  • 可检测并修复性别、语言偏见,适合安全可控生成场景

可解释性是提升大语言模型可信度的关键挑战,源于从模型参数中提取推理过程的复杂性。本文提出帧表示假设(Frame Representation Hypothesis),基于线性表示假设(LRH)构建理论严谨的框架,通过建模多标记词汇来解释与控制大模型。以往研究仅限于单标记分析,而大多数词汇由多个标记构成,因此我们扩展LRH至多标记词,使该方法适用于包含数千个概念的任意文本数据。我们提出词汇可被表示为有序向量序列帧,更准确捕捉标记-词关系;概念则表示为共享同一概念的词帧的平均值。我们通过Top-k概念引导解码展示了该工具的有效性,可直观地以选定概念引导文本生成。在Llama 3.1、Gemma 2和Phi 3系列模型上验证,成功揭示了性别与语言偏见,暴露有害内容,也展现出修复潜力,有助于构建更安全、透明的大模型。代码已公开于https://github.com/phvv-me/frame-representation-hypothesis.git。

原文摘要 · Abstract (English)

Interpretability is a key challenge in fostering trust for Large Language Models (LLMs), which stems from the complexity of extracting reasoning from model's parameters. We present the Frame Representation Hypothesis, a theoretically robust framework grounded in the Linear Representation Hypothesis (LRH) to interpret and control LLMs by modeling multi-token words. Prior research explored LRH to connect LLM representations with linguistic concepts, but was limited to single token analysis. As most words are composed of several tokens, we extend LRH to multi-token words, thereby enabling usage on any textual data with thousands of concepts. To this end, we propose words can be interpreted as frames, ordered sequences of vectors that better capture token-word relationships. Then, concepts can be represented as the average of word frames sharing a common concept. We showcase these tools through Top-k Concept-Guided Decoding, which can intuitively steer text generation using concepts of choice. We verify said ideas on Llama 3.1, Gemma 2, and Phi 3 families, demonstrating gender and language biases, exposing harmful content, but also potential to remediate them, leading to safer and more transparent LLMs. Code is available at https://github.com/phvv-me/frame-representation-hypothesis.git

可解释性概念控制偏见检测文本生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。