Abstract
Instruction-based text editing is increasingly critical for real-world applications such as code editors (e.g., Cursor), but Large Language Models (LLMs) continue to struggle with this task. Unlike free-form generation, editing requires faithfully implementing user instructions while preserving unchanged content, as even minor unintended modifications can break functionality. Existing approaches treat editing as generic text generation, leading to two key failures: they struggle to faithfully align edits with diverse user intents, and they often over-edit unchanged regions. We propose HyperEdit to address both issues. First, we introduce hypernetwork-based dynamic adaptation that generates request-specific parameters, enabling the model to tailor its editing strategy to each instruction. Second, we develop difference-aware regularization that focuses supervision on modified spans, preventing over-editing while ensuring precise, minimal changes. HyperEdit achieves a 9%--30% relative improvement in BLEU on modified regions over state-of-the-art baselines, despite utilizing only 3B parameters.
Abstract (translated)
基于指令的文本编辑在诸如代码编辑器(例如Cursor)等实际应用中变得越来越重要,但大型语言模型(LLMs)在此任务上仍然面临挑战。与自由形式生成不同,编辑要求忠实执行用户的指示并保留未更改的内容,因为即使是细微的意外修改也可能破坏功能完整性。现有的方法将编辑视为通用文本生成处理方式,导致两个关键问题:它们难以准确地根据不同的用户意图实施编辑,并且经常在未改变的部分过度编辑。我们提出了HyperEdit来解决这些问题。 首先,我们引入了基于超网络的动态适应机制,该机制可以为每个指令生成特定请求的参数,从而使模型能够为其编辑策略定制化以满足具体需求。 其次,我们开发了一种差异感知正则化方法,这种方法专注于监督修改区域,防止过度编辑的同时确保精确且最小化的更改。 HyperEdit在已修改部分实现了显著改进,在BLEU评分上比最先进的基准高出9%到30%,而仅使用了约30亿参数。
URL
https://arxiv.org/abs/2512.12544