Elamur Research

ScanDL: A Diffusion Model for Generating Synthetic Scanpaths on Texts

Paper · 2023 · Lena S. Bolliger, David R. Reich, Patrick Haller et al.

Summary

A reader may skip a word, look at another word several times, or return to a phrase after reaching the end of it. An eye tracker can record the order of those events, but collecting such recordings takes time and equipment. Many applications that could use gaze information have only the text available when they run. The authors introduce ScanDL to generate a plausible reading trace from a sentence alone. The trace, called a scanpath, records which word received each fixation in chronological order. It can represent skipping, rereading, and backward movements, while leaving out how long each fixation lasted.

The method gives the sentence and the scanpath a shared representation. A fixation points to the position of a word in the sentence, even when the input tokenizer splits that word into several pieces. Separate position information captures the order of the sentence and the order in which the reader looked at its words. ScanDL learns to recover these fixation sequences after noise has been added to their continuous representations. To generate a new scanpath, it starts with noise in the place reserved for the fixations, keeps the sentence available throughout the process, and gradually resolves the noisy sequence into word positions.

On CELER L1, an eye-tracking corpus for native English reading, ScanDL had the lowest mean normalized edit distance among the systems tested across all the within-corpus splits. When both readers and sentences were held out, its mean distance to a recorded scanpath was 0.515, compared with 0.578 for Eyettention and 0.538 for a comparison between human readers of the same sentence. After training on CELER L1 and testing on natural reading in ZuCo, ScanDL scored 0.647, close to the human comparison of 0.646. The authors also examined what the generated paths do at the word level. The estimated effects of word length, frequency, and predictability agreed in direction with the human effects across the reading measures they studied, although some effects were stronger or weaker in the synthetic data.

The results support the use of ScanDL to approximate how a group reads a sentence. A trace near several readers’ recordings can score well even when it misses the habits of a particular reader. In the experiments, backward movements and densely fixated sentences remained harder to predict, and some of the generated paths understated how frequently readers went back. The paper establishes similarity in the order and distribution of word visits under the tested conditions. The timing of those visits and the cognitive process that produced the human recordings remain outside that evidence.

Deep dive: ScanDL: A Diffusion Model for Generating Synthetic Scanpaths on Texts

ScanDL uses diffusion to predict where readers look in a sentence, then tests how closely the resulting scanpaths resemble human eye movements. · about 36 minutes to read

The problem and its context

A sentence has a word order and a reading order

The order in which words appear is fixed by the text. The order in which a reader looks at them is a separate sequence. A fixation is an occasion on which the eyes settle at a location. In this paper, each retained fixation is represented by the position of its word in the sentence. A saccade is a movement between fixations. A forward movement advances through the sentence, while a regression returns to an earlier position. If the eyes settle again on the same word, the word’s position appears again in the scanpath. A word that receives no fixation has no entry of its own.

This representation preserves a distinction that matters for sentence processing. Suppose a reader crosses a short word without looking directly at it, continues through the phrase, then returns and looks at the skipped word. A list of words that received attention would register the word as visited. A scanpath can also place that visit after the later part of the phrase. Similarly, a count of fixations per word can register repeated attention, while the scanpath distinguishes a cluster of fixations on the first visit from a return after reading other words. Some of the paper’s analyses depend on exactly that distinction.

Eye movements carry information about both the reader and the text. In psycholinguistics, researchers use them to investigate how people process language as they read. A word’s frequency and predictability, for instance, can help explain where readers look. Differences among readers also matter. The paper describes research that uses gaze to infer properties such as language proficiency and reading comprehension, alongside work that uses gaze to assess the difficulty of a text. An example of the former is Assessing Language Proficiency from Eye Movements in Reading.

The authors also describe uses in natural language processing. Gaze can provide a point of comparison when researchers interpret what an automated system attends to, or an additional source of information when they train it for another task. These uses face related constraints. Real recordings are scarce because participants must read under conditions in which their gaze can be measured. Once an application is deployed, it may encounter sentences for which no gaze was collected at all. A generator that needs only the sentence addresses that second constraint directly. Its usefulness for any particular application still depends on whether the generated traces retain the kind of information that application needs.

From theories of eye control to sequence prediction

E-Z Reader and SWIFT are the principal examples the paper gives of research grounded in theories of reading. Both predict the locations and durations of fixations using linguistic properties such as word frequency and predictability. Their design serves an explanatory purpose. Researchers can use an explicit account of eye movement control to ask how comprehension interacts with visual attention, or how known properties of words affect when and where the eyes move. Making plausible predictions is part of that enterprise, alongside explaining the observations through proposed mechanisms.

A separate line of research approaches gaze as a prediction problem. The paper describes early logistic regression work that used features derived from eye movements to predict the next fixation, then extended the approach to include features of the text. Here the features give a predictor access to potentially relevant information, and observed data determine how that information is used. The resulting predictor can be evaluated by comparing its output with new recordings without requiring its internal steps to correspond to a theory of reading.

Other approaches drew on sequence labeling. One used an unsupervised architecture to decide whether the next word would receive a fixation. Another combined neural sequence processing with a conditional random field to estimate fixation probabilities for words in a sentence. These formulations can describe the likelihood of looking at each word as the text progresses. Chronology is a separate output requirement. A labeling decision assigned to a word has no natural place to store all the later moments at which that same word might be visited again.

Eyettention, the closest predecessor considered in the paper, explicitly separates the word and gaze sequences. It uses recurrent encoders to represent them and cross-attention to make information in one sequence available to the other. It generates a path autoregressively, meaning that it predicts the next fixation using the path already generated. This formulation can accumulate a sequence of forward movements, repeated visits, and regressions. It also frames generation as repeated continuation of an existing prefix. ScanDL formulates generation as repeated refinement of a candidate for the path as a whole.

Why diffusion was a plausible alternative

Diffusion learns a generative process by training on increasingly corrupted versions of real examples. The forward process adds noise according to a prescribed rule. The learned reverse process uses a noisy state to estimate a cleaner one. With Gaussian diffusion, these operations are defined over continuous values. A sentence or a scanpath is discrete, however. Adding a small fraction to the index of a fixated word gives a real number, but that operation on its own has no reading interpretation. An embedding gives each discrete item a vector on which noise and reconstruction can operate. The general approach comes from Deep Unsupervised Learning using Nonequilibrium Thermodynamics.

The paper describes more than one way earlier research adapted diffusion to discrete sequences. An edit-based approach corrupted text through discrete changes. Other work moved discrete data into a continuous embedding space and used a reverse process to generate text, with constraints supplied through classifiers or through an entire source sentence. For ScanDL, the particularly relevant idea is to keep one sequence available as a condition while generating another. The paper draws on Diffusion-LM and DiffuSeq.

The adaptation to gaze changes what it means for the two sequences to correspond. In conditional text generation, the source and target are both text. In ScanDL, the input consists of words and the output consists of visits to positions in those words. A fixation has a clear referent in the stimulus, but its place in the chronological trace is independent of that referent’s place in the sentence. The method therefore needs a way to preserve the identity of the word being looked at and, separately, to represent when that look occurred.

The method, step by step

Build a shared representation without losing either order

Each training example pairs a sentence with a human scanpath. The sentence supplies the stimulus. The scanpath gives the chronological series of word indices for a reading of that stimulus. More than one reader can contribute a path for the same sentence. ScanDL uses each observed path as a training target for the sentence it belongs to. Reader identity indexes the recorded data, while the generation condition consists of the sentence.

fʳ_w = ⟨f₁, …, fₙ⟩

Here fʳ_w is the path made by reader r on sentence w. Each fⱼ is the word index of the fixation at chronological position j. The last entry is written fₙ, with n denoting the number of fixations. Angle brackets indicate an ordered sequence, and the ellipsis stands for its intervening entries. Repetition is meaningful because a reader can fixate the same word more than once.

The sentence passes through WordPiece subword tokenization. A word can occupy several entries in the tokenized sentence, while a recorded fixation is aligned to a whole word. ScanDL bridges those levels by assigning the pieces of a word a common word index. Each piece retains its own tokenizer ID. On the gaze side, the fixation carries the shared word index and receives a padding ID in the tokenizer channel. The latter convention avoids assigning a fixation to a particular piece when the training data locate it only at the word level. The tokenizer and the lexical embedding come from BERT.

Both sequences receive a CLS marker at the beginning and a SEP marker at the end. The markers give the sentence and the scanpath explicit boundaries before they are joined. The resulting sequence can be read in three parallel channels. One channel identifies which word a sentence piece or fixation refers to. Another identifies the sentence pieces in the tokenizer vocabulary, with PAD on the fixation side. The remaining channel gives the order of entries within their respective sequences.

x = xʷ ⊕ xᶠ

The symbol x denotes the joined discrete input. Its sentence portion is xʷ, and its fixation portion is xᶠ. The operator ⊕ means concatenation along the sequence. Each portion includes its boundary markers. Concatenation puts the two portions where the same attention mechanism can inspect them while keeping their roles identifiable.

The word index answers “which word?” The position index answers “where in this sequence?” Consider two fixations on the same word, separated by a visit to another word. They have the same word index, but their positions in the path differ. Conversely, successive positions in the fixation sequence can point backward through the word indices. The joint representation gives ScanDL a way to distinguish these cases without treating every gaze event as a new lexical item. It also accommodates the fact that the sentence uses sub-word pieces while the path refers to whole words.

How ScanDL represents a sentence and generates its scanpath

The steps in order.

How ScanDL represents a sentence and generates its scanpathStep 1: Tokenize the sentence and mark sequence boundaries1. Tokenize the sentence and mark sequence boundariesStep 2: Align fixations and sentence pieces by word index2. Align fixations and sentence pieces by word indexStep 3: Embed word indices, token identities, and positions3. Embed word indices, token identities, and positionsStep 4: Learn to recover partially noised fixation sequences4. Learn to recover partially noised fixation sequencesStep 5: Initialize fixation word indices with Gaussian noise5. Initialize fixation word indices with Gaussian noiseStep 6: Denoise while restoring the original sentence condition6. Denoise while restoring the original sentence conditionStep 7: Decode the final vectors into fixation word indices7. Decode the final vectors into fixation word indices

Map the discrete channels into vectors

ScanDL has an embedding for each channel. The word-index embedding and the position embedding are learned during training. The pretrained BERT embedding is frozen, and a linear projection places it in the dimensional space used by ScanDL. Each entry in the joined sequence is thus represented by a vector containing contributions from identity, lexical information, and order. The embeddings need a common width because their contributions are added element by element.

Eᴹᴮ(x) = Eᵢdx(xᵢdx) + Eᵦₑᵣₜ(xᵦₑᵣₜ) + Eₚₒₛ(xₚₒₛ)

Eᴹᴮ is the complete embedding function and x is the joined input. The labels idx, bert, and pos identify the word-index, BERT-token, and position channels. The x with each label is that channel’s discrete input, and the E with the matching label maps it to vectors. The plus signs denote elementwise addition of the aligned vector sequences. Every resulting vector has the hidden width d, which is 256 in the selected configuration.

The embedding introduces a continuous space in which similar or related signals can be handled by the same network. It also makes it possible to perturb a training example without defining discrete operations such as choosing which fixation to delete. In the paper’s probabilistic account, the first latent, or internal continuous state, is sampled around the embedded example. The initial embedding center and the resulting sample serve different roles in the training objective.

z₀ ∼ qᵩ(z₀ | x) = 𝒩(Eᴹᴮ(x), β₀ I)

Here z₀ is the initial continuous state, ∼ means sampled from, and qᵩ is the forward embedding distribution with parameters ϕ. The bar means “conditioned on,” so the distribution depends on the discrete example x. The notation 𝒩 gives a Gaussian distribution by its mean and covariance. Its mean is the embedding Eᴹᴮ(x), and its covariance is the initial variance scale β₀ times the identity matrix I. The identity matrix specifies an isotropic perturbation, with the same variance along each coordinate and no covariance between coordinates.

The implementation distinguishes the representation that needs corruption from the inputs that help recover it. In the subsequent diffusion process, the changing part is the fixation portion of the word-index representation. The lexical and positional inputs remain available without diffusion corruption. The sentence portion also remains fixed during forward noising. This separation makes the training problem resemble deployment. The network must resolve where the gaze falls, with access to the words and their order even when the fixation identities carry substantial noise.

Add noise to the path and keep the sentence available

A forward diffusion transition is Gaussian. At each step, it scales the previous continuous state and adds a Gaussian perturbation. A schedule determines the variance used at each step. By repeating the transition, the procedure moves the corrupted part away from the clean example and toward a state dominated by noise. Forward transitions have the first-order Markov property. Given the latest state, the rule for producing the next one needs no earlier states.

q(zᶠₜ | zᶠₜ₋₁) = 𝒩(√(1 − βₜ) zᶠₜ₋₁, βₜ I)

In this equation, q is the fixed forward transition and the superscript f identifies the fixation component undergoing corruption. The subscripts t and t−1 denote the current and preceding diffusion steps. The variance scale at step t is βₜ. The square root of 1 − βₜ scales the preceding state to give the conditional mean. The covariance βₜ I describes the newly added noise, with I the identity matrix. This rule concerns the noised representation of fixation identities. It does not assign a new word to any individual gaze event during the forward process.

The full state uses the fixed sentence component alongside the changing fixation component.

zₜ = zʷ₀ ⊕ zᶠₜ

The symbol zₜ denotes the joined state at step t. Its sentence component zʷ₀ comes from the initial state, indicated by the subscript 0. Its fixation component is zᶠₜ, which changes with t. The concatenation operator ⊕ joins the two components along the sequence. The maximum number of steps is written T̃, and the main setup reports T̃ as 2000. During training, T denotes a selected noise level from the available steps.

The appendix also expresses the Gaussian corruption in terms of the signal retained at each step. This is useful because it gives the distribution at a selected noise level directly from the initial latent. The forward process defines the sequence of transitions even when a training calculation needs only the marginal distribution at one step. With the sentence held fixed, the following relation describes the component undergoing Gaussian corruption.

q(zₜ | z₀) = 𝒩(√ᾱₜ z₀, (1 − ᾱₜ) I)

Here zₜ is the noised latent at step t, and z₀ is the initial latent being corrupted. The appendix uses αₜ for the fraction 1 − βₜ, where βₜ is the step’s noise variance scale. The bar over α denotes the product of these retained fractions through step t. The Gaussian mean scales z₀ by the square root of that product. The remaining fraction multiplies I to give the covariance. Thus the same initial example can be presented to the denoiser at a sampled noise level without constructing an explicit training target for every preceding step.

For the selected configuration, the authors name a square-root schedule with the initial constant s set to 0.0001. They also give linear, cosine, and truncated alternatives in the hyper-parameter search. There is an ambiguity in how the schedule formulas are labeled. The printed square-root expression gives the following curve.

βₜ = 1 − √(t / T̃ + s)

In the printed notation, βₜ is the schedule quantity, t is the step, T̃ is the maximum step, and s is the initial constant. Taken literally through the terminal step, the expression does not stay in the positive interval the paper requires of a per-step transition variance. The cosine and truncated cosine entries also display the same normalized cosine expression. The paper distinguishes the named settings and reports their empirical comparisons, but its printed formulas leave the conversion from those curves to per-step transition variances unclear.

Learn to estimate a clean state

The learned reverse process begins with a terminal state and proceeds one step at a time. Its transition at a given step depends on the current state, with the sentence supplied alongside the changing fixation portion. The network sees the noise level as well. Knowing the step matters because interpreting a nearly clean path calls for a different estimate from interpreting a state whose fixation vectors are still dominated by noise.

pθ(z₀:ₜ) = p(zₜ) ∏ₜ₌₁ᵀ pθ(zₜ₋₁ | zₜ)

pθ is the reverse distribution with learned parameters θ. On the left, z₀:ₜ denotes the sequence of latent states from the initial state through the terminal state, with the upper endpoint understood as T. The term p(zₜ) outside the product is the prior at that terminal step, taken to be standard Gaussian on the generated component. In the product, the index t runs from 1 through T, and each factor is the probability density for the preceding state zₜ₋₁ conditional on the current state zₜ. The factorization is the reverse counterpart to the forward chain.

The authors train the reverse process using a variational lower bound on the log likelihood of the initial state. Direct computation would require integrating over all possible hidden trajectories that could lead to an observed example. The bound uses paths sampled under the known forward rule to supply training comparisons. In particular, the clean starting state is available during training, so the forward rule defines a posterior for the preceding noisy state conditional on both the current noisy state and the original sample.

VLB = 𝔼q(z₁:ₜ | z₀) [log(p(zₜ) / q(zₜ | z₀))
      + log pθ(z₀ | z₁)
      + ∑ₜ₌₂ᵀ log(pθ(zₜ₋₁ | zₜ) / q(zₜ₋₁ | zₜ, z₀))]

VLB is the variational lower bound. The expectation 𝔼 averages over paths z₁:ₜ through the terminal step T, sampled from the forward distribution q given z₀. The first log ratio compares the terminal prior p with the forward marginal q at that terminal step. The second term is the log density the reverse process assigns to reconstructing z₀ from the first corrupted state z₁. The sum covers reverse steps from 2 to T. Its numerator uses the learned transition pθ and its denominator uses the forward posterior for zₜ₋₁ given zₜ and the starting state z₀. The operator log is the logarithm. The division inside each logarithm compares densities for the corresponding latent state.

In the appendix, the forward posterior is derived by combining the transition from the previous to the current step with the Gaussian marginals given the starting point. The result is a Gaussian whose mean blends the current noisy state with the original latent. Its covariance can be read from the schedule.

σ²q(t) = ((1 − αₜ)(1 − ᾱₜ₋₁)) / (1 − ᾱₜ)

σ²q(t) is the scalar variance of the forward posterior at step t. Multiplying it by I gives the covariance matrix. αₜ is the retained fraction for the current transition, and ᾱₜ₋₁ and ᾱₜ are the products of retained fractions through the previous and current steps. The quantities on the right are fixed by the forward schedule.

μq(zₜ, z₀) = (√αₜ (1 − ᾱₜ₋₁) zₜ + √ᾱₜ₋₁ (1 − αₜ) z₀) / (1 − ᾱₜ)

μq is the forward posterior mean. It combines the current latent zₜ and the initial latent z₀. The square roots, products, and division give their weights using the same retained fractions and cumulative products as in the variance. The learned transition uses this form with the network’s estimate fθ(zₜ, t) in the place occupied by z₀. Here fθ is the denoising network and its arguments are the current state and the step. At generation time, this substitution supplies the term for which a known clean latent would otherwise be needed.

The appendix sets the two Gaussian covariances equal for the purpose of deriving the denoising term. With matched covariance, reducing the divergence between the transitions comes down to bringing their means closer. The part of the mean involving the current state already has the same form on both sides. The remaining comparison is between the predicted initial state and the real one, up to a weight set by the schedule. The authors drop that weight in the implemented reconstruction term. Consequently, the network predicts the clean latent even though the reverse sampler uses that prediction to take an intermediate step.

Train for reconstruction and for discrete output

The objective combines the latent reconstruction term with a term close to the embedding boundary and one that trains the reverse embedding into discrete space. This division reflects the distinction between recovering a continuous representation and recovering the word identities it is meant to encode. At the initial boundary, the embedding center is available as a target separate from the Gaussian sample around it.

LScanDL = ∑ₜ₌₂ᵀ ‖fθ(zₜ, t) − z₀‖₂²
          + ‖Eᴹᴮ(x) − fθ(z₁, 1)‖₂²
          − log pθ(x | z₀)

LScanDL is the loss minimized over θ. The first sum compares fθ(zₜ, t) with the initial latent z₀ at steps t from 2 through the selected level T. The notation ‖·‖₂² is squared Euclidean distance, which adds the squared differences of the vector coordinates. The second term compares the embedding Eᴹᴮ(x) of the discrete example x with the estimate obtained from z₁ at the first step. The last term is the negative log probability assigned to the discrete input by the reverse embedding conditioned on z₀. It penalizes a continuous representation that decodes poorly. The paper also allows training to sample T = 0, where the task is to recover the discrete input from the initial continuous sample.

The denoiser is an encoder-only Transformer and attention architecture. An encoder can process the joined sequence of sentence and fixation positions in one pass at each step. Attention allows information from the sentence to contribute to estimates on the fixation side and allows positions in the candidate path to inform each other. The network receives positional embeddings explicitly. For a path that may move backward or repeat an index, position within the path is information that the word indices alone cannot supply. The architecture follows the attention framework introduced in Attention Is All You Need.

The chosen encoder uses a hidden dimension of 256, contains 12 blocks and 8 attention heads, and supports sequences up to 128 tokens long. The authors use importance sampling to choose training noise levels. This varies the amount of corruption presented during training without treating every training example as a complete generation from the final noise level. The approach to selecting steps follows Improved Denoising Diffusion Probabilistic Models.

The training search sampled 60 configurations and used triple cross-validation in the New Reader/New Sentence setting, selecting by normalized edit distance. The search covered encoder depth, attention head count, hidden width, and noise schedule. The reported training runs used 80,000 learning steps, a batch size of 64, and a learning rate of 1e-4 on 4 NVIDIA GeForce RTX 3090 GPUs. The implementation uses PyTorch and the optimizer is AdamW, from Decoupled Weight Decay Regularization. The authors released the ScanDL implementation through DiLi-Lab.

Generate a scanpath for a sentence

At inference, the sentence can be embedded immediately. There is no recording from which to obtain the fixation word indices, so ScanDL starts that part of the input with standard Gaussian noise. The position and padding inputs still identify the slots reserved for the scanpath. Together with the sentence embedding, these inputs form the starting state for denoising. Supplying the sentence in advance makes its words available before any fixation prediction has taken shape.

The reverse steps repeatedly estimate the clean latent and update the candidate path. At each step, an anchoring operation maps continuous predictions to discrete identities and projects those identities back into the continuous space. This rounding puts intermediate predictions in correspondence with actual discrete representations. It also restores the sentence portion from the original embedding. That restoration matters because the network processes the joined state during denoising. Estimates on the generated side can evolve while the words that govern the task remain available in their original form.

After the final reverse step, the inverse embedding gives the discrete fixation sequence. The output can name a word more than once, leave a word unvisited, or refer back to an earlier word after a later one. These possibilities follow from predicting a sequence of word indices in chronological slots. The procedure does not require a separate rule to insert a regression after the rest of the scanpath has been decoded.

Experiments and results

The corpora and what each split holds out

The authors use the native-English portion of CELER, called CELER L1, for training and within-corpus evaluation. CELER L1 contains 5456 unique sentences and recordings from 69 readers. Its sentences have a mean length of 11.2 ± 3.6 words, where the figure after the ± sign is the standard deviation. For evaluation across corpora, the authors use the natural-reading portion of ZuCo, called ZuCo NR. It contains 700 unique sentences and recordings from 12 readers, with a mean sentence length of 19.6 ± 9.8 words. The study leaves the other reading conditions in these corpora outside the reported evaluation.

The within-corpus experiment uses 5-fold cross-validation with three definitions of an unfamiliar test example. In New Sentence, the test sentences are held out of training, while the readers are represented in both parts. This tests how well the predictor can apply what it learned to different text from the same corpus. In New Reader, the people are held out, while the sentences appear in both training and testing. Training can therefore expose the predictor to what other people did on the same sentence. In New Reader/New Sentence, neither the test readers nor the test sentences appeared during training. The corpus still supplies a common recording setup and presentation style.

For the across-corpus experiment, the authors train on CELER L1 and test on ZuCo NR. The new recordings bring different people and sentences, different presentation conditions, and a change in recording hardware. The eye tracker used for CELER L1 is listed at 1000 Hz, while the one for ZuCo NR is listed at 500 Hz. The datasets also differ in their sentence lengths. Because the study changes corpora as a unit, the resulting score measures transfer under those shifts together.

The comparison systems and the edit-distance metric

The baselines serve different purposes. Uniform samples fixation locations independently across the available sentence positions. Train-label-dist draws the range of saccades from the distribution in the training labels. The latter can use the prevalence of different movement sizes without learning where a regression is likely to occur on a specific sentence. These comparisons help determine how much a method gains from moving beyond basic distributions over positions and movements.

E-Z Reader and SWIFT are the theory-driven comparison systems. Eyettention is the learned comparison that explicitly represents both the word sequence and the gaze sequence. Human measures the agreement between separate readers on the same sentence. It provides a reference for how much edit distance arises when both traces are genuine, since real readers can follow different paths through identical words. The comparison scores the generated and human paths in the same word-index space.

The evaluation metric is normalized Levenshtein distance, abbreviated NLD. Levenshtein distance counts the smallest number of insertions, deletions, and substitutions required to transform one sequence into another. If a generated path adds a visit or omits an observed visit, an edit can account for it. If a visit points to a different word, substituting its index is another possible edit. The minimum is taken over alignments of the two chronological sequences, so agreement about which words were visited is only part of the comparison.

NLD(S, Ŝ) = LD(S, Ŝ) / max(|S|, |Ŝ|)

S is the recorded sequence of fixation word indices, and Ŝ is the predicted sequence. LD(S, Ŝ) is their minimum edit count. Vertical bars indicate each sequence’s length. The max operator selects the longer length for the denominator, so NLD expresses the edit distance relative to the size of the longer path. The experiment reports the mean NLD over comparisons. Lower values correspond to greater agreement under this metric.

A score is therefore a statement about the recorded sequence and the cost rule. It tells the reader how much editing is needed after taking path length into account. Word order affects the alignment, but the cost of an individual substitution does not depend on how far apart the two word positions are. A human path can also be atypical and still be the target for the comparison. Both features matter when interpreting what a lower score establishes.

Results when training and testing in CELER L1

In New Sentence, ScanDL obtains mean NLD of 0.516 ± 0.006, against 0.580 ± 0.002 for Eyettention and 0.538 ± 0.006 for Human. These uncertainty figures are standard errors. E-Z Reader obtains 0.619 ± 0.005, and SWIFT obtains 0.607 ± 0.004. Train-label-dist scores 0.672 ± 0.003, and Uniform scores 0.779 ± 0.002. The improvement over the previous learned system therefore appears even when the actual words and sentence orders in the test examples have been held out.

New Reader yields the lowest mean NLD of ScanDL’s within-corpus results, at 0.509 ± 0.014. Eyettention obtains 0.580 ± 0.004 and Human obtains 0.536 ± 0.004. E-Z Reader and SWIFT give 0.620 ± 0.006 and 0.608 ± 0.006, respectively. Train-label-dist gives 0.672 ± 0.004, and Uniform gives 0.781 ± 0.003. Since readers are unseen but sentences are familiar from other readings, the split is compatible with a predictor that benefits from repeated exposure to how different people read the same text.

Mean NLD on CELER L1 with new readers and new sentences

ScanDL has the lowest mean edit distance on the split that holds out both readers and sentences.

Mean NLD on CELER L1 with new readers and new sentencesUniform: 0.782Uniform0.782Train-label-dist: 0.674Train-label-dist0.674E-Z Reader: 0.622E-Z Reader0.622SWIFT: 0.607SWIFT0.607Eyettention: 0.578Eyettention0.578Human: 0.538Human0.538ScanDL (this paper): 0.515ScanDL (this paper)0.515
The numbers
System or settingmean NLD
Uniform0.782
Train-label-dist0.674
E-Z Reader0.622
SWIFT0.607
Eyettention0.578
Human0.538
ScanDL (this paper)0.515

In New Reader/New Sentence, ScanDL’s standard error is 0.014, compared with 0.006 for both Eyettention and Human. The paper marks the synthetic reference systems as significantly worse than ScanDL in each within-corpus setting. The Human comparison has no such significance marker. The fact that ScanDL has a lower mean than Human across these splits supports the authors’ interpretation that it tends to produce paths close to those of a typical reader. A second human reader brings a separate set of habits and can attend to different parts of the sentence. A path estimated from many readings can be nearer the observed examples on average than a single reader’s path.

The paper also reports that the mean NLD was unchanged when it compared a generated path with all the human paths on its sentence in the test set and averaged those comparisons. This addresses the possibility that the result depended on which recorded reader furnished the target. The authors also note that the ordering of their scores across splits differs from earlier work that had identified new readers as the main challenge. The split definitions make those observations compatible with ScanDL learning sentence-conditioned patterns that generalize across readers more readily than it generalizes across sentence stimuli.

Transfer to ZuCo natural reading

Mean NLD on ZuCo NR after training on CELER L1

ScanDL leads the synthetic systems and comes close to the agreement between human readers.

Mean NLD on ZuCo NR after training on CELER L1Uniform: 0.802Uniform0.802Train-label-dist: 0.723Train-label-dist0.723E-Z Reader: 0.667E-Z Reader0.667SWIFT: 0.703SWIFT0.703Eyettention: 0.697Eyettention0.697Human: 0.646Human0.646ScanDL (this paper): 0.647ScanDL (this paper)0.647
The numbers
System or settingmean NLD
Uniform0.802
Train-label-dist0.723
E-Z Reader0.667
SWIFT0.703
Eyettention0.697
Human0.646
ScanDL (this paper)0.647

Human has a standard error of 0.002 on this comparison. The table gives point estimates for the synthetic systems in this setting. ScanDL retains its lead over the other generated paths, while the human mean is slightly lower. E-Z Reader is the nearest synthetic reference on ZuCo NR, whereas Eyettention leads the synthetic references other than ScanDL in the within-corpus evaluation. The change in ranking illustrates why the transfer comparison adds information beyond another held-out split of CELER.

ScanDL’s across-corpus NLD is higher than any of its within-corpus values. The human comparison is also higher. That context matters because the reference for what counts as agreement changes with the test corpus. The across-corpus result shows that useful sentence-conditioned behavior carries to the tested ZuCo readings. The experiment has one direction of transfer and bundles several differences together, so the distance changes cannot be attributed to any single feature of the recording setup or the sentences.

What the ablations show

The sentence and the embeddings carry distinct kinds of information

The component comparisons use 5-fold cross-validation on CELER L1 in the New Reader/New Sentence setting. This setting is particularly informative for the sentence condition because the evaluation requires a response to unfamiliar text from unfamiliar readers. The paper compares the full configuration with unconditional generation and with a configuration that removes both the BERT and position embeddings. It also tests alternate noise schedules.

Mean NLD for ScanDL variants on CELER L1 with new readers and sentences

Removing sentence conditioning or both auxiliary embeddings hurts performance more than changing the noise schedule.

Mean NLD for ScanDL variants on CELER L1 with new readers and sentencesSquare root, original ScanDL (this paper): 0.515Square root, original ScanDL (thispaper)0.515Cosine: 0.514Cosine0.514Linear: 0.519Linear0.519Without the sentence condition: 0.667Without the sentence condition0.667Without BERT and position embeddings: 0.968Without BERT and position embeddings0.968
The numbers
System or settingmean NLD
Square root, original ScanDL (this paper)0.515
Cosine0.514
Linear0.519
Without the sentence condition0.667
Without BERT and position embeddings0.968

The standard errors for the original, cosine, and linear configurations are 0.014, 0.018, and 0.020, respectively. The unconditional configuration has a standard error of 0.015. When both BERT and position embeddings are omitted, it is 0.002. The paper reports significant performance drops for both removals. The paired comparison of the square-root and cosine settings gives p = 0.68. The cosine setting has the lowest numerical mean in the table, while the statistical comparison leaves the relative merits of these schedules unresolved at the precision of the experiment.

The unconditional system retains positional information, but loses the sentence it would use to decide where gaze is likely to fall. Its decline shows the value of conditioning on the actual stimulus under the tested setup. A generator supplied only with a path representation can still learn common properties of scanpaths. The lower error of the complete system indicates that a useful portion of the performance comes from relating those patterns to the sentence being read.

Removing the BERT and position embeddings together leaves the word-index channel. That channel tells the network that particular sentence entries and gaze events refer to the same word position. The removed inputs carry lexical representation and explicit order. A fixation array must make its own chronological order available even when successive fixations visit sentence words out of order. The result therefore supports the authors’ interpretation that the dual representation needs more than a shared identifier for the fixated word.

This is a joint removal. Its score does not estimate how much of the loss is due to BERT alone, how much is due to position alone, or whether their contributions interact. The appendix also reports about 130 million trainable parameters for the full system and about 22 million for each of the removal variants. These are comparisons between the tested configurations, with changes in capacity accompanying the changes in inputs. The schedule experiment isolates a more narrowly defined change. Within the tested alternatives, its results give stronger grounds for crediting the representation and conditioning than for crediting the exact form of the default schedule.

Check whether the word-level effects resemble human reading

The authors next ask what happens within the generated paths. Two systems can obtain comparable edit distances and still behave differently around long or unexpected words. To detect such differences, the paper takes measures from the generated and recorded paths and estimates how each measure varies with word length, lexical frequency, and surprisal. This analysis uses the New Reader/New Sentence split, so its synthetic effects are estimated on outputs generated for held-out readers and text.

Lexical frequency is obtained with wordfreq. Surprisal measures how unexpected a token is given the preceding tokens in its sentence. The authors obtain the probabilities for this analysis from GPT-2. Surprisal supplies a predictor separate from the gaze generator. It lets the analysis ask whether gaze behaves differently where a separate estimator assigns low probability to the next token.

surprisal(wⱼₖ) = −log p(wⱼₖ | wⱼ,<ₖ)

Here wⱼₖ is the token at position k in sentence j. The notation wⱼ,<ₖ means the tokens in the same sentence before position k. The probability p is the probability assigned to the target token conditional on that prefix, as indicated by the vertical bar. The negative logarithm makes smaller probabilities correspond to larger surprisal values.

The paper examines four outcomes. First-pass regression records whether a backward movement began from a word on its initial visit. Skipping records whether the word was passed over on the first pass. First-pass fixation count records consecutive fixations on the word during its initial visit. Total fixation count includes fixations across the whole trace. A word visited again later can therefore have the same first-pass count as another word but a larger total count. That distinction lets the analysis capture different consequences of a word’s properties.

The Bayesian analysis uses logistic regression for the binary outcomes and Poisson regression for the counts. The human fits include reader-specific random intercepts, so each person can have a different baseline level of a reading measure. The synthetic fits omit the by-reader intercept. The authors draw posterior distributions using brms with 4 chains of 4000 iterations, including 1000 warm-up iterations, and report 95% credible intervals. The intervals describe uncertainty in the fitted effects under the statistical analysis.

Across the tested outcomes, ScanDL reproduces the direction of the human coefficient for each of the three predictors. For instance, the posterior mean coefficient for word length on skipping is −0.95 in the human data and −0.64 in the ScanDL data. Eyettention gives −0.34 on the same outcome. The negative estimates are consistent with a tendency to skip longer words less often, with different strengths across systems. The length coefficient on total fixation count is 0.24 for human paths and 0.18 for ScanDL. That coefficient reflects the tendency for longer words to attract more fixations in both sets of paths.

Matches in direction can coexist with differences in magnitude. For surprisal and skipping, the human posterior mean is 0.07 and ScanDL’s is 0.21. For lexical frequency and skipping, the corresponding means are −0.23 and −0.25. In this case the estimates are close as well as pointing in the same direction. For the effect of surprisal on first-pass fixation counts, the human and ScanDL means are both 0.08. These examples show why the authors examine estimates across several outcomes. A single well-matched coefficient could hide a poor match somewhere else, and agreement across effects can be informative even when individual estimates differ.

The paper’s conclusion about these regressions is comparative. Across the collection of effects, ScanDL has the closest overall qualitative and quantitative correspondence to the human patterns in the study. E-Z Reader and SWIFT were designed with linguistic effects in mind, yet some of their estimates differ in direction or size from those fitted to these recorded paths. The regression results show how the output behaves under the chosen measurements. They do not identify the internal reasoning that produced a fixation.

Examine variability and difficult paths

The variability analysis compares means and standard deviations for properties of whole scanpaths, including regression rate, normalized fixation count, forward and backward saccade length, skipping, and first-pass count. These comparisons ask whether ScanDL outputs vary the way human paths vary. Group-level variability of a statistic and accuracy for an individual path are different quantities. A generator can reproduce the spread of a reading measure across many paths while missing which particular reader or sentence will give rise to an extreme value.

On CELER, the mean and standard deviation of first-pass count are 0.91 ± 0.21 in the true data and 0.90 ± 0.19 in the generated data. For backward saccade length, the corresponding values are 2.55 ± 2.16 and 1.82 ± 2.24. The backward movements have a broadly similar spread in the two sets, while the average generated movement is shorter. On ZuCo, the true and synthetic skipping rates are 0.42 ± 0.16 and 0.41 ± 0.18. The regression rates differ more clearly, at 0.15 ± 0.09 in the true data and 0.07 ± 0.07 for ScanDL.

These results qualify the idea that realistic paths need only match a typical reading. ScanDL can produce heterogeneous outputs, including substantial variation in backward movement length. At the same time, its outputs tend to have fewer backward movements and lower normalized fixation counts. On ZuCo, the normalized fixation count is 1.15 ± 0.45 for true paths and 0.83 ± 0.34 for generated paths. The study thus offers evidence both for reproducing some kinds of variation and for systematically underrepresenting some behaviors.

The authors also average reading measures and NLD over the scanpaths associated with each reader. The resulting correlations ask whether people with a particular reading pattern tend to receive closer predictions. The correlation between a reader’s mean regression rate and mean NLD is .62 on CELER and .75 on ZuCo. The corresponding normalized fixation count correlations are .52 and .07. The regression result is consistent across these samples, while normalized fixation count does not have the same reader-level relationship in the two corpora. Overall, the analysis suggests that ScanDL has an easier time matching readers whose paths contain fewer backward movements.

A separate comparison asks whether ScanDL and the other systems find the same sentences difficult. The authors compute each system’s mean NLD per sentence, then correlate that series of means with ScanDL’s. The significant correlations run from 0.36 for SWIFT to 0.41 for Eyettention, as reported in the paper’s discussion of the analysis. There is some shared difficulty, alongside enough variation for the systems to have different error profiles. An average lead therefore says little by itself about which particular sentences will be predicted poorly.

The final error-pattern comparison works at the level of individual recorded paths in the New Reader/New Sentence setting. All systems have positive correlations between NLD and both normalized fixation count and regression rate. Densely fixated paths and paths with more backward movements are harder to match. For ScanDL, the correlation of NLD with first-pass fixation count is 0.03. Eyettention’s is 0.02. The theory-driven systems have substantially larger positive correlations for this measure, so their errors increase more strongly on paths with repeated fixations during initial visits. The result describes behavior in this experiment and on this metric. It is stronger evidence about differences in predictive error than about why human readers fixate repeatedly.

Watch the path emerge during decoding

The decoding analysis visualizes high-dimensional states using t-SNE, a projection that makes neighborhoods in the representation easier to inspect. The authors compare snapshots during denoising to see when generated fixation vectors start to align with the sentence word representations and separate from vectors that will decode as padding. This examines the progression of a sampled path, whereas the ablation results measure final accuracy across configurations.

In the visualizations, clear alignment and separation emerge during the last 200 steps of the 2000-step process. The figure labels step 1999 as the final iteration. At the end, predicted PAD entries concentrate in a small set of locations in the projection. Thus the late part of the reverse process is where word identity and padding become visibly organized in the examples shown. The plots provide a view of when those distinctions become apparent. They leave open how much earlier steps contribute to making the late separation possible.

Limitations

Limits the authors identify

ScanDL conditions on the sentence and aims to reproduce group-level reading behavior. The authors interpret the low NLD relative to Human as evidence that it abstracts away from personal idiosyncrasies. That property is compatible with simulating a typical trace for a sentence. A use that requires the likely path of a particular person would need information that distinguishes that person from other readers. Generating multiple plausible paths from the same text gives variation at the sentence level without assigning the variation to the people who actually produced it. The authors propose adding reader-specific information as a future extension.

The same issue arises for reading tasks. The experiments concern natural reading. Readers searching for information, reading to answer a question, or reading under a different task instruction could allocate attention differently. The authors discuss adding the task as a condition, and note that task-specific gaze may be more informative for some downstream uses. The cross-corpus result tests transfer between the two selected reading datasets under their study conditions. It leaves the response to different task instructions open.

The available output records word positions and their visit order. It leaves out fixation durations. The authors identify this as a substantive limitation because timing can matter to analyses of processing difficulty and to scanpath similarity measures. They discuss alternatives to NLD, including MultiMatch and ScanMatch, whose validity has been questioned in work cited by the paper. They also point to a measure that can distinguish subtle differences between paths on simple sentences and that incorporates durations. Using the latter measure to its intended advantage would require predictions of timing alongside fixation location.

The authors also report a computational cost at inference. With the reported configuration, training takes about 8 hours. Decoding on one NVIDIA GeForce RTX 3090 GPU takes about 75 minutes for 2200 sentences, or around 2 seconds per sentence as reported in the paper. Run time and memory are relevant because generating a path invokes the denoiser repeatedly. The visualization’s late emergence of discrete structure offers a perspective on that process, while no shortened decoding run is evaluated by the visualization itself.

The paper draws a boundary around explanation. The probabilistic reverse process was built to generate plausible outputs. The linguistic effects estimated from its outputs show resemblance to patterns seen in human behavior. The authors make no claim that the denoising process describes how people control their eyes. Agreement in the fitted regressions is compatible with different generative mechanisms producing similar relationships in the observable data.

Limits visible in the experimental design

The datasets restrict the populations and reading conditions about which the experiments can speak. CELER includes non-native readers, but training and evaluation use its native-English subset. ZuCo NR is also a native-English sample. The transfer result therefore provides evidence for generalization between these corpora, with specific reading populations and stimulus conditions. It leaves performance in other languages and in the unused reader groups unmeasured. Different hardware and sentence characteristics enter together in the across-corpus experiment, preventing an estimate of the effect of any one shift.

NLD favors agreement at the level of discrete, uniformly priced sequence edits. A substitution to a neighboring word has the same cost as a substitution to a distant one. The metric can also favor a path close to common readings of a sentence even when actual paths contain distinctive returns or repetitions. The paper’s supplementary analyses make those effects easier to see. Similar human and synthetic skipping rates, for example, can coexist with fewer predicted regressions. Neither a low mean NLD nor agreement on one aggregate supplies the full distribution of behavior a downstream study might care about.

The psycholinguistic analysis provides evidence about word length, frequency, and surprisal as they enter the authors’ statistical fits. The coefficients are associations conditional on that choice of predictors and response variables. Their signs can agree even where their sizes differ, and the fitted synthetic data can underrepresent some scanpath properties at the same time. Claims about the full range of reading behavior require measurements beyond the relationships studied here.

The paper proposes piloting experimental stimuli and using synthetic paths in human-centered evaluations of generated text. The experiments establish the fidelity of some aspects of the traces. They do not evaluate whether a pilot using those traces detects the same experimental confounds as a pilot with human participants, or whether a downstream application improves when given the generated paths. A similar distinction applies to privacy and representativeness. The ethics discussion notes the sensitivity of gaze as a behavioral biometric and points out that a sentence-conditioned generator avoids collecting a deployment reader’s gaze to produce its output. The reported experiments measure scanpath fidelity, leaving the proposed privacy and equity benefits without a direct empirical test.

What came after

ScanDL starts with a fixed text and predicts a gaze sequence. A later citing work takes up the relationship between gaze and text generation from the direction suggested by its title. Controlling Reading Ease with Gaze-Guided Text Generation names gaze as guidance for producing text with a desired reading property. The citation establishes the connection to ScanDL, while the title gives the aim of the later work. It leaves open whether that work uses ScanDL’s generated paths, uses gaze obtained another way, or draws on the earlier paper as background.

The connection is pertinent to a use that ScanDL’s authors already envisaged. They proposed using synthetic reading traces when evaluating generated text. In the ScanDL experiments, the words are fixed and synthetic gaze is the output whose quality is measured. In gaze-guided generation, reading ease is the stated target for the text being produced. Passing from prediction of gaze to control of a text property raises a separate empirical question about whether the gaze signal captures the differences in reading ease that the generation procedure is intended to influence. The ScanDL paper gives evidence about the first relationship under its reading conditions. The citation alone does not establish how the later work implements or tests the second.

Cite

Cite as Lena S. Bolliger, David R. Reich, Patrick Haller, Deborah N. Jakobi, Paul Prasse and Lena A. Jäger. 2023. ScanDL: A Diffusion Model for Generating Synthetic Scanpaths on Texts. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2023.emnlp-main.960

@inproceedings{bolliger2023scandl,
  title = {{ScanDL: A Diffusion Model for Generating Synthetic Scanpaths on Texts}},
  author = {Lena S. Bolliger, David R. Reich, Patrick Haller, Deborah N. Jakobi, Paul Prasse and Lena A. Jäger},
  booktitle = {Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.960},
  url = {https://doi.org/10.18653/v1/2023.emnlp-main.960}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bolliger-2023-scandl-diffusion-model-generating-synthetic/