TL;DR
This paper introduces a greedy approximation algorithm that automatically assembles a "cascade" of pre-trained machine learning models to reduce inference costs. By routing "easy" examples to cheap models and "hard" ones to expensive ones, the authors achieve up to a 2x reduction in computation and a 6x reduction in memory I/O on ImageNet without sacrificing accuracy.
The Cost-Accuracy Trade-off in Inference
In modern machine learning, deploying models often involves a strict trade-off between accuracy and computational cost. State-of-the-art models (like NasNet) are highly accurate but require billions of operations, while "mobile-friendly" models (like MobileNet) are much faster but less precise.
The core observation driving this research is that not all examples are equally difficult. A simple, well-lit image of a banana might be easily identified by a tiny model, whereas a cluttered scene with a rare breed of dog requires a massive, high-resolution network. Ideally, an adaptive system should spend only as much "computational budget" as a specific image requires. While adaptive neural networks exist, they often require complex end-to-end training. This paper seeks a principled, post-processing method to combine existing pre-trained models into an efficient sequence, or "cascade," that minimizes average cost while hitting a target accuracy.
Methodology: Abstention and Greedy Cascades
The authors propose a framework based on two main components:
- Abstaining Models: Any standard model is converted into an "abstaining model" by adding a confidence rule. If the model isn't confident (e.g., the "logit gap" between the top two predictions is too small), it returns a "don't know" symbol and passes the example to the next stage in the cascade.
- The Greedy Cascade Algorithm: Finding the absolute optimal sequence of models and thresholds is NP-hard. To solve this, the authors use a greedy meta-algorithm. In each step, it selects the (model, threshold) pair that classifies the largest number of remaining examples per unit of cost, provided that the model meets a specific accuracy constraint on those examples.
Key Innovations: * Theoretical Guarantees: The authors prove that their greedy approach is a 4-approximation algorithm—meaning the resulting cascade's cost is at most four times that of the theoretical optimum. * Flexible Costs: The algorithm can account for "computation reuse." For example, if two models in the cascade share the first few layers of a ResNet, the algorithm recognizes that those layers only need to be computed once. * Decomposable Constraints: They define "decomposable" accuracy constraints, ensuring that if each stage is "accurate enough" on the subset of data it handles, the entire cascade will meet the overall accuracy goal.
Key Insights and Cascade Anatomy
The researchers evaluated their approach using the ImageNet classification task, utilizing a pool of 23 pre-trained models (including NasNet, Inception, and MobileNet). They split the standard validation set into two halves: 25,000 images to "train" the cascade (set thresholds) and 25,000 images to report final test results.
Surprisingly, simple confidence measures like the "logit gap" performed almost as well as complex logistic regression models at predicting whether a model's prediction would be correct.
Furthermore, the auto-generated cascades followed a highly intuitive progression. As shown in the table below, the algorithm naturally learns to use low-resolution images and small models first, requiring very high confidence to stop early. If the cheap model is unsure, the system moves to higher-resolution inputs and more complex architectures.
Results: Pushing the Pareto Frontier
The algorithm doesn't just save time; in some cases, it actually improves accuracy. By using a high-confidence threshold for a small model, the system only lets that model "speak" when it is very likely to be right, potentially avoiding errors a larger model might make on those specific "easy" images.
Highlights from the evaluation include:
- Computation Reduction: Compared to a high-end NasNet model, the generated cascade achieved the same accuracy with 1.5x fewer floating-point multiplications.
- Mobile Optimizations: When applied to a pool of MobileNet models, the cascade achieved a 2x reduction in cost while actually gaining 0.5% in top-1 accuracy.
- Memory I/O: By including quantized models (models with lower bit-precision) in the pool, the authors generated cascades that reduced average-case memory I/O by up to 6x with no loss in accuracy.
- Inception-v4: A cascade achieved a 1.8x cost reduction relative to a standalone Inception-v4 model with zero accuracy loss.
Limitations and Future Work
While highly effective, the algorithm relies on having a representative validation set to determine the optimal thresholds. If the distribution of "easy" vs. "hard" images changes significantly at test time, the cost-savings or accuracy might fluctuate.
Additionally, while the paper discusses "adaptive policy trees" (where the next model chosen depends on the specific output of the current model), the primary results focus on linear sequences. The authors note that the technical conditions required for the same theoretical guarantees on trees are harder to satisfy. Future work could integrate this method more tightly with Neural Architecture Search (NAS) to design models specifically intended to be "early exit" stages in a cascade.
Summary updated