通过分析残差信号强度,实现高效可控的模型微调层选择。
Understanding and Guiding Layer Placement in Parameter-Efficient Fine-Tuning of Large Language Models
- 从残差投影角度建模微调机制,量化各层可修正偏差
- 仅微调部分关键层即可接近全层效果,降低计算开销
- 提供可复用诊断工具,支持性能与成本灵活权衡
随着大语言模型持续增长,全参数微调的成本已使参数高效微调(PEFT)成为下游适配的默认策略。在可扩展服务中的推理延迟约束和边缘或快速部署场景下的微调成本限制下,选择微调哪些层变得不可避免。然而当前实践通常对所有层统一应用PEFT,缺乏对层选择的理解与利用。本文基于冻结基础模型,提出一个统一的投影残差视角。在局部二次近似下,层间适配由三个量决定:(i) 投影残差范数(resnorm),衡量每层可捕捉的可纠正偏差;(ii) 激活能量,决定特征条件;(iii) 层耦合度,量化残差跨层交互强度。我们证明,在平方损失与线性适配器下,resnorm 等于归一化梯度范数,激活能量控制病态性与噪声放大,弱耦合则导致层间贡献近似可加。基于此,我们引入「层卡」(Layer Card),一种可复用的诊断工具,汇总每层的残差信号强度、计算成本与性能表现。使用相同模型与LoRA配置,层卡指导的层选择可灵活优化不同目标,如最大化性能或最小化微调成本。此外,在Qwen3-8B上,仅选择性微调部分层即可达到接近全层LoRA的性能,同时显著降低微调成本和推理时适配器增广层数,为全层插入提供更兼顾成本与性能的替代方案。
原文摘要 · Abstract (English)
As large language models (LLMs) continue to grow, the cost of full-parameter fine-tuning has made parameter-efficient fine-tuning (PEFT) the default strategy for downstream adaptation. Constraints from inference latency in scalable serving and fine-tuning cost in edge or rapid-deployment settings make the choice of which layers to fine-tune unavoidable. Yet current practice typically applies PEFT uniformly across all layers, with limited understanding or leverage of layer selection. This paper develops a unified projected residual view of PEFT on top of a frozen base model. Under a local quadratic approximation, layerwise adaptation is governed by three quantities: (i) the projected residual norm (resnorm), which measures how much correctable bias a layer can capture; (ii) the activation energy, which determines feature conditioning; and (iii) layer coupling, which quantifies how strongly residuals interact across layers. We show that, for squared loss and linear adapters, the resnorm equals a normalized gradient norm, activation energy controls ill-conditioning and noise amplification, and weak coupling yields approximately additive layerwise contributions. Building on these insights, we introduce the Layer Card, a reusable diagnostic that summarizes residual signal strength, compute cost, and performance for each layer of a given model. With an identical model and LoRA configuration, Layer Card-guided placement refines the choice of adapted layers to flexibly prioritize different objectives, such as maximizing performance or reducing fine-tuning cost. Moreover, on Qwen3-8B, we show that selectively adapting a subset of layers can achieve performance close to full-layer LoRA while substantially reducing fine-tuning cost and the number of adapter-augmented layers during inference, offering a more cost-performance-aware alternative to full-layer insertion.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。