RAPID: In-Domain Distillation on Small Data, Surpassing SOTA with 5x Less Compute

RAPID uses three techniques for fast in-domain distillation on small data, surpassing SOTA with 5x less compute.
RAPID is an in-domain distillation method for data- and compute-constrained settings. It uses only a few target-domain samples to compress foundation models like CLIP and DINOv2 into specialized compact experts, combining progressive resolution scaling, token dropping, and multi-layer feature distillation. It surpasses SOTA on ImageNet distillation with 5x less compute; distilling ViT-S from scratch with 7k-197k samples beats DINOv2-S and nearly matches the DINOv2-B teacher, and the recipe generalizes to CLIP, C-RADIOv3, and DINOv3.
Vision foundation models (such as DINOv2 and CLIP) provide powerful general-purpose features, but their massive parameter counts and computational demands make them impractical for many real-world deployments. At the same time, specific application scenarios often only require a small fraction of a foundation model's capabilities. This mismatch makes in-domain distillation highly attractive: rather than preserving generality, compress the foundation model into a compact expert tailored to the target domain.
However, existing distillation methods are compute-intensive and rely on large general-purpose datasets, making them inaccessible to practitioners with limited data and compute. The recently proposed RAPID method offers a simple recipe focused on fast distillation on small data, surpassing the current state-of-the-art on the ImageNet distillation task with 5x less compute.

Why In-Domain Distillation Is Worth Attention
The generality of foundation models is both a strength and a burden. A ViT-B model pretrained on broad data may contain visual concepts across hundreds of categories, but scenarios like industrial quality inspection, medical imaging, or specific product recognition only need a small subset of those features.
Traditional distillation attempts to make the student model mimic the teacher's full capabilities, which both wastes compute and may introduce irrelevant noise. RAPID takes the opposite approach: abandon generality and focus on the target domain. The authors point out that typical application domains only require a small fraction of a foundation model's capabilities, and this mismatch is exactly where the value of in-domain distillation lies.
For teams with limited data and compute, this means they don't need to pretrain from scratch or distill using massive general-purpose datasets—just a small number of in-domain samples is enough to obtain a compact model that performs excellently on a specific task.
Knowledge distillation centers on having a smaller "student" model mimic the outputs or intermediate representations of a larger "teacher" model, thereby transferring the teacher's learned knowledge into a compact model. The classic approach is to have the student match the teacher's soft labels (logits) on large datasets, or align intermediate layer features. Distillation typically significantly compresses model size and inference cost, but traditional pipelines often require massive data and long training times—especially when the teacher model is large, where computational overhead is even higher. In-domain distillation is a variant of distillation: it does not aim for the student to inherit all of the teacher's general capabilities, but instead uses only a small number of samples from the target domain, focusing the student on learning the most critical features for that domain. This makes the distillation objective more focused and easier to complete under limited compute.
RAPID's Three Core Recipes
RAPID's design philosophy is "simple but effective," combining three techniques:
Progressive Resolution Scaling
Input image resolution is dynamically adjusted during training—lower resolution is used initially for fast convergence, then gradually increased to refine features. This significantly reduces the computational overhead of early training.
Token Dropping
Vision Transformers split images into multiple patch tokens, and RAPID drops some tokens during training to reduce self-attention computation. This strategy substantially lowers compute requirements while maintaining performance.
Vision Transformer (ViT) divides the input image into fixed-size patches, maps each patch to a token, and then models relationships between tokens through self-attention. Self-attention computation grows quadratically with the number of tokens, so higher input resolution and more tokens lead to greater training and inference overhead. Token dropping removes some tokens during training according to a strategy (e.g., random dropping or keeping high-importance tokens), reducing the number of tokens involved in attention computation and lowering memory usage and compute. Since dropped tokens may still contain useful information, training typically requires an appropriate drop ratio or recovery strategy to minimize impact on final performance.
Multi-Layer Feature Distillation
Rather than only matching the teacher model's final output, this aligns feature representations across multiple intermediate layers. This allows the student model to learn richer in-domain information from the teacher's hierarchical representations.
Combined, these three techniques enable RAPID to maintain high performance under low compute budgets. The authors emphasize that this recipe generalizes across multiple foundation models, including CLIP, C-RADIOv3, and DINOv3.
Intermediate layer feature alignment is a commonly used strategy in knowledge distillation. Different layers of a deep network learn representations at different levels of abstraction: shallow layers capture low-level information like edges and textures, while deeper layers are closer to semantic concepts. When only matching final outputs (logits), the supervision signal the student receives is relatively sparse; aligning feature maps from multiple teacher intermediate layers allows the student to be guided at multiple abstraction levels simultaneously, learning richer hierarchical representations. In practice, one typically needs to handle mismatches in feature dimensions between student and teacher—a common approach is to add a linear projection layer that maps student features to the teacher's dimension, then compute a distance loss between features. RAPID applies this strategy to in-domain distillation, enabling the student to absorb key information from the target domain through the teacher's hierarchical representations.
Impressive Results on Small Data
RAPID's most striking finding is that distilling a ViT-S from scratch with only 7k to 197k in-domain samples yields surprisingly strong results.
Across eight in-domain evaluations, RAPID's distilled ViT-S surpasses DINOv2-S and nearly matches its DINOv2-B teacher model. This means a compact student model can approach the level of a much larger teacher within a specific domain, while requiring far fewer parameters and much less compute.
Another notable conclusion is that in narrow-domain tasks, larger teacher models are actually more advantageous. This runs counter to the intuition that "large models are hard to distill"—the stronger the teacher, the more refined the in-domain features the student learns.
Implications for Practitioners
RAPID's value lies in lowering the barrier to in-domain distillation. Previously, distilling a foundation model required large-scale general-purpose datasets and substantial GPU hours; now, a small number of in-domain samples combined with a carefully designed training recipe is enough to obtain a deployable specialized model under limited compute.
The authors have committed to open-sourcing the code and models (https://github.com/ecker-lab/rapid/), which is good news for teams hoping to try in-domain distillation in practical projects. Note, however, that RAPID's evaluation focuses on the visual domain, and its applicability to other modalities remains to be verified.
Looking at the trend, the tension between foundation model capability surplus and deployment constraints will persist long-term. Methods like in-domain distillation that "condense large model knowledge into small models" may become an important bridge connecting research and real-world deployment.
One-line Summary
RAPID uses three techniques to quickly complete in-domain distillation on small data, surpassing SOTA with 5x less compute.
Paragraph Summary
RAPID is an in-domain distillation method designed for data- and compute-constrained scenarios. It abandons the goal of having the student model inherit all of the foundation model's general capabilities, instead using only a small number of target-domain samples to compress foundation models like CLIP and DINOv2 into specialized compact experts. The method combines progressive resolution scaling, token dropping, and multi-layer feature distillation, surpassing the current state-of-the-art on the ImageNet distillation task with 5x less compute. Experiments show that distilling ViT-S from scratch with only 7k to 197k in-domain samples surpasses DINOv2-S across eight evaluations and nearly matches the DINOv2-B teacher; the recipe also generalizes to CLIP, C-RADIOv3, and DINOv3, and larger teachers prove more advantageous in narrow-domain tasks. The authors have committed to open-sourcing the code and models.
Related articles

CLI-Anything: The GitHub Sensation That Lets AI Agents Take Over Any Desktop Program
GitHub project CLI-Anything converts GUI programs into CLI commands, letting AI agents like Claude Code and Codex call software directly. ~70K stars in nine months; supports ready-made repos and auto-generation from source, but requires strong models and source code.

Cursor Tab Deep Dive: How Predictive Multi-Line AI Coding Is Disrupting Traditional Autocomplete
An in-depth analysis of Cursor Tab predictive multi-line AI coding completion: from guessing line endings to guessing programming intent, it auto-generates multi-line code blocks, patches imports, and self-heals adjacent-line bugs. It examines the value of the local neural engine and the applicable boundaries of the claim that "typing syntax character by character is obsolete."

Second-Hand 5G Router Hides Backdoor: A Tailscale Intrusion Channel Named After Me
A second-hand 5G router was found with a Tailscale backdoor named after the buyer, revealing supply chain security blind spots in second-hand network devices and defensive measures for ordinary users.