Interpreting the Second-Order Effects of Neurons in CLIP

Yossi Gandelsman, Alexei A. Efros, Jacob Steinhardt
2/12/2026

No official code found. Best implementation: yossigandelsman/second_order_lens (41 stars, MIT, last commit 2024-11-15).

Abstract

We interpret the function of individual neurons in CLIP by automatically describing them using text. Analyzing the direct effects (i.e. the flow from a neuron through the residual stream to the output) or the indirect effects (overall contribution) fails to capture the neurons' function in CLIP. Therefore, we present the"second-order lens", analyzing the effect flowing from a neuron through the later attention heads, directly to the output. We find that these effects are highly selective: for each neuron, the effect is significant for<2% of the images. Moreover, each effect can be approximated by a single direction in the text-image space of CLIP. We describe neurons by decomposing these directions into sparse sets of text representations. The sets reveal polysemantic behavior - each neuron corresponds to multiple, often unrelated, concepts (e.g. ships and cars). Exploiting this neuron polysemy, we mass-produce"semantic"adversarial examples by generating images with concepts spuriously correlated to the incorrect class. Additionally, we use the second-order effects for zero-shot segmentation, outperforming previous methods. Our results indicate that an automated interpretation of neurons can be used for model deception and for introducing new model capabilities.

View on arXivView PDF

Code Implementations(1)

MIT

Official pytorch implementation of "Interpreting the Second-Order Effects of Neurons in CLIP"

412Python, Jupyter NotebookMay 24, 20241 years agoMIT

Similar Papers

Cite this paper

@article{gandelsman2026interpreting,
  title  = {Interpreting the Second-Order Effects of Neurons in CLIP},
  author = {Yossi Gandelsman and Alexei A. Efros and Jacob Steinhardt},
  year   = {2026},
  eprint = {2406.04341},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2406.04341},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.04341.svg)](https://codeofpaper.com/paper/2406.04341)

Discussion