Research project · concluded 2026-10-22
A compact data format for LLMs. Measured, and not worth using.
LDF writes JSON records as typed tables: one header, one line per record, nothing lost. It does save tokens. But on real database tools most of the waste was whitespace, agents spend their context on their own prompts, and a pre-registered study found the format safe only for a few models and data shapes. This site keeps the results, the misses included.
@records id:s,customer.name:s,items:t,total:f,status:s
ORD-1,Val Thompson,2,715.94,shipped
ORD-2,Sol Ritchie,1,2757.03,cancelled
ORD-3,Kim Abara,2,53.78,shipped
@records.items id:s,sku:s,qty:i,price:f
ORD-1,E5,3,28.78
ORD-1,C3,4,157.4
ORD-2,A1,1,2757.03
ORD-3,B2,2,12.5
ORD-3,E5,1,28.78[{"id":"ORD-1","customer":{"name":"Val Thompson"},
"items":[{"sku":"E5","qty":3,"price":28.78},
{"sku":"C3","qty":4,"price":157.4}],
"total":715.94,"status":"shipped"},
{"id":"ORD-2","customer":{"name":"Sol Ritchie"},
"items":[{"sku":"A1","qty":1,"price":2757.03}],
"total":2757.03,"status":"cancelled"},
{"id":"ORD-3","customer":{"name":"Kim Abara"},
"items":[{"sku":"B2","qty":2,"price":12.5},
{"sku":"E5","qty":1,"price":28.78}],
"total":53.78,"status":"shipped"}]What the format looks like. The saving is real on data like this; the findings below are why it did not add up to much.
- It saves tokens. 20 to 64 percent against compact JSON on irregular data, lossless.
- It rarely matters. Minifying gets most of the saving, and in an agent session tool results are a small share of the prompt.
- It is proven safe narrowly. 6 of 13 study cells pass; one layout cost Opus 10 answers.
Findings
Where the tokens actually went.
o200k_base tokens unless stated. No model was called for these numbers except the Claude Code session; each row links its report.
| measured | result | report |
|---|---|---|
| LDF against compact JSON, irregular data | 20 to 64 percent fewer tokens | 2026-10-17-baseline |
| Minifying a database MCP server's pretty JSON | 31 to 59 percent fewer on most results | 2026-10-21-columnar |
| LDF on top of minified JSON, flat SQL results | 0.1 to 7 percent; one table 4 tokens larger | 2026-10-21-columnar |
| LDF on top of minified JSON, structs and lists | 13 to 28 percent | 2026-10-21-columnar |
| Claude Code session, LDF arm against JSON | total prompt 3 percent larger (about 20 000 tokens, mostly Claude Code's own) | 2026-10-21-columnar |
| SELECT * on 10 000 log rows | 1.4 MB as JSON, 683 KB as LDF; a size cap is what fixes it | 2026-10-21-columnar |
The study
Does the model still answer correctly? Sometimes provably.
Pre-registered before the first response: 200 held-out records, the same questions in both formats, and LDF passes only if the one-sided 95 percent bound on its loss against JSON is at most 3 points. Earlier evaluations with 52 to 95 questions per cell were too small to show that; this one cost $21.
| model | data | questions | LDF / JSON correct | loss bound (pp) | verdict |
|---|---|---|---|---|---|
| Opus 5.5 | flat_users | 151 | 150 / 148 | 1.2 | pass |
| Opus 5.5 | nested_orders (hoisted) | 249 | 238 / 247 | 6.3 | fails |
| Opus 5.5 | sparse_events | 220 | 214 / 214 | 2.6 | pass |
| Opus 5.5 | mixed_types | 151 | 151 / 150 | 1.1 | pass |
| Sonnet 5.5 | flat_users | 151 | 148 / 150 | 3.9 | inconclusive |
| Sonnet 5.5 | nested_orders (0.75) | 249 | 227 / 229 | 3.5 | inconclusive |
| Sonnet 5.5 | sparse_events | 220 | 214 / 216 | 3.6 | inconclusive |
| Sonnet 5.5 | mixed_types | 151 | 151 / 151 | 1.8 | pass |
| Sonnet 5.5 | sql_events (NULL as null) | 220 | 216 / 217 | 2.6 | pass |
| DeepSeek | flat_users | 151 | 83 / 92 | 10.7 | fails |
| DeepSeek | nested_orders (hoisted) | 249 | 159 / 162 | 3.7 | inconclusive |
| DeepSeek | sparse_events (0.75) | 220 | 132 / 136 | 5.5 | inconclusive |
| DeepSeek | mixed_types | 151 | 150 / 150 | 2.3 | pass |
Haiku 5.5 and GPT were not in the study and have no passing evidence. Study report, pre-registration and raw responses.
Instead
What does save tokens.
- Minify tool output. Free and safe, for every model.
- Check which copy your client reads. FastMCP sends each result twice; Claude Code shows the model
structuredContent, not the text. - Cap big results. Keep the rows that fit and tell the model how to narrow the query.
- Count the questions. Under about 90 per cell, a "no loss" result cannot rule out a 3-point loss.
Status
No longer developed. Everything stays readable.
The Rust workspace, the specification, the evaluation harness and every report stay public. The crates on crates.io remain as published and will not be updated.