paper-with-me

홈 › Papers

EyeTrans: Merging Human and Machine Attention for Neural Code Summarization

2024-02-21 · Yifan Zhang, Jiliang Li, Zachary Karas, Aakash Bansal, Toby Jia-Jun Li, Collin McMillan, Kevin Leach, Yu Huang

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.

📄 PDF Abstract BibTeX arXiv:2402.14096

Code (1)

https://zenodo.org/record/10684985 공식 구현

Tasks

Code Summarization

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Focus 설명 없음
Adam 설명 없음
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Multi-Head Attention 설명 없음

Similar Papers 제목 키워드 기반

VVC+M: Plug and Play Scalable Image Coding for Humans and Machines

2023-05-17 · Alon Harell, Yalda Foroutan, Ivan V. Bajic

Compression for machines is an emerging field, where inputs are encoded while optimizing the performance of downstream automated analysis. In scalable coding for humans and machines, the compressed representation used fo…

Image Compression

OAT: Object-Level Attention Transformer for Gaze Scanpath Prediction

2024-07-18 · Yini Fang, Jingling Yu, Haozheng Zhang, Ralf van der Lans 외

Visual search is important in our daily life. The efficient allocation of visual attention is critical to effectively complete visual search tasks. Prior research has predominantly modelled the spatial allocation of visu…

DecoderObjectPredictionScanpath prediction

Interspatial Attention for Efficient 4D Human Video Generation

2025-05-21 · Ruizhi Shao, Yinghao Xu, Yujun Shen, Ceyuan Yang 외

Generating photorealistic videos of digital humans in a controllable manner is crucial for a plethora of applications. Existing approaches either build on methods that employ template-based 3D representations or emerging…

Video Generation

Enhancing Code LLM Training with Programmer Attention

2025-03-19 · Yifan Zhang, Chen Huang, Zachary Karas, Dung Thuy Nguyen 외

Human attention provides valuable yet underexploited signals for code LLM training, offering a perspective beyond purely machine-driven attention. Despite the complexity and cost of collecting eye-tracking data, there ha…

Code Summarization

An Emerging Coding Paradigm VCM: A Scalable Coding Approach Beyond Feature and Signal

2020-01-09 · Sifeng Xia, Kunchangtai Liang, Wenhan Yang, Ling-Yu Duan 외

In this paper, we study a new problem arising from the emerging MPEG standardization effort Video Coding for Machine (VCM), which aims to bridge the gap between visual feature compression and classical video coding. VCM …

Action RecognitionFeature CompressionSSIM