让大模型学会在外部信息干扰时仍保持判断力
Towards Context-Robust LLMs: A Gated Representation Fine-tuning Approach
- 用门控机制识别并过滤有问题的外部信息
- 仅在内部知识不足时才依赖外部信息,避免被误导
- 只需极少数据和参数即可提升模型抗干扰能力
增强外部上下文的大语言模型(如通过检索增强生成)常因证据不完善而表现不佳,容易过度依赖外部知识,从而受误导性或无用信息影响。为此,本文提出‘上下文鲁棒大模型’概念,使其能像人类一样平衡内部知识与外部信息:仅在缺乏内部知识时才使用外部信息,识别内外知识矛盾,并忽略无用上下文。为此,我们提出Grft——一种轻量级、可即插即用的门控表示微调方法。该方法包含两个核心组件:门控机制用于检测和过滤问题输入,低秩表示适配器用于调整隐藏表示。仅需训练约200个样本及模型总量0.0004%的参数量,Grft即可有效引导大模型实现上下文鲁棒行为。
原文摘要 · Abstract (English)
Large Language Models (LLMs) enhanced with external contexts, such as through retrieval-augmented generation (RAG), often face challenges in handling imperfect evidence. They tend to over-rely on external knowledge, making them vulnerable to misleading and unhelpful contexts. To address this, we propose the concept of context-robust LLMs, which can effectively balance internal knowledge with external context, similar to human cognitive processes. Specifically, context-robust LLMs should rely on external context only when lacking internal knowledge, identify contradictions between internal and external knowledge, and disregard unhelpful contexts. To achieve this goal, we introduce Grft, a lightweight and plug-and-play gated representation fine-tuning approach. Grft consists of two key components: a gating mechanism to detect and filter problematic inputs, and low-rank representation adapters to adjust hidden representations. By training a lightweight intervention function with only 0.0004\% of model size on fewer than 200 examples, Grft can effectively adapt LLMs towards context-robust behaviors.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。