通过可解释的模型编辑提升大模型语义一致性
Enhancing Semantic Consistency of Large Language Models through Model Editing: An Interpretability-Oriented Approach
- 定位影响语义一致性的关键注意力头并注入修正偏置
- 在多个数据集上显著提升语义一致性和任务表现
- 无需大规模参数调整,适合需要透明性与高效优化的场景
大语言模型在面对语义等价但表达不同的提示时,常产生不一致甚至矛盾的输出。现有基于数据微调的方法虽有效,但需大量计算资源,且将模型视为黑箱,难以洞察其内部机制。本文提出一种可解释的模型编辑方法,首先识别影响语义一致性的关键注意力头,随后沿语义一致性激活方向向这些组件的输出注入偏置。该方法成本低,无需大规模修改原始参数。在构建的NLU与开源NLG数据集上的实验表明,该方法显著提升了模型的语义一致性和任务性能,并展现出良好的泛化能力,适用于多种未训练任务。
原文摘要 · Abstract (English)
A Large Language Model (LLM) tends to generate inconsistent and sometimes contradictory outputs when presented with a prompt that has equivalent semantics but is expressed differently from the original prompt. To achieve semantic consistency of an LLM, one of the key approaches is to finetune the model with prompt-output pairs with semantically equivalent meanings. Despite its effectiveness, a data-driven finetuning method incurs substantial computation costs in data preparation and model optimization. In this regime, an LLM is treated as a ``black box'', restricting our ability to gain deeper insights into its internal mechanism. In this paper, we are motivated to enhance the semantic consistency of LLMs through a more interpretable method (i.e., model editing) to this end. We first identify the model components (i.e., attention heads) that have a key impact on the semantic consistency of an LLM. We subsequently inject biases into the output of these model components along the semantic-consistency activation direction. It is noteworthy that these modifications are cost-effective, without reliance on mass manipulations of the original model parameters. Through comprehensive experiments on the constructed NLU and open-source NLG datasets, our method demonstrates significant improvements in the semantic consistency and task performance of LLMs. Additionally, our method exhibits promising generalization capabilities by performing well on tasks beyond the primary tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。