Exact State Layer · Early access · Patent pending

Exact state for the model you already serve.

ESL is a layer you attach to your own language model. It reads what each event changes, keeps the running state in exact integer arithmetic outside the model, and flags a read it is unsure of.

Your model is not retrained and its weights do not change. On documents of 1,000 events, models that could not answer on their own answered correctly through ESL, and two models that could answer on their own took 11 to 13 times less time. Each deployment comes with a certificate measured on your own checkpoint and hardware.

Talk to us

Who it is for

Teams that serve their own models.

ESL is for teams whose customers ask how an answer can be guaranteed. It gives you something to show them: the state is computed in integers outside the model, every read carries a status, and a certificate measured on your own model states how often a full input was read with no error. Where a simple parser can pick out every change, a parser is enough. ESL is for records in which the change is written in ordinary language. We have measured the cases on this page. On your own records, the fit and the certificate on your data are the test.

The problem

Keeping state over a long run of events.

An event is one change in a record: a move, an edit, a status update. The state is what is true after all of them: which item is where after a long series of moves, the value of a field after a long run of edits. The same shape appears wherever a record is changed many times: the status of a ticket after a long thread, a field after many amendments, the place of an item after many transfers.

A language model usually reads a single event correctly. The difficulty is the state, because it depends on every event before it, in order. Published analyses (Merrill, Petty and Sabharwal, 2024, and the work they cite) show that, under a standard conjecture, a fixed-depth transformer cannot track some kinds of state over arbitrarily long inputs. Reasoning step by step can get there, at a cost that grows with every event.

An example

Five people, five rooms, 1,000 swaps.

The test document names five people and the room each one is in. Then come 1,000 numbered lines, each saying that two of them swapped rooms. The last line asks where everyone is. The documents are written in Korean.

Each line is easy to read. The answer depends on all 1,000, in order. Ten models were asked to reason their way to the answer, and three of them got all five documents right.

Seven of the ten were also run through ESL, two of them from the three that had succeeded alone. The model was given 50 lines at a time and returned the pair swapped in each line, with no chain of thought requested. The register applied the swaps in order. All seven got all five documents right.

Every line here has the same form. The case ESL is built for is text in which the change has to be read, such as the issue-tracker comments below.

  1. room 1Cheolsu
  2. room 2Younghee
  3. room 3Minsu
  4. room 4Jia
  5. room 5Hyunwoo
  1. room 1Jia
  2. room 2Younghee
  3. room 3Hyunwoo
  4. room 4Cheolsu
  5. room 5Minsu
Follow the blue line. Each swap is easy to read; where Cheolsu ends up depends on all 1,000, in order.
Input: one of the test documents (translated from Korean)
  Cheolsu is in room 1, Younghee in 2, Minsu in 3, Jia in 4, Hyunwoo in 5.
  1. Cheolsu and Jia swapped rooms.
  2. Cheolsu and Hyunwoo swapped rooms.
  3. Jia and Younghee swapped rooms.
  ... 1,000 lines in all

What the model returns for those lines
  {"pairs": [["Cheolsu","Jia"], ["Cheolsu","Hyunwoo"], ["Jia","Younghee"], ...]}

What the register computes
  after line 1       Cheolsu 4  Younghee 2  Minsu 3  Jia 1  Hyunwoo 5
  after line 2       Cheolsu 5  Younghee 2  Minsu 3  Jia 1  Hyunwoo 4
  after line 3       Cheolsu 5  Younghee 1  Minsu 3  Jia 2  Hyunwoo 4
  after line 1,000   Cheolsu 4  Younghee 2  Minsu 5  Jia 1  Hyunwoo 3

How it works

Your model reads. ESL keeps the state.

Your record

  1. event 1
  2. event 2
  3. event 3
  4. ⋮
  5. event n

Your model weights unchanged

1 Reada small reader on one intermediate layer

Exact State Layer outside the model

2 Commitevery change gets a status

  • exact
  • flagged
  • candidates

3 Composean integer register applies them in order

  1. 1

    Read

    A small reader on one intermediate layer reads each event's change and a confidence value, for every event in one pass. Through an API, the model lists each event's change instead.

  2. 2

    Commit

    Each change enters the state as exact, flagged, or a set of candidates, according to its confidence. An uncertain read is kept as uncertain.

  3. 3

    Compose

    An integer register outside the model applies the changes in order. The state carries its status with it, and the status tells whatever uses the state whether it may act on it.

Exact refers to the arithmetic. Given the changes that were read, the register computes the state in integers, with no rounding. Reading is the step that can go wrong, which is why every read has a confidence value and the state has a status.

What we measured

Each number with its scope.

A third-party benchmark, 16k to 32k tokens

Items answered correctly, out of 30. Two models, four settings.

The model alone 0 to 2
A program the model wrote 24 to 27
The model through ESL 29 to 30

500 issue-tracker comments in ordinary prose

Share of comments in which the changed value was named.

Frequency table 61.0%
ESL reader, one answer 68.8%
True value in the reader’s short list 94.8%

Five people, five rooms, 1,000 swaps

Models that got all five documents right. A regular expression also solves this fixed-format task.

Reasoning alone 3 of 10 models
Through ESL 7 of 7 models
30 / 30

on StateBench, a third-party benchmark for state tracking, through an API: two models on three of four test settings of 16k to 32k tokens, and 29 of 30 on the fourth. On their own the same models scored 0 to 2 of 30, and 4 at best with four times the output limit and high effort. A program written by the model itself scored 24 to 27.

68.8%

of 500 issue-tracker comments written in ordinary prose: a reader model of about four billion parameters, adapted to such comments by low-rank training, named the new value of the field that the comment changed. A frequency table built from the same training projects scored 61.0%. The 500 comments come from projects not used in training. On 100 comments that state the change in set words it scored 92, against 85 for a hand-written parser.

94.8%

of the same 500 comments had the true value inside the reader's short list of candidates, 2.55 values on average out of 8.58 possible. When the reader committed to a single value at a strict confidence threshold, it did so on 22 comments, and none of the 22 was wrong.

299 / 299

windows of 43,687 events each, read with no error by a frozen open model with a trained reader. A window is one input of 262,140 tokens, and it passes only if every event in it is read correctly. The events are synthetic: random rearrangements of five items.

298 / 299

windows when the 299-window run above was repeated on a fresh machine with new windows. One event in one window was misread, so the 0.99 bound was not reproduced. A separate follow-up of 473 windows read 472. We report both, and certify per host.

576 / 576

items of the same benchmark ended in the exact final state with a reader on an open 7B host, in the integer-code format, and 575 of 576 in the spreadsheet format. Both formats were in the reader's training data. Items of up to 8k tokens.

7 / 7

models answered all five 1,000-event room-swap documents through ESL, with no chain of thought requested. Reasoning alone, 3 of 10 models did. A regular expression also solves this fixed-format task, so the rows on prose above matter more.

11–13×

less wall-clock time on the same documents, for the two models that answered all five on their own and were also run through ESL. The 50-line groups were sent at the same time.

The certificate

A measured bound for one model on one machine.

A certificate is a statistical statement about one model, on one machine, on one task. It gives the number of fresh inputs tested, how many were read with no error at all, and a one-sided 95% lower bound on the probability that the next one is read with no error.

For example, 299 of 299 gives a bound of 0.990, and 298 of 299 gives 0.984. Another machine, another model, a longer input or another kind of text each gets its own run and its own certificate.

Certificatewhat one states, with our own two runs
First runRepeat
Hosta frozen open modelthe same model
Machinefirst machinea fresh machine
Window262,140 tokens, 43,687 events262,140 tokens, 43,687 events
Fresh windows tested299299
Read with no error299298
Lower boundone-sided, 95%0.9900.984
The bound is the chance that the next fresh window is read with no error. The repeat missed the 0.99 target by one event, and the certificate says so.

What it takes

One layer to read, and a marker after each event.

On a model you host, ESL needs read access to one intermediate layer's activations and the position of a marker after each event. The reader there is a small selector, trained once for each host model, while the model's own weights stay fixed. Through an API, ESL works from the text the model returns. We fit and certify on your checkpoint and your hardware. A certificate states its host, window length and sample size.

Stage

Early access.

The method and measurements are in the paper, and the code is public. We fit and certify ESL on a pilot customer's own model and hardware.

What comes next

Where we are taking it.

Text written in prose

ESL already reads changes stated in prose in issue-tracker comments. We are extending the reader to less structured records.

Free conversation

In open conversation a strong model still tracks state well on its own. Readers for conversation are in research.

More host models

ESL has been fitted to models of different sizes from different makers. Each new host is fitted and certified on its own checkpoint.

The paper

Method and measurements in full.

The method and every measurement on this page are described in the preprint “Learning to Read Events for Exact State Tracking with Frozen Language Models”. Its data and code are public.

Serving your own language model?

If you serve your own language model and long-running state matters to your customers, we would be glad to hear from you. You can write in Korean, English, or Japanese.