TL;DR
This paper explores whether human cognitive data, specifically eye-tracking and EEG, can be used to guide the attention mechanisms within BERT for relation classification. By supervising BERT's attention with this cognitive data, they found it can lead to unique error patterns and potentially more human-like model behavior without sacrificing overall performance.
What Problem Does This Paper Address?
Determining semantic relationships between entities in text is a complex task for humans, often relying on context, commonsense knowledge, and even subtle cues. While Natural Language Processing (NLP) models like BERT have made significant strides, their internal "attention" mechanisms, which determine how much focus is placed on different parts of the input, are not necessarily aligned with how humans process information. Traditional NLP relies on human-annotated labels, but these can be subjective and may not capture the full picture of cognitive processing. This paper investigates if more objective measures of human cognitive processing, like eye movements and brain activity, can be used to "teach" NLP models how to attend to text in a more human-like way, potentially improving their understanding and error patterns.
Methods
The core of this work involves fine-tuning a pre-trained BERT model for relation classification. The novel aspect is the introduction of an "auxiliary attention supervision" task. This means that in addition to the primary task of classifying relations, the model's attention weights are also trained to mimic patterns observed in human eye-tracking (ET) and electroencephalography (EEG) data. Specifically, they used the ZuCo dataset, which contains synchronized ET and EEG recordings of subjects reading text.
The authors extract features from the ET and EEG data for each token. For ET, they use measures like Total Reading Time (TRT), and for EEG, they use electrode values mapped to fixation onsets. These human cognitive signals are then used to create target attention distributions. BERT's attention weights, particularly those associated with the [CLS] token (which acts as a sentence representation), are then regularized to align with these human-derived distributions using a Kullback-Leibler divergence loss. This creates a multi-task learning setup where the model optimizes for both relation classification accuracy and attention similarity to human data.
Datasets
The primary dataset used is the ZuCo dataset. This corpus contains eye-tracking (ET) and electroencephalography (EEG) recordings from 12 adult subjects reading English sentences. The sentences are drawn from two sources: 400 review excerpts from the Stanford Sentiment Treebank and 707 biographical sentences from a Wikipedia relation extraction dataset. For this study, a subset of 300 relation sentences (7,737 tokens) was used, divided into 566 phrases. The dataset is annotated with entity markers and 11 relation types.
Key Insights and Ideas
- Cognitive Data as a Supervision Signal: The paper demonstrates that objective measures of human cognitive processing (ET and EEG) can be effectively used as a supervision signal to guide the attention mechanisms of large language models like BERT.
- Shifting Attention, Not Just Performance: While the overall classification performance didn't significantly improve, the attention distributions of the supervised models were demonstrably shifted towards the cognitive data. This suggests that the models are learning to "look" at text differently, even if it doesn't always translate to higher accuracy on the primary task.
- Unique Error Patterns: Models trained with cognitive attention supervision exhibit distinct error patterns compared to the baseline. This is a crucial finding, as it suggests these models might be making errors for reasons more aligned with human cognitive processes, potentially revealing new avenues for understanding model behavior.
- EEG's Influence: The study hints that EEG-based supervision might be particularly influential in shifting attention, even if its direct impact on overall accuracy is not always pronounced.
Key Results
- Performance Parity: Fine-tuning BERT with ET and/or EEG attention supervision did not lead to statistically significant improvements in relation classification accuracy compared to the baseline BERT model.
- Attention Shift: The attention distributions of the supervised models showed a measurable shift towards the human ET and EEG data.
- Unique Errors: Models with cognitive attention supervision made different errors than the baseline. Specifically, they were more likely to correctly classify samples that the baseline model misclassified.
- Attention Similarity: The ET+EEG supervised model showed the highest overlap (attention similarity) with human attention patterns, suggesting it learned the most human-like attention.
Limitations and Future Work
The authors acknowledge several limitations:
- Dataset Size: The study used a relatively small English dataset, which may limit the generalizability and robustness of the findings.
- EEG Noise: The EEG data might have been too noisy, and dimensionality reduction techniques (as used in other studies) might be needed for a more consistent signal.
- Cognitive Data Specificity: The cognitive data used was not specifically collected for an entity-related reading task, which might influence the effectiveness of the supervision.
- Influence Breadth: The study focused on [CLS]-based attention supervision and did not explore the influence across all BERT layers and heads, nor did it investigate trade-off coefficients for multiple losses.
Future work could involve:
- Investigating the impact of different dimensionality reduction techniques for EEG data.
- Exploring the influence of attention supervision on specific layers or heads of BERT.
- Using cognitive data specifically designed for entity-related tasks.
- Examining the ethical implications of using cognitive data to align models with human biases.
- Investigating how this approach can lead to more interpretable and trustworthy AI systems.
Summary updated