New AI Language docs · static / Cloudflare Pages

Token savings by format (not by smarter prose)

Your goal: fewer tokens using better representations — same idea as your maths research:

images / tables / covers pack what matters denser than English essays.

No retrain. Prompting + external store + tool I/O format only.


1. Core law (from your research, translated to formats)

Research findingFormat translation
Don’t recover all scores — approximate output \(A(q)\)Don’t store full chat — store what the next step needs
Low \(r_\Sigma\) → few anchors cover the manifoldFew prototype lines / codes cover long history
\(A_0\) = winner value only (often nearly enough)Keep one best fact per topic, not the debate
Hybrid: exact recent + compressed pastLast \(N\) turns exact-ish; older → dense IR
Content-id / fetch body on demandPaste ids/titles, expand only when needed
Paid novelty (only grow on real splits)Only add memory when state actually changed

**English prose is the dense-model’s slow path.**

Tokenizers charge you for grammar glue (“the”, “we decided to”, “because”).

Better formats remove glue and keep anchors.


2. Efficiency ladder (worst → best for agent memory)

Rough density for the same facts (illustrative; measure with your tokenizer):

RankFormatRelative tokensWhen to use
0Narrative chat history100% (baseline)Almost never for multi-turn agents
1Bullet English summary~40–60%Human handoff only
2Min JSON / YAML short keys~25–40%APIs, tools, structured answers
3Tables / TSV / CSV~15–30%Multi-entity, tool dumps, logs
4STATE-IR + LEGEND codes~10–25%Default agent memory
5Δ patches only~5–15% after turn 1Ongoing sessions
6IDs + one-line titles (body external)~2–10%Codebases, docs, big tool results
7Image / screenshot / diagram (vision)win or loseUI, plots, layout, PDFs — not pure abstract facts

About “images more efficient than text”

Sometimes yes, sometimes no.

CasePrefer imagePrefer text/IR
UI bug, dashboard, architecture diagramScreenshot + 1-line askDescribing every pixel in English
Chart with many pointsPlot imageListing 200 numbers as prose
Exact code / legal wording / IDsText/IR always (images OCR-waste + error)
Abstract decisions, constraintsSTATE-IR (cheapest + checkable)
Photo of whiteboardImage + extract IRLong transcription in-prompt every turn

Rule: image = dense spatial packet; IR = dense symbolic packet.

Your maths is about symbolic covers (anchors). Images are the multimodal cousin for spatial covers.


3. The format pack to use (drop-in)

A) Default: STATE-IR (symbolic, like \(r^*\) anchors)


# PREFIX once (prompt-cache):

IR v1 | keys: G F D O N X R Δ | codes in LEGEND | no narrative memory



LEGEND: T1=AuthService T2=StripeWebhook T3=users_table



# BODY each turn (only this + user):

G: ship billing v1

F: [T1→T2 signed, T3=postgres+tx]

D: [idempotency=key-hdr]

O: [PCI review]

N: [CHK X, CALL verify_sig, COMMIT]

X: [no_raw_pan]

R: [{id:c91,t:pci.md}]

Δ: [F+ rate=100rpm]

Why tokens drop: no essays, short keys, codes reuse long names, bodies live behind R.

B) Tool I/O: never prose dumps

Bad (token bomb):


The query returned 40 rows. The first row has id 1 and name Alice and email...

Good (table IR):


id|name|email|st

1|Alice|a@x|ok

2|Bob|b@x|fail

... max 30 rows; use SQL LIMIT

Or even denser:


rows:30 cols:id,name,st sample:[[1,Alice,ok],[2,Bob,fail]] ...

C) History: Δ not replay

After turn 1, don’t resend full STATE — send:


BASE@rev3

Δ: O-[PCI done] N:[write mig] F+[mig=up]

Same idea as edit script / path compression and your hybrid exact-recent + compressed past.

D) Retrieval: \(A_0\) style (winner only)

When RAG/tools return many chunks:


# not: paste 5 chunks

# yes:

WIN: {id:c91, claim:"PCI needs tokenization", conf:0.8}

ALT: [{id:c77, claim:"..."}]   # only if conf close

One winner claim ≈ \(A_0\); extras only if competitive (paid novelty).

E) Multimodal: image when spatial


USER: [image: dashboard.png]

Q: which panel is red? answer as IR: {panel, status, fix?}

Then store the answer as IR, not the image every turn.


4. Concrete “format codec” inspired by your maths

Name: CoverFormat (user-space cousin of output-manifold covering)

Math objectCoverFormat rule
Anchors \(r^*\)Max K fact lines in F (e.g. K=12); merge/reencode when over
\(r_\Sigma\) gateIf task “repetitive / local” → aggressive codes; if “novel hard” → more exact text allowed in N only
\(A_0\)One WIN per question
Hybrid windowLast 2 user/assistant turns raw-ish; older only IR
Paid noveltyAppend to F/D only if new line isn’t paraphrase of existing
Content-idDocs/code as R:[{id}] never full file

Pseudo-orchestrator (weekend):


on each turn:

  1. encode user msg → IR fields (or keep short raw if simple Q)

  2. build prompt = PREFIX + SUMMARY_IR + last2 + user

  3. model must answer in IR (or final user prose once)

  4. merge Δ into SUMMARY_IR

  5. if len(SUMMARY_IR) > budget: reencode (keep G,X, last D, collapse F)

  6. tools must return tables ≤ M rows


5. Expected savings (honest)

WorkloadRealistic tokens_in cut vs full chat prose
Multi-turn coding agent (8+ turns)40–70% with IR+Δ+no file paste
Tool/SQL heavy50–80% with table caps
RAG with chunk paste30–60% with WIN/A0 extract then drop chunks
Pure one-shot chat0–20% (format tax can hurt if you over-schema)
Vision for UI vs describing UIOften big win; vision for pure logic often lose

Falsify like always: 20 tasks, kill if not ≥20–25% tokens_in down or quality drops >10%.


6. What not to do

  • Invent a “magical binary language” the model doesn’t know — models already know JSON, tables, code, short labels.
  • Put giant base64 images every turn (usually worse than IR).
  • Compress by deleting constraints in X (fidelity death).
  • Use soft prompts / finetune (out of scope).
  • Assume image tokens are always cheaper (count your provider’s vision token formula).

7. One-page cheat sheet


ALWAYS

  - Short-key STATE (G F D O N X)

  - LEGEND for repeated names

  - Tools → tables

  - Docs → id + title; fetch body on demand

  - History → Δ after baseline



SOMETIMES

  - Screenshot for UI/layout

  - Plot image for dense numeric trends

  - Winner-only RAG claim (A0)



NEVER

  - Full chat novel as memory

  - Paste whole DB / log / repo

  - Re-send unchanged LEGEND/schema every time without prompt cache


8. Link to your piles of work

SourceUse for formats
Maths 17 / filter (low \(r_\Sigma\), hybrid, A0)Anchors, winner-only, hybrid window
dense_ir_primitives.md / PB12STATE-IR alphabet
Tesla codec opsintern, patch, fetch_on_miss, gate, decay_uncited
Chirotope “paid novelty”Only grow F when something splits decisions

Bottom line:

Token savings you want = stop using text essays as the working medium.

Use tables + short-key IR + codes + deltas + ids, and images only for spatial stuff.

That is the same spirit as “approximate the output manifold, not the full transcript” — without training any weights.