Manuscript Offprint

arXiv:2610.11620

Where to Adapt Matters: Layer-Selective Fine-Tuning for Capability Retention

Zhiqiang Pang, Zihong Sun, Qi Xie, Jun Shu, Deyu Meng, Zongben Xu

ABSTRACT

Parameter-efficient fine-tuning (PEFT) enables large language models (LLMs) to adapt to specialized tasks, but often at the cost of degrading general capabilities acquired during pretraining. Existing approaches primarily mitigate this trade-off through data replay or regularization, relying on additional data or explicit optimization constraints. We instead focus on a different question: where should adaptation be applied? We find that fine-tuning different Transformer layers produces different target-task gains and degrees of capability degradation, suggesting that not all layers are equally suitable for adaptation. To characterize this difference, we use layer-wise empirical Fisher information to measure target-task sensitivity. However, computing Fisher scores requires backward computation and becomes increasingly expensive for large models. We therefore introduce input–output cosine similarity as a lightweight, forward-only proxy for ranking layer sensitivity. Across models and tasks, layers with lower input–output similarity consistently exhibit higher empirical Fisher scores. Building on this observation, we propose Layer-Selective LoRA (LS-LoRA), which places trainable LoRA adapters only in layers with low input–output similarity. Experiments on mathematical reasoning and code generation show that LS-LoRA improves average target-task performance while retaining substantially more commonsense reasoning capability than standard all-layer LoRA, demonstrating that carefully choosing where to adapt can provide a simple and effective way to balance target-task adaptation and general capability retention.

1 INTRODUCTION

Large language models (LLMs) acquire strong general capabilities through large-scale pretraining, enabling them to perform a wide range of downstream tasks (Brown et al., 2020; Bommasani et al., 2021). Despite the general capabilities, specialized applications such as mathematical reasoning (Xin et al., 2024) and code generation (Luo et al., 2024) often require fine-tuning on domain-specific data to meet the demands of target tasks. However, as LLMs continue to scale, full fine-tuning, which updates all model parameters, incurs increasingly high computational and memory costs (Hu et al., 2022).

Parameter-efficient fine-tuning (PEFT), particularly low-rank adaptation (LoRA), reduces these costs by optimizing only a small number of parameters, which is widely adopted in LLM fine-tuning (Houlsby et al., 2019; Li & Liang, 2021; Lester et al., 2021; Hu et al., 2022). However, improvements in target-task performance through PEFT may come at the expense of general capabilities acquired during pretraining, a phenomenon known as forgetting (Biderman et al., 2024). Therefore, effective adaptation requires improving target-task performance while retaining these general capabilities (Huang et al., 2026).

Existing approaches mitigate capability degradation primarily through data replay and regularization. Data replay mixes examples from general domains into downstream training to retain general capabilities (Scialom et al., 2022; Béthune et al., 2025). However, replay methods that rely on stored

∗^{*}Equal contribution.

examples may be limited by data availability, particularly when the original pretraining corpus is inaccessible (Marek et al., 2026). Regularization methods preserve prior knowledge by constraining parameter changes (Kirkpatrick et al., 2017; Li et al., 2018). However, these constraints may limit improvements in target-task performance (Zenke et al., 2017). These methods mainly rely on the data or constraints used during fine-tuning, leaving a different question underexplored: where should adaptation be applied?

We find that the choice of layers to adapt matters for both target-task performance and general capability retention. Standard LoRA typically uses the same adaptation configuration across Transformer layers, yet fine-tuning different layers can lead to different effects on adaptation and retention, as shown in Fig. 1. Adapting some layers contribute more to target-task performance, while adapting others lead to greater degradation of general capabilities. These observations motivate selecting which layers to adapt.

The next question is how to identify which layers should be adapted for a given target task. We use layer-wise empirical Fisher scores to characterize target-task sensitivity, and introduce input–output cosine similarity as an effi-

Figure

Figure 1: Effects of independently fine-tuning each layer of Llama-3.2-1B on Math-10K. Each bar corresponds to fine-tuning a single layer. Left: target-task performance. Right: general capability retention after fine-tuning.

cient forward-only proxy for this sensitivity. Based on this proxy, we propose Layer-Selective LoRA (LS-LoRA), which trains LoRA adapters only in layers with low input–output cosine similarity.

Our main contributions are as follows:

• We use layer-wise empirical Fisher scores to characterize differences in target-task sensitivity across LLM layers, motivating a layer-selective adaptation strategy.

• We propose input–output cosine similarity as an efficient proxy for layer-wise sensitivity. It requires only a single forward pass over target-task calibration inputs, without response labels or backpropagation. Our analysis shows consistent negative rank correlations between this proxy and empirical Fisher scores across models and tasks.

• We introduce LS-LoRA, which trains LoRA adapters only in layers with low input–output cosine similarity. Experiments on mathematical reasoning and code generation show that LS-LoRA improves average target-task performance while reducing degradation of the evaluated general capabilities.

References (39)

  • Scaling laws for forgetting during finetuning with pretraining data injection
  • LoRA learns less and forgets less
  • On the Opportunities and Risks of Foundation Models
  • Language models are few-shot learners
  • Parameter-efficient transfer learning for NLP. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2790–2799
  • LoRA: Low-rank adaptation of large language models
  • LLM-adapters: An adapter family for parameter-efficient fine-tuning of large language models
  • PEFT-Arena: Understanding parameter-efficient finetuning from a stability-plasticity perspective (opens arXiv in a new tab)
  • Exploring selective layer freezing strategies in transformer fine-tuning: Nli classifiers with sub-3b parameter models
  • Overcoming catastrophic forgetting in neural networks
  • The power of scale for parameter-efficient prompt tuning
  • Prefix-tuning: Optimizing continuous prompts for generation
  • Explicit inductive bias for transfer learning with convolutional networks
  • DoRA: Weight-decomposed low-rank adaptation
  • Spectral insights into data-oblivious critical layers in large language models
  • LIFT the veil for the truth: Principal weights emerge after rank reduction for reasoning-focused supervised fine-tuning
  • WizardCoder: Empowering code large language models with Evol-Instruct
  • Forgetting in language models: Capacity, optimization, and self-generated replay (opens arXiv in a new tab)
  • ShortGPT: Layers in large language models are more redundant than you expect
  • Pissa: Principal singular values and singular vectors adaptation of large language models
  • Layer-wise LoRA fine-tuning: A similarity metric approach (opens arXiv in a new tab)
  • LISA: Layerwise importance sampling for memory-efficient large language model fine-tuning
  • Fine-tuned language models are continual learners
  • The bottom-up evolution of representations in the transformer: A study with machine translation and language modeling objectives
  • Association for Computational Linguistics, 2019
  • DeepSeek-Prover: Advancing theorem proving in LLMs through large-scale synthetic data (opens arXiv in a new tab)
  • Understanding and guiding layer placement in parameter-efficient fine-tuning of large language models (opens arXiv in a new tab)
  • Continual learning through synaptic intelligence
  • Adaptive budget allocation for parameter-efficient fine-tuning
  • Investigating layer importance in large language models
  • Both scores use the same target-task examples $\mathcal{S}_{\tau} = \{(x_i, y_i)\}_{i=1}^N$, with $N_c = N$ and $\mathcal{V} = \{(i, T_i)\}_{i=1}^N$
  • This allows dependence on every output token, as in a standard feed-forward Transformer with parameters not shared across layers
  • The map $a_\phi$ may be nonlinear
  • 12 and 10:
  • LS-DoRA and LS-PiSSA apply the respective adapters only to layers with low input–output cosine similarity
  • >Method</td><td colspan=
  • When $\rho$ is close to $-1$, one tends to decrease as the other increases
  • Rand-LoRA selects the same number of layers as LS-LoRA at random
  • Applying our input–output similarity criterion improves average accuracy on both mathematical reasoning and commonsense reasoning benchmarks for both methods