ONTO:一种高效的列式记法用于LLM输入优化
ONTO: A Token-Efficient Columnar Notation for LLM Input Optimization
AI总结:
ONTO通过列式记法减少LLM输入的token数量,相比JSON在100到1000条记录间实现46-51%的token减少,并提升推理效率。
摘要:
为文档交换设计的序列化格式在大规模数据处理时会产生结构性开销。一个1000个物联网传感器读数的JSON序列化数据需要约80,000个token,大部分用于重复字段名、嵌套大括号和结构标点而非语义内容。我们提出ONTO(用于token优化的对象记法),一种列式记法,每个实体声明字段名一次,并以竖线分隔的行排列值,使用缩进表示层次结构。这种schema-一次,data-多次的设计消除了每条记录键的重复,同时保持人类可读性和嵌套结构支持。在三个合成操作数据集上的评估显示,与JSON相比,token减少46-51%,从100到1000条记录的规模保持稳定。在Qwen2.5-7B上的受控推理基准测试显示相应的5-10%延迟改进。理解验证确认在查找、计数、提取和聚合操作中,当提供格式上下文时,LLM任务准确性没有明显下降。消融分析表明,键重复是JSON开销的主要部分,嵌套结构中的缩进成本解释了扁平与层次数据之间的4个百分点差距。ONTO在序列化领域占据了一个未被填补的位置:具有层次结构的列式效率,优化用于LLM上下文窗口而非文档交换。代码和规范可在https://github.com/harsh-aranga/onto获取。
英文摘要:
Serialization formats designed for document interchange impose structural overhead that becomes prohibitive when large language models consume operational data at scale. A modest dataset of 1,000 IoT sensor readings serialized as JSON requires approximately 80,000 tokens - the majority spent on repeated field names, nested braces, and structural punctuation rather than semantic content. We present ONTO (Object Notation for Token Optimization), a columnar notation that declares field names once per entity and arranges values in pipe-delimited rows with indentation-based hierarchy. This schema-once, data-many design eliminates per-record key repetition while preserving human readability and nested structure support. Evaluation across three synthetic operational datasets demonstrates 46-51% token reduction versus JSON, with stable scaling from 100 to 1,000 records. Controlled inference benchmarks on Qwen2.5-7B show corresponding 5-10% latency improvement. Comprehension validation confirms no material degradation in LLM task accuracy across lookup, counting, extraction, and aggregation operations when format context is provided. Ablation analysis reveals that key repetition accounts for the majority of JSON overhead, with indentation costs in nested structures explaining the 4-percentage-point gap between flat and hierarchical data. ONTO occupies a previously unfilled position in the serialization landscape: columnar efficiency with hierarchical structure, optimized for LLM context windows rather than document interchange. Code and specification are available at https://github.com/harsh-aranga/onto.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。