HyC-LoRA: Memory Efficient LoRA Fine-tuning with Hybrid Activation Compression

Yujin Wang, Shunan Dong, Zongle Huang, Yichen You, Liu He, Huazhong Yang, Yongpan Liu, Hongyang JiaMLSys 2025

TL;DR

This paper introduces HyC-LoRA, a novel method to significantly reduce memory usage during the fine-tuning of Large Language Models (LLMs) by aggressively compressing buffered activations. By employing a hybrid intra- and inter-operator compression strategy, HyC-LoRA achieves up to a 3.97x end-to-end memory reduction with minimal impact on model accuracy, making LLM fine-tuning more accessible on memory-constrained devices.

What Problem Does This Paper Address?

Fine-tuning Large Language Models (LLMs) for specific tasks is crucial for customization and performance, but it's notoriously memory-intensive. While methods like LoRA (Low-Rank Adaptation) have successfully reduced the memory footprint associated with model weights and optimizer states, they often overlook the significant memory overhead of "buffered activations." These are intermediate values that must be stored during the forward pass to be used in the backward pass for gradient computation. In LLM fine-tuning, especially with LoRA, these buffered activations, particularly those from non-linear operations, become a dominant memory bottleneck, hindering efficient training on resource-limited hardware.

Methods

HyC-LoRA tackles the buffered activation memory bottleneck with a two-pronged hybrid compression approach:

  • Intra-operator Hybrid Compression: This strategy focuses on individual operators. It identifies and handles "extreme outliers" in buffered activations, which are problematic for standard quantization. By storing these outliers separately (structured outlier storage), HyC-LoRA mitigates quantization errors, allowing for more aggressive compression of the remaining activation data.
  • Inter-operator Hybrid Compression: This method leverages the LoRA adapter itself. It reorders and fuses operations to allow for selective recomputation of certain buffered activations. This means that instead of storing all intermediate values, some can be re-calculated on-the-fly using the LoRA adapter's learned information, effectively compensating for compression-induced errors and reducing storage needs.

These techniques are integrated into a system that enables near 2-bit buffered activation quantization across operators, significantly reducing memory consumption without sacrificing model performance.

Datasets

The authors evaluated HyC-LoRA on a variety of datasets and tasks, including:

  • Arithmetic Reasoning: GSM8K, SVAMP, mawps, AQUA (used with the Math10K dataset for fine-tuning).
  • Text Understanding: Wikitext-2.
  • Long Sequence Understanding: Redpajama.
  • General Language Understanding: GLUE benchmark.

Key Insights and Ideas

  • Buffered Activations are the Real Bottleneck: While weight and optimizer memory have been addressed by methods like LoRA and QLoRA, the paper highlights that buffered activations, especially from non-linear layers, are the primary memory hog during LLM fine-tuning.
  • Non-linear Operators are Tricky: Quantizing buffered activations from non-linear operators is more challenging than linear ones because errors can propagate and accumulate, leading to significant accuracy degradation.
  • LoRA Adapters Can Be Reused for Compression: The paper ingeniously uses the LoRA adapter's structure not just for weight updates but also to aid in the recomputation of buffered activations, demonstrating a clever synergy between adaptation and compression.
  • Hybrid Approach is Key: Neither intra-operator (outlier handling) nor inter-operator (reordering/recomputation) compression alone is sufficient. The combination is what unlocks significant memory savings without accuracy loss.

Key Results

  • Memory Reduction: HyC-LoRA achieves up to 3.97x end-to-end memory reduction compared to baselines. Specifically, buffered activation reduction can reach up to 8x.
  • Accuracy Preservation: The method demonstrates negligible accuracy degradation, with improvements in some cases (e.g., outperforming baselines on Llama-2-7B with 2-bit quantization).
  • Efficiency: The approach enables fine-tuning of models like Llama-2-7B within a memory capacity of 8 GB.
  • Throughput: HyC-LoRA provides a throughput boost of about 1.17x to 1.54x compared to traditional memory-efficient methods like gradient checkpointing.

Limitations and Future Work

  • Calibration Overhead: While minimal, the calibration stage for determining quantization parameters does introduce a small overhead. The paper shows that only a few samples are needed, mitigating this concern.
  • Hardware Compatibility: While tested on NVIDIA GPUs, the repository code is primarily compatible with x86 architectures, though experiments on ARM were also conducted.
  • Future Work: The paper suggests that combining HyC-LoRA with other recomputation methods can further alleviate peak memory consumption, especially for long-sequence fine-tuning. They also note that the effectiveness of intra-operator compression varies across different operators.

Summary updated

BibTeX
@inproceedings{wang2025hyc,
  author = {Yujin Wang and Shunan Dong and Zongle Huang and Yichen You and Liu He and Huazhong Yang and Yongpan Liu and Hongyang Jia},
  title = {{HyC-LoRA: Memory Efficient LoRA Fine-tuning with Hybrid Activation Compression}},
  booktitle = {MLSys},
  year = {2025},
  url = {https://openreview.net/forum?id=WU86J4uM9V},
}
Figure