Unified Functional Hashing in Automatic Machine Learning

Ryan Gillard, Stephen Jonany, Yingjie Miao, Michael Munn, Connal de Souza, Jonathan Dungay, Chen Liang, David R. So, Quoc V. Le, Esteban RealarXiv 2023 · DOI

Abstract

Automatic Machine Learning (AutoML) often suffers from high computational costs due to the redundant evaluation of functionally identical candidate models. This paper presents Unified Functional Hashing (UFH), a domain-agnostic method to detect functional equivalence by hashing model outputs on canonical inputs. Experimental results across diverse domains, including neural architecture search and reinforcement learning, demonstrate search speedups of up to 10x without compromising model quality.

1. Introduction

Automatic Machine Learning (AutoML) has revolutionized the design of neural architectures and learning algorithms by automating the search for optimal configurations. However, the computational cost remains a significant barrier. Evolutionary search methods often evaluate thousands of candidate solutions, each requiring full training and validation cycles that can span hours or days. This paper introduces Unified Functional Hashing (UFH), a technique designed to accelerate AutoML by identifying and skipping the evaluation of functionally redundant candidates.

A primary bottleneck in evolutionary AutoML is the high frequency of "silent mutations." These are changes to a model's underlying representation (genotype) that do not alter its external behavior (phenotype). For instance, swapping two commutative operations or adding a zero-weight layer results in a structurally distinct but functionally identical model.

Detecting such redundancies through structural comparison is computationally prohibitive. Graph isomorphism checks are complex, and a method tailored for neural network graphs typically fails to generalize to imperative code or symbolic expressions. Consequently, search algorithms frequently waste resources re-evaluating models they have effectively seen before.

3. Unified Functional Hashing (UFH)

The proposed solution, Unified Functional Hashing (UFH), shifts the focus from structural identity to functional equivalence. Instead of analyzing the model's internal graph, UFH characterizes a model by its behavior on a set of reference inputs.

3.1 Methodology

  1. Canonical Inputs: A small, fixed set of inputs (e.g., random vectors or a subset of the training data) is defined.
  2. Forward Pass: The candidate model is executed on these inputs for a minimal number of steps.
  3. Hashing: The resulting outputs (logits, error signals, or internal states) are concatenated and passed through a hash function to generate a unique "fingerprint."
  4. Functional Equivalence Caching (FEC): This fingerprint is used as a key in a global cache. If a new candidate produces a known hash, its performance score is retrieved from the cache, bypassing the expensive training process.

To further optimize the search, the authors introduce Functional Change Mutation (FCM). This strategy ensures that every mutation produces a functionally distinct child; if a mutation is silent, the algorithm continues mutating until the hash changes.

4. Experimental Evaluation

The versatility of UFH was evaluated across four distinct AutoML domains to demonstrate its unified nature:

  • MNAS: Searching for mobile-efficient CNN architectures on CIFAR-10. The search space consists of predefined blocks with searchable parameters like kernel size and filter count.
  • AutoRL: Evolving reinforcement learning loss functions, represented as computational graphs, for environments like CartPole and LunarLander.
  • AutoML-Zero: Evolving machine learning algorithms from basic mathematical primitives.
  • NAS-Bench-101: A large-scale benchmark used to analyze hash collision rates and noise robustness.
The MNAS search space, where blocks are predefined skeletons with searchable parameters such as kernel size and filter count.
The AutoRL search space, representing reinforcement learning loss functions as computational graphs.

5. Results and Discussion

The empirical results demonstrate that UFH significantly enhances search efficiency:

  • Search Acceleration: UFH-based techniques achieved speedups ranging from 2x to 10x across various benchmarks.
  • High Redundancy Detection: In certain search spaces, the cache hit rate reached 80-90%, indicating that the vast majority of generated candidates were redundant.
  • Improved Convergence: By avoiding redundant evaluations, the search can explore a larger portion of the solution space within the same compute budget, often leading to higher-quality final models.
  • Robustness to Noise: The method proved effective even in stochastic domains like RL. While hash collisions are theoretically possible, they were found to be negligible when using sufficient precision in the output representation.

6. Conclusion

Unified Functional Hashing provides a simple yet powerful framework for reducing the computational overhead of AutoML. By treating models as "black boxes" and comparing their outputs, UFH offers a domain-agnostic approach to redundancy detection. Future research directions include Functional Equivalence Aggregation (FEA), which could improve score estimation in noisy environments by averaging results across all functionally equivalent models found during the search.

Summary updated

BibTeX
@misc{gillard2023unified,
  author = {Ryan Gillard and Stephen Jonany and Yingjie Miao and Michael Munn and Connal de Souza and Jonathan Dungay and Chen Liang and David R. So and Quoc V. Le and Esteban Real},
  title = {{Unified Functional Hashing in Automatic Machine Learning}},
  year = {2023},
  eprint = {2302.05433},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.05433},
}
Figure