NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CoSy: Evaluating Textual Explanations of Neurons

Laura Kopf, Philine Lou Bommer, Anna Hedström, Sebastian Lapuschkin, Marina M.-c. Höhne, Kirill Bykov

TL;DR

This paper introduces CoSy, a novel, architecture-agnostic framework for quantitatively evaluating textual explanations of neurons in Deep Neural Networks (DNNs). By leveraging generative AI to create synthetic images from textual explanations, CoSy allows for an objective assessment of explanation quality without human intervention, revealing significant differences in performance among existing explanation methods.

What Problem Does This Paper Address?

Understanding the inner workings of Deep Neural Networks (DNNs) is a major challenge. While researchers have developed methods to describe what individual neurons "detect" using human-understandable text (e.g., "pomegranate," "red objects"), a significant hurdle is the lack of a standardized, quantitative way to evaluate the quality of these textual explanations. Existing methods often rely on ad-hoc evaluations or human studies, which can be subjective and difficult to compare across different approaches. This makes it hard to definitively say which explanation method is truly better or how reliable these explanations are.

Methods

The core of CoSy is a three-step framework:

  1. Generate Synthetic Data: Given a textual explanation for a neuron (e.g., "pomegranate"), CoSy uses a text-to-image generative model (like SDXL) to create a set of synthetic images that visually represent this concept.
  2. Collect Neuron Activations: The trained DNN is then fed both these synthetic images and a set of natural "control" images (representing concepts the model was originally trained on). The activations of the target neuron are recorded for both sets of images.
  3. Score Explanations: CoSy quantifies the quality of the explanation by comparing the neuron's activation patterns on the synthetic images versus the control images. Two primary metrics are used:
  4. Area Under the Receiver Operating Characteristic (AUC): Measures how well the neuron can distinguish between concept-related (synthetic) and non-concept-related (control) images. A higher AUC indicates a better explanation.
  5. Mean Activation Difference (MAD): Quantifies the difference in the average activation of the neuron on synthetic versus control images.

This approach is architecture-agnostic, meaning it can be applied to any DNN.

Datasets

  • ImageNet validation dataset: Used as a control dataset for evaluating neuron responses and for generating natural images.
  • Places365 dataset: Used to investigate dataset dependency and prompt bias in image generation.
  • Broden dataset: Mentioned in the context of NetDissect, which uses pixel-level annotated image datasets for concept identification.
  • Milannotations dataset: Used by MILAN for training its language model.

No new datasets were introduced; the focus is on evaluating existing explanation methods using existing datasets.

Key Insights and Ideas

  • Bridging the gap: CoSy provides the first general-purpose, quantitative framework for evaluating textual neuron explanations, addressing a critical need in the field of explainable AI (XAI).
  • Generative AI as an evaluator: The novel use of text-to-image models to create synthetic data points for evaluation is a key innovation.
  • Layer-specific performance: Explanation methods generally perform better for neurons in higher layers of a network, where more abstract, high-level concepts are learned, compared to lower layers which represent more basic features.
  • Method variability: There's substantial variability in the quality of explanations provided by different methods, with some consistently outperforming others.
  • Prompt engineering matters: The choice of prompts for text-to-image models significantly impacts the similarity between generated synthetic images and natural images.

Key Results

  • Benchmarking: INVERT and CLIP-Dissect consistently achieved the highest AUC scores across various models and datasets, indicating superior explanation quality. MILAN generally performed poorly, with scores close to random guessing, likely due to its tendency to generate abstract concepts that are hard for text-to-image models to render accurately.
  • Layer Analysis: Performance generally increases with network depth. For example, in ResNet18, explanation quality (measured by AUC and MAD) was lower for lower layers compared to the output layer.
  • Sanity Checks: CoSy demonstrated reliability by showing that:
  • Synthetic images generated with specific prompts (e.g., "realistic photo of a close up of [concept]") showed higher similarity to natural images.
  • DNNs responded similarly to both synthetic and natural images, with only minor differences in activation.
  • True explanations (derived from known class labels) consistently received high scores, while random explanations received low scores, validating CoSy's effectiveness.

Limitations and Future Work

  • Limitations:
    • Generative Model Dependency: The quality of CoSy's evaluation is tied to the capabilities of the text-to-image models used. These models might not have all concepts in their training data, or may struggle with highly abstract concepts.
  • Abstract Concepts: Explaining low-level, abstract features (e.g., textures, edges) remains challenging for current explanation methods and generative models.
  • Future Work:
    • Extended Evaluation Metrics: Incorporating human judgment or evaluating explanation quality based on downstream task performance.
  • Broader Domains: Extending CoSy to Natural Language Processing (NLP) and healthcare applications.
  • LLM Explanations: Evaluating explanations from large language models (LLMs).
  • More Sophisticated Models: Exploring specialized or constrained generative models for improved synthetic data generation.

Summary updated

BibTeX
@inproceedings{kopf2024cosy,
  author = {Laura Kopf and Philine Lou Bommer and Anna Hedström and Sebastian Lapuschkin and Marina M.-C. Höhne and Kirill Bykov},
  title = {{CoSy: Evaluating Textual Explanations of Neurons}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=GGDSFjY6Tn},
}
Figure