arXiv:2610.16813cs.CVOct 2026

Manuscript Offprint

arXiv:2610.16813

Carve VFM: Carving Specialists out of Generalists, Automatic Task-Specific Compression of Vision Foundation Models

Lotfi Abdelkrim Mecharbat, Abdelrahman Elsayed, Ibrahim Almakky, Martin Takáč, Mohammad Yaqub

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Vision foundation models (VFMs) provide transferable visual representations, but their inference cost limits deployment in many settings. Fine-tuning specializes a VFM without shrinking it; distillation shrinks it, but through expensive teacher-guided training. Structured pruning offers a more direct route by extracting a compact subnetwork from the VFM. However, as compression gets aggressive, existing methods fail because they treat subnetwork selection and recovery as separate axes. Across layers, capacity must follow task sensitivity rather than spread uniformly. Within a layer, a removal cannot be judged by importance alone; its impact also depends on how well the lost contribution can be recovered from what remains. Selection and recovery must therefore be decided jointly. We introduce Carve VFM, which resolves this interdependence. Given a VFM, a calibration set, and a parameter budget, it (i) searches for task-specific capacity allocations across layers; (ii) guides the search via an adaptive recovery-aware fitness criterion; and (iii) reconstructs removed behavior through iterative closed-form low-rank corrections merged into the surviving weights. The result is a dense encoder produced in minutes on a single GPU without backbone retraining. Across twelve benchmarks and four models from DINOv3 and MetaCLIP-2, Carve VFM achieves the highest reported mean accuracy in seven of eight backbone-budget configurations among the evaluated dense structured-pruning methods. Further fine-tuning surpasses the strongest evaluated edge model (88.1% vs. 85.8%), and carved models cut compute and memory while delivering 1.3-2.0× higher GPU throughput than the uncompressed one. These results show that the compact model you need is inside the VFM; it only has to be carved out.

Date: Oct 12, 2026

1 Introduction

Vision foundation models (VFMs) derive their value from generality: their representations transfer well across tasks and domains [31]. In deployment, however, this generality can become a practical liability [1]. A model trained to represent a broad visual world may ultimately serve a narrow task such as distinguishing cars or tissues. We call resolving this mismatch VFM specialization: given a pretrained VFM, a target task, and a parameter budget, derive the most accurate task-specific model that fits within that budget.

Pretraining is done once and amortized over many uses, whereas inference is paid for on every input for the model's lifetime. In production, inference indeed accounts for a large share of ML energy use [25].

Fine-tuning techniques fit the VFM to the target task but preserve its computational cost. Parameter-efficient updates reduce training cost but still execute the full model at inference [12]. On the other side, knowledge distillation can yield compact student models that run faster, but it requires a costly teacher-guided training process [5, 11].

Structured pruning offers a more direct route by removing entire components, such as MLP channels or attention heads, to produce a smaller dense model [2]. Beyond efficiency, pruning can also improve transfer learning by eliminating pretrained components that are detrimental to a target task [18]. These observations suggest that a VFM contains task-specific subnetworks hidden within its general-purpose architecture, a hypothesis supported by recent work that successfully extracts such subnetworks [27, 29, 39]. Local importance scores can rank structures within a layer, yet they provide little guidance on how model capacity should be distributed across layers or which pruning operator is suitable for each layer. As Figure 1 illustrates, under the same 10M parameter budget, the optimal allocation varies across tasks, while poorly allocated removals can degrade accuracy. A first challenge is therefore allocation; specialization requires discovering a task-specific

Figure

Figure 1 Task accuracy after pruning ViT-S from 21.6M to 10M parameters under different layer-wise allocations. Results are mean±std over 3 seeds. The unpruned model is included for reference.

allocation to find a good subnetwork within the VFM.

At mild compression, pruning can concentrate on redundant or detrimental structures, often preserving and occasionally improving accuracy. As the budget tightens, however, useful structures can also be removed. At this point, a removal depends not only on the importance of its contribution, but also on how well that contribution can be reconstructed from the remaining structures. Recovery methods exploit this redundancy by compensating output bias or fitting low-rank corrections to the compression residual [3, 20], yet they are typically applied only after subnetwork selection. As a result, two equal-budget subnetworks may incur similar degradation after pruning, yet differ substantially in how faithfully their lost behavior can be reconstructed. The second gap is therefore recoverability: subnetwork selection should favor structures whose lost contributions can be recovered from the surviving model, rather than simply the least important ones.

Ideally, the search would rank subnetworks by their recovered task accuracy. In practice, this would require repeatedly extracting, repairing, and evaluating thousands of candidate subnetworks, making exhaustive evaluation infeasible. Cheap local criteria enable efficient exploration but cannot capture cross-layer interactions or the preservation of the target task's decision boundaries. Conversely, feature reconstruction alone is not enough, as faithfully reproducing pretrained representations does not guarantee task discrimination [19]. The third gap is therefore evaluation: the search requires a proxy that is both inexpensive for exploration and predictive of the recovered task accuracy that ultimately determines deployment performance.

We address these challenges with Carve VFM, which jointly searches capacity allocations and attention removal operators under a parameter budget, using recoverability-aware local-global evaluation. The selected subnetwork is carved and repaired into a dense task-specific model. Our main contributions are:

  • Task-specific allocation. We formulate VFM specialization as allocation under a parameter budget and introduce a unified search space over layer-wise MLP and attention capacity together with attention removal operators.

  • Adaptive local-to-global selection. We introduce a recoverability-aware fitness in which cached conditional-recovery estimates enable inexpensive exploration, while a held-out task audit detects when the local ordering is unreliable and adaptively guides the search.

  • Mergeable iterative repair. We develop a closed-form low-rank recovery that iteratively transfers useful behavior from removed structures into the surviving weights and leaves no additional inference branch.

References (38)