mlsanityData to 14 Oct 2026

EyeTrans: Merging Human and Machine Attention for Neural Code Summarization

arXiv 2402.14096 ↗First posted 21 Feb 2024cs.SE cs.AI cs.HCcited by 9

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2015Deep Residual Learning for Image Recognitioncited by 52,096
  3. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  5. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  6. 2016Layer Normalizationcited by 5,669
  7. 2021Attention Mechanisms in Computer Vision: A Surveycited by 232
  8. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 179
  9. 2020A Transformer-based Approach for Source Code Summarizationcited by 133
  10. 2020Improved Code Summarization via a Graph Neural Networkcited by 79
  11. 2021On the Evaluation of Neural Code Summarizationcited by 48
  12. 2019Recommendations for Datasets for Source Code Summarizationcited by 46
19 more
  1. 2020Improving Natural Language Processing Tasks with Human Gaze-Guided Neural Attentioncited by 45
  2. 2022jTrans: Jump-Aware Transformer for Binary Code Similaritycited by 44
  3. 2017Exploring Human-like Attention Supervision in Visual Question Answeringcited by 36
  4. 2021CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax Treescited by 32
  5. 2021Code Structure Guided Transformer for Source Code Summarizationcited by 30
  6. 2020Code Summarization with Structure-induced Transformercited by 29
  7. 2016Gaze Embeddings for Zero-Shot Image Classificationcited by 25
  8. 2016Improving sentence compression by learning to predict gazecited by 24
  9. 2016Seeing with Humans: Gaze-Assisted Neural Image Captioningcited by 20
  10. 2021Improving Code Summarization with Block-wise Abstract Syntax Tree Splittingcited by 19
  11. 2017Supervising Neural Attention Models for Video Captioning by Human Gaze Datacited by 18
  12. 2022Source Code Summarization with Structural Relative Position Guided Transformercited by 14
  13. 2021AST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarizationcited by 11
  14. 2022AutoPruner: Transformer-Based Call Graph Pruningcited by 11
  15. 2023kTrans: Knowledge-Aware Transformer for Binary Code Embeddingcited by 10
  16. 2023Towards Modeling Human Attention from Eye Movements for Neural Source Code Summarizationcited by 8
  17. 2023Modeling Programmer Attention as Scanpath Predictioncited by 7
  18. 2019Developer Reading Behavior While Summarizing Java Methods: Size and Context Matterscited by 3
  19. 2020Classifying Referential and Non-referential It Using Gazecited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 5; 2026: 3.

9 papers.