π€ AI Summary
Large language models (LLMs) face challenges when editing JSONβsuch as inefficient full-document regeneration, missed cascading updates, and array index shifts due to mutable positional references. To address these issues, this paper proposes EASE (Explicitly Addressed Sequence Encoding), a novel encoding strategy that transforms arrays into dictionary structures with stable, content-derived keys, thereby eliminating reliance on positional indices. EASE further leverages RFC 6902 to generate localized JSON Patch operations, avoiding complete document reconstruction. This design significantly improves editing precision and robustness, especially under complex instructions and list manipulations. Experimental results demonstrate that EASE reduces token consumption by 31% compared to full-generation baselines, while limiting degradation in edit quality to within 5%, thus achieving an effective balance between efficiency and accuracy.
π Abstract
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/