Abstract
Fine-tuning Large Language Models (LLMs) is often constrained by the "memory wall," where the VRAM required for optimizer states and activations exceeds hardware limits. While layer-wise optimization methods like LISA and BAdam mitigate this by updating one block at a time, they remain coarse-grained and memory-intensive. This paper introduces Module-wise Importance SAmpling (MISA), a framework that partitions layers into constituent modules and employs a gradient-based importance sampling strategy. MISA reduces memory overhead significantly while maintaining or exceeding the performance of full-parameter tuning and LoRA.
1. Introduction
The scaling of LLMs to billions of parameters has made full-parameter fine-tuning increasingly inaccessible for most researchers. The primary bottleneck is not just the model weights, but the auxiliary data required during backpropagation: optimizer states (e.g., Adam's moments), gradients, and intermediate activations. Recent "block-wise" or "layer-wise" methods attempt to solve this by freezing most of the model and updating only a single transformer block at a time. However, these methods treat each block as a monolithic unit, ignoring the internal heterogeneity of transformer layers.
2. The Case for Module-wise Granularity
The authors of MISA identify two critical limitations in existing layer-wise approaches:
- Coarseness: Within a single transformer block, different modules (e.g., the Feed-Forward Network vs. Attention projections) contribute differently to the learning process. Updating the entire block uniformly is inefficient.
- Memory Bottlenecks: Even a single layer in a modern LLM requires substantial VRAM for activations and optimizer states, limiting the potential for memory reduction.
MISA addresses these by breaking down transformer blocks into their constituent weight matrices: $W_q, W_k, W_v, W_o, W_{up},$ and $W_{down}$. This fine-grained partitioning allows for more targeted updates and a significantly smaller memory footprint.
3. Module-wise Importance Sampling (MISA)
The core of MISA is a stochastic selection process that decides which modules to update in each iteration.
3.1 Importance Scoring
Rather than selecting modules at random or in a fixed cycle, MISA tracks the historical gradient norms of each module. Modules with higher gradient norms are considered more "important" for the current stage of training and are sampled with higher probability. This strategy provably reduces gradient variance, leading to more stable and faster convergence.
3.2 Exploration vs. Exploitation
To prevent the optimization from stagnating on a small subset of parameters, MISA incorporates a Kullback–Leibler (KL) divergence penalty into its sampling distribution. This ensures the model continues to "explore" less active modules, maintaining model plasticity and preventing the model from over-focusing on a few high-gradient modules.
3.3 Theoretical Foundations
Unlike many heuristic-based methods, MISA is supported by a formal convergence proof of $O(1/\sqrt{K})$. This proof accounts for the complexities of the Adam optimizer and stochastic gradients, providing a rigorous guarantee for the method's effectiveness in non-convex LLM optimization.
4. Experimental Evaluation
The authors evaluated MISA across a wide array of standard benchmarks, including commonsense reasoning (8 datasets), mathematical reasoning (GSM8K, SVAMP), and instruction tuning (Alpaca GPT-4), using models such as LLaMA3-8B, Qwen2.5-7B, and Mistral-7B.
4.1 Performance and Accuracy
MISA consistently outperformed existing PEFT (Parameter-Efficient Fine-Tuning) methods. On LLaMA3-8B commonsense tasks, MISA achieved an average score of 86.6, surpassing LoRA (82.5), DoRA (85.2), and the layer-wise method LISA (85.9). In pre-training scenarios using the C4 dataset, MISA reached a perplexity of 22.11, significantly outperforming GaLore (24.34) and nearly matching full Adam performance (21.30).
4.2 Memory and Speed Efficiency
The memory savings are substantial. For LLaMA3-8B, MISA required only 30.7 GB of VRAM, compared to 35.7 GB for LoRA and 56.3 GB for LISA. Furthermore, MISA is computationally faster; its per-step time of 111.6ms is lower than both LoRA (179.3ms) and LISA (123.4ms), primarily due to the reduced overhead of the backward pass requirements.
5. Key Insights
- Module Heterogeneity: Gradient norms across a model show that modules within the same layer have vastly different levels of activity. Updating them all uniformly is a waste of resources.
- Regularization Effect: MISA occasionally outperforms full-parameter fine-tuning. The authors suggest that by updating only a subset of important parameters at a time, the method acts as a form of regularization, preventing the model from overfitting to the fine-tuning data.
- Memory Scaling: MISA’s efficiency becomes more pronounced as sequence lengths increase, as activation memory is kept to a minimum by activating smaller blocks of parameters.
6. Conclusion and Future Work
MISA represents a significant step forward in making LLM optimization more accessible. By moving from layer-wise to module-wise updates and employing a principled importance sampling strategy, it achieves a superior balance of performance and resource efficiency. Future research may extend MISA to larger scales (70B+ parameters) and multi-modal architectures beyond text-based Transformers.
Summary updated