[Paper Review] Accelerating Deep Learning Inference via Freezing
This paper proposes Freeze Inference, a system that accelerates deep learning inference by caching intermediate layer activations using k-means clustering to enable approximate, low-latency inference. It reduces effective computation by up to 50% for 91.58% of CIFAR-10 requests on ResNet-18, achieving 92.85% accuracy with only 12.5MB of cache memory.
Over the last few years, Deep Neural Networks (DNNs) have become ubiquitous owing to their high accuracy on real-world tasks. However, this increase in accuracy comes at the cost of computationally expensive models leading to higher prediction latencies. Prior efforts to reduce this latency such as quantization, model distillation, and any-time prediction models typically trade-off accuracy for performance. In this work, we observe that caching intermediate layer outputs can help us avoid running all the layers of a DNN for a sizeable fraction of inference requests. We find that this can potentially reduce the number of effective layers by half for 91.58% of CIFAR-10 requests run on ResNet-18. We present Freeze Inference, a system that introduces approximate caching at each intermediate layer and we discuss techniques to reduce the cache size and improve the cache hit rate. Finally, we discuss some of the open research challenges in realizing such a design.
Motivation & Objective
- Address the growing inference latency in deep neural networks (DNNs) caused by increasingly complex, accurate models.
- Reduce prediction latency without sacrificing model accuracy, unlike prior methods such as quantization or distillation.
- Explore the feasibility of caching intermediate layer outputs to avoid full forward passes for a significant fraction of inference requests.
- Design a scalable, low-memory caching system that supports fast lookups and maintains high accuracy through approximate matching.
- Enable practical deployment of caching in real-world DNN serving systems with dynamic batching and incremental updates.
Proposed method
- Construct an offline cache of intermediate layer outputs from training data, using dimensionality reduction to compress high-dimensional tensors.
- Apply k-means clustering on the reduced-dimensional space to store only cluster centroids, minimizing memory footprint.
- Use k-nearest neighbors (k-NN) search to match new inputs to the closest cluster centroid for fast cache lookup.
- Introduce a confidence threshold to determine whether a prediction from the cached centroid is reliable enough to skip further layers.
- Optimize cache look-up performance by offloading distance computation to CPU, achieving ~20× speedup over a single DNN layer.
- Design a system that supports dynamic batching and incremental cache updates to adapt to new, frequently occurring inputs over time.
Experimental results
Research questions
- RQ1Can intermediate layer outputs in DNNs be effectively cached to avoid full forward passes for a significant fraction of inference requests?
- RQ2How can approximate caching be designed to balance memory usage, lookup speed, and prediction accuracy?
- RQ3What is the impact of layer-specific clustering and thresholding on the trade-off between latency reduction and accuracy?
- RQ4How can caching be integrated into GPU-based inference pipelines with dynamic batching?
- RQ5What mechanisms enable incremental, online cache updates without retraining the entire model?
Key findings
- Freeze Inference reduces the number of effective layers by up to 50% for 91.58% of CIFAR-10 requests on ResNet-18 through intermediate layer caching.
- The system achieves 92.85% accuracy on CIFAR-10 and 88.86% on CIFAR-100 when freezing predictions based on cached centroids.
- Cache look-up is approximately 20× faster than computing a single DNN layer, enabling low-latency inference.
- The final cache requires only 12.5MB of memory for ResNet-18, demonstrating high memory efficiency through k-means clustering.
- The trade-off between frozen request percentage and accuracy can be tuned via a threshold parameter, with higher thresholds improving accuracy at the cost of fewer frozen requests.
- The approach shows strong potential for real-world deployment, especially under non-uniform request workloads, though dynamic batching and online updates remain open challenges.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.