Did the Model Understand the Question?

Pramod Kaushik Mudrakarta, Ankur Taly, Mukund Sundararajan, Kedar Dhamdhere

Abstract

We analyze state-of-the-art deep learning models for three tasks: question answering on images, tables, and passages of text. Using the notion of attribution (word importance), we find that these deep networks often ignore important question terms. Leveraging such behavior, we perturb questions to craft a variety of adversarial examples. Our strongest attacks drop the accuracy of a visual question answering (VQA) model from 61.1% to 19%, and that of a tabular question answering model from 33.5% to 3.3%. Additionally, we show how attributions can strengthen existing adversarial attacks. Our results demonstrate that attributions can augment standard measures of accuracy and empower investigation of model performance, surfacing erroneous logic that indicates inadequacies in the test data.

The "Clever Hans" Problem

In machine learning, high accuracy on a test set is often treated as proof of understanding. However, researchers have long suspected that models might be "Clever Hanses"—performing well by picking up on unintended statistical shortcuts rather than actually grasping the logic of the task. This paper addresses the lack of transparency in how deep learning models process questions. If a model provides the correct answer while ignoring the subject of the query, its reliability is questionable. By "peeking under the hood" using attribution methods, the authors reveal the specific words that drive a model's decisions.

Methodology: Attribution via Integrated Gradients

The core tool used in this study is Integrated Gradients (IG), an attribution method that assigns an importance score to each input feature (words in a question). IG calculates the integral of the gradients along a path from a baseline input (an empty question) to the actual input.

By visualizing these scores as heatmaps, the authors can see which words the model "looks at" most. They also use Overstability Testing, systematically dropping words from questions to see how much accuracy remains. If a model maintains high accuracy after the subject of the question is deleted, it is deemed "overstable" and likely relying on shortcuts.

Attribution heatmap for a tabular QA model, showing heavy reliance on structural cues like 'first (max)' rather than the question text.

Insights: Shortcuts in VQA and Tabular QA

The researchers identified several startling shortcuts across different domains:

  • The "Color" Shortcut: In Visual QA, the word "color" alone is often enough for the model to achieve 50% of its final accuracy. The model identifies the question type and simply looks for the most prominent color in the image, ignoring the specific object being asked about.
  • Table-Specific Biases: In tabular QA, models like Neural Programmer often ignore the question text and rely on the table's structure. For instance, in a table about Olympic medals, the model might be predisposed to pick the first row (the "Gold" winner) regardless of the query logic, as shown in the attribution heatmaps where structural tokens receive the highest scores.
  • Ignoring Nouns: Models frequently assign low attribution to nouns and adjectives—the words defining the question's intent—and instead focus on generic function words like "how," "many," or "is."

Results: The Fragility of State-of-the-Art Models

Based on attribution insights, the authors developed adversarial attacks that prove models are not truly "understanding" the text. These include Prefix Attacks (adding phrases like "in not many words...") and Subject Ablation (replacing the question's subject with a word the model ignores).

Impact of adversarial prefix attacks on VQA model accuracy.

The results demonstrate extreme fragility:

  • Visual QA: A simple prefix attack dropped accuracy from 61.1% to 19%.
  • Tabular QA: Concatenating irrelevant trigger words dropped accuracy from 33.5% to 3.3%. Shuffling the rows of a table (which should not change the answer) dropped accuracy from 33.5% to 23%.
  • Subject Replacement: In VQA, replacing the subject of a question with a random noun resulted in the model giving the same (now incorrect) answer 75.6% of the time.

Furthermore, the authors showed that existing adversarial attacks on paragraph comprehension (SQuAD) are 50% more effective when the distractor sentences include words identified as "important" by attribution methods.

Conclusion and Future Work

While these attacks expose significant weaknesses, they also point toward solutions. The authors suggest that attribution insights can be used for Data Augmentation to create more robust training sets and for designing Inductive Biases in model architectures that discourage ignoring key linguistic components. Ultimately, providing attribution visualizations to end-users can help build appropriate trust by showing why a model reached a specific conclusion.

Summary updated

BibTeX
@inproceedings{mudrakarta2018did,
  author = {Pramod Kaushik Mudrakarta and Ankur Taly and Mukund Sundararajan and Kedar Dhamdhere},
  title = {{Did the Model Understand the Question?}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  url = {https://openreview.net/forum?id=BkWrQhgOWH},
}
Figure