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.

orders.ldf143 tokens
@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
the same data as JSON169 tokens compact
[{"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.

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.

measuredresultreport
LDF against compact JSON, irregular data20 to 64 percent fewer tokens2026-10-17-baseline
Minifying a database MCP server's pretty JSON31 to 59 percent fewer on most results2026-10-21-columnar
LDF on top of minified JSON, flat SQL results0.1 to 7 percent; one table 4 tokens larger2026-10-21-columnar
LDF on top of minified JSON, structs and lists13 to 28 percent2026-10-21-columnar
Claude Code session, LDF arm against JSONtotal prompt 3 percent larger (about 20 000 tokens, mostly Claude Code's own)2026-10-21-columnar
SELECT * on 10 000 log rows1.4 MB as JSON, 683 KB as LDF; a size cap is what fixes it2026-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.

modeldataquestionsLDF / JSON correctloss bound (pp)verdict
Opus 5.5flat_users151150 / 1481.2pass
Opus 5.5nested_orders (hoisted)249238 / 2476.3fails
Opus 5.5sparse_events220214 / 2142.6pass
Opus 5.5mixed_types151151 / 1501.1pass
Sonnet 5.5flat_users151148 / 1503.9inconclusive
Sonnet 5.5nested_orders (0.75)249227 / 2293.5inconclusive
Sonnet 5.5sparse_events220214 / 2163.6inconclusive
Sonnet 5.5mixed_types151151 / 1511.8pass
Sonnet 5.5sql_events (NULL as null)220216 / 2172.6pass
DeepSeekflat_users15183 / 9210.7fails
DeepSeeknested_orders (hoisted)249159 / 1623.7inconclusive
DeepSeeksparse_events (0.75)220132 / 1365.5inconclusive
DeepSeekmixed_types151150 / 1502.3pass

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.

  1. Minify tool output. Free and safe, for every model.
  2. Check which copy your client reads. FastMCP sends each result twice; Claude Code shows the model structuredContent, not the text.
  3. Cap big results. Keep the rows that fit and tell the model how to narrow the query.
  4. 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.