DiffCLIP: Differential Attention Meets CLIP
Hasan Abed Al Kader Hammoud, Bernard Ghanem
TL;DR
DiffCLIP extends the differential attention mechanism to the CLIP vision-language framework to suppress attention noise and sharpen cross-modal alignment with minimal overhead. By learning two complementary attention maps and subtracting one from the other in both vision and text streams, it yields more focused representations and stronger performance on linear probing, few-shot, retrieval, and zero-shot tasks, including improved robustness to out-of-domain shifts. The approach achieves these gains with roughly 0.003% extra parameters and demonstrates that differential attention can be effectively ported to multimodal settings, with additional benefits when applied to just the vision encoder. Ablation studies reveal a flexible design, including dynamic versus static lambda initialization and vision-only configurations, while early scaling ideas suggest further gains from larger models and datasets. Overall, DiffCLIP offers a lightweight, robust enhancement to vision-language pretraining with practical implications for multimodal understanding and deployment.
Abstract
We propose DiffCLIP, a novel vision-language model that extends the differential attention mechanism to CLIP architectures. Differential attention was originally developed for large language models to amplify relevant context while canceling out noisy information. In this work, we integrate this mechanism into CLIP's dual encoder (image and text) framework. With minimal additional parameters, DiffCLIP achieves superior performance on image-text understanding tasks. Across zero-shot classification, retrieval, and robustness benchmarks, DiffCLIP consistently outperforms baseline CLIP models. Notably, these gains come with negligible computational overhead, demonstrating that differential attention can significantly enhance multi-modal representations without sacrificing efficiency. Code can be found at https://github.com/hammoudhasan/DiffCLIP.
