Do Compressed LLMs Forget Knowledge? An Experimental Study with Practical Implications

📄 arXiv: 2310.00867v3 📥 PDF

作者: Duc N. M Hoang, Minsik Cho, Thomas Merth, Mohammad Rastegari, Zhangyang Wang

分类: cs.CL, cs.AI

发布日期: 2023-10-02 (更新: 2024-02-16)


💡 一句话要点

提出推理重定向方法以恢复压缩LLM的知识性能

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 知识恢复 推理重定向 动态提示 模型压缩

📋 核心要点

  1. 压缩大型语言模型后,知识性能下降是一个严重问题,尤其在知识密集型任务中表现尤为明显。
  2. 本文提出通过推理重定向和动态提示方法来恢复压缩模型的知识性能,强调知识的内部位移而非遗忘。
  3. 实验结果显示,使用推理时动态提示(IDP)方法相比传统再训练方法在性能恢复上更有效,且显著减少参数和推理时间。

📝 摘要(中文)

压缩大型语言模型(LLMs)通常会导致性能下降,尤其是在知识密集型任务中。本文探讨了压缩对LLM固有知识的影响及可能的解决方案。作者提出了两个假设:一是压缩后知识被遗忘,需通过额外参数重新学习;二是知识内部位移,仅需通过输入侧增强(如提示)进行推理重定向。通过大量实验验证这两个假设,发现提示方法在模型调优方面表现出色,并引入了一种称为推理时动态提示(IDP)的变体,有效增加提示多样性而不增加推理开销。实验结果表明,与传统的再训练方法相比,使用IDP的提示方法在压缩后性能恢复上表现更佳,参数规模减少21倍,推理延迟降低60%。

🔬 方法详解

问题定义:本文旨在解决压缩大型语言模型后知识性能下降的问题,现有方法往往依赖于再训练,导致额外的计算开销和参数增加。

核心思路:提出通过推理重定向的方式,利用输入侧增强(如提示)来恢复模型的知识性能,认为知识并非被遗忘,而是内部位移。

技术框架:整体架构包括两个主要模块:压缩后的模型和推理时动态提示(IDP)机制。IDP通过动态生成多样化的提示来增强模型的推理能力。

关键创新:最重要的创新在于引入了推理时动态提示(IDP),该方法在不增加推理开销的情况下,显著提高了提示的多样性,与传统的再训练方法形成鲜明对比。

关键设计:在实验中,IDP的参数设置经过精心调整,以确保提示的多样性和有效性,同时损失函数设计上注重保持知识的完整性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,使用推理时动态提示(IDP)方法相比传统的再训练方法(如LoRA)在压缩后性能恢复上表现更佳,性能提升幅度显著,参数规模减少21倍,推理延迟降低60%。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、智能对话系统和知识检索等。通过有效恢复压缩模型的知识性能,能够在资源受限的环境中提升模型的实用性和效率,具有重要的实际价值和广泛的应用前景。

📄 摘要(原文)

Compressing Large Language Models (LLMs) often leads to reduced performance, especially for knowledge-intensive tasks. In this work, we dive into how compression damages LLMs' inherent knowledge and the possible remedies. We start by proposing two conjectures on the nature of the damage: one is certain knowledge being forgotten (or erased) after LLM compression, hence necessitating the compressed model to (re)learn from data with additional parameters; the other presumes that knowledge is internally displaced and hence one requires merely "inference re-direction" with input-side augmentation such as prompting, to recover the knowledge-related performance. Extensive experiments are then designed to (in)validate the two conjectures. We observe the promise of prompting in comparison to model tuning; we further unlock prompting's potential by introducing a variant called Inference-time Dynamic Prompting (IDP), that can effectively increase prompt diversity without incurring any inference overhead. Our experiments consistently suggest that compared to the classical re-training alternatives such as LoRA, prompting with IDP leads to better or comparable post-compression performance recovery, while saving the extra parameter size by 21x and reducing inference latency by 60%. Our experiments hence strongly endorse the conjecture of "knowledge displaced" over "knowledge forgotten", and shed light on a new efficient mechanism to restore compressed LLM performance. We additionally visualize and analyze the different attention and activation patterns between prompted and re-trained models, demonstrating they achieve performance recovery in two different regimes.