EyeLayer: Integrating Human Attention Patterns into LLM-Based Code Summarization
Not on the map. Why?
Abstract (arXiv)
Code summarization is the task of generating natural language descriptions of source code, which is critical for software comprehension and maintenance. While large language models (LLMs) have achieved remarkable progress on this task, an open question remains: can human expertise in code understanding further guide and enhance these models? We propose EyeLayer, a lightweight attention-augmentation module that incorporates human eye-gaze patterns, as a proxy of human expertise, into LLM-based code summarization. EyeLayer models human attention during code reading via a Multimodal Gaussian Mixture, redistributing token embeddings based on learned parameters (μi, σi2) that capture where and how intensively developers focus. This design enables learning generalizable attention priors from eye-tracking data and incorporating them into LLMs seamlessly, without disturbing existing representations. We evaluate EyeLayer across diverse model families (i.e., LLaMA-3.2, Qwen3, and CodeBERT) covering different scales and architectures. EyeLayer consistently outperforms strong fine-tuning baselines across standard metrics, achieving gains of up to 13.17% on BLEU-4. These results demonstrate that human gaze patterns encode complementary attention signals that enhance the semantic focus of LLMs and transfer effectively across diverse models for code summarization.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 28 of its 51 references that are in the map. First posted on arXiv 25 Feb 2026.
Builds on
28 of 51 references.
References · 28
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2020Gradient Surgery for Multi-Task Learningcited by 1,210
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2013Generating Sequences With Recurrent Neural Networkscited by 549
- 2015Attention-Based Models for Speech Recognitioncited by 400
- 2019On the Relationship between Self-Attention and Convolutional Layerscited by 299
- 2022Grounded Copilot: How Programmers Interact with Code-Generating Modelscited by 216
- 2015DRAW: A Recurrent Neural Network For Image Generationcited by 190
- 2022Do Users Write More Insecure Code with AI Assistants?cited by 186
- 2023Large Language Models for Software Engineering: Survey and Open Problemscited by 178
16 more
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2020A Transformer-based Approach for Source Code Summarizationcited by 129
- 2021On the Evaluation of Neural Code Summarizationcited by 47
- 2023What Makes Good In-context Demonstrations for Code Intelligence Tasks with LLMs?cited by 47
- 2020Hard-Coded Gaussian Attention for Neural Machine Translationcited by 42
- 2024Talking Heads: Understanding Inter-layer Communication in Transformer Language Modelscited by 39
- 2023Security Weaknesses of Copilot-Generated Code in GitHub Projects: An Empirical Studycited by 36
- 2024Investigating Layer Importance in Large Language Modelscited by 35
- 2023Distilled GPT for Source Code Summarizationcited by 30
- 2023Evaluating Code Summarization Techniques: A New Metric and an Empirical Characterizationcited by 21
- 2024Do Machines and Humans Focus on Similar Code? Exploring Explainability of Large Language Models in Code Summarizationcited by 16
- 2024Calibration of Large Language Models on Code Summarizationcited by 12
- 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarizationcited by 9
- 2023Towards Modeling Human Attention from Eye Movements for Neural Source Code Summarizationcited by 8
- 2025EyeMulator: Improving Code Language Models by Mimicking Human Visual Attentioncited by 4
- 2025Disentangling Recall and Reasoning in Transformer Models through Layer-wise Attention and Activation Analysiscited by 4
Built on by
Not cited yet.