AI-powered coding assistants, like GitHub Copilot, are increasingly used to boost developers' productivity. However, their output quality hinges on the contextual richness of the prompts. Meanwhile, gaze behaviour carries rich cognitive information, providing insights into how developers process code. We leverage this in Real-time GazeCopilot, a novel approach that refines prompts using real-time gaze data to improve code comprehension and readability by integrating gaze metrics, like fixation patterns and pupil dilation, into prompts to adapt suggestions to developers' cognitive states. In a controlled lab study with 25 developers, we evaluated Real-time GazeCopilot against two baselines: Standard Copilot, which relies on text prompts provided by developers, and Pre-set GazeCopilot, which uses a hard-coded prompt that assumes developers' gaze metrics indicate they are struggling with all aspects of the code, allowing us to assess the impact of leveraging the developer's personal real-time gaze data. Our results show that prompts dynamically generated using developers' real-time gaze data significantly improve code comprehension accuracy, reduce comprehension time, and improve perceived readability compared to Standard Copilot. Our Real-time GazeCopilot approach selectively refactors only code aspects where gaze data indicate difficulty, outperforming the overgeneralized refactoring done by Pre-set GazeCopilot by avoiding revising code the developer already understands.


翻译:以GitHub Copilot为代表的AI编程助手正日益普及,旨在提升开发者的工作效率。然而,其输出质量在很大程度上取决于提示语境的丰富程度。与此同时,注视行为蕴含着丰富的认知信息,能够揭示开发者处理代码时的思维过程。本研究提出实时GazeCopilot这一创新方法,通过将注视模式、瞳孔扩张等实时注视指标整合到提示中,利用实时注视数据优化提示,使代码建议能够适应开发者的认知状态,从而提升代码理解与可读性。我们在包含25名开发者的受控实验室研究中,将实时GazeCopilot与两种基线方法进行比较:一是依赖开发者提供文本提示的标准Copilot,二是采用预设提示的GazeCopilot(该预设假设开发者的注视指标表明其在代码所有方面均存在理解困难),以此评估利用开发者个人实时注视数据的影响。实验结果表明,与标准Copilot相比,基于开发者实时注视数据动态生成的提示能显著提高代码理解的准确性、缩短理解时间,并改善感知可读性。我们的实时GazeCopilot方法仅选择性重构注视数据显示存在理解困难的代码部分,避免了预设GazeCopilot因过度泛化而重构开发者已理解代码的问题,从而表现出更优的性能。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【CVPR 2021】变换器跟踪TransT: Transformer Tracking
专知会员服务
22+阅读 · 2021年4月20日
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【CVPR 2020 Oral】小样本类增量学习
专知
20+阅读 · 2020年6月26日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
Single-Shot Object Detection with Enriched Semantics
统计学习与视觉计算组
14+阅读 · 2018年8月29日
读论文Discriminative Deep Metric Learning for Face and KV
统计学习与视觉计算组
12+阅读 · 2018年4月6日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
VIP会员
相关资讯
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【CVPR 2020 Oral】小样本类增量学习
专知
20+阅读 · 2020年6月26日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
Single-Shot Object Detection with Enriched Semantics
统计学习与视觉计算组
14+阅读 · 2018年8月29日
读论文Discriminative Deep Metric Learning for Face and KV
统计学习与视觉计算组
12+阅读 · 2018年4月6日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员