Enhancing Large Language Model Performance with Gradient-Based Parameter Selection

Haoling Li, Xin Zhang, Xiao Liu, Yeyun Gong, Yifan Wang, Qi Chen, Peng Cheng

Abstract

Gradient-Mask Tuning (GMT) is a selective fine-tuning strategy that identifies and updates only the most salient parameters during training. By masking gradients with low absolute values, GMT acts as a task-specific regularizer, reducing redundancy and noise. Experimental results across math, code, and general reasoning benchmarks demonstrate that GMT consistently outperforms full-parameter fine-tuning and random sparsification methods without requiring additional FLOPs.

Introduction

Large Language Models (LLMs) rely on billions of parameters to achieve state-of-the-art performance. However, full-parameter fine-tuning often introduces noise and redundancy, as not all parameters are equally relevant for specific downstream tasks. Existing approaches to mitigate this include random sparsification (e.g., DropBP) and structural pruning. While random methods are efficient, they ignore task-specific data content, and structural pruning can permanently damage the model's architecture.

Standard training loop for pretrained parameters

Gradient-Mask Tuning (GMT) offers a "middle way" by using task-specific information to decide which parameters to update dynamically, preserving the underlying model structure while focusing updates on the most impactful weights.

Methodology

The core principle of GMT is that gradient magnitude serves as a reliable proxy for parameter importance. During each training step, the method follows a four-step process:

  1. Gradient Calculation: Standard backpropagation is performed to calculate gradients for all parameters.
  2. Saliency Scoring: The absolute value of each gradient is measured. A higher absolute value indicates that a change to that parameter will significantly impact the loss function.
  3. Dynamic Masking: Based on a pre-defined percentile (mask ratio), GMT identifies a saliency threshold. Gradients falling below this threshold are zeroed out.
  4. Selective Update: Only the "salient" parameters—those exceeding the threshold—are updated in the model weights.
Weight update mechanism in GMT

Unlike static pruning, GMT applies this mask at every training step, allowing the model to adaptively select critical parameters as the learning process evolves.

Experimental Results

The researchers evaluated GMT using models such as Mistral-7B, Llama3-8B, and DeepSeek-Coder-6.7B across three domains: code generation, mathematical reasoning, and general instruction following.

Performance Gains

  • Mathematical Reasoning: GMT outperformed standard Supervised Fine-Tuning (SFT) by 3.3% on Mistral-7B and 3.9% on Llama3-8B on the GSM8k benchmark.
  • General Domain: On Llama2-7B, GMT improved average performance across all tasks by 3.0%, with a notable 13.0% lead on GSM8k.
  • Alignment: When applied to Direct Preference Optimization (DPO), GMT consistently surpassed standard DPO and other sparse methods like RMT.

Efficiency and Robustness

GMT is computationally efficient, requiring zero additional FLOPs since it does not alter the fundamental math of the forward or backward passes. The sorting overhead results in a minor training slowdown of only 6-14%. Furthermore, the model exhibits high robustness to sparsity, maintaining effectiveness even at a 90% mask ratio, though 20-40% is typically optimal.

Conclusion

Gradient-Mask Tuning (GMT) provides a robust framework for selective parameter updates in LLMs. By leveraging gradient magnitude as a "free" importance signal, GMT acts as an effective regularizer that prevents overfitting to noise. Its ability to improve performance across diverse tasks while maintaining the original model architecture makes it a versatile alternative to standard fine-tuning and alignment techniques.

Summary updated

BibTeX
@inproceedings{li2025enhancing,
  author = {Haoling Li and Xin Zhang and Xiao Liu and Yeyun Gong and Yifan Wang and Qi Chen and Peng Cheng},
  title = {{Enhancing Large Language Model Performance with Gradient-Based Parameter Selection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i23.34621},
}
Figure