AI
AI Model Predicts Where Programmers Look While Reading Code
Researchers develop a neural network that mirrors human eye movements on source code, outperforming existing baselines and large language models at understanding programmer attention.
A new computational approach can forecast which words in source code will capture a programmer's visual attention, advancing our understanding of how software engineers process and comprehend code.
How the model works#
The research team designed a neural network with a specialized loss function that bridges human eye-tracking data with the internal attention mechanisms of artificial neural networks. This alignment allows the model to learn patterns that mirror real programmer behavior when scanning and reading code.
The team evaluated their approach using eye-tracking data collected from three separate studies: two involving Java programmers and one with C programmers. The model achieved substantial improvements—64% better than baseline for Java study 1, 16% for Java study 2, and 467% for the C dataset, measured by Pearson correlation.
Performance against existing systems#
The model also demonstrated its value in practical tasks. When predicting scanpath sequences (the ordered pattern of where a programmer's gaze moves across code), it showed statistically significant gains over the closest competing baseline. On both reading and writing tasks, the approach outperformed Claude and GPT-5, the latter of which represents a substantial jump in large language model capabilities.
Why this matters#
Understanding visual attention in code reading has implications for interface design, developer tooling, and artificial systems that aim to replicate human reasoning about software. By capturing which program elements attract programmer focus, the work offers insights into the cognitive load of different coding patterns and the information requirements of software engineers during their work.

