TL;DR
This paper introduces a formal framework that uses category theory and logic to automatically "build" search spaces for machine learning models. By treating components like LEGO bricks with strict rules (types), the system can synthesize valid neural architectures and optimize them using Bayesian methods, outperforming traditional syntax-based approaches.
What Problem Does This Paper Address?
In fields like Neural Architecture Search (NAS) and Hyperparameter Optimization (HPO), researchers usually have to manually define a "search space"—a set of all possible models the computer is allowed to try. This is often done using context-free grammars (CFGs), which are tedious to write and don't always guarantee that the resulting "sentences" (models) will actually work or make mathematical sense.
The authors identify a gap: we lack a general, automated way to derive these search spaces from a simple list of available components (like linear layers, activations, or sums) while ensuring that every synthesized model is structurally well-formed according to the underlying mathematical theory of parametric functions.
Methods
The authors bridge the gap between abstract math and practical code using three main pillars:
- The Para-construction: A concept from category theory that treats a machine learning model as a "parametric function"—a mapping where the behavior depends on both an input and a set of parameters. They formalize this using string diagrams, which visually represent how data and parameters flow through a system.
- Finite Combinatory Logic with Predicates (FCLP): This is the "engine" of the framework. It treats components as "combinators" with specific types. Given a repository of components and a target type (e.g., "a function from 1 input to 1 output"), the system automatically synthesizes a grammar of all possible valid compositions.
- CoSy (Combinatory Synthesizer) Extension: The authors extended an existing synthesis tool to support sampling and optimization. Once the search space is synthesized, they use Evolutionary Algorithms and Bayesian Optimization (BO) to find the best-performing model within that space.
Crucially, they interpret these synthesized terms as PyTorch modules, making the theory directly applicable to modern deep learning.
Datasets
Because this is a foundational paper focused on a new framework, the authors used a controlled synthetic environment to validate their ideas:
- The "Bounce" Function: A 1D piecewise-affine target function ($f^*(x) = 10 - |x|$).
- Training/Testing: They generated 1,000 training points in the interval $[-10, 10]$ and 1,000 testing points in a wider interval $[-15, 15]$ to evaluate out-of-distribution (OOD) performance.
- Components: A "parts bin" containing PyTorch modules:
Linear,Sigmoid,ReLU,Tanh,Sum,Product, andCopy.
Key Insights and Ideas
- Structure Over Syntax: The biggest "aha moment" is that kernels (similarity measures used in optimization) perform much better when they look at the graph structure (Directed Acyclic Multigraphs or DAMGs) of a model rather than its raw code "tree." This suggests that the categorical representation captures the actual functional behavior of the model better than the syntax does.
- Automatic Well-formedness: By using typed logic, the framework prevents the synthesis of "nonsense" models. If a component requires two inputs and you only give it one, the logic simply won't allow that model to exist in the search space.
- Compact Discovery: The system discovered a highly unconventional but effective model for the "bounce" function. Instead of a standard MLP, it found a compact architecture that applied ReLU directly to inputs and used a specific branching structure to perfectly mimic the target function with minimal parameters.
Key Results
- Bayesian Optimization vs. Random Search: BO consistently identified better models than random search across all tested search spaces.
- Kernel Alignment: The DAMG-based kernels showed significantly higher correlation with the actual objective function (test loss) compared to standard tree-based kernels.
- Predictive Performance: In the surrogate modeling task, the DAMG kernel achieved the lowest Normalized Mean Squared Error (0.781 vs. 0.837 for Tree kernels) and the highest $R^2$ score (0.367 mean, 0.893 max).
- Refinement Matters: Restricting the "structural variance" (narrowing the search space based on domain knowledge) improved the learnability of the objective, leading to better optimization results.
Limitations and Future Work
- Decidability: The authors note that checking if a search space is empty or finite is "semi-decidable." In practice, if a user defines a poorly constrained specification, the synthesis or sampling might not terminate.
- Tree Language Constraint: While FCLP can represent complex Horn-theories, the current implementation is confined to tree languages.
- Scaling: The proof-of-concept focused on a 1D toy problem. Future work is needed to see how this categorical synthesis scales to massive, real-world NAS problems (like searching for the next Transformer variant).
- Formal Soundness: The authors aim to develop a full categorical semantics for FCLP to formally prove that every synthesized model is "correct" relative to its mathematical specification.
Summary updated