Eye Gaze and Self-attention: How Humans and Transformers Attend Words in Sentences
Paper · 2022 · Joshua Bensemann, Alex Peng, Diana Benavides-Prado et al.
Summary
When people read a sentence, they spend more time looking at some words than at others. A transformer also distributes attention unevenly across a sentence, but its attention weights govern how token representations exchange information. Bensemann and colleagues ask whether the two measures agree on which words receive more attention. The question has a practical motivation. Comparing every token with every other token makes full self-attention expensive on long inputs. If a cheaper estimate based on reading behavior could identify the words a transformer would emphasize, it might help filter those inputs.
The authors compare eye-tracking recordings from six English reading datasets with self-attention extracted from 31 pretrained variants across 11 transformer families. They give the systems the sentences the participants read and leave the pretrained weights fixed. For each layer, they summarize how much attention each word receives from the sentence. They compare that score with dwell time, the total time a reader’s eyes fixate on the word. Both quantities are expressed as shares of their sentence totals before the authors compare their ranks across words.
The agreement was generally strongest near the input. The first layer gave the highest correlation in 66.2% of comparisons across variants and datasets. Uncased BERT led in 7 out of 9 reported dataset and task conditions. On GECO, where participants read a novel, its average first-layer Spearman correlation across size variants was 0.816, behind DeBERTa-v2 at 0.824. On the ZuCo task where readers could see a question while reading, uncased BERT’s first-layer correlation was 0.324, and compact systems moved to the top of the ranking. Increasing parameter count within a family gave little indication of which variant would agree more closely with gaze.
The findings depend partly on how the comparison is made. When the authors normalized attention and dwell time by paragraph, correlations often weakened. The paragraph analysis also recovered the lack of a significant last-layer XLNet correlation reported in an earlier reading-comprehension study. In a separate sarcasm experiment, adding a training objective that encouraged BERT’s first layer to follow a reader’s gaze gave no demonstrated improvement in test accuracy. The paper thus establishes a recurring association under sentence-level measurement, with substantial variation by reading task and a clear distinction between observing the association and making it useful for training.
Deep dive: Eye Gaze and Self-attention: How Humans and Transformers Attend Words in Sentences
An eye-tracking study comparing where people spend time while reading with the words that receive attention in different layers of a transformer. · about 35 minutes to read
The problem and its context
Attention as a reading measure and a computation
A camera can record where someone looks and how long their eyes stay there. During reading, those measurements can be assigned to the words on the screen. They capture overt attention, the part of attention expressed through observable behavior. The authors take the word at the center of a fixation as the word the reader is attending to for that measure. Readers can also shift their mental focus without moving their eyes. That covert component is part of the paper’s account of human attention, but it falls outside the gaze measurement.
A transformer’s attention begins with a different question. When updating the representation at a particular position, how much information should the system draw from each available position in the input? In a bidirectional encoder, earlier words can draw on later words as well as the reverse. The internal weights can therefore reveal patterns in how a system combines information from a sentence. The authors cite an example from the original transformer study in which the attention associated with a pronoun reflected a relationship useful for resolving its reference. That work helped establish attention as something researchers could inspect alongside the outputs of a language task. Attention Is All You Need
The computational motivation follows from the number of comparisons that full self-attention makes. As a sequence grows, each additional token gives the existing tokens another place to look and adds a new position that can look across the sequence. Memory and computation therefore grow quadratically with sequence length. The authors had previously used attention extracted from pretrained transformers as a filter for a sentiment classification task. In that earlier experiment, they reported reducing the input sequence length by 99% while retaining 70% classification accuracy. That result made word selection worth investigating, while leaving open how to select words without first paying for full attention.
Human reading suggested one possible source of that selection. The work discussed in the paper describes readers skipping words and, in some settings, skimming while still doing well on a reading task. A system that can predict which words people will look at might provide an inexpensive estimate of which positions deserve computation. For that idea to be plausible, there needs to be some agreement between the words emphasized by readers and the words emphasized inside the transformer. The study tests that premise by measuring the agreement on the same text.
Attention also has a longer history in the paper’s account of natural language processing. The authors cite the use of learned alignment in machine translation and discuss how transformers use attention throughout their computations. BERT is an especially useful subject for the gaze comparison because it places each token in the context of the entire input sequence. Its pretraining included filling in masked tokens, an objective inspired by the Cloze procedure used in reading research, as well as predicting whether sentences were contiguous. The paper draws on these connections to motivate the choice of systems. Neural Machine Translation by Jointly Learning to Align and Translate
What earlier gaze studies measured
Much earlier work used text representations to predict a person’s eye movements. The paper describes studies that supplied BERT representations alongside other features and studies that adapted BERT itself to estimate fixation behavior. Hollenstein and colleagues reported that this prediction could work for texts in English, Dutch, German, and Russian. In that line of research, gaze is an output the system is trained to predict. The question in the present paper is whether a system trained on its original language tasks already assigns relatively high attention to the words that people spend more time looking at.
Other studies used predicted gaze or saliency to change how a language task was performed. The paper describes a text-compression study by Sood and colleagues that trained a separate component to estimate saliency. That component learned first from simulated reading behavior and then from human eye-tracking data. Its output modulated attention in the system that performed the compression. This provides a precedent for incorporating gaze-related signals into a language task, with a different procedure from directly encouraging an existing attention layer to match human fixation times.
Work on skipping offered another connection. The authors discuss recurrent systems that learned how many words to skip while classifying sentiment. A study by Yu and colleagues found that such a system could skip several words at a time while matching or improving the accuracy of a counterpart that read the whole input. Hahn and Keller also examined how actual eye movements could inform a skipping procedure. As the paper points out, that analogy concerns overt behavior. Which words a reader skips gives only a partial view of the information they use while reading.
Earlier comparisons of human and computational attention also differed in what counted as evidence of human focus. In the sentiment study by Sen and colleagues, participants judged reviews and highlighted text they considered important. The authors of that study compared those selections with attention from recurrent networks and found that agreement weakened for longer texts. Highlighting after making a judgment asks readers to identify text they consider relevant to an explicit decision. Fixation time records where the eyes linger as reading unfolds. The present study uses the latter and asks how the result changes with the size of the text unit used for analysis.
The closest direct comparison in the paper comes from a reading-comprehension study by Sood and colleagues. Participants read passages and answered questions drawn from MovieQA. Sood and colleagues compared gaze with attention in a convolutional network, a recurrent network, and XLNet. They found strong negative associations for the convolutional and recurrent systems and no significant association for XLNet. Their transformer comparison used the final encoder layer after adaptation to the question-answering task. Bensemann and colleagues reused the gaze data and broadened the analysis to cover layers throughout a collection of pretrained transformers.
There was already reason to examine the layers separately. Toneva and Wehbe had compared transformer representations with measurements of human brain activity. They reported that middle layers became better predictors as more context was available. They also found that making attention uniform at lower BERT layers could improve their brain-activity prediction. The paper cites these observations to show that layer choice matters and that the best layer can depend on what human measurement is being predicted. It also discusses work by Schrimpf and colleagues in which even untrained systems carried some predictive signal for brain activity. Taken together, those studies give the authors grounds to consider architecture, training, and layer position as potential sources of variation in the gaze comparison.
Why compare a collection of pretrained systems?
A single transformer checkpoint would establish how that particular system behaved under this procedure. The authors instead assemble families with a range of relationships to BERT. Some preserve the basic architecture and change the training regime. Some shrink or share parts of the network. Some alter the attention mechanism or change how the whole system is organized. The collection makes it possible to ask whether an observed pattern persists when a system is made larger, when the training procedure changes, or when attention is computed differently.
The reading data provide another axis of comparison. A reader following a novel and a reader looking for an answer can both produce word-level dwell times. Their reasons for dwelling may differ. Bringing together several reading tasks lets the paper ask how much the observed relationship depends on what readers are doing. The setup also makes comparisons within a corpus possible, especially where the same participants took part in several tasks. These contrasts provide more information than a single correlation with a single group of readers, although they retain the differences among the original studies.
The method, step by step
Put the words on both sides of the comparison
The common unit is a word in a particular sentence. On the human side, the starting point is a record of how long a participant’s eyes fixated on that word. On the transformer side, the starting point is an array of attention weights among token positions. The authors turn these arrays into word scores and express both kinds of score relative to the sentence in which the word occurs. Only after those steps do they compare the distributions.
Consider a sentence in which a reader dwells on a name. The human score asks what share of the reader’s total fixation time for that sentence went to the name. The transformer score asks how prominently the corresponding word figures as a destination for attention from positions throughout the sentence. It is possible for the name to rank high by both measures even when the attention matrix contains several distinct patterns of interaction. The test works at the level of word prominence after that matrix has been summarized.
From sentences and gaze recordings to layer correlations
The steps in order.
Select the systems and preserve their training
The authors use pretrained checkpoints from the Hugging Face Transformers collection, together with each checkpoint’s associated tokenizer. A checkpoint supplies the learned weights needed to run the system. The authors keep those weights as downloaded for the core study, so the gaze data enter the analysis only after the attention scores have been computed. The separate sarcasm experiment does adapt or train BERT and is described independently. Transformers: State-of-the-Art Natural Language Processing
The comparison calls for attention in both directions across a sentence. A strictly left-to-right system prevents early positions from attending to later ones and would therefore give early and late words different opportunities to receive attention. The authors exclude unidirectional systems such as GPT-2 for this reason. They include Big Bird as an alternative means of approximating full attention. The collection thus includes a specific sparse-attention design alongside systems with conventional bidirectional attention.
The authors organize the sample into basic, compact, and alternative groups. The basic group starts with BERT itself. It includes cased and uncased English variants and a multilingual cased variant. BERT pretraining used masked language prediction, with 15% of tokens masked, and included the next-sentence prediction objective. Cased and uncased variants provide a comparison between released checkpoints that treat capitalization differently, and the multilingual variant provides a checkpoint with a different language scope.
RoBERTa gives the authors a same-architecture contrast. As the paper describes it, RoBERTa was trained longer with larger batches and more data. Its masks were generated dynamically during training, and the next-sentence objective was removed. The comparison also includes Muppet, which uses multitask training with RoBERTa, and XLM-RoBERTa, a multilingual variant of RoBERTa. These checkpoints give the authors different training histories within closely related architectures.
The compact group supplies several approaches to reducing the cost of a BERT-like system. ALBERT factorizes the large vocabulary embedding matrix into smaller matrices and shares parameters across layers. DistilBERT uses a teacher–student procedure, starting the smaller system from alternating layers of the full one and then training the student on the original training data. The teacher–student relationship is an instance of knowledge distillation. SqueezeBERT introduces grouped convolutions in place of feed-forward layers. These approaches all yield compact systems, while making different changes to the machinery that produces attention.
The alternative group extends the comparison beyond those designs. DeBERTa separates the contributions of word content and position to attention. Its later variants also use a different training procedure. Big Bird combines global, sparse, and random connections to approximate full attention. XLNet incorporates recurrence and uses permutations of word order during training. BART uses an encoder and a decoder and is pretrained to recover text from corrupted inputs, including masking, deletion, and changes to sentence order. Taken together, the alternatives broaden the range of checkpoints whose attention can be compared with the same human data.
Read the attention weights before the values are mixed
The first equation in the paper describes the attention computation on which the analysis is based.
Attention(Q, K, V) = softmax(QKᵀ / √n) V
Attention(Q, K, V) is the output of one attention operation. Q contains query vectors, which represent the positions requesting information. K contains key vectors, which represent the positions available to answer those requests. Kᵀ is the transpose of K, so QKᵀ forms all the query–key dot products. The matrix has a row for each query and a column for each key. n is the dimension used to scale the dot products, and √n is its square root. softmax converts the scaled scores in each row into non-negative weights that sum to one. V contains value vectors for the key positions. Multiplying the weights by V produces a weighted combination of those value vectors for every query position.
Self-attention means the queries, keys, and values are derived from the same sequence. They can represent the same position in different ways. For the gaze comparison, the authors retain the result of softmax before multiplication by V. Each row then records how a query position divides its attention among the available positions. Taking the output after multiplication would instead give a new representation at each query position. The study needs the allocation across positions so it can sum up which words receive attention.
Each layer has several attention heads, which calculate separate sets of weights. Within a layer, the researchers average across heads and across the rows corresponding to query positions. Each destination position ends up with a score that reflects attention received from the sentence as a whole. For example, a word can get a high score because many positions give it some attention or because particular heads and positions give it a large share. Both patterns contribute to the resulting mean. The method repeats this calculation for every layer separately.
This direction of aggregation matters. A row describes what a position attends to, and the row total has already been normalized by softmax. The authors need a score that varies by destination. Averaging down the rows gives a column-wise measure of incoming attention. The procedure therefore says which positions are prominent as sources of information for the sentence, while discarding the identity of the positions that assigned the weight. It also discards distinctions among the heads after their scores are combined.
Earlier work by Sood and colleagues used a maximum to summarize attention. A maximum emphasizes the strongest assignment contributing to a word’s score. A mean can reflect contributions spread across many queries and heads. Bensemann and colleagues report that preliminary comparisons suggested greater stability across datasets with the mean, which they use for their main analysis. They released code and full results in Eye-Tracking-Analysis, including comparisons using the maximum.
Match tokens to words and put both measures on the same scale
The eye-tracking data attach observations to displayed words. Transformer tokenization can divide a word into several pieces, so the two representations of the sentence do not always line up position for position. Where subword tokenization splits a word, the authors average the scores of its pieces to obtain a single word score. Averaging means that a word does not accumulate a higher total simply because its tokenizer creates more positions for it.
The procedure also keeps special tokens such as [CLS] and [SEP] present when computing attention. These are part of the input used by the transformer, and its word positions can interact with them. The authors drop the special-token entries from the final vector that will be matched to the gaze data. They then divide each word’s remaining score by the sentence total. The resulting value expresses the word’s share of attention among the words eligible for the comparison.
On the human side, the authors use total dwell time because every dataset includes it. The measure is the total duration of fixations on a word, so multiple visits can contribute to it. The authors start with each participant’s data for a sentence and divide each word’s dwell time by that participant’s total dwell time for the sentence. They average these normalized shares across participants who read the sentence, giving one human score per word. In this order of operations, the measure reflects the typical allocation of a reader’s time within a sentence. Simply pooling raw durations would give a reader who spent longer on a sentence more influence over its word shares.
Both branches now produce a relative score. A word that accounts for a substantial part of a short sentence can have a large share even if its reading time is modest in absolute terms. Similarly, the transformer’s final word score is relative to the other words left after aggregation and removal of special tokens. This common scale is central to the comparison. The authors also calculate a paragraph-normalized version to see how the choice of text unit affects the result.
Correlate ranks across pooled words
The authors align the human and transformer scores by word occurrence, then pool the matched pairs from a text. They calculate Spearman rank correlation on the pooled scores. Spearman measures whether larger values on one side tend to be paired with larger values on the other, using the rankings of the observations. It fits the comparison because there is no reason to expect a given increase in fixation time to correspond to an equally sized increase in an attention weight. The authors also chose it to avoid relying on normally distributed measurements and to make their analysis comparable with the earlier gaze study.
Pooling follows normalization. The calculation is therefore a rank correlation over all included word occurrences, instead of an average of rank correlations computed separately for each sentence. A word competes for its share of attention or dwell time within its sentence, and that share is then ranked against the shares for words from other sentences. The authors remove single-word sentences because both normalized scores for the sole word are automatically 1.0. Including those mechanically identical pairs would inflate agreement.
One run of this procedure produces a coefficient for each layer of a checkpoint on a dataset or task condition. The authors can then ask which layer ranks highest, whether larger checkpoints have higher correlations than smaller relatives, and whether the ordering of systems stays similar when the reading task changes. The paper’s main correlation results report sentence normalization. The paragraph analysis gives a comparison in which the reference span is longer.
Add gaze as a training objective in the appendix
The main analysis observes attention in fixed pretrained systems. The appendix changes the question by asking whether encouraging first-layer attention to follow gaze helps a classifier identify sarcasm. The authors use BERT and the dataset from Mishra and colleagues. They compare runs that use an additional gaze term during training with runs that train for sarcasm classification alone. This design lets them observe what changes in test accuracy when the training objective includes a human signal.
L = H(y, ŷ) + αH(p, p̂)
L is the total loss minimized during training. In H(y, ŷ), H denotes the cross-entropy for the binary sarcasm classification task, y is the target sarcasm label and ŷ is BERT’s predicted distribution over labels. In H(p, p̂), p is the target distribution of normalized fixation durations for the words of the sentence and p̂ is the corresponding first-layer attention distribution. This term measures divergence from the gaze distribution. α is a hyper-parameter that controls how much that term contributes to the total loss. It determines the relative emphasis on matching the fixation distribution and getting the sarcasm label right.
The gaze target comes from Participant 6, who had the highest reported sarcasm-detection accuracy among the participants, at 90.29%. That choice gives the training intervention a single reader’s signal. It differs from the averaged reader signal used for the main correlation analysis. The authors tune hyper-parameters on a validation set taken from the training data and then use the selected settings on the entire training set. They test both pretrained initialization and training from scratch, and they repeat those comparisons at different training-set sizes.
Experiments and results
The reading datasets
All the passages included in the main analysis were read in English. The source corpora vary in the length and origin of their material, the background of the readers, and the instructions given to them. Some corpora supply distinct task conditions, which accounts for the difference between the six datasets and the 9 conditions in the paper’s comparison of top-ranked systems. The authors apply the same sentence-level attention and dwell-time procedure to each condition.
GECO tracks sustained reading of Agatha Christie’s The Mysterious Affair at Styles. The original study included 19 Dutch bilingual readers and 14 English readers, with comprehension tests between reading sessions. The bilingual group read in Dutch as well as English. The authors include sessions conducted in English from both groups. GECO supplies connected fiction with comprehension checks outside the immediate act of reading, an arrangement that differs from seeing a question while inspecting the text.
PROVO contains 55 passages, which average 2.5 sentences. The passages came from sources including online news, magazines, and fiction. Its 84 native English speakers were asked to read for comprehension. The study compares attention and dwell time for the sentences drawn from these short passages. PROVO provides a point of comparison with GECO in a setting that also involves reading for understanding but uses varied and shorter source material.
The ZuCo corpus combines eye tracking with EEG, though the correlation analysis uses the gaze data. Its 12 native speakers of English read one sentence at a time and could set their own pace. Task 1 was sentiment analysis. Task 2 presented comprehension questions after reading. In Task 3 the question was visible during reading, so participants could use it to decide where to focus. The three conditions share participants, which makes the difference in their instructions especially relevant to the authors’ account of the results.
The data from Sood and colleagues came from 32 MovieQA passages distributed across two studies. Study 1 had 18 participants answer questions on 16 passages. Its conditions included multiple choice, free responses with the text available, and free responses from memory. Study 2 had 4 participants, who answered multiple-choice questions on the other 16 passages. In Study 2, the question was shown on screen, as it was in two-thirds of the tests in Study 1. These are the corpora on which the authors can make a direct comparison with the earlier analysis of XLNet.
The study by Frank and colleagues supplies a different sort of comprehension setting. Its 48 readers encountered 205 sentences drawn from unpublished novels and occasionally answered a yes-or-no question after a sentence. The sample included both native and non-native English speakers. In the dataset from Mishra and colleagues, proficient non-native English speakers read short passages and judged sarcasm. Those passages came from varied sources and contained a maximum of 40 words. Mishra’s data are used both in the general correlation comparison and in the appendix’s separately trained sarcasm classifier.
The metric and points of comparison
The main outcome is Spearman correlation between pooled word-level attention shares and pooled word-level dwell-time shares. It measures agreement in relative order. Classification or comprehension accuracy does not enter that calculation. A high coefficient says that words with relatively high gaze shares generally also have relatively high incoming-attention shares. The appendix uses test accuracy as its outcome because it asks whether gaze supervision improves the classifier’s labels.
In the correlation experiments, the reference comparisons are other pretrained checkpoints, the layers of the same checkpoint, and the previous result for XLNet on the Sood data. The first-layer table combines size variants within a reported type. For instance, the entry for uncased BERT represents the average for its tested sizes, and the entry for DeBERTa-v2 also represents its group of tested sizes. This level of aggregation differs from the layer analysis, which examines individual checkpoint and dataset combinations. It also differs from selecting the best layer separately in every setting.
First-layer agreement across systems
The authors report significant positive correlations between dwell time and attention across layers and systems in the sentence-based analysis. The first layer produced the maximum in 66.2% of the checkpoint and dataset comparisons. The remaining maxima generally still favored early layers, with exceptions among multilingual and compact variants. The authors use first-layer correlations to compare systems at a common position and examine the results of selecting the best layer separately as an additional check.
GECO shows both the strength of the highest associations and the spread among systems reading the same sentences. DeBERTa-v2 yielded the highest average first-layer correlation for a reported type, at 0.824. The uncased BERT group followed at 0.816, and cased BERT had 0.802. First-layer agreement was positive for the other groups shown below, though several had distinctly lower correlations on this corpus.
First-layer Spearman correlation with dwell time on GECO
DeBERTa-v2 leads the comparison, with uncased BERT close behind.
The numbers
| System or setting | Spearman correlation |
|---|---|
| XLNet | 0.678 |
| RoBERTa | 0.709 |
| DistilBERT uncased | 0.796 |
| BERT cased | 0.802 |
| BERT uncased | 0.816 |
| DeBERTa-v2 (this paper) | 0.824 |
The ranking changes on PROVO. There the average first-layer correlation was 0.710 for uncased BERT and 0.708 for DeBERTa-v2. Cased BERT placed next at 0.668. Uncased BERT also led the Mishra sarcasm condition with 0.791, followed by cased BERT at 0.783 and uncased DistilBERT at 0.780. In the Frank comprehension data the first-layer coefficients for uncased and cased BERT were 0.746 and 0.744, respectively, with uncased DistilBERT at 0.725.
Across the paper’s 9 reported conditions, uncased BERT ranked first in 7. GECO was one exception, where it placed second. ZuCo Task 3 was the other, where it placed ninth. DeBERTa-v2 was frequently near the top, including on PROVO and both Sood conditions. The recurring strength of uncased BERT gives a recognizable pattern across corpora. The result for the question-visible ZuCo condition shows how much that pattern can change with the behavior being measured.
Reading with a question in view
The ZuCo conditions let the authors compare gaze from the same participants under different instructions. Uncased BERT led Task 1 with an average first-layer Spearman correlation of 0.693 and Task 2 with 0.722. DeBERTa-v2 was close in both, with 0.688 and 0.712, respectively. For Task 3, when the question appeared during reading, the coefficients were generally lower and the ranking changed. SqueezeBERT and the cased DistilBERT group had the highest first-layer correlations. Uncased BERT had the same rounded coefficient as multilingual cased BERT in the table, at 0.324.
First-layer Spearman correlation with dwell time on ZuCo Task 3
Compact systems lead when readers can consult the question during reading.
The numbers
| System or setting | Spearman correlation |
|---|---|
| RoBERTa | 0.291 |
| DeBERTa-v2 | 0.306 |
| BERT uncased | 0.324 |
| BERT cased | 0.328 |
| DistilBERT multilingual cased | 0.333 |
| DistilBERT cased | 0.341 |
| SqueezeBERT (this paper) | 0.348 |
The Sood studies, which also included questions displayed during reading, produced the next weakest correlations in the paper’s overall description. In Study 1, uncased BERT had the highest first-layer group average at 0.626. DeBERTa-v2 had 0.601, and cased BERT had 0.584. The same ordering occurred in Study 2, with coefficients of 0.434, 0.423, and 0.410, respectively. The lower correlations across these conditions are consistent with the authors’ interpretation that readers redistribute gaze when they can search for a specific piece of information. The studies differ in additional respects, which matters when attributing the weaker association to that particular feature of the task.
Comparing with the earlier XLNet result
Sood and colleagues had reported a last-layer XLNet correlation of -.16 that was statistically non-significant. Bensemann and colleagues also examined XLNet’s last layer on the Sood material, using their sentence-normalized procedure. They obtained .428 for Study 1 and .327 for Study 2. These are last-layer comparisons reported in the discussion. The first-layer XLNet group averages in the paper’s cross-system table are 0.369 for Study 1 and 0.287 for Study 2, so the values refer to different layer selections.
The authors were unsure exactly how the earlier study had normalized its scores. They suspected that the normalization span could help explain the contrasting conclusions. When they reran their analysis with paragraph normalization, the resulting XLNet correlations were non-significant. The same change frequently weakened associations in the broader set of comparisons. This result shows that a study using the same source gaze recordings can reach a different statistical conclusion depending on the scope over which scores are expressed.
Several choices separate the studies. The earlier XLNet had been adapted to the task, and Sood and colleagues used a maximum-based attention summary. The new study uses pretrained weights and a mean. The paragraph rerun is informative because it changes normalization within the new procedure, holding its other choices in place. It shows that normalization alone can change the finding within that procedure, while the exact contribution of normalization to the difference between the two studies remains uncertain.
Accuracy with gaze-guided training
The appendix evaluates the sarcasm classifier on a fixed test set of 300 examples. The larger training set contained 693 examples, and the corresponding experiments used 20 runs. The smaller training set contained 70 examples, and those experiments were repeated 50 times. For each setting, the figure compares training with and without the gaze term. It also separates runs initialized from pretrained BERT from runs trained from scratch.
Pretrained initialization gave significantly higher test accuracy than training from scratch with both training-set sizes. In the condition using 693 training examples and no pretraining, adding the gaze term lowered test accuracy, with a t-test giving p < .05. When runs with the larger training set started from pretrained BERT, both training objectives yielded classifiers whose accuracy exceeded Participant 6’s 90.29% on the comparison reported by the authors. In that setting, mean accuracy was still lower with the gaze term, but the difference had lost statistical significance. With the smaller training set, the authors likewise found no significant accuracy difference attributable to the gaze term.
The Mishra results answer separate questions in the two parts of the paper. In the observational experiment, a pretrained system can put relatively high attention on words that receive relatively high gaze shares during a sarcasm task. In the intervention, forcing first-layer attention towards a particular participant’s fixation distribution can change the classification result. The observed direction of that effect, where the difference reached significance, was unfavorable for this training procedure.
What the ablations show
How much depends on which layer is inspected?
The layer comparison varies the place from which attention is extracted while keeping the text, human data, and checkpoint fixed. This matters because each layer recalculates attention using representations produced by earlier processing. A coefficient for the final layer characterizes that particular stage. It can miss a stronger association near the sentence input. Examining the whole stack allows the authors to see both effects, including the checkpoints whose peak occurs later.
The paper describes peak location on a relative scale, with 0 representing the first layer and 1 the last. This makes depths comparable when transformers have different numbers of layers. Each plotted point represents the location of the best layer for a checkpoint on a particular dataset. The first layer frequently wins, but a checkpoint can peak at different locations depending on the data. The multilingual versions of BERT and RoBERTa, along with many compact variants, account for notable departures from the broad concentration of peaks near the input.
The maximum’s location alone gives no indication of how much the winning layer outperforms the first. The authors inspect that gap in the comparisons where another layer won. On average, the first-layer coefficient was 0.055 below the best layer’s correlation in those cases. In 75% of those cases, the gap was less than 0.082. This supports using a common early layer to describe the broad results, while allowing a reader to distinguish a slightly higher later peak from a larger change across depth. The paper reports that the analysis using each checkpoint’s actual maximum gave broadly similar conclusions.
The contrast between bert-base-cased and albert-base-v1 illustrates why depth can tell a different story in different architectures. The paper shows average correlations across layers for these checkpoints. The ALBERT curve is relatively flat, whereas the BERT example shows a stronger relationship near the input. The authors suggest that ALBERT’s cross-layer weight sharing may help explain its similar correlations at each layer. Reusing parameters makes this a plausible connection, although the study does not independently change weight sharing while holding everything else fixed. A similar coefficient also leaves room for the attention patterns themselves to differ.
The authors connect the early-layer finding to the brain-activity results of Toneva and Wehbe. An early BERT layer may retain patterns that line up relatively well with where text is taken in through the eyes, while middle-layer representations may be more informative for some subsequent processing. The comparisons involve different human signals and different outputs from the transformer. In the gaze paper, the match is between fixation distributions and attention weights. The brain study used lettered layers’ representations as predictors of measured activity. The proposed link between stages of processing is an interpretation of that juxtaposition.
What changes when a variant gets larger?
The size analysis compares a checkpoint with the next smaller variant of the same type. This is more informative about parameter count than a simple comparison of the largest checkpoint in one family with the smallest checkpoint in another. A family-level comparison narrows some of the differences in architecture and training practice, although the published variants can still differ in more than their number of parameters. The authors use a sign test to ask whether one direction of change occurs consistently across the matched size comparisons.
The test was non-significant at p = .090. The authors also describe similar correlations for the respective cased and uncased base and large BERT checkpoints. The large BERT variant contains 340 million parameters, and the base variant contains 110 million. The largest DeBERTa variants reach 1.5 billion parameters, with smaller variants containing less than 1/3 of that number. Differences in correlation remained modest in these examples in spite of the wide variation in parameter count. Within the tested comparisons, size provided little guidance about which checkpoint would show stronger gaze agreement.
This outcome helps explain why the first-layer results average across sizes within a type. If size had changed the ordering strongly and consistently, the averages would have concealed a major dimension of the finding. The reported comparisons suggest that types such as uncased BERT and DeBERTa-v2 generally retain recognizable behavior across their tested sizes. The sign test addresses the direction of changes in this collection. It does not estimate how much the association would change for a particular new size or establish equivalence between every pair of checkpoints.
What can training differences explain?
The shared architecture of BERT and RoBERTa provides a comparison of systems whose training regimes differ. BERT’s first-layer correlations were generally higher in the reported conditions. The comparison shows that agreement with gaze can differ even when the basic architecture is shared. RoBERTa changed several things together, including the amount of training, data, and masking procedure. As a result, the result establishes an association with a package of training differences and leaves the contribution of individual differences unresolved.
DeBERTa provides another contrast. Its later variants use Scale-invariant Fine-Tuning, or SiFT, and v2 frequently shows much stronger first-layer gaze correlation than v1. On GECO, the averages are 0.824 for v2 and 0.731 for v1. On PROVO, they are 0.708 for v2 and 0.511 for v1. Those comparisons explain why the authors single out training as a plausible contributor. The checkpoint comparison does not independently vary SiFT, so the observed change cannot be assigned solely to that procedure.
The paper also compares the gaze rankings with the familiar ordering of the systems on language tasks. Many BERT descendants outperformed BERT on benchmarks discussed in the paper, while their attention frequently had weaker correlations with gaze. DeBERTa-v2 stands out in this discussion because of both its high agreement and the strong benchmark performance reported for that generation. The pattern across checkpoints supplies examples in which language task performance and gaze agreement move in different directions. The paper draws on benchmark results from the earlier work for this observation. SuperGLUE
What changes when the scores are normalized by paragraph?
Normalizing by sentence makes the score for a word its share of a relatively local total. Normalizing by paragraph makes it compete with words across a larger span. Human reading time can vary from one sentence to another within that span, and the transformer’s summary of attention can also be redistributed over the longer input. A change in normalization scope therefore changes the relative quantities that go into the rank comparison.
The authors’ paragraph rerun substantially weakened many of the correlations and reproduced the non-significant result in the XLNet comparison with prior work. This is among the most direct procedural checks in the paper. The authors retain the general comparison between fixation time and incoming attention while changing the span used to place those scores in context. The outcome gives a concrete reason to report the normalization scope with any result. A coefficient from the sentence analysis describes local allocation under sentence-based processing and scaling.
The choice of mean versus maximum changes what the word score captures in a different way. With a maximum, a single strong assignment to the word can determine its score. With the mean, an assignment’s influence depends on how it combines with the other assignments to that word. The authors’ preliminary analysis favored the mean for stability across datasets. They make the maximum results available alongside the main analysis, while the reported layer, size, and task comparisons use the mean.
What changes when the reader has a specific target?
The comparison among ZuCo tasks holds the participant group fixed. The correlation profile for sentiment judgments and after-reading comprehension looks more like the profile found in other datasets. Once questions are visible during reading, associations are weaker and compact variants rank highest. That change is particularly informative because an explanation based solely on the composition of the participant group would have to account for the more typical results from those same readers in the other tasks.
One interpretation is that a visible question gives the reader a specific target and changes which words merit time. A word decisive for answering a question can become prominent even when it would be unremarkable in the course of reading the passage for general understanding. The transformer receives the original text as sentences in the general analysis. It has no equivalent instruction to search those words for the answer. The comparison may therefore put question-directed gaze beside attention generated under ordinary sentence processing. The lower coefficients in the Sood conditions are compatible with this account.
What changes when gaze is added to the loss?
The appendix supplies the comparison closest to a conventional training ablation. Within each combination of initialization and training-set size, the authors compare a classifier trained with the additional fixation term with a counterpart trained on the sarcasm objective alone. The test set stays fixed. Gaze has its clearest measured cost when the authors train from scratch on the larger dataset. With pretrained weights or the smaller training set, adding gaze gives no statistically significant improvement.
This result bears directly on the interpretation of the correlations. The fact that gaze and attention often agree in a pretrained system does not tell us how classification will change when the system is rewarded for matching gaze more closely. The correlation aggregates relative prominence across words. The training loss directly penalizes a divergence between distributions for a specific reader. A classifier can benefit from attending to words in ways that differ from that reader’s allocation, even when the two systems broadly tend to emphasize similar words. The experiment establishes the accuracy outcome for this particular training intervention.
Limitations
Limits identified by the authors
Gaze is a measure of overt attention. The authors take fixation location as observable evidence of what word a reader is attending to, while recognizing that attention can shift covertly. The dataset cannot reveal every such shift, and total dwell time also cannot distinguish the reasons for a long fixation. Someone may spend time on a word because it is hard to interpret, because it bears on a question, or because they return to it later. The analysis deliberately uses the measure that all the corpora have in common.
The authors also qualify the explanation for the training comparisons. Differences between BERT and RoBERTa and between generations of DeBERTa indicate that parameter count alone is insufficient to explain the gaze rankings. The research design gives no way to assign an independent effect to each pretraining or adaptation decision. Likewise, the interpretation of the multilingual and compact exceptions is tentative. All the analyzed text is English, and the comparisons involving multilingual checkpoints concern their behavior on English reading data.
The authors treat the task effect as evidence for a possible role of question-directed reading. The same participants in ZuCo showed a different profile under Task 3, and the MovieQA conditions offer a broadly consistent pattern. Additional work would be required to identify what part of the task produces the change. A question on the screen can alter how readers allocate time, but question visibility also occurs within a larger protocol that includes the nature of the question, the materials, and the expected response.
The paper also identifies uncertainty about the earlier XLNet analysis. Because the earlier authors did not specify their normalization clearly, the paragraph rerun supports an explanation without settling how they obtained their original coefficient. Finally, the paper leaves the use of gaze as an efficient substitute for transformer attention as a research direction. The findings concern correlation in the studied reading data, and the appendix concerns one choice of gaze supervision for a classification task. Neither experiment measures the speed or accuracy of a gaze-based replacement for full attention.
The appendix discusses a contrast with the earlier saliency-guided text-compression study. That work reported gains from a component trained to predict gaze-related saliency. The sarcasm experiment applies gaze directly as a regularizing signal on a layer. The authors leave open whether the different outcomes arose from the tasks, the ways of incorporating the human data, or both. Their experiment establishes the result for the particular combination of sarcasm data, BERT, and the fixation-dependent loss.
Limits that follow from the measurement
The conversion from attention matrices to word scores discards information by design. Two heads can focus on the same word for different purposes, and positions in a sentence may give weight to a word for entirely different relationships. The average loses these distinctions. A high correlation with the average consequently describes the distribution of incoming attention. It does not establish that a particular head traces a reader’s fixation sequence, or that a transformer and a reader use the same relationships between words.
Total dwell time also collapses the order of reading events. Several short looks and a single sustained look can contribute the same total duration. On the human side, the procedure then averages normalized scores across participants. A coefficient for that average says how the aggregate profile relates to transformer attention. A system could match that profile well while showing weaker or stronger agreement for particular readers. Individual variation is outside the main result.
Sentence normalization addresses differences in the total reading time and the total retained attention for each sentence. It also gives sentence length a role in the scores. A sentence has a fixed total share to distribute across its words, while sentences of different lengths enter the same pooled ranking. As a result, part of the association could reflect properties of the shared sentence structure. Removing single-word sentences deals with the most direct example of forced agreement. The experiment does not estimate how much of the remaining association would persist after accounting for sentence length or weighting different sentences equally.
The paper also does not report a comparison against a simple predictor built from properties such as a word’s length or position. This leaves open how much predictive value incoming transformer attention adds beyond basic features of the displayed text. For example, if a textual property tends to increase both a word’s dwell share and its received attention, the coefficient can reflect that shared dependency. Identifying such contributions would require a comparison that conditions on those properties or explicitly adds them as baselines.
The samples differ in more than the task given to readers. They include different texts, different participant groups, and different designs for evaluating comprehension. The Sood conditions, for instance, draw on different passages and use different numbers of participants. Their ordering by correlation supports inspecting question availability as a possible influence, while leaving the effects of those other differences unresolved. ZuCo provides the closer comparison by retaining the same participants, though its tasks still do not isolate question visibility from all aspects of how the material is read.
Limits on generalization and intervention
The system sample is defined by the requirements of the scoring procedure. Early and late positions can exchange attention under the bidirectional setup. A left-to-right architecture gives positions unequal opportunities to receive attention simply because later tokens are unavailable to earlier queries. A researcher could devise a different normalization or comparison for such an architecture, but the present coefficients apply to the collection examined here. They give no direct estimate for unidirectional language processing.
A strong rank correlation is also different from agreement about which words can safely be removed. A word can receive little average attention while carrying information that matters in a particular prediction. Averaging across heads and query positions makes the prominence measure useful for comparison while reducing its sensitivity to such specialized uses. The paper’s earlier filtering result motivated the gaze study, but the present study does not test whether a filter based on the fixation scores preserves the information needed for a new task or makes processing cheaper.
The sarcasm intervention uses fixation times from a single participant, selected for high task accuracy. It therefore tests an informative but narrow instance of gaze supervision. Its outcome could depend on the selected reader, the relation between that reader’s gaze and the training examples, the use of the first layer, or the influence assigned to the gaze term. The comparisons across training sizes and initializations show where the reported performance change appeared. They do not resolve whether another aggregation of human data or a different training objective would yield the same result.
The layer interpretation has a comparable boundary. The association of early layers with overt gaze can coexist with an association of middle layers with brain activity in a different experiment. Placing these findings next to one another suggests a way to ask more specific questions about the stages of reading and sentence processing. Establishing a correspondence between those stages would require matching the human signals, texts, and transformer measurements within a design that directly tests the proposed relationship.
What came after
No later study is documented here as extending the paper’s method or replicating its findings. The text-compression and brain-activity studies discussed above are antecedents, and the sarcasm experiment belongs to the paper itself. The question the authors leave open is whether word-level agreement with gaze can be turned into a cheaper attention procedure that preserves accuracy on a language task.
Cite
Cite as Joshua Bensemann, Alex Peng, Diana Benavides-Prado, Yang Chen, Neset Tan, Paul Michael Corballis, Patricia Riddle and Michael Witbrock. 2022. Eye Gaze and Self-attention: How Humans and Transformers Attend Words in Sentences. Proceedings of the Workshop on Cognitive Modeling and Computational Linguistics.
@inproceedings{bensemann2022eye,
title = {{Eye Gaze and Self-attention: How Humans and Transformers Attend Words in Sentences}},
author = {Joshua Bensemann, Alex Peng, Diana Benavides-Prado, Yang Chen, Neset Tan, Paul Michael Corballis, Patricia Riddle and Michael Witbrock},
booktitle = {Proceedings of the Workshop on Cognitive Modeling and Computational Linguistics},
year = {2022},
doi = {10.18653/v1/2022.cmcl-1.9},
url = {https://doi.org/10.18653/v1/2022.cmcl-1.9}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bensemann-2022-eye-gaze-self-attention-how/