arXiv:2411.07180cs.CLcs.AI2024-11ICLR被引 15

用数学方法生成语言模型的反事实文本,揭示干预的真实影响。

Gumbel Counterfactual Generation From Language Models

  • 将语言模型重构为结构方程模型,用Gumbel技巧生成反事实句子
  • 能准确还原原始文本在干预下的可能形态,避免传统方法的副作用
  • 适合研究模型可解释性、因果推理和行为控制的学者

理解并操控语言模型中的因果生成机制对控制其行为至关重要。以往工作主要依赖表示手术等干预手段,如模型删减或概念相关线性子空间操作。为精确评估干预效果,需考察反事实——即某句子在特定干预下本应如何生成。我们指出,反事实推理与干预在因果层次上存在本质区别。为此,提出基于Gumbel-max技巧的语言模型结构方程建模框架,实现真正字符串层面的反事实生成。该方法可建模原始字符串与其反事实间的联合分布,通过事后Gumbel采样算法推断潜在噪声变量,生成观察到句子的反事实版本。实验表明,该方法生成的反事实语义合理,且揭示了常用干预技术存在显著副作用。

原文摘要 · Abstract (English)

Understanding and manipulating the causal generation mechanisms in language models is essential for controlling their behavior. Previous work has primarily relied on techniques such as representation surgery -- e.g., model ablations or manipulation of linear subspaces tied to specific concepts -- to \emph{intervene} on these models. To understand the impact of interventions precisely, it is useful to examine \emph{counterfactuals} -- e.g., how a given sentence would have appeared had it been generated by the model following a specific intervention. We highlight that counterfactual reasoning is conceptually distinct from interventions, as articulated in Pearl's causal hierarchy. Based on this observation, we propose a framework for generating true string counterfactuals by reformulating language models as a structural equation model using the Gumbel-max trick, which we called Gumbel counterfactual generation. This reformulation allows us to model the joint distribution over original strings and their counterfactuals resulting from the same instantiation of the sampling noise. We develop an algorithm based on hindsight Gumbel sampling that allows us to infer the latent noise variables and generate counterfactuals of observed strings. Our experiments demonstrate that the approach produces meaningful counterfactuals while at the same time showing that commonly used intervention techniques have considerable undesired side effects.

因果推理反事实生成语言模型

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