
"The recently released Token-Oriented Object Notation (TOON) aims to be a schema-aware alternative to JSON that significantly reduces token consumption at a similar level of accuracy. While the existence and quantity of saved tokens depend on the data shape, some benchmarks show that TOON may use 40% fewer tokens in some cases than JSON, potentially resulting in LLM and inference cost savings."
"Running this example in an online playground will show a 55% reduction in tokens vs. pretty-printed JSON, 25% vs. compact JSON, and 38% vs. YAML. As the previous example showcases, TOON combines YAML (for nested objects) and CSV (for uniform arrays) layouts to save tokens. However, for non-uniform data, JSON may be more efficient. For deeply nested objects, YAML may be more token-efficient."
TOON is a schema-aware alternative to JSON designed as a compact, human-readable encoding of the JSON data model for LLM prompts. It reduces token consumption by combining YAML-like nested object layout and CSV-like uniform array layout. Measured examples show up to 55% fewer tokens versus pretty-printed JSON, 25% versus compact JSON, and 38% versus YAML. TOON introduces field headers and explicit array declarations, adding about 5% overhead to improve LLM accuracy. Benchmark results include 99.4% accuracy on GPT-5 Nano while using 46% fewer tokens. Efficiency depends on data shape; flat data favors CSV, deep nesting favors YAML, and non-uniform arrays may favor JSON.
Read at InfoQ
Unable to calculate read time
Collection
[
|
...
]