Know What You Need: Efficient Activation Checkpointing
Danyal Ahmed, Edouard Oyallon
NeurIPS page · OpenReview · Open on the map
Category: Efficient LLM Inference & Training › Model Compression for Transformers · Type: new method · Keywords: activation checkpointing, memory-efficient training, approximate rematerialization, transformer linear layers, gradient estimation
Areas: LLM Reasoning › Efficient Reasoning › Efficient Transformers; Memory › Model Memory Optimization › Activation Memory Reduction
Summary
We introduce a novel method for approximate rematerialization that selectively recomputes only a fraction of layer components, reducing computational cost for activation checkpointing in large language model training.
Explained to a 5-year-old
When we train big computer programs, they need a lot of memory to remember what they calculated. To save memory, we sometimes forget some of those calculations and redo them later. Redoing everything takes a lot of extra work, especially for the parts that are most important. The new idea is to only redo a small part of those calculations, using what we already know. This helps the computer use less memory and less extra work, so it can learn faster.
Explained to a 5-year-old, longer
Training big AI models needs a lot of memory to keep track of all the numbers they compute. To avoid using too much memory, we can forget some of those numbers after we use them. Later, when the model is learning, we need to remember those forgotten numbers to calculate how to improve. Re-remembering everything can take a huge amount of extra time and computer work. The paper suggests we don’t have to re-remember everything; we can just re-remember a small part. We look at what we already know from the first step and pick the most important pieces to redo. These pieces are chosen either by a simple rule or by a quick sketch that still gives a good estimate. Even though we only redo a few pieces, the overall learning result stays almost the same. This trick works for different parts of the model, like the parts that handle words and the parts that pay attention. When we apply it to a medium-sized model, the extra work goes down by about a third. The model’s performance only gets a tiny bit worse, like a small increase in its error rate. So, the method lets us train larger models using less memory and less extra computing power.
For a technical reader
The paper addresses the high compute cost of rematerializing linear layers when using activation checkpointing to reduce GPU memory during large language model training. It proposes to reuse information from the forward pass to select only a subset of layer components for recomputation, either greedily or via a sketching technique that yields unbiased gradients. By recomputing fewer components, the method cuts the FLOPs required for the backward pass by roughly one-third while keeping the model’s perplexity within a couple percent of the baseline. The approach is evaluated on a Llama-488M model, showing consistent savings across feed-forward, attention, or both layer types. This enables practitioners to scale memory-efficient training on existing hardware without a significant loss in model quality.
Problem
Training large language models is limited by GPU memory, and activation checkpointing, while saving memory, incurs high computational cost when rematerializing transformer linear layers.
Method
The approach uses information from the initial forward pass to select a subset of layer components for recomputation, either greedily or via sketching, providing unbiased gradient estimates while reducing FLOPs.
Results
When applied to FFN, attention, or both layers, the approach cuts the computational cost of rematerialization and backward pass by 33% on a Llama-488M model, with perplexity increases of only 1.7%, 1.2%, and 2.5% respectively.
Contributions
It proposes a way to selectively recompute only a fraction of linear layer components, achieving unbiased gradient estimates and substantial FLOPs savings while preserving model accuracy.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction