Abstract
Modern computer vision models, while highly accurate, are often too computationally intensive for deployment on edge devices. This paper introduces TACO (Few-Shot Task-Aware COmpression), a technique that transforms large "generalist" models into lean "specialists" tailored for specific sub-tasks. Using only a handful of images per class, TACO reduces model parameters by 10–20x and provides up to 6x speedups on standard hardware with minimal impact on accuracy.
Introduction
State-of-the-art vision models like Vision Transformers (ViTs) and ConvNeXts have achieved remarkable performance but come with a high computational cost. A standard ViT can contain hundreds of millions of parameters, making it impractical for resource-constrained environments such as mobile phones or remote camera traps.
A key observation is that while these models are trained as generalists—capable of identifying thousands of categories—most real-world applications only require expertise in a narrow domain (e.g., identifying specific shark species). Traditional compression methods attempt to preserve performance across all original categories, which limits the potential for aggressive pruning. TACO asks: if we only care about a specific task, can we use that knowledge to compress the model more effectively?
The TACO Methodology
TACO operates in two primary stages, requiring only a tiny "calibration set" (typically 10 images per class):
1. Task-Aware Compression
Unlike standard magnitude pruning, TACO employs data-aware solvers to identify weights critical to the target task. The authors introduce HybridOBC, a solver that balances accuracy and speed. It applies Optimal Brain Compression (OBC) to sensitive layers while using faster approximations for larger layers. This allows an 86M parameter model to be specialized in approximately 10 minutes on a single GPU.
2. Few-Shot Tuning with Distillation
Pruning at high rates (e.g., >90% sparsity) typically leads to significant accuracy drops. TACO mitigates this by fine-tuning the sparse model on the calibration set. To prevent overfitting on such small data, the authors use self-distillation, where the sparse "student" model is trained to mimic both the output logits and the internal feature activations of the original dense "teacher" model.
Experimental Evaluation
The researchers evaluated TACO across several benchmarks, including ImageNet-1K and iNaturalist 2021. They tested 166 subtasks derived from WordNet hierarchies (e.g., "Vehicles," "Dogs") and taxonomic branches. Additionally, they applied TACO to transfer learning tasks (CIFAR, Caltech, Oxford Pets) and even generative models like Stable Diffusion v1.4.
Results and Discussion
The core finding, termed the "TACO Effect," demonstrates that task-specific compression is significantly more efficient than task-agnostic approaches. By focusing on a subset of data, the degree of sparsity can be doubled compared to generalist pruning while maintaining the same accuracy level.
Key Insights:
- Specialization Enables Sparsity: As tasks become more specific, models become more compressible. This suggests that large models contain specialized "circuits" for different concepts that can be isolated.
- Feature-Level Distillation: Mimicking internal activations is crucial in the few-shot regime to recover accuracy without memorizing the calibration set.
- Real-World Speedups: On an Apple M1 CPU, TACO models achieved 4x to 6x latency reduction. On NVIDIA T4 GPUs, speedups ranged from 60% to 2.5x.
Conclusion and Future Work
TACO provides a powerful framework for deploying high-performance vision models on the edge by specializing them for the task at hand. While the current work focuses on classification and text-to-image generation, future research could extend these principles to object detection and segmentation. Additionally, combining task-aware sparsity with low-precision quantization could lead to even greater efficiency gains.
Summary updated