Reducing Hyperparameter Tuning Costs in ML, Vision and Language Model Training Pipelines via Memoization-Awareness

Abdelmajid Essofi, Ridwan Salahuddeen, Munachiso Nwadike, Elnura Zhalieva, Kun Zhang, Eric P. Xing, Willie Neiswanger, Qirong HoarXiv 2024 · DOI

Introduction

Hyperparameter tuning (HPT) is essential for achieving state-of-the-art performance in modern machine learning, yet it remains one of the most computationally expensive phases of the AI lifecycle. For large-scale models, such as Large Language Models (LLMs), a single training run can consume thousands of dollars in compute time. Standard HPT algorithms, like Bayesian Optimization (BO), typically treat the training process as a monolithic "black box." This approach is inefficient because real-world training pipelines are often sequential, consisting of multiple stages like data preprocessing, teacher model training, and student distillation.

When a researcher modifies a hyperparameter for a late-stage process, standard BO re-runs the entire pipeline from scratch, wasting resources on redundant early-stage computations. This paper introduces EEIPU (Expected-Expected Improvement Per Unit-cost), a memoization-aware BO algorithm designed to exploit the multi-stage nature of AI pipelines by caching intermediate results and intelligently discounting costs.

Methodology: The EEIPU Framework

The core innovation of EEIPU lies in its ability to treat training as a transparent sequence of stages rather than a single block. It incorporates three primary components:

  1. Memoization-Awareness: The system maintains a "Memoization Hash Table" containing the results of the top-performing pipeline runs. When evaluating a new candidate configuration, EEIPU checks if its early stages match a cached entry. If a match is found, the predicted cost for those stages is set to near-zero, as the results can be retrieved from storage.
  2. Stage-wise Cost Modeling: Instead of modeling total runtime, EEIPU employs separate Gaussian Processes (GPs) to predict the duration of each individual stage. This granularity allows the acquisition function to accurately calculate the "discounted" cost of a partial run.
  3. Cost-Cooling ($\eta$): To balance exploration and exploitation, a budget-based cooling factor is applied. Early in the search, the algorithm prioritizes low-cost exploration of cached paths; as the budget nears exhaustion, it shifts toward high-quality exploitation of potentially expensive but promising configurations.
The EEIPU acquisition function architecture, illustrating the integration of stage-wise cost GPs and the memoization hash table.

Experimental Evaluation

The researchers evaluated EEIPU against state-of-the-art baselines (e.g., CArBO, LaMBO) across several complex domains:

  • Machine Learning (Stacking): A 2-stage pipeline for loan classification.
  • Computer Vision (Segmentation): A 3-stage pipeline for aerial image analysis.
  • Language Models (T5): A 5-stage pipeline for fine-tuning and distilling T5 models (up to 770M parameters).
  • Synthetic Benchmarks: Multi-stage pipelines (3, 5, and 10 stages) using standard optimization functions.

Key Results

EEIPU demonstrated significant efficiency gains across all tested scenarios. By leveraging memoization, the algorithm completed an average of 103% more iterations than standard methods within the same time budget. In 10-stage synthetic pipelines, this improvement reached nearly 3x.

More importantly, the increased search volume translated directly into better model performance. EEIPU improved validation metrics (such as ROUGE scores for T5 or AUROC for stacking) by an average of 108% more than competing methods relative to the post-warm-up baseline.

Performance comparison showing the best objective value achieved per iteration. EEIPU (blue) consistently finds higher-quality solutions faster than baselines.

Discussion and Insights

The success of EEIPU can be understood through the "Breadcrumb Analogy." By caching successful intermediate states, the algorithm can retrace its steps to a known high-quality point and branch off into new hyperparameter territory without restarting the entire journey.

Interestingly, the authors found that caching only the top-5 configurations was optimal. Caching more led to diminishing returns due to the computational overhead of the BO search itself. The storage and retrieval costs remained negligible, typically representing less than 1-3% of total runtime.

Limitations and Future Work

While highly effective, EEIPU's performance can be sensitive to the correlation between cost and quality. If the best results are strictly tied to the most expensive hyperparameters (e.g., maximum epochs), the algorithm might over-explore "cheap" but low-quality regions early on. Additionally, like all BO methods, it requires an initial "warm-up" phase of random evaluations to seed its predictive models. Future work may extend these principles to foundation models where single-stage costs are even more prohibitive.

Conclusion

EEIPU represents a significant step toward making large-scale AI training more sustainable and accessible. By breaking the "black box" assumption and introducing memoization-awareness, it allows researchers to explore twice as much of the hyperparameter space for the same cost, leading to superior models in less time.

Summary updated

BibTeX
@misc{essofi2024reducing,
  author = {Abdelmajid Essofi and Ridwan Salahuddeen and Munachiso Nwadike and Elnura Zhalieva and Kun Zhang and Eric P. Xing and Willie Neiswanger and Qirong Ho},
  title = {{Reducing Hyperparameter Tuning Costs in ML, Vision and Language Model Training Pipelines via Memoization-Awareness}},
  year = {2024},
  eprint = {2411.03731},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.03731},
}
Figure