EyeTrans: Merging Human and Machine Attention for Neural Code Summarization
Not on the map. Why?
Abstract (arXiv)
Neural code summarization leverages deep learning models to automatically generate brief natural language summaries of code snippets. The development of Transformer models has led to extensive use of attention during model design. While existing work has primarily and almost exclusively focused on static properties of source code and related structural representations like the Abstract Syntax Tree (AST), few studies have considered human attention, that is, where programmers focus while examining and comprehending code. In this paper, we develop a method for incorporating human attention into machine attention to enhance neural code summarization. To facilitate this incorporation and vindicate this hypothesis, we introduce EyeTrans, which consists of three steps: (1) we conduct an extensive eye-tracking human study to collect and pre-analyze data for model training, (2) we devise a data-centric approach to integrate human attention with machine attention in the Transformer architecture, and (3) we conduct comprehensive experiments on two code summarization tasks to demonstrate the effectiveness of incorporating human attention into Transformers. Integrating human attention leads to an improvement of up to 29.91% in Functional Summarization and up to 6.39% in General Code Summarization performance, demonstrating the substantial benefits of this combination. We further explore performance in terms of robustness and efficiency by creating challenging summarization scenarios in which EyeTrans exhibits interesting properties. We also visualize the attention map to depict the simplifying effect of machine attention in the Transformer by incorporating human attention. This work has the potential to propel AI research in software engineering by introducing more human-centered approaches and data.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 31 of its 77 references that are in the map. First posted on arXiv 21 Feb 2024.
Builds on
31 of 77 references.
References · 31
- 2017Attention Is All You Needcited by 60,361
- 2015Deep Residual Learning for Image Recognitioncited by 52,096
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2016Layer Normalizationcited by 5,669
- 2021Attention Mechanisms in Computer Vision: A Surveycited by 232
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 179
- 2020A Transformer-based Approach for Source Code Summarizationcited by 133
- 2020Improved Code Summarization via a Graph Neural Networkcited by 79
- 2021On the Evaluation of Neural Code Summarizationcited by 48
- 2019Recommendations for Datasets for Source Code Summarizationcited by 46
19 more
- 2020Improving Natural Language Processing Tasks with Human Gaze-Guided Neural Attentioncited by 45
- 2022jTrans: Jump-Aware Transformer for Binary Code Similaritycited by 44
- 2017Exploring Human-like Attention Supervision in Visual Question Answeringcited by 36
- 2021CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax Treescited by 32
- 2021Code Structure Guided Transformer for Source Code Summarizationcited by 30
- 2020Code Summarization with Structure-induced Transformercited by 29
- 2016Gaze Embeddings for Zero-Shot Image Classificationcited by 25
- 2016Improving sentence compression by learning to predict gazecited by 24
- 2016Seeing with Humans: Gaze-Assisted Neural Image Captioningcited by 20
- 2021Improving Code Summarization with Block-wise Abstract Syntax Tree Splittingcited by 19
- 2017Supervising Neural Attention Models for Video Captioning by Human Gaze Datacited by 18
- 2022Source Code Summarization with Structural Relative Position Guided Transformercited by 14
- 2021AST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarizationcited by 11
- 2022AutoPruner: Transformer-Based Call Graph Pruningcited by 11
- 2023kTrans: Knowledge-Aware Transformer for Binary Code Embeddingcited by 10
- 2023Towards Modeling Human Attention from Eye Movements for Neural Source Code Summarizationcited by 8
- 2023Modeling Programmer Attention as Scanpath Predictioncited by 7
- 2019Developer Reading Behavior While Summarizing Java Methods: Size and Context Matterscited by 3
- 2020Classifying Referential and Non-referential It Using Gazecited by 2
Built on by
Citing papers per year: 2024: 1; 2025: 5; 2026: 3.
9 papers.
- 2024Seeing Eye to AI: Human Alignment via Gaze-Based Response Rewards for Large Language Modelscited by 12
- 2025EyeMulator: Improving Code Language Models by Mimicking Human Visual Attentioncited by 4
- 2025OASST-ETC Dataset: Alignment Signals from Eye-tracking Analysis of LLM Responsescited by 3
- 2025Optimizing Code Runtime Performance through Context-Aware Retrieval-Augmented Generationcited by 1
- 2025CONSTRUCTA: Automating Commercial Construction Schedules in Fabrication Facilities with Large Language Modelscited by 1
- 2025Enhancing Code LLM Training with Programmer Attentioncited by 0
- 2026EyeLayer: Integrating Human Attention Patterns into LLM-Based Code Summarizationcited by 0
- 2026Your Mouse and Eyes Secretly Leak Your Preference: LLM Alignment using Implicit Feedback from Userscited by 0
- 2026CodeTD: Topology of Attention Detects Hallucinations in Code LLMscited by 0
- 2026CodeTD: Topology of Attention Detects Hallucinations in Code LLMs7 Sep 2026
- 2026Your Mouse and Eyes Secretly Leak Your Preference: LLM Alignment using Implicit Feedback from Users18 Jun 2026
- 2026EyeLayer: Integrating Human Attention Patterns into LLM-Based Code Summarization25 Feb 2026
- 2025EyeMulator: Improving Code Language Models by Mimicking Human Visual Attention22 Aug 2025
- 2025Enhancing Code LLM Training with Programmer Attention19 Mar 2025
- 2025OASST-ETC Dataset: Alignment Signals from Eye-tracking Analysis of LLM Responses13 Mar 2025
- 2025CONSTRUCTA: Automating Commercial Construction Schedules in Fabrication Facilities with Large Language Models17 Feb 2025
- 2025Optimizing Code Runtime Performance through Context-Aware Retrieval-Augmented Generation28 Jan 2025
- 2024Seeing Eye to AI: Human Alignment via Gaze-Based Response Rewards for Large Language Models2 Oct 2024