TL;DR
- Transformer decode repeats the same family of computations while carrying state from one token step to the next.
- That state-in, local-work, state-out shape can be written naturally as a STARK execution trace.
- Natural does not mean cheap: attention, nonlinear functions, floating-point semantics, and large model weights still create substantial proving work.
- SparseProve applies this framing to one conditional Mixture-of-Experts block and asks whether a proof can follow only the experts the router selected.
A language model generates text one token at a time.
At each step, it starts from what has already been computed, runs another block of model work, produces a new token, and prepares the state needed for the next step.
A STARK proves computation in a similar shape. It records a run as a table of states and uses algebraic checks to establish that the committed execution follows the transition rules.
That is the useful connection between them.
It is not a claim that STARKs automatically beat every other proof system for machine learning. It is a claim about representation:
Transformer decode exposes a repeated state transition, and repeated state transitions are natural objects for a trace-based proof system.
The difficult question comes after that observation. What should each state contain? How do we represent floating-point model operations over a finite field? Which parts need arithmetic constraints, lookups, or separate commitments? What, exactly, does the final proof promise?
This essay builds the structural bridge first. The rest of the research begins where that bridge ends.
The precise claim
The bridge
A transformer is usually introduced from the user’s point of view.
You give it some text. It produces probabilities for what should come next. One token is selected, appended to the text, and the process repeats.
A STARK is usually introduced from the verifier’s point of view.
You describe a computation as a sequence of states. You define rules for how one state may turn into the next. The prover commits to a record of the run, and the verifier checks that the record satisfies those rules.
That execution record is called a trace.
The bridge is easiest to see when the two views are placed side by side:
- decode extends a prefix one token step at a time;
- a trace records a computation one valid transition at a time.
Take one step in the example. The visible text before the step is The cat sat. The transformer runs and produces on. The visible text is now The cat sat on.
The trace describes the same event differently. The computation starts from state 2, applies the allowed decode transition, and produces state 3.
The token on is what the reader sees. The transition from one valid state to the next is what the proof system checks.
This does not mean that one token becomes one trace row. A real transformer step can require many rows, several tables, and multiple committed columns. The important correspondence is between one decode transition and one checked segment of execution.
Decode is a state transition
In this essay, a state means:
the information that must cross the boundary between two steps so the next step is well-defined.
That state can include:
- the current token position;
- an internal representation of the prefix;
- keys and values cached from earlier tokens;
- and commitments to data that the next step is allowed to use.
The exact contents depend on the proof boundary. The general shape does not:
- receive a valid state;
- perform the next piece of model computation;
- expose the claimed output;
- produce the state for the next step.
People often use the KV cache as the state of transformer decode. It stores keys and values derived from previous tokens so the model does not recompute the entire prefix at every step.
KV cache is a useful boundary, not a mathematical requirement. A prover could choose a heavier boundary and recompute the prefix. What matters is that the statement says which information was inherited and that the next step is constrained to begin from it.
This is why decode is better pictured as a moving frontier than as a collection of unrelated guesses. Each step inherits a boundary, extends it, and hands a new boundary forward.
Two properties now matter:
- continuity: the state leaving one step is the state entering the next;
- repetition: each step applies the same family of model operations to different values.
Those are the two properties a trace is designed to make explicit.
What happens inside one step
A transformer step is not one simple arithmetic operation. It contains attention, normalization, feed-forward layers, residual connections, and numeric conversions.
Attention is a useful example because it shows both the structural fit and the proving difficulty.
The current token state is projected into query, key, and value views. The query is compared with keys carried from earlier positions. Those scores are normalized and used to mix the corresponding values.
From the execution perspective, the step has a clear shape:
- start from the current state and carried context;
- derive structured intermediate values;
- compare the current query with earlier keys;
- normalize the scores;
- mix the carried values;
- write the resulting state forward.
The repeated structure is friendly to a trace. The individual operations are not automatically cheap to prove.
Matrix multiplication maps cleanly to finite-field arithmetic once a numeric representation has been chosen. Softmax, LayerNorm, GELU, SiLU, range checks, and quantization require more care. They may need fixed-point arithmetic, polynomial approximations, authenticated tables, or specialized arguments.
The proof boundary therefore matters as much as the model boundary.
Related arithmetic and table checks can be placed inside one receipt, or split into several proof objects that must later be connected. Both can be valid. They have different commitment, opening, verifier, and soundness costs.
This is where “the model looks like a trace” stops being an answer and starts becoming a design problem.
Writing decode as a trace
A trace is a table whose columns record the values needed to check the execution and whose rows organize those checks over a domain.
For transformer decode, one checked segment needs to establish three things:
- Input boundary: the step began from the state named by the statement.
- Local validity: the model operations followed their constrained arithmetic, lookup, range, and data-access rules.
- Output boundary: the resulting token, logits, or carried state match the claimed output.
The handoff between steps is just as important as the computation inside a step.
If row group t claims to end at one state while row group t + 1 begins from another, the proof describes valid-looking fragments rather than one continuous run.
The public statement supplies the outer boundaries. It identifies the model and policy, fixes the starting state or input, and names the output being certified. The trace supplies the checked path between them.
This distinction prevents a common mistake. A proof can be cryptographically valid while the application attaches the wrong meaning to it. The model identity, input, numeric policy, output, and verifier domain must be bound to the statement the verifier actually accepts. Labels added after verification do not create that binding.
What fits naturally
STARKs are particularly comfortable with computations that have:
- repeated transition rules;
- large, regular execution tables;
- local algebraic constraints;
- explicit beginning and ending conditions;
- and many similar checks that can be committed and opened together.
Transformer decode has all five at the structural level.
The same model blocks repeat across token positions. Context crosses explicit boundaries. Most operations can be reduced to finite-field arithmetic and table relations. The final claim can name the model, input state, output, and carried state.
Local constraints check that each piece of execution follows the intended rule.
Boundary constraints connect that execution to the claim a user cares about.
Together, local validity, continuity, and public boundaries turn a collection of rows into one claimed model computation.
This is the sense in which transformer decode fits a STARK trace. The fit concerns the shape of the relation, not a universal performance advantage.
What does not fit automatically
Several important costs remain:
- model inference normally uses floating-point or low-precision integer semantics, not raw field arithmetic;
- nonlinear functions need constrained approximations or authenticated tables;
- attention reads a growing context and can create large memory surfaces;
- model weights are too large to recommit and reopen carelessly for every request;
- the verifier must know exactly what each commitment, table, policy, and output represents;
- and concrete security depends on the complete commitment, FRI, Fiat-Shamir, and grinding analysis, not only on the AIR equations.
Other proof systems may handle some of these workloads better. Sumcheck, GKR, lookup-centric systems, recursive proofs, and specialized polynomial commitments provide different tradeoffs.
So the responsible conclusion is not “Transformers belong in STARKs.” It is:
Transformer decode gives STARK designers a natural trace surface. The quality of the resulting prover depends on what they choose to put on that surface.
From this picture to SparseProve
The next research question is more specific.
Modern Mixture-of-Experts models store many feed-forward networks but activate only a few for each token. A router chooses which experts run.
That creates conditional computation. It also creates a verification problem: a prover should not be allowed to choose whichever expert path is cheapest and then prove only that convenient path.
An illustrated SparseProve introduction follows one token through this problem. It explains what an expert is, how the router chooses a canonical top-k route, why the selected weights must come from the registered model, and how one receipt connects the route to the selected nonlinear computation and output.
SparseProve currently studies one production-shaped MoE feed-forward block, not a complete Transformer. It is publicly verifiable rather than zero knowledge. Its prover and verifier run end to end, but the complete cryptographic security composition remains conditional and no end-to-end security-bit claim is made.
That narrower scope lets the project test one concrete version of the idea introduced here:
Can proof work follow the conditional computation that actually runs while the condition itself remains inside the verified statement?
The trace picture makes that question possible. SparseProve is one attempt to answer it. The paper, implementation, and illustrated introduction will be shared soon.
Continue from the trace to the research
The forthcoming SparseProve primer connects this trace picture to the research. The rest of the proof-boundary series covers the deeper statement and receipt questions.
- 01
An AI Chooses Which Experts to Run. How Do You Prove It Chose Correctly?
Coming soon: a beginner’s illustrated introduction to Mixture-of-Experts and proof-carrying sparsity.
- 02
Proof Pressure Is Not Just Matrix Multiply
Where lookup-heavy work changes the proof shape.
- 03
Proof Validity Is Not Statement Validity
Why a valid proof still needs a statement that binds the intended claim.
- 04
What a Proof Is Allowed to Mean
The typed receipt around a proof artifact.