Zero-Shot Natural Language Explanations

Fawaz Sammani, Nikos DeligiannisICLR 2025

Introduction: The Need for Faithful Explanations

Deep learning models are notoriously opaque. When an image classifier mistakes a leatherback turtle illuminated by red light for a volcano, we naturally want to know why. Standard interpretability tools like Grad-CAM provide heatmaps showing where the model looked, but they fail to explain the underlying reasoning or semantic features that triggered the decision.

Heatmaps showing a model misclassifying a leatherback turtle as a volcano.

Existing Natural Language Explanation (NLE) systems attempt to solve this by generating descriptive sentences. However, they suffer from a severe "faithfulness" problem. Because these systems are typically trained on human-annotated datasets, they often learn to generate what a human expects to hear (e.g., "this is a bird because it has wings") rather than what the model actually saw. This phenomenon is known as shortcut bias. Furthermore, these systems usually require massive datasets of image-caption pairs to train, making them difficult to apply to new, specialized models.

To address this, researchers have introduced a way to generate faithful NLEs for any pre-trained vision model without needing a single sentence of training data. By training a tiny mapping module in just seconds to link text to a classifier's internal weights, the authors can "interrogate" the model to reveal the actual visual features—like a "bright red glow"—that led to a specific prediction.

Methods: Bridging Vision and Language Zero-Shot

The authors propose a zero-shot approach that bridges the gap between visual features and natural language by exploiting the classifier's own internal "knowledge."

  1. Learning Class Embeddings: Every classifier has a weight matrix where each row represents a class (e.g., "tench" or "volcano"). These weights are essentially embeddings in a visual-semantic space. The authors train a simple Multi-Layer Perceptron (MLP) to map text embeddings (from a frozen encoder like Sentence-BERT) to these classifier weights.
  2. The "10-Second" Training: This MLP is trained using only the class names of the model (e.g., the 1,000 labels of ImageNet). Because the dataset is so small, training takes mere seconds on a single GPU.
  3. Zero-Shot Generation: To generate an explanation for a specific image, they use a frozen Pretrained Language Model (PLM) like GPT-2. They employ inference-time prefix tuning, which optimizes a small set of "prefix" vectors to steer the GPT-2 model. The goal is to generate words that, when passed through the MLP, closely match the actual visual features the classifier extracted from the image.
  4. Data Augmentation: To handle the data scarcity of only having 1,000 class names, they use Input Dropout and a novel Learned Soft Dropout (using Gated Linear Units) to help the MLP generalize to arbitrary text.

Datasets and Evaluation

The MLP is trained using the class names and weights from 38 different pre-trained vision models (including ResNets, ViTs, and ConvNeXts), primarily on ImageNet-1K.

To evaluate the approach, the authors utilized several benchmarks:

  • ImageNet-X: Used to test the quality and faithfulness of the generated NLEs.
  • MSCOCO: Used to benchmark zero-shot image captioning capabilities.
  • Places365 & DTD (Describable Textures Dataset): Used to test how well the method transfers to entirely new domains without further training.

Key Insights and Results

The Classifier is the Key: The most elegant insight of this work is that a classifier’s weights already contain the semantic map needed for explanations. We don't need to train a new vision-language model from scratch; we just need a "translator" (the MLP) to access what's already there.

Faithfulness via Alignment: By forcing the generated text to align with the classifier's internal weights, the explanation is inherently more "faithful." If the model is biased toward a specific color or texture, the explanation will reflect that, rather than providing a generic "textbook" description. On the ImageNet-X test set, these zero-shot NLEs outperformed supervised baselines (which were trained on 141K samples) on semantic metrics like CLIP-S (30.56 vs 28.52).

Uncovering Model Shortcuts: The method can reveal embarrassing model secrets. For example, the authors found a ResNet-50 associated "jellyfish" with "glowing." This suggests the model isn't looking for the biological features of a jellyfish, but simply a specific lighting effect common in its training photos.

State-of-the-Art Zero-Shot Captioning: The method achieved top results on the MSCOCO benchmark for zero-shot captioning, even outperforming models that used much larger vision-language encoders like CLIP. It also generalized well to new datasets like Places365 (scene recognition) and DTD (textures), proving it isn't just memorizing ImageNet labels.

Limitations and Future Work

While promising, the approach has a few limitations:

  • Inference Speed: Because the method uses an optimization process at inference time (prefix tuning), generating a single explanation takes about 35 seconds. This is significantly slower than supervised models that generate text in a single forward pass.
  • General vs. Specific Focus: The model sometimes focuses on general background features (like "jars" in a kitchen) rather than the specific object being classified.
  • Potential for Hallucination: Like all LLM-based systems, it can occasionally hallucinate details or generate inappropriate language if the embedding space is "noisy" (e.g., confusing the bird "cock" with anatomical terms).

Future directions include exploring ways to speed up the generation process and applying the method to even more complex multi-modal tasks.

Summary updated

BibTeX
@inproceedings{sammani2025zero,
  author = {Fawaz Sammani and Nikos Deligiannis},
  title = {{Zero-Shot Natural Language Explanations}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=X6VVK8pIzZ},
}
Figure