Skip to main content
QUICK REVIEW

[Paper Review] PyGlove: Symbolic Programming for Automated Machine Learning

Daiyi Peng, Xuanyi Dong|arXiv (Cornell University)|Jan 21, 2021
Machine Learning and Data ClassificationComputer Science7 citations
TL;DR

PyGlove introduces a symbolic programming paradigm for Automated Machine Learning (AutoML), enabling mutable, manipulable ML programs that decouple search spaces, search algorithms, and child models. By treating models as symbolic objects, PyGlove allows dynamic program transformation, simplifying complex search flows and rapid iteration on architectures and hyperparameters, as demonstrated on ImageNet and NAS-Bench-101 with improved search efficiency and flexibility.

ABSTRACT

Neural networks are sensitive to hyper-parameter and architecture choices. Automated Machine Learning (AutoML) is a promising paradigm for automating these choices. Current ML software libraries, however, are quite limited in handling the dynamic interactions among the components of AutoML. For example, efficientNAS algorithms, such as ENAS and DARTS, typically require an implementation coupling between the search space and search algorithm, the two key components in AutoML. Furthermore, implementing a complex search flow, such as searching architectures within a loop of searching hardware configurations, is difficult. To summarize, changing the search space, search algorithm, or search flow in current ML libraries usually requires a significant change in the program logic. In this paper, we introduce a new way of programming AutoML based on symbolic programming. Under this paradigm, ML programs are mutable, thus can be manipulated easily by another program. As a result, AutoML can be reformulated as an automated process of symbolic manipulation. With this formulation, we decouple the triangle of the search algorithm, the search space and the child program. This decoupling makes it easy to change the search space and search algorithm (without and with weight sharing), as well as to add search capabilities to existing code and implement complex search flows. We then introduce PyGlove, a new Python library that implements this paradigm. Through case studies on ImageNet and NAS-Bench-101, we show that with PyGlove users can easily convert a static program into a search space, quickly iterate on the search spaces and search algorithms, and craft complex search flows to achieve better results.

Motivation & Objective

  • To address the tight coupling between search spaces, search algorithms, and model implementations in existing AutoML libraries, which hinders flexible experimentation.
  • To enable dynamic modification of ML programs during search, treating models as mutable symbolic objects rather than immutable code.
  • To support complex search flows—such as nested or factorized search—by allowing meta-programming over symbolic representations.
  • To lower the barrier for integrating AutoML into existing ML pipelines by enabling plug-and-play search capabilities.
  • To demonstrate the practical benefits of symbolic programming in real-world AutoML benchmarks like ImageNet and NAS-Bench-101.

Proposed method

  • Introduces a symbolic programming model where Python classes and functions are made mutable via annotations, allowing runtime cloning and modification.
  • Uses symbolic rebindings (e.g., `rebind` method) to transform static models into search spaces by modifying hyperparameters like kernel size, expansion ratio, or filters.
  • Employs meta-programs to mediate interactions between search space, algorithm, and child model, enabling dynamic adaptation of search logic.
  • Supports complex search flows via higher-order sampling constructs (e.g., `pg.sample`) that allow nested or phased search strategies.
  • Enables weight-sharing and super-network construction by symbolically transforming child models into differentiable search spaces.
  • Provides a library, PyGlove, that exposes symbolic programming primitives in Python for seamless integration with existing ML code.

Experimental results

Research questions

  • RQ1How can we decouple search space, search algorithm, and child model to enable independent modification and experimentation?
  • RQ2Can symbolic programming enable efficient and composable search flows such as factorized or hybrid search in NAS?
  • RQ3To what extent can symbolic manipulation simplify the integration of AutoML into existing ML pipelines?
  • RQ4How does symbolic programming improve the flexibility and speed of iterating on search spaces and algorithms?
  • RQ5What performance gains can be achieved with complex search flows enabled by symbolic manipulation in real-world benchmarks?

Key findings

  • PyGlove enables the conversion of a static MobileNetV2 model into a search space by applying symbolic rebindings to tune kernel size, expansion ratio, and channel width.
  • The library supports complex search flows such as factorized and hybrid search, where node and edge search are decoupled across phases, improving search efficiency.
  • On NAS-Bench-101, PyGlove’s hybrid search achieved a top-1 accuracy of 94.8%, outperforming standard search and enabling better exploration of the architecture space.
  • The symbolic approach reduced the need for extensive code refactoring when switching between weight-sharing and non-weight-sharing search algorithms.
  • Users could rapidly prototype and test new search spaces and algorithms by modifying symbolic representations without changing core program logic.
  • The framework demonstrated seamless integration into existing training pipelines, allowing AutoML to be added to pre-existing models with minimal changes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.