Learning to Explain: Supervised Token Attribution from Transformer Attention Patterns
This paper introduces ExpNet, a lightweight neural network that automatically learns to map transformer attention patterns to token-level importance scores, offering a more adaptive and computationally efficient alternative to existing rule-based attention aggregation and model-agnostic explanation methods.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a super-smart robot (a "Transformer" model) that reads text and makes decisions, like telling if a movie review is positive or if a sentence is grammatically correct. The problem is, this robot is a black box. It gives you an answer, but you have no idea why it chose that answer. In high-stakes situations (like healthcare or law), we can't just trust a black box; we need to know its reasoning.
This paper introduces a new tool called ExpNet (Explanation Network) to solve this mystery. Here is how it works, explained simply:
The Problem: The Robot's "Internal Monologue"
Inside the robot, there is a mechanism called Self-Attention. You can think of this as the robot's internal "gaze." When the robot reads a sentence, it looks at different words and decides how much to focus on each one.
- The Old Way: Previously, scientists tried to guess which words were important by using fixed rules (like "always look at the words the robot stared at the longest"). It's like trying to guess a person's favorite food just by watching them stare at a menu for a long time. Sometimes it works, but often the rules are too rigid and miss the nuance.
- The Other Way: Other methods treat the robot like a mystery box, poking it with different inputs to see how it reacts. This is slow, expensive, and often creates nonsense sentences that the robot doesn't understand.
The Solution: ExpNet (The "Translator")
The authors built ExpNet, which is like a translator or a coach that learns to read the robot's "gaze" (attention patterns) and translate it into a clear explanation.
Instead of using fixed rules, ExpNet learns from humans.
- Training: The researchers showed ExpNet examples where humans had already highlighted the important words (the "rationales").
- Learning: ExpNet looked at the robot's internal "gaze" during those examples and figured out: "Ah, when the robot looks at the word 'terrible' in this specific way, humans think that word is the key reason for the negative review."
- The Result: ExpNet becomes a lightweight, fast neural network that can look at the robot's attention patterns and say, "These are the words that matter," with high accuracy.
How It Works (The Analogy)
Imagine the robot is a detective solving a case.
- The Robot's Attention: The detective has a magnifying glass. He moves it over different clues (words).
- The Old Methods: They just assumed that whatever clue the detective held the magnifying glass over the longest was the most important.
- ExpNet: ExpNet is a trainee detective who watched the master detective solve many cases where a human expert pointed out the actual smoking gun. The trainee learned to recognize the pattern of the master's gaze. Now, when the master looks at a new case, the trainee can instantly point out the clues, even if the master hasn't been trained on that specific type of case before.
The Big Test: Can It Learn General Rules?
The authors tested ExpNet in a very tough scenario: Cross-Task Generalization.
- They trained ExpNet on two different types of problems (e.g., detecting hate speech and analyzing movie reviews).
- Then, they tested it on a completely different problem (e.g., checking grammar) that it had never seen before.
The Result: ExpNet didn't just memorize the answers; it learned the language of importance. It performed better than 13 other existing methods, even on the new, unseen task. It proved that the "gaze" of the robot contains universal clues about what humans consider important, and ExpNet is the best at decoding them.
Why Is This Better?
- It's Fast: Unlike other methods that have to poke and prod the robot thousands of times, ExpNet just takes a quick look at the robot's internal data and gives an answer instantly.
- It's Accurate: It matched human reasoning better than any other method tested.
- It's Flexible: It works across different types of text (sentiment, grammar, hate speech) without needing to be retrained for every single new topic.
The Catch (Limitations)
- It needs a teacher: To learn, ExpNet needs examples where humans have already highlighted the important words. If you have a brand new task with no human examples, you can't train it yet (though the paper shows it can still guess well if trained on other tasks).
- It sees words, not phrases: It explains things word-by-word. It might miss the nuance of a phrase like "not bad" (which means good) because it looks at "not" and "bad" separately.
- It reflects human bias: Since it learns from human annotations, if the humans who trained it were biased, ExpNet will learn those biases too. It reflects human reasoning, not necessarily absolute truth.
Summary
The paper argues that instead of guessing how AI models think using rigid rules or slow experiments, we should teach a small, smart helper (ExpNet) to read the model's internal attention patterns. By learning from human examples, this helper can quickly and accurately explain why the AI made a decision, making these powerful tools more trustworthy and transparent.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.