动态追踪知识神经元,实现推理时自适应剪枝
DART-ing Through the Drift: Dynamic Tracing of Knowledge Neurons for Adaptive Inference-Time Pruning
- 根据注意力分布变化实时追踪上下文,动态调整剪枝掩码
- 在LLAMA-3.1-8B上70%前馈层稀疏度下准确率提升14.5%
- 适合需要高效推理且保持高精度的部署场景
大语言模型(LLMs)在前馈网络(FFNs)中存在显著参数冗余。现有剪枝方法面临两大局限:一是依赖数据集特定校准,带来强数据依赖与计算开销;二是多为静态剪枝,无法随自回归生成过程中上下文演变而动态调整知识神经元的保留策略。为此,我们提出DART(Dynamic Attention-Guided Runtime Tracing),一种轻量级、无需训练的运行时上下文感知剪枝方法。DART通过监控注意力分数分布的变化来感知上下文转移,动态更新神经元级掩码以保留关键参数。在十项基准测试中,DART优于现有动态基线,在LLAMA-3.1-8B上70% FFN稀疏度下最高实现14.5%的准确率提升。在摘要任务中,其ROUGE-L得分比静态剪枝最高提升3倍,性能接近原始稠密模型。实验表明,该框架能有效适应多样语义上下文,在通用与领域任务中均保持模型能力,同时内存占用低于10MB(LLAMA-3.1-8B,16GB显存),仅引入0.1%额外浮点运算开销。代码已开源。
原文摘要 · Abstract (English)
Large Language Models (LLMs) exhibit substantial parameter redundancy, particularly in Feed-Forward Networks (FFNs). Existing pruning methods suffer from two primary limitations. First, reliance on dataset-specific calibration introduces significant data dependency and computational overhead. Second, being predominantly static, they fail to account for the evolving subset of knowledge neurons in LLMs during autoregressive generation as the context evolves. To address this, we introduce DART, i.e., Dynamic Attention-Guided Runtime Tracing), a lightweight, training-free method that performs on-the-fly context-based pruning. DART monitors shifts in attention score distributions to infer context changes, dynamically updating neuron-level masks to retain salient parameters. Across ten benchmarks, DART outperforms prior dynamic baseline, achieving accuracy gains of up to 14.5% on LLAMA-3.1-8B at 70% FFN sparsity. Furthermore, DART achieves up to 3x better ROUGE-L scores with respect to static-masked pruning on summarization tasks, with its performance comparable to the original dense models. We conclusively demonstrate that the proposed framework effectively adapts to diverse semantic contexts, preserves model capabilities across both general and domain-specific tasks while running at less than 10MBs of memory for LLAMA-3.1-8B(16GBs) with 0.1% FLOPs overhead. The code is available at https://github.com/seeder-research/DART.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。