What is TOON (Token-Oriented Object Notation)?
mainTOON is a compact, human-readable encoding of the JSON data model designed specifically for LLM prompts. It aims to reduce token consumption while maintaining or improving retrieval accuracy compared to standard JSON.
Key characteristics include:
- Token Efficiency: Uses significantly fewer tokens than JSON (e.g., ~42.6% reduction in benchmarks).
- JSON Compatibility: Encodes the same objects, arrays, and primitives as JSON with deterministic, lossless round-trips.
- LLM Guardrails: Uses explicit
[N]lengths and{fields}field lists in headers to provide models with a clear schema, improving parsing reliability. - Minimal Syntax: Employs indentation instead of braces and minimizes quoting, combining YAML-like readability with CSV-style compactness.
- Tabular Forms: Optimizes uniform arrays of objects into tables that declare field lists once and stream row values line by line.