NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Make Pre-trained Model Reversible: From Parameter to Memory Efficient Fine-Tuning

Baohao Liao, Shaomu Tan, Christof Monz

This paper, presented at NeurIPS 2023 by researchers from the University of Amsterdam, introduces a clever way to make large-scale model training accessible on consumer hardware by tackling the "memory wall" of activations.

TL;DR

Memory-Efficient Fine-Tuning (MEFT) transforms standard pre-trained models into reversible ones without requiring any additional pre-training. By recomputing activations during the backward pass instead of storing them, MEFT slashes activation memory usage by up to 84% while matching the performance of full fine-tuning and state-of-the-art parameter-efficient methods.

What Problem Does This Paper Address?

While Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA have successfully reduced the number of trainable weights (saving disk space), they haven't solved the primary bottleneck of training: activation memory.

To calculate gradients during backpropagation, standard neural networks must "cache" (store in RAM) the intermediate outputs of every layer from the forward pass. For massive models like OPT or RoBERTa, these activations consume significantly more memory than the model parameters themselves. Reversible networks—which can mathematically reconstruct inputs from outputs—offer a solution by allowing us to discard activations and recompute them on the fly. However, standard pre-trained models (PLMs) aren't reversible, and training a reversible model from scratch is prohibitively expensive.

Methods

The authors propose MEFT, a framework that inserts lightweight "adapters" into a PLM to create a reversible architecture. The core innovation lies in two areas:

  1. The Starting Point Hypothesis: The authors discovered that the success of any fine-tuning method depends on preserving the PLM’s original output at the start of training. If the new parameters change the model's initial behavior too much, performance tanks.
Memory trade-offs and the effect of initialization on fine-tuning performance.
  1. Reversible Adaptation: MEFT wraps existing PLM layers (like Attention or MLP blocks) into a reversible structure. Unlike traditional reversible networks (RevNets) that use a scaling factor of 1, MEFT uses meticulous scaling factors ($\lambda, \beta$) that approach zero at initialization. This ensures the model "starts" exactly where the pre-trained model left off.

The paper introduces three architectural variants (MEFT$_1$, MEFT$_2$, MEFT$_3$) that differ in which parts of the Transformer block are treated as the main reversible functions ($\mathcal{F}$ and $\mathcal{G}$). They also implement a "switch" trick to ensure the representation continuity is maintained across layers.

Datasets

The researchers evaluated MEFT across a wide range of tasks and modalities:

  • Natural Language Understanding: The GLUE benchmark (8 tasks including MNLI, QQP, and SST-2).
  • Question Answering: Five sequence-to-sequence tasks: OpenBookQA, PIQA, ARC (Easy and Challenge), and SciQ.
  • Computer Vision: Image classification on the SVHN (Street View House Numbers) dataset.
  • Backbone Models: BERT, RoBERTa, BART, and large-scale decoder models (OPT-1.3B and OPT-6.7B).

Key Insights and Ideas

  • Preservation is Key: The "Aha!" moment is that you don't need to pre-train a reversible model from scratch. You can "force" an existing model into a reversible container as long as you initialize the container to be an identity function (or close to it) relative to the original model's signal.
  • The Memory-Compute Trade-off: Reversible models essentially trade time for space. By recomputing activations, training takes about twice as long, but it allows you to fit much larger models or larger batch sizes on the same GPU.
  • Numerical Stability Matters: The authors found that while FP16 (Half Precision) is standard for speed, it can introduce reconstruction errors in reversible paths. Training in FP32 or using specific layer-freezing strategies for very deep models (like OPT-6.7B) is necessary to maintain stability.

Key Results

MEFT demonstrates that it is possible to achieve the best of both worlds: the high performance of full fine-tuning and the low memory footprint of reversible networks.

Performance vs. Activation Memory for various fine-tuning methods.
  • Massive Memory Savings: On BERT$_{base}$, MEFT reduced activation memory by 84% compared to full fine-tuning.
  • Performance Parity: On the GLUE benchmark, MEFT achieved an average score of 83.2, identical to full fine-tuning, while using only 0.27% trainable parameters.
  • Scaling Up: For the OPT-6.7B model, MEFT achieved a 61.7% average score on QA tasks, significantly outperforming zero-shot baselines (58.0%) while using only half the activation memory of full fine-tuning.
  • Efficiency vs. Baselines: MEFT outperformed other memory-efficient methods like LST (Ladder Side-Tuning) and Y-Tuning in both accuracy and memory footprint.

Limitations and Future Work

  • Training Speed: Because activations are recomputed, MEFT is roughly 2x slower per iteration than standard PEFT methods.
  • Precision Sensitivity: The method is sensitive to numerical precision. The authors noted that reconstruction errors can accumulate in very deep models when using FP16.
  • Future Directions: The authors suggest exploring MEFT for even larger "extreme" scale models (100B+ parameters) and expanding into other domains like automatic speech recognition. They also highlight the potential of combining MEFT with other techniques like quantization (e.g., QLoRA) for even greater efficiency.

Summary updated

BibTeX
@inproceedings{liao2023make,
  author = {Baohao Liao and Shaomu Tan and Christof Monz},
  title = {{Make Pre-trained Model Reversible: From Parameter to Memory Efficient Fine-Tuning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=J8McuwS3zY},
}
Figure