TENS LAB
TENS LAB
Works
NOTE 03BENCHMARK NOTE

THE TOKEN COST OF SYNTAX

Measuring attention compute and token expenditure lost to JSON formatting in production.

THE OBSERVATION

Production LLM pipelines routinely treat JSON as the default lingua franca for model communication, inheriting web-browser serialization habits without auditing the token cost.

THE HYPOTHESIS

How much context window capacity and inference spend is consumed purely by structural syntax overhead across standard database and tool-calling workloads?

ANALYSIS & BENCHMARKING

Analyzed production payloads across relational tables, nested entity graphs, and API responses using standard BPE tokenizers.

EMPIRICAL RESULTS

Structural syntax consistently accounts for 60% to 80% of total payload tokens. Models retain 100% reasoning accuracy when syntax is compiled into clean, token-aligned slot tables.

IMPLICATIONS

Informed the core design principles behind the Contex compiler.