让大模型学会识别因果关系,提升复杂场景下的推理能力。
CAT: Causal Attention Tuning For Injecting Fine-grained Causal Knowledge into Large Language Models
- 通过注意力机制注入细粒度因果信号,引导模型关注真实因果结构。
- 在跨分布测试中,模型性能最高提升36个百分点,显著改善泛化能力。
- 适合需要高可靠性推理的场景,如医疗诊断、金融预测等应用。
大型语言模型在多个领域表现卓越,但其是否能有效利用因果知识进行预测与生成仍存疑问。实证研究表明,直接在大规模数据上训练的模型常捕捉虚假相关性而非真实因果关系,尤其在分布外(OOD)场景下表现不佳。为此,本文提出因果注意力调优(CAT),一种将细粒度因果知识注入注意力机制的新方法。我们设计自动化流程,利用人类先验自动生成词级别因果信号,并引入重注意力机制指导训练,帮助模型聚焦于因果结构,同时减少注意力分数中的噪声与偏差。在新提出的虚假关键词游戏(STG)基准及多个下游任务上的实验表明,该方法能有效利用因果知识,且在分布外场景中保持鲁棒性。CAT在STG数据集上平均提升5.76%,在下游任务上提升1.56%。例如,Llama-3.1-8B在STG_M上的分布外性能从64.5%提升至90.5%,Qwen在STG_H上的分布外性能从25.4%提升至55.9%。实现细节见https://github.com/Kairong-Han/CAT。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have achieved remarkable success across various domains. However, a fundamental question remains: Can LLMs effectively utilize causal knowledge for prediction and generation? Through empirical studies, we find that LLMs trained directly on large-scale data often capture spurious correlations rather than true causal relationships, leading to suboptimal performance, especially in out-of-distribution (OOD) scenarios. To address this challenge, we propose Causal Attention Tuning (CAT), a novel approach that injects fine-grained causal knowledge into the attention mechanism. We propose an automated pipeline that leverages human priors to automatically generate token-level causal signals and introduce the Re-Attention mechanism to guide training, helping the model focus on causal structures while mitigating noise and biases in attention scores. Experimental results on our proposed Spurious Token Game (STG) benchmark and multiple downstream tasks demonstrate that our approach effectively leverages causal knowledge for prediction and remains robust in OOD scenarios. The CAT achieves an average improvement of 5.76% on the STG dataset and 1.56% on downstream tasks. Notably, the OOD performance of the Llama-3.1-8B model on STG_M increased from 64.5% to 90.5%, and Qwen's OOD performance on the STG_H dataset improved from 25.4% to 55.9%. Implementation details can be found at https://github.com/Kairong-Han/CAT.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。