请勿复制粘贴:AI辅助编程中的复制软屏障
Do Not Copy/Paste: Soft Barriers for Copying in AI-Assisted Programming
浏览论文内容
中文总结 AI 辅助
本文针对AI辅助编程中代码复制粘贴的问题,提出软屏障机制,通过Unicode扰动实现高复制粘贴抗性,可引导用户转向编辑重构,为AI代码交接研究提供方向。
中文摘要 AI 辅助
将聊天窗口中的函数复制到编辑器耗时不到一秒。对于AI编程工具的许多用途而言,这种速度正是其优势所在;但在编程教育、代码审查以及对安全性要求极高的开发等场景中,这种速度也可能成为问题。本文将复制粘贴界定为一种“AI代码交接问题”:模型生成的文本从对话语境进入可执行或已提交软件的时刻,是当前工具基本未加管理的设计边界。我们认为,AI编程助手的评估不应仅基于其生成的代码,还应基于其对代码向软件工件转移过程的调节方式。我们提出“软屏障”作为一类感知交接的机制。软屏障在保留AI访问权限的同时,使未经过审查的转移变得不那么顺畅。作为初步技术探索,我们通过Unicode输出扰动实现了这一想法,这些扰动保留了视觉可读性,但会破坏未经审查的复制粘贴执行。我们引入“复制粘贴抗性(CPR)”,即功能正确的干净解决方案在扰动后变为语法无效的比例。在HumanEval和MBPP数据集上,使用四个大语言模型(LLM)和四种扰动类型,我们发现输出级屏障可实现高复制粘贴抗性,但其有效性高度依赖于模型和任务。对18名参与者的探索性试点研究提供了早期证据,表明软屏障可使用户从直接转移转向编辑和重构。我们并非将Unicode扰动作为可部署的解决方案,而是将其作为对更广泛研究议程的最小探索,该议程聚焦于实用、透明且符合政策要求的AI代码交接。
英文摘要
Copying a function from a chat window into an editor takes less than a second. For many uses of AI coding tools, that speed is the point; in settings such as programming education, code review, and security-sensitive development, it can also be the problem. This paper frames copy-paste as an \emph{AI code handoff problem}: the moment model-generated text crosses from a conversational context into executable or committed software is a design boundary that current tools leave largely unmanaged. We argue that AI coding assistants should not only be evaluated by the code they generate, but also by how they mediate the transfer of that code into software artifacts. We propose \emph{soft barriers} as one class of handoff-aware mechanisms. Soft barriers preserve access to AI assistance while making unexamined transfer less frictionless. As an initial technical probe, we instantiate this idea using Unicode output perturbations that preserve visual readability but disrupt naive copy-paste execution. We introduce Copy-Paste Resistance (CPR), the fraction of functionally correct clean solutions that become syntactically invalid after perturbation. Across HumanEval and MBPP with four LLMs and four perturbation families, we find that output-level barriers can achieve high copy-paste resistance, but their effectiveness is highly model- and task-dependent. An exploratory pilot with 18 participants provides early evidence that soft barriers can shift users from direct transfer toward editing and reconstruction. We do not present Unicode perturbations as a deployment-ready solution; rather, we use them as a minimal probe for a broader research agenda on practical, transparent, and policy-aware AI code handoff.
发表机构
- University of Luxembourg(卢森堡大学)
机构由 AI 辅助整理,请以论文原文为准。