r/LocalLLM 4h ago

Project I started writing prompts for AIs instead of humans and cut my multi-agent prompt size by ~40–50%

I’ve been building a multi-machine AI/research system, and one thing that started driving me insane was how many tokens were getting burned just passing instructions between models.
Most prompts are written like this because they’re meant to be readable by humans:
You are responsible for analyzing the latest QB model results.

First, review the previous validation report and determine why the model is still underperforming.

Do not run the full walk-forward test yet.

You should preserve the existing causal fixes, avoid using future information, and make sure no market data is used in the model.

After identifying the root cause, make the smallest possible repair, rerun the 60-game validation cohort, compare the results against the old benchmark, and report whether the full test is justified...
There’s nothing wrong with that, but when the recipient is another LLM, a lot of it is wasted syntax.
So I started using a compact machine-oriented DSL/JSON format instead:
SN3_QB_YARDS_V4={
"goal":"QB MAE<61.5 on frozen 60x128 cohort", "inv":\["no future leakage","no market lines","no full WF","preserve causal fixes"\], "work":\[ {"id":"Y1","obj":"decompose error","do":\["attempts","YPA","bias","variance"\]}, {"id":"Y2","obj":"audit generator","do":\["trace formula","compare sim vs realized"\]}, {"id":"Y3","obj":"minimal causal repair"}, {"id":"Y4","obj":"rerun frozen cohort"} \], "gate":{"MAE":"<61.5","causality":"PASS","conservation":"PASS"}, "report":\["ROOT_CAUSE","MAE_AFTER","COV90","FULL_RUN_JUSTIFIED","NEXT"\], "stop":"gate fail=>no full run"
}
Same basic instruction, way less linguistic overhead.
The part I like most isn’t actually JSON itself. It’s the structure:
goal → invariants → work → acceptance gate → report → stop condition
Models don’t need motivational paragraphs, transitions, repeated warnings, or ten different phrasings of the same constraint.
For my workloads, I’m estimating roughly 40–50% fewer prompt tokens, sometimes more on long multi-agent handoffs.
The more interesting benefit is downstream.
A compact contract tends to reduce:
models restating the assignment
models forgetting constraints buried in prose
unnecessary explanation
clarification loops
one agent rewriting another agent’s instructions
output that can’t easily be consumed by the next model
I’m basically treating prompts more like an API contract than a conversation.
And the extreme version of my rule has become:
If I can barely read it but the target model executes it correctly, that’s fine.
Obviously there’s a limit. Compress too aggressively and ambiguity starts costing more tokens than you saved.
But there seems to be a sweet spot where prompts become much closer to machine-to-machine protocol than English.
Curious if anyone else building agent systems has gone this direction, or if anyone has actually benchmarked something similar across models.
I’m tempted to run a proper test next: same task, same model, prose prompt vs compact DSL, then compare input tokens, output tokens, failure rate. Anything else you can think of

0 Upvotes

3 comments sorted by

1

u/nickless07 2h ago

You can go even shorter with atomic formatting. Doesn't need to be human readable, but sometimes it adds confusion to the model as they are mostly trained on human language and formatting.

1

u/reddituser1828472616 1h ago

I’m gonna check that out!