TL;DR
Existing multi-fidelity hyperparameter optimization (MF-HPO) methods cut training time by using fewer epochs or smaller data subsets, but they fail to reduce GPU memory requirements. The authors introduce layer freezing as a novel fidelity dimension—training only the final layers while keeping early layers frozen at random initialization. This drastically reduces both compute and peak VRAM while preserving hyperparameter rank correlations ($\rho \approx 1.0$ when training less than half the layers).
What Problem Does This Paper Address?
Tuning hyperparameters (HPs) for deep neural networks is expensive, often demanding days of GPU compute and accelerators with large VRAM. Multi-fidelity HPO (MF-HPO) tackles this by screening candidate configurations on "cheap" approximations (e.g., fewer epochs, data downsampling) and promoting only the top performers to full training.
However, conventional fidelities treat the model as a black box: evaluating a configuration on a tiny data subset still requires allocating full model weights, full activation graphs for backpropagation, and full optimizer states (such as Adam's first and second moments). As a result, low-fidelity evaluations cannot run on smaller, cheaper GPUs, nor can multiple trials be densely packed into high-end GPUs.
Methods
The authors propose cracking open the neural network training loop to use the number of trainable layers as an explicit fidelity parameter:
- Output-to-Input Freezing: Given an $n$-layer model, the first $n - z$ layers remain frozen at their random initialization, while only the top $z$ output layers are trained.
- Triple Resource Savings:
- Compute: Backward propagation terminates early at layer $n - z + 1$.
- Activation Memory: Activations for the first $n - z$ layers do not need to be retained for backward passes.
- Optimizer State Memory: Zero optimizer states (e.g., Adam momentum buffers) are allocated for frozen parameters.
- Architectural Discretization Rules: The authors outline modular decomposition rules (e.g., grouping by residual blocks in ResNets or transformer encoder blocks) to establish discrete fidelity levels.
- Joint Multi-Fidelity (Many-Fidelity) HPO: Layer freezing is orthogonal to traditional fidelities, allowing algorithms like Successive Halving (SH) to navigate a joint space of both trained layers and training tokens/epochs.
[ Input ] -> [ Layer 1 ] -> ... -> [ Layer n-z ] -> [ Layer n-z+1 ] -> ... -> [ Layer n ] -> [ Loss ]
|_______________________________| |__________________________________|
FROZEN TRAINED
(No backprop, no activations, (Full forward, backward, and
no optimizer memory overhead) optimizer state tracking)
Datasets
- SlimPajama: Used for training GPT-2 architecture variants (14M, 127M, 600M parameters) and evaluating Pythia-1.4B.
- CIFAR-100 (and CIFAR-10): Used for image classification sweeps across ResNet architectures (ResNet-18, ResNet-101, ResNet-152).
No new benchmarks were created; experiments used standard implementations from LitGPT and TorchVision.
Key Insights and Ideas
- Random representations provide sufficient signal: Because deep networks possess strong inductive biases even at random initialization, randomly initialized early layers still extract meaningful features. Training only the top layers is sufficient to distinguish good hyperparameter settings from bad ones.
- Freezing direction is critical: An ablation reveals that freezing must begin from the input and unfreeze toward the output. Freezing the output while training the input forces gradients to propagate across the entire architecture, completely forfeiting compute and activation-memory savings.
- Hardware as a fidelity: Slashing memory overhead allows low-fidelity evaluations to run on budget hardware (e.g., an RTX 2080 Ti with 11 GB VRAM) before promoting top candidates to high-memory data center GPUs (e.g., NVIDIA L40S with 48 GB). Alternatively, modern GPU slicing (MIG) can parallelize many low-fidelity runs on a single accelerator.
Key Results
- High Rank Correlation at Low Cost: For a 14M GPT-2 model and ResNet-18, training only 40% of the layers yielded a Spearman rank correlation of $\rho \approx 1.0$ compared to full model training. On ResNet-18 on CIFAR-100, training just 1 out of 11 layer blocks yielded $\rho = 0.852$ (and $\rho = 0.955$ with 7 layers).
- Memory and Runtime Reductions: For Pythia (1.4B), lowest-fidelity evaluations reduced memory requirements by $\ge 3\times$ and accelerated per-step runtimes by $\ge 4\times$.
- Compound Efficiency in Joint Multi-Fidelity: In a 2D Successive Halving schedule scaling both tokens and layers simultaneously on a 14M GPT-2:
- At ~19% tokens, training 2 layers achieved $\rho = 0.82$ in 4,843s (0.48 $\times 10^{16}$ FLOPs), compared to single-fidelity SH training all 10 layers which took 7,281s (0.55 $\times 10^{16}$ FLOPs) for $\rho = 0.84$.
- At ~50% tokens, 5 trainable layers achieved $\rho = 0.87$ in 15,135s, saving over an hour of wall-clock time compared to 10 layers at 18,759s ($\rho = 0.89$).
Limitations and Future Work
- No Checkpoint Continuation (Warmstarting): Unlike training for additional epochs, progressively unfreezing layers on a running checkpoint alters optimization dynamics and interacts unpredictably with learning rate schedules. Thus, evaluations at each fidelity currently start from scratch.
- Manual Architecture Discretization: Determining where to cut layers requires heuristic or domain knowledge, which may not translate trivially to non-sequential or novel architectures.
- Layer-Specific Hyperparameters: The search spaces evaluated used uniform hyperparameters across layers; interactions with layer-specific hyperparameters (e.g., layer-wise learning rate decay) remain unexplored.
Summary updated