[论文解读] PyGlove: Symbolic Programming for Automated Machine Learning
PyGlove 为自动化机器学习(AutoML)引入了一种符号编程范式,支持可变、可操作的机器学习程序,实现了搜索空间、搜索算法与子模型之间的解耦。通过将模型视为符号对象,PyGlove 支持动态程序变换,简化了复杂的搜索流程,并实现了架构与超参数的快速迭代,如在 ImageNet 和 NAS-Bench-101 上所展示的,显著提升了搜索效率与灵活性。
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.
研究动机与目标
- 为解决现有 AutoML 库中搜索空间、搜索算法与模型实现之间紧密耦合的问题,该问题阻碍了灵活的实验。
- 在搜索过程中支持对机器学习程序的动态修改,将模型视为可变的符号对象,而非不可变的代码。
- 通过在符号表示上进行元编程,支持复杂搜索流程(如嵌套或因子化搜索),实现对搜索逻辑的动态适应。
- 通过提供即插即用的搜索能力,降低将 AutoML 集成到现有机器学习流水线的门槛。
- 在 ImageNet 和 NAS-Bench-101 等真实世界 AutoML 基准上,展示符号编程的实际优势。
提出的方法
- 提出一种符号编程模型,通过注解使 Python 类和函数可变,支持运行时克隆与修改。
- 使用符号重绑定(如 `rebind` 方法)通过修改超参数(如卷积核大小、扩展比或滤波器数量)将静态模型转换为搜索空间。
- 使用元程序协调搜索空间、算法与子模型之间的交互,实现搜索逻辑的动态适应。
- 通过高阶采样构造(如 `pg.sample`)支持复杂搜索流程,允许嵌套或分阶段的搜索策略。
- 通过符号化变换将子模型转化为可微分的搜索空间,支持参数共享与超网络构建。
- 提供一个名为 PyGlove 的库,暴露 Python 中的符号编程原语,实现与现有机器学习代码的无缝集成。
实验结果
研究问题
- RQ1如何实现搜索空间、搜索算法与子模型之间的解耦,以支持独立的修改与实验?
- RQ2符号编程能否实现高效且可组合的搜索流程(如因子化或混合搜索)在神经架构搜索中的应用?
- RQ3符号操作在多大程度上能简化将 AutoML 集成到现有机器学习流水线的过程?
- RQ4符号编程在多大程度上提升了搜索空间与算法迭代的灵活性与速度?
- RQ5在真实世界基准中,通过符号操作支持的复杂搜索流程能带来多大的性能提升?
主要发现
- PyGlove 通过在卷积核大小、扩展比与通道宽度上应用符号重绑定,实现了将静态的 MobileNetV2 模型转化为搜索空间。
- 该库支持复杂的搜索流程,如因子化与混合搜索,其中节点与边的搜索在不同阶段解耦,提升了搜索效率。
- 在 NAS-Bench-101 上,PyGlove 的混合搜索实现了 94.8% 的 top-1 准确率,优于标准搜索方法,并实现了对架构空间更优的探索。
- 符号化方法显著减少了在参数共享与非参数共享搜索算法之间切换时所需的代码重构工作量。
- 用户可通过修改符号表示快速原型化并测试新的搜索空间与算法,而无需更改核心程序逻辑。
- 该框架在现有训练流水线中实现了无缝集成,使 AutoML 能够以最小改动添加到已有模型中。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。