arXiv:2510.04717cs.CL2025-10EMNLP被引 3

用差分补丁精准修改JSON,比重写节省31%计算量

JSON Whisperer: Efficient JSON Editing with LLMs

  • 生成RFC 6902格式的增量补丁,只改必要部分
  • 引入EASE编码使数组转为带稳定键的字典,解决索引错位问题
  • 复杂指令下性能提升明显,适合需频繁修改JSON的场景

大型语言模型可通过自然语言指令修改JSON文档,但现有方法每次编辑都重新生成完整结构,导致计算效率低下。本文提出JSON Whisperer框架,让LLM生成符合RFC 6902标准的差分补丁,仅表达必要修改内容。我们识别出两个关键挑战:(1)独立生成补丁时易遗漏相关更新;(2)数组操作中索引位移难以追踪,模型表现不佳。为此,我们提出EASE(显式地址序列编码),将数组转换为具有稳定键的字典,消除索引计算复杂性。评估显示,使用EASE的补丁生成可减少31%的令牌消耗,同时在编辑质量上保持在完整重生成的5%以内,尤其在复杂指令和列表操作中优势显著。数据集已公开于:https://github.com/emnlp2025/JSON-Whisperer/

原文摘要 · Abstract (English)

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/

JSON处理LLM应用高效编辑差分补丁

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。