Introduction
The machine learning research cycle is often fragmented. While libraries like PyTorch and TensorFlow have mastered low-level operations like backpropagation, researchers still spend a disproportionate amount of time on "plumbing": writing boilerplate for data preprocessing, manually managing hyperparameter grid searches, orchestrating distributed training on clusters, and refactoring research code for production deployment.
Flambé is an open-source Python framework designed to accelerate the machine learning research lifecycle by unifying prototyping, hyperparameter tuning, and deployment into a single, modular YAML-based interface. It allows researchers to move from local experimentation to distributed AWS clusters with minimal code changes, bridging the gap between flexible low-level libraries and rigid high-level tools.
Methods
The core of Flambé is its YAML-based configuration system. Every experiment—from data loading to model evaluation—is defined in a human-readable file. Key technical features include:
- Modular Extensions: Users can write custom Python classes and reference them in the YAML. Flambé can even pull these extensions directly from GitHub repositories or local paths.
- Object Linking (
!@notation): A powerful referencing system allows one stage of a pipeline to point to the output of a previous stage (e.g., an evaluator pointing to the "best" model produced by a trainer). - Native Hyperparameter Search: Using the
!gtag, users can define grid searches or distributions for random/Bayesian search directly in the config. - Distributed Execution: Flambé integrates with Ray and Tune to handle trial scheduling (like Hyperband) and distributed computation. Moving an experiment from a laptop to an AWS cluster requires only adding a small "manager" block to the YAML.
- Hierarchical Serialization: Unlike standard "pickled" models, Flambé saves model states in a directory structure that mirrors the object hierarchy. This makes it easy to inspect or swap specific components (like just the encoder) without loading the entire state.
Experimental Results
The authors demonstrate Flambé’s utility using two standard NLP benchmarks for text classification: TREC (question classification) and SST2 (binary sentiment analysis).
A primary case study involved distilling BERT (110M parameters) into a much smaller SRU (Simple Recurrent Unit) model (5M parameters). Using Hyperband scheduling within Flambé, the team found optimal hyperparameters in roughly half the time of standard search methods.
As shown in the results, the distilled SRU model outperformed a base SRU trained from scratch. On TREC, the distilled model achieved 95.5% accuracy (vs. 94.8% for base SRU), and on SST2 it reached 87.8% (vs. 86.2% for base SRU). Crucially, the final model maintained high performance while being >95% smaller than the original BERT model, significantly improving its viability for production environments.
Conclusion
Flambé addresses the "usability vs. flexibility" trade-off by providing a system where custom user code can be instantly integrated into a standardized, automated pipeline. By treating configuration as the "source of truth," it ensures high reproducibility and seamless scaling from local machines to cloud clusters.
Future work includes moving beyond the YAML-only dependency to support a pure Python API for dynamic experiment creation, expanding the library of off-the-shelf components, and implementing auto-scaling clusters based on pipeline stage requirements.
Summary updated