EyeLayer: Integrating Human Attention Patterns into LLM-Based Code Summarization

Jiahao Zhang, Yifan Zhang, Kevin Leach, Yu Huang
2/25/2026
cs.SEcs.AI

No confident code implementation found for this paper.

Abstract

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, σ_i^2) 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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2026eyelayer,
  title  = {EyeLayer: Integrating Human Attention Patterns into LLM-Based Code Summarization},
  author = {Jiahao Zhang and Yifan Zhang and Kevin Leach and Yu Huang},
  year   = {2026},
  eprint = {2602.22368},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.22368v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.22368.svg)](https://codeofpaper.com/paper/2602.22368)

Discussion