arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.04717cs.CL
收藏

JSON Whisperer:利用大语言模型实现高效JSON编辑

JSON Whisperer: Efficient JSON Editing with LLMs

Lightricks;The Hebrew University of Jerusalem(耶路撒冷希伯来大学)

Sarel Duanis, Asnat Greenstein-Messica, Eliya Habba

AI总结:

针对大语言模型编辑JSON时全量重生成效率低的问题,提出JSON Whisperer框架,通过生成RFC 6902差异补丁及EASE显式寻址序列编码解决补丁编辑的关联更新遗漏和数组索引偏移问题,在保证编辑质量的同时大幅降低token消耗。

摘要:

大语言模型(LLM)可通过自然语言指令修改JSON文档,但现有方法每次编辑都会重新生成完整结构,导致计算效率低下。我们提出JSON Whisperer框架,该框架支持LLM生成RFC 6902差异补丁(仅表达必要修改内容),而非完整文档。我们发现基于补丁的编辑存在两大关键挑战:(1)LLM生成孤立补丁时常常遗漏关联更新;(2)数组操作需要追踪跨操作的索引偏移,而LLM对此处理能力较差。为解决这些问题,我们提出EASE(显式寻址序列编码)方法,将数组转换为带有稳定键的字典,消除了索引运算的复杂度。我们的评估显示,结合EASE的补丁生成方法可减少31%的token使用量,同时编辑质量与完整重生成方法的差距保持在5%以内,在复杂指令和列表操作场景下提升尤为显著。数据集可在以下地址获取:https://github.com/emnlp2025/JSON-Whisperer/

英文摘要:

Large language models (LLMs) can modify JSON documents through natural language commands, but current approaches regenerate entire structures for each edit, resulting in computational inefficiency. We present JSON Whisperer, a framework that enables LLMs to generate RFC 6902 diff patches-expressing only the necessary modifications-rather than complete documents. We identify two key challenges in patch-based editing: (1) LLMs often miss related updates when generating isolated patches, and (2) array manipulations require tracking index shifts across operations, which LLMs handle poorly. To address these issues, we introduce EASE (Explicitly Addressed Sequence Encoding), which transforms arrays into dictionaries with stable keys, eliminating index arithmetic complexities. Our evaluation shows that patch generation with EASE reduces token usage by 31% while maintaining edit quality within 5% of full regeneration with particular gains for complex instructions and list manipulations. The dataset is available at: https://github.com/emnlp2025/JSON-Whisperer/

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑