NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Transformer Attention vs Human Attention in Anaphora Resolution

Anastasia Kozlova, Albina Akhmetgareeva, Aigul Khanova, С.и. Кудрявцев, Alena Fenogenova2024

Abstract

Motivated by human cognitive processes, attention mechanisms within transformer architectures have been developed to assist neural networks in allocating focus to specific aspects within input data. Despite claims regarding the interpretability achieved by attention mechanisms, the extent of correlation and similarity between machine and human attention remains a subject requiring further investigation. In this paper, we conduct a quantitative analysis of human attention compared to neural attention mechanisms in the context of the anaphora resolution task. We collect an eye-tracking dataset based on the Winograd schema challenge task for the Russian language. Leveraging this dataset, we conduct an extensive analysis of the correlations between human and machine attention maps across various transformer architectures, network layers of pre-trained and fine-tuned models. Our aim is to investigate whether insights from human attention mechanisms can be used to enhance the performance of neural networks in tasks such as anaphora resolution. The results reveal distinctions in anaphora resolution processing, offering promising prospects for improving the performance of neural networks and understanding the cognitive nuances of human perception.

Introduction

In Natural Language Processing (NLP), the "attention" mechanism is a mathematical framework that allows models to weigh the relative importance of different tokens in a sequence. While conceptually inspired by human cognitive focus, the degree to which these mathematical weights align with biological attention is a matter of ongoing debate. This study investigates this alignment through the lens of anaphora resolution, specifically utilizing the Winograd Schema Challenge (WSC).

Winograd schemas are pairs of sentences that differ by only a few words, creating an ambiguity that requires world knowledge and context to resolve (e.g., "The trophy didn't fit into the brown suitcase because it was too [large/small]."). Resolving whether "it" refers to the trophy or the suitcase is trivial for humans but remains a significant hurdle for AI. We explore whether Transformers and humans focus on the same linguistic cues to solve these puzzles and if human gaze data can be used as an inductive bias to improve model performance.

Methodology and Data

Our research follows a multi-stage approach involving data collection, correlation analysis, and model optimization.

Data Collection: The EyeWino Dataset

We introduced EyeWino, a novel eye-tracking dataset for the Russian language. Using video oculography, we recorded the eye movements of 100 native Russian speakers as they solved 296 Winograd schema sentence-question pairs. This resulted in approximately 450,000 individual gaze observations. We extracted three primary metrics from this data:

  1. Total Reading Time (TRT): The cumulative time spent looking at a word.
  2. Gaze Duration (GD): The time spent on a word during the first pass.
  3. Fixations: The total number of times the eye rested on a specific word.

Models and Benchmarks

We evaluated several Transformer architectures, including BERT (ruBERT, mBERT), RoBERTa (ruRoberta, XLM-R), and T5 (ruT5, mT5). Models were tested in both their pre-trained states and after fine-tuning on Russian benchmarks such as TAPE and RWSD.

Analysis of Attention Alignment

We employed Spearman’s rank correlation to compare human gaze metrics against the attention maps of the Transformer models. A critical finding was the importance of the aggregation strategy. We compared "mean-based" attention (the average attention of the entire sentence) against "row-based" attention (how the specific ambiguous pronoun attends to other words).

Figure 4: Spearman correlation between human eye-tracking metrics and Transformer attention maps across various aggregation strategies and model checkpoints.

As shown in Figure 4, row-based attention consistently yielded higher correlations with human gaze than mean-based attention. For instance, ruBERT-base showed a high correlation ($\rho \approx 0.72$) with human fixations in its first layer. This "First Layer Phenomenon" suggests that the initial structural processing in BERT-like models mirrors the human initial scan of a text. Interestingly, fine-tuning often led to a divergence; as models became more accurate, their internal attention maps sometimes moved further away from human-like patterns, suggesting the discovery of non-human mathematical shortcuts.

Gaze Integration and Performance

To test if human insights could improve AI, we modified the standard training loss function to include a "human-centric" penalty. This encouraged models to align their attention distributions with the relative importance assigned by humans (as measured by eye-tracking).

Figure 1: Performance comparison of pre-trained and fine-tuned models on the EyeWino and RWSD datasets.

The results of this integration were mixed but promising for specific architectures. As seen in Figure 1, the fine-tuned mT5-base model achieved the highest accuracy on the eye-tracking test set (71.3%). In specific tasks, injecting human gaze data into the loss function improved mT5-base accuracy from approximately 58.5% to over 64%, demonstrating that biological signals can indeed serve as a useful inductive bias.

Conclusion and Future Work

Our study confirms that while Transformers do not inherently "see" like humans, there are significant points of alignment, particularly in early layers and pronoun-specific attention. While forcing models to mimic human gaze is not a universal solution, it provides measurable gains for certain architectures like T5.

Future research will expand this analysis to generative decoder layers and explore more granular integration methods, such as targeting specific attention heads rather than entire layers. Understanding these cognitive nuances remains essential for developing truly interpretable and robust NLP systems.

Summary updated

BibTeX
@misc{kozlova2024transformer,
  author = {Anastasia Kozlova and Albina Akhmetgareeva and Aigul Khanova and С.И. Кудрявцев and Alena Fenogenova},
  title = {{Transformer Attention vs Human Attention in Anaphora Resolution}},
  year = {2024},
  doi = {10.18653/v1/2024.cmcl-1.10},
}
Figure