Introduction
In the rapidly evolving field of deep learning, the path to a final model is rarely linear. Researchers often navigate a complex web of training, pruning, fine-tuning, and quantization. However, this iterative process frequently leads to a "reproducibility crisis." While code may be open-sourced, the ad-hoc experimental boilerplate used to reach specific model states is often lost or tangled, making it nearly impossible for others to reconstruct the exact provenance of a result.
Existing tools often fail to bridge this gap. Production-grade orchestrators like Airflow are often too cumbersome for the rapid iteration required in research, while experiment trackers like Sacred focus on hyperparameter logging rather than the causal "family tree" of model mutations. To address these challenges, we introduce dagger, a lightweight Python framework designed to track the entire evolutionary history of machine learning models.
The Dagger Formalism
The core of dagger is a formal graph-based approach to experiment management. It treats an experiment as a Directed Acyclic Graph (DAG), specifically a tree, composed of two primary elements:
- States ($S$): Nodes in the graph representing a specific model configuration and its context, including data, seeds, and hyperparameters.
- Recipes ($R$): Edges representing transformations or mutations applied to a state, such as a
TrainRecipeorPruneRecipe.
By enforcing this tree structure, dagger creates a clear "provenance" for every model. Any leaf node can be traced back to the root through a specific sequence of actions and parameters.
Technical Implementation
To ensure strict reproducibility and efficiency, dagger employs several key mechanisms:
Recursive Hashing and Caching
The framework computes a unique hash for every state ($h_j$) based on its own properties and the hash of its parent state ($h_j = H(S_j, h_i)$). This recursive hashing ensures that any change in the pipeline—even deep in the history—is reflected in the final state's identity. This also enables automated caching: if a researcher attempts to run an operation that has been previously executed, dagger retrieves the result from the cache, significantly reducing redundant computation.
Lazy Evaluation and Scalability
Built upon the Dask library, dagger allows researchers to define complex experiment trees symbolically before execution. This lazy evaluation enables the framework to optimize task scheduling and run operations in parallel across multiple threads, processes, or distributed clusters. Crucially, this scalability is achieved without requiring changes to the user's core logic, allowing a seamless transition from a local laptop to a high-performance computing (HPC) cluster.
Results and Visualization
The primary "results" of the dagger framework are functional improvements to the research workflow. One of the most immediate benefits is the ability to automatically generate visual maps of research progress.
As shown in the figure above, dagger tracks the level of each state and allows for tagging (e.g., 'lr:0.1', 'pruned'). This visualization provides researchers with an immediate overview of their experimental branches. Furthermore, the framework's "Slim Analysis" API allows users to load only the metadata of the experiment graph into memory. This enables efficient filtering and searching for specific states before committing to the resource-intensive process of restoring heavy model weights for evaluation.
Practical Application
While dagger is library-agnostic—working equally well with PyTorch, TensorFlow, or JAX—its utility is best demonstrated through standard ML workflows. For instance, in experiments involving VGG-11 architectures on the CIFAR-10 dataset, dagger can manage the branching paths of testing multiple pruning rates from a single pre-trained checkpoint, ensuring each path is cached and reproducible.
Limitations and Future Work
As a "minimalist" framework, dagger prioritizes ease of adoption over the extensive UI dashboards found in commercial trackers. Its current focus on tree structures (one parent per state) also means it does not yet naturally support "merging" states, such as those found in model ensembling or federated learning. Future iterations may explore extending the formalism to accommodate these more complex graph topologies.
Ultimately, dagger shines in branching research scenarios, providing a robust foundation for researchers to separate their scientific contributions from the overhead of orchestration.
Summary updated