arXiv:2611.01513cs.CVNov 2026

Manuscript Offprint

arXiv:2611.01513

Label-Free Localization and Test-Time Suppression of CLIP's Typographic Circuits

Bohan Liu, Wenqian Ye, Guangzhi Xiong, Zhenghao He, Sanchit Sinha, Aidong Zhang

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

Abstract

CLIP-based Vision-Language Models have become cornerstones of modern multimodal systems. The cross-modal contrastive objective equips the CLIP vision encoder to both see objects and read text. These two abilities induce an entanglement between the encoding of lexical and semantic shapes, creating a distinctive vulnerability to typographic attacks, in which rendered text overrides an image's semantic content with its literal meaning. The black-box nature of these encoders has prevented a mechanistic interpretation of such entanglement. We introduce a head-decomposed Sparse Dictionary Learning (SDL) architecture that, by design, decomposes individual attention heads into interpretable, head-specific latents. Based on this inductive disentanglement, we re-purpose Clarity Score and propose normalized Text Attribution Score, which are both label-free, to identify attention heads that carry typographic information. As a causal validation of successful circuit separation, we perform a mechanistic intervention that reweighs attention away from the patch tokens in the identified lexical heads at test-time. Experiments show that the intervention effectively recovers object classification under typographic attack and, across five CLIP variants and four typographic benchmarks, achieves up to 46.9% improvement while incurring up to 1% accuracy loss in general image perception, outperforming prior supervised and training-free methods. Expanding on the mechanistic intervention, we propose a test-time adaptive attention head routing to further reduce the impact on performance at matched robustness, pushing beyond the Pareto frontier of current robustness-perception tradeoff.

1 Introduction

Vision encoders trained on web-scale image-text pairs develop two distinct visual processing capacities. They encode semantic shape for zero-shot recognition, while also encoding lexical shape from rendered text, both capacities induced by the contrastive objective in Contrastive Language-Image Pretraining (CLIP) (Radford et al. 2021). Their entanglement creates a distinctive failure mode: rendered text can distract CLIP models from semantic shape, shifting visual encoding toward the text's literal meaning: in Figure 1, a cat overlaid with the text "Goose" is misclassified as a goose.

This entanglement, exploited by typographic attacks (Goh et al. 2021), has been studied in black-box defenses (Azuma and Matsui 2023; Materzyńska, Torralba,

Figure

Figure 1: Motivating example. A superimposed “Goose” text causes CLIP to label a cat as a goose.

and Bau 2022). The mechanistic question of where in the network lexical and semantic processing live, and at what computational granularity they are separable, has remained underexplored. Existing interpretability tools for CLIP either decompose the residual stream into per-layer and per-head components through text-based analysis (Gandelsman, Efros, and Steinhardt 2024a,b) or apply Sparse Autoencoders (SAEs) (Huben et al. 2024) to layer outputs as monolithic blocks (Zaigrajew, Baniecki, and Biecek 2025; Dreyer et al. 2025b). These approaches either fail to leverage the spatial routing of information within an attention head or ignore the division of labor across attention heads, resulting in minimal findings beyond superficial observation of letter-reading attention modules. Meanwhile, Dyslexify (Hufe et al. 2025) investigates the attention weight distribution over text and object shapes, but does not verify what the attended tokens encode in the latent space.

In this paper, we argue that the individual attention head is the key unit for interpreting and resolving such entanglement. Multi-Head Self-Attention (MHSA) is designed to project the residual stream into parallel low-dimensional subspaces, apply attention separately within each subspace, and recombine via an output projection (Vaswani et al. 2017). As descriptive context, head outputs in the last 20% of transformer blocks are approximately mutually decorrelated under Centered Kernel Alignment (Kornblith et al. 2019) (CKA panels and discussion in the supplement). The primary evidence that the per-head unit is the right granularity is causal and comes from our matched-capacity ablation against a monolithic dictionary (supplement). Therefore, sparse decompo-

∗^{*}Corresponding author.

sition methods that aggregate across heads contradict this structure, increasing the polysemanticity of learned activations under the sparsity constraints.

We close this gap with a head-decomposed sparse transcoder that interprets the subspace structure of MHSA. Independent encoders operate on individual head outputs, and a joint decoder reconstructs the post-projection residual stream. The encoder preserves head-local activation by construction, whereas the decoder respects the downstream computation that recombines head latents through the output projection. Our dictionary design provides localized head-level concepts that underpin our circuit mining metrics: Clarity Score, an unsupervised measure of cluster concentration that captures the geometric signature of semantic processing, and normalized Text Attribution Score, which operates on minimally augmented unlabeled images to provide causal concept attribution. They provide a strong signal that separates lexical concepts from semantic concepts without class labels.

Subsequent circuit mining reveals a separation between lexical and semantic processing among attention heads. Per-head latents partition into two distinct populations: object concepts activate on semantic shapes, and their activating image sets cluster tightly in CLIP space. In contrast, lexical concepts activate on image sets that are visually disparate, held together only by the presence of rendered text. Individual attention heads have concept dictionaries that are overwhelmingly composed of either type. By reweighting attention away from text patches in the identified lexical heads, we causally suppress the lexical circuit while preserving the semantic stream. This mechanistic intervention recovers the semantic representation under typographic attacks, with consistent accuracy gains across five CLIP variants and four typographic benchmarks (up to 46.9%) and less than 1% accuracy loss on general clean-data classification. Beyond a practical defense, the result establishes that typographic vulnerability arises from localized entanglement within the CLIP encoder, and disentangling the circuits recovers semantic perception.

Building up on the mechanistic insights, we propose a test-time adaptive intervention that activates based on individual attention module's output norm, allowing further mitigation of clean-data performance loss and preservation of the model's internal representations. Experiments show that adaptive intervention pushes beyond the Pareto frontier established by prior arts. We summarize our contributions as follows:

  • Head-decomposed sparse transcoders. We introduce a sparse decomposition architecture that respects the subspace structure of MHSA, motivated by the subspace structure of MHSA, with late-layer head decorrelation as supporting evidence and the mechanistic prerequisite of self-supervised circuit mining signals.

  • Localization of lexical and semantic processing. We identify the geometric and attributional signals of the two processing streams: we discover that the Clarity Score (Dreyer et al. 2025a), introduced for concept-concentration evaluation, doubles as a head-level robustness indicator, and we propose the normalized Text Attribution Score to separate lexical and semantic attention heads without concept labels.

  • Causal intervention recovers semantic perception. We demonstrate that intervention on identified lexical components recovers object classification under typographic attack across five CLIP ViT variants and four benchmarks, with sub-1% cost on general classification, outperforming supervised and unsupervised baselines, and an input-conditional adaptive variant that fires only on heads exceeding their clean firing statistics retains the defense at near-zero clean-data accuracy cost on every variant.

References (40)