Learning by Self-Explaining

Wolfgang Stammer, Felix Friedrich, David Steinmann, Manuel Brack, Hikaru Shindo, Kristian Kersting

Abstract

Much of explainable AI research treats explanations as a means for model inspection. Yet, this neglects findings from human psychology that describe the benefit of self-explanations in an agent’s learning process. Motivated by this, we introduce a novel workflow in the context of image classification, termed Learning by Self-Explaining (LSX). LSX utilizes aspects of self-refining AI and human-guided explanatory machine learning. The underlying idea is that a learner model, in addition to optimizing for the original predictive task, is further optimized based on explanatory feedback from an internal critic model. Intuitively, a learner’s explanations are considered “useful” if the internal critic can perform the same task given these explanations. We provide an overview of important components of LSX and, based on this, perform extensive experimental evaluations via three different example instantiations. Our results indicate improvements via Learning by Self-Explaining on several levels: in terms of model generalization, reducing the influence of confounding factors, and providing more task-relevant and faithful model explanations. Overall, our work provides evidence for the potential of self-explaining within the learning phase of an AI model.

Introduction

In human psychology, "self-explanation" is a well-known learning strategy: when a student explains a concept to themselves, they often uncover gaps in their own understanding. In contrast, most Explainable AI (XAI) research treats explanations as a one-way street—a tool for humans to inspect a "black box" model after it has already been trained.

The authors identify a major gap: AI models rarely use their own explanations to improve their learning process. Without this internal feedback, models often fall into the trap of shortcut learning—picking up on spurious correlations (like a watermark on an image) rather than the actual object of interest. LSX aims to turn explanations into a training signal, forcing the model to "think" about whether its reasons for a prediction actually make sense.

The LSX Framework

The LSX workflow consists of a "Learner" model and an internal "Critic" model operating in a four-stage loop designed to refine the model's internal logic.

The LSX workflow: A Learner generates explanations that are evaluated by an internal Critic to provide feedback for model refinement.
  1. Fit: The Learner is trained on a standard task, such as image classification.
  2. Explain: The Learner generates an explanation for its prediction (e.g., a heatmap of important pixels or a logical statement).
  3. Reflect: This is the core innovation. The internal critic assesses the explanation. Intuitively, an explanation is "useful" if the critic can perform the same task using only the information provided in that explanation.
  4. Revise: The Learner is updated based on the critic’s feedback, refining its internal representations to produce better, more task-relevant explanations.

Implementation and Evaluation

The framework was evaluated across three distinct architectures to demonstrate its versatility across different data modalities and reasoning types.

Summary of the three LSX instantiations evaluated: CNN-LSX, NeSy-LSX, and VLM-LSX.
  • CNN-LSX: Standard neural networks using pixel-level attribution maps for image classification.
  • NeSy-LSX: Neuro-symbolic models that generate logical "rules" for their decisions, evaluated on complex geometric reasoning (CLEVR-Hans3).
  • VLM-LSX: Vision-Language Models that generate natural language explanations for Visual Question Answering (VQA-X).

These models were tested on diverse benchmarks, including standard vision (MNIST), fine-grained bird species classification (CUB-10), and "confounded" datasets where specific decoys (like colored boxes) were added to trick the model into learning shortcuts.

Key Results

Better Generalization and Shortcut Mitigation

In "few-shot" scenarios, LSX significantly outperformed vanilla models. For instance, on the CUB-10 bird dataset with only 150 samples, LSX improved accuracy from ~87% to ~93%. More importantly, LSX helps models ignore "decoys." On the DecoyMNIST dataset, where shortcuts are rampant, a standard CNN scored 63.5% on clean test data, while the CNN-LSX reached 78.9%. If a model tries to explain a prediction by pointing to a decoy, the critic finds that explanation less useful, forcing the learner to pivot to the actual object.

Faithfulness and Regularization

Explanations in LSX act as a form of regularization, guiding the model toward features that are truly discriminative. Using standard XAI metrics (Comprehensiveness and Sufficiency), the authors showed that LSX models are more "honest"—their predictions are more tightly coupled to the features they claim are important. Furthermore, LSX leads to "cleaner" models where explanations for the same class become more similar to each other and more distinct from other classes.

Limitations and Future Work

Despite its benefits, LSX introduces significant computational overhead. Training a CNN with LSX was roughly 200x slower per batch than standard training in the authors' implementation. Additionally, there is a risk of the learner "overfitting" to the specific quirks of the internal critic rather than learning the true underlying logic of the data.

Future work aims to explore more efficient feedback mechanisms and investigate how these internal reflection loops might mirror human cognitive processes—moving from fast, intuitive guesses to slow, deliberate reasoning.

Summary updated

BibTeX
@article{stammer2024learning,
  author = {Wolfgang Stammer and Felix Friedrich and David Steinmann and Manuel Brack and Hikaru Shindo and Kristian Kersting},
  title = {{Learning by Self-Explaining}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=bpjU7rLjJ7},
}
Figure