Signed Relevance Score for Attention-Based Neural Network Interpretation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Attention-based neural networks operate as 'black-boxes' and do not provide explanations for their prediction outcomes, making it unclear whether the model has learned correct concepts, and attention weights alone do not indicate the directional relevance of input tokens to the prediction.

Innovation Solution

A method that computes a signed relevance score by taking the gradient of the loss with respect to the attention weights and multiplying it with the attention weights, providing explanations on the contribution of tokens to the outcome, and using layer-wise relevance propagation to redistribute relevance from contextual embeddings to input words.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If attention-based neural networks are used for prediction, then prediction performance is improved, but interpretability of the model deteriorates

Engineering Contradiction:
Improveprediction performanceVSAvoidinterpretability
Core Design Contradiction:
ReliabilityVSLoss of information

Solution Approach 1:

The patent introduces attention weights as an intermediary mechanism that bridges the gap between the neural network's internal processing and interpretable explanations. These attention weights serve as a mediator that quantifies the relevance between input tokens and predictions, making the black-box model's decision-making process visible and interpretable without altering the underlying prediction performance

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent transforms the uninterpretable internal states of the neural network into interpretable parameters by computing attention weights and relevance scores. This parameter transformation converts abstract neural activations into meaningful relevance metrics that can be directly interpreted to explain model predictions

Inventive Principle:
Principle #35Parameter changes

2Loss of information

If attention weights are used to explain model behavior, then model interpretability is improved, but directional relevance information is lost

Engineering Contradiction:
Improvemodel interpretabilityVSAvoiddirectional relevance
Core Design Contradiction:
Loss of informationVSMeasurement precision

Solution Approach 1:

Instead of using attention weights directly as relevance scores, the patent inverts the approach by computing the gradient of the loss function with respect to the attention weights. This inversion transforms the forward-pass attention mechanism into a backward-pass relevance measurement, revealing the directional impact of each token on the prediction outcome

Inventive Principle:
Principle #13The other way round (Inversion)

Solution Approach 2:

The patent changes the parameter representation from raw attention weights to gradient-based relevance scores. This parameter transformation preserves and enhances directional information by using the sign and magnitude of gradients to indicate whether each token contributes positively or negatively to the prediction

Inventive Principle:
Principle #35Parameter changes

3Measurement precision

If gradient computation is performed to determine relevance scores, then directional relevance information is improved, but computational complexity increases

Engineering Contradiction:
Improvedirectional relevance informationVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent leverages the existing gradient computation infrastructure already present in attention-based neural networks for training purposes. By reusing the same computational graphs and gradient mechanisms for explanation generation, the system achieves directional relevance information without requiring separate complex computational pathways

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS20230186072A1Extracting explanations from attention-based models
Publication Date: 2023.06.15 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US20230186072A1 patent drawing
  • US20230186072A1 patent drawing
  • US20230186072A1 patent drawing

AI summary

Providing an explanation for model outcome can include receiving input data, and passing the input data through an attention-based neural network, where the attention-based neural network learns attention weights associated with contextual embeddings corresponding to tokens of the input data and predicts an outcome corresponding to the input data. Based on an attention weight associated with a contextual embedding corresponding to a token of the input data, a signed relevance score can be determined to associate with the token for quantifying the token's relevance to the outcome. Based on the signed relevance score, an explanation of the token's contribution toward or against the outcome can be provided. The signed relevance score can be computed as a gradient of loss with respect to the attention weight.