TypoCD: Training-Free Contrastive Decoding for Typographic Defense in Large Vision-Language Models

Xia Sihan, Jing Li, Junhao Dong, Ivor Tsang, Yew-Soon Ong


Abstract
Large vision-language models (LVLMs) remain highly sensitive to text embedded in images: a misleading word printed, painted, or pasted onto an object can override visual evidence and flip the model’s answer. Existing defenses are often tied to specific vision encoders, require training or feature-level intervention, or do not operate on the autoregressive decoding interface of modern LVLMs. We propose TypoCD, a training-free contrastive decoding method for typographic robustness. TypoCD constructs a text-localized counterfactual view by detecting visible text regions and inpainting only the typographic content, then contrasts the attacked-image and typography-removed logits during decoding. This localized contrastive direction targets the attacker’s textual signal while preserving unrelated visual content, allowing TypoCD to subtract the typography-induced logit shift without modifying model parameters or internal features. Across three open-source LVLM backbones and synthetic, real-world, and safety-oriented typographic benchmarks, TypoCD recovers attacked-image accuracy to within a few percentage points of clean-image performance without per-backbone tuning, closing a gap that often exceeds 40 percentage points under attack. When combined with a simple prompt prefix, TypoCD also substantially reduces jailbreak attack success on safety-oriented typographic attacks.
Anthology ID:
2026.findings-emnlp.944
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
19905–19919
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.944/
DOI:
Bibkey:
Cite (ACL):
Xia Sihan, Jing Li, Junhao Dong, Ivor Tsang, and Yew-Soon Ong. 2026. TypoCD: Training-Free Contrastive Decoding for Typographic Defense in Large Vision-Language Models. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 19905–19919, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
TypoCD: Training-Free Contrastive Decoding for Typographic Defense in Large Vision-Language Models (Sihan et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.944.pdf