Manuscript Offprint

arXiv:2610.03389

From Patching to Pruning Visual Computation in Vision Language Models

Rahul Chowdhury, Timothy A Rupprecht, Xuan Shen, Shaoyi Huang, Pu Zhao, Yanzhi Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

ABSTRACT

Vision-language models (VLMs) incur substantial inference cost because every visual token is processed by the attention and MLP projections of every decoder layer, even when token-specific visual computation is unnecessary at many depths. We introduce Patch-to-Prune (P2P), inspired by Mechanistic Interpretability, a training-free framework that converts activation patching from a diagnostic tool into an inference-time computation bypass. P2P performs validation-guided forward and backward layer sweeps to identify decoder regions whose visual-token projection outputs can be replaced by fixed neutral proxy activation vectors within a user-specified accuracy tolerance. Unlike conventional token-pruning methods, P2P preserves the sequence length, token order, positional information, attention mask, and residual pathways, thereby pruning computation without removing tokens or modifying the pretrained model weights. We evaluate P2P on four VLMs from the Qwen2.5-VL and LLaVA families across seven multi-modal benchmarks using mutually disjoint calibration, validation, and test partitions. P2P at a 3% tolerance retains around 94% of dense accuracy while reducing FLOPs by 55%. Beyond these efficiency gains, our layer-wise analysis suggests that visual processing in VLMs is non-uniformly distributed across decoder depth: early and late layers often require little token-specific visual computation, whereas intermediate layers appear to perform most task-relevant visual integration, enabling later reasoning to rely largely on visual information already embedded in shared residual and textual representations. This makes P2P both an efficient inference framework and a causal lens into visual information processing in VLMs.

1 INTRODUCTION

Vision–language models (VLMs) have achieved superior performance across visual question answering, multimodal reasoning, object recognition, and spatial understanding. This capability, however, comes with substantial inference cost. An input image is typically represented by hundreds or thousands of visual tokens, which are processed repeatedly by every decoder layer. Since visual tokens typically dominate the input sequence, repeatedly applying the attention transformations makes the language decoder a major computational bottleneck in VLM inference Zhao et al. (2024a); Shen et al. (2025e; 2026); Zhao et al. (2025a); Mi et al. (2026); Zhao et al. (2026a); Li et al. (2022); Zhang et al. (2022); Li et al. (2023a); Yang et al. (2023); Shen et al. (2025b).

Prior training-free acceleration methods like FastV Chen et al. (2024b) and PyramidDrop Xing et al. (2024) tackle this problem mainly by pruning visual tokens: they estimate each token's importance from early attention or similarity scores, then permanently discard tokens judged less relevant. However, this approach ignores how visual information actually flows through the network, and it overlooks the fact that a token's importance in later layers may not decrease monotonically—a token that seems unimportant early on could become critical downstream. This limitation raises a complementary question: which layers are actually responsible for processing visual tokens?

Figure

Figure 1: Framework of Patch-to-Prune

To investigate this problem, we first perform a layer sensitivity analysis through activation patching, which replaces the output of a selected module with a reference activation to identify its causal significance. Our analysis reveals a pronounced non-uniformity: substitution of visual-token projection outputs is well tolerated in many early and late layers, whereas an intermediate band of layers exhibits markedly greater sensitivity to such substitution. This pattern suggests that redundancy within VLM decoders is not uniformly distributed, but is instead systematically structured across depth.

Based on our layer sensitivity analysis, we propose Patch-to-Prune (P2P) shown in Figure 1, an acceleration framework that converts this diagnostic intervention into an actual inference-time computation bypass. P2P first runs the frozen VLM on a small calibration set and constructs a modality-conditioned activation prototype for every decoder layer and linear module. It then performs cumulative forward and backward patching sweeps on a disjoint validation set. These sweeps identify the layers whose visual-token computations can be replaced by corresponding prototypes while remaining within a specified accuracy tolerance. The union of these selected regions defines the set of pressable or safe layers during inference.

At test time, P2P does not perform the full computations. Instead, for visual tokens in safe layers, their outputs of attention projection modules are directly filled with cached activation prototype, without actual computations. Only textual tokens in safe layers and all tokens in other layers go through the typical attention computations. Importantly, P2P prunes computation rather than tokens. Input embeddings of visual tokens remain in the sequence throughout the network, and the original sequence length, token order, attention mask, and residual pathways are preserved. This design avoids the irreversible token-removal decisions by conventional pruning methods and enables P2P to be applied directly to pretrained VLMs without modifying their parameters, changing their architecture, or performing additional training. Our main contributions are as follows:

• We introduce P2P, an acceleration framework that uses modality-conditioned activation patching to localize redundant visual-token computations across decoder depth.

• We present a validation-guided, tolerance-controlled layer-selection procedure that provides an interpretable accuracy–efficiency trade-off.

• We convert post-hoc activation replacement into an actual computation bypass that skips selected attention and MLP projection matmuls while preserving all tokens and the original sequence structure.

• We demonstrate consistent FLOP and latency reductions across four VLMs and seven multimodal benchmarks, and show that decoder redundancy is concentrated near the early and late layers of the network. We demonstrate that our P2P-aware finetuning can adapt the model directly under its patched computation graph and substantially recover the accuracy lost under aggressive pressing.

References (38)