用真人看代码的注意力数据提升代码模型性能
EyeMulator: Improving Code Language Models by Mimicking Human Visual Attention
- 从真实用户眼动数据提取语义重要性和注视转移规律,用于重加权训练损失
- 在36个实验配置中均提升效果,结构保持和翻译任务提升最明显
- 无需修改模型架构,适合想改进代码生成与理解的开发者使用
代码语言模型(CodeLLMs)通过数据相关性学习标记重要性,而人类开发者会关注语义显著的代码片段。我们提出EyeMulator,一种无需改变模型架构的方法,将人类视觉注意力先验注入代码模型微调过程。该方法将眼动追踪数据提炼为语义显著性与注视转移先验,并用于调整逐标记训练损失权重。在六种骨干模型、两种数据设置及三个CodeXGLUE任务上,报告配置在全部36个模型-任务-设置组合中均取得正向匹配指标提升。结构保持型补全与翻译任务提升最显著,摘要任务亦获得小幅但正向的METEOR得分改善。会话模式与组件消融分析表明,阅读、写作、语义与转移衍生的先验提供互补信息。人类注意力数据可在https://zenodo.org/records/17205682 获取。
原文摘要 · Abstract (English)
Code Language Models (CodeLLMs) learn token importance from data correlations, whereas human developers attend selectively to semantically salient code. We present EyeMulator, a model-agnostic method that injects human visual-attention priors into CodeLLM fine-tuning without architectural changes. EyeMulator distills eye-tracking data into semantic salience and gaze-transition priors, then uses them to reweight token-level training losses. Across six backbones, two data regimes, and three CodeXGLUE tasks, the reported configurations yield positive matched-metric deltas in all 36 model-task-setting cells. Effects are largest for structure-preserving completion and translation, while summarization shows smaller but positive METEOR deltas. Session-mode and component-ablation analyses further show that reading, writing, semantic, and transition-derived priors provide complementary signal. Human-attention artifacts are available at https://zenodo.org/records/17205682.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。