How to Test LLM State Tracking With a Deployment Log


You move staging to production at 09:05. Five minutes later, staging is running build b31. At 09:11, what build is served to users? The most recent log entry shows a build ID and a timestamp. What fact are you still missing?

To simplify, let’s say a promotion always copies the build on staging to production. Production keeps that copy until its next deployment. Staging was running build b17 at 09:00. Therefore, the served build at 09:11 is build b17. If we change that value to state that staging was running build b24 at that time, then the answer will be b24. Both logs end with the same two entries. Give each log separately to a large language model (LLM) and ask which build was served at 09:11.

What does a state-tracking benchmark vary?

Jackson Petty, William Merrill, and Ashish Sabharwal describe StateBench in their November 2, 2026 preprint. The authors present a sequence of updates to named variables and derive simpler sequences while keeping the number of variables, the number of distinct values and the positions of the updates fixed. Updates in the same positions in two sequences may require different work from a reader (or model) interpreting the sequences. [1]

Consider assignment, overwrite, increment, and swap. The first requires only a single lookup. For an overwritten setting, you need the most recent assignment. Incrementing a counter requires knowledge of the previous value. Swapping two registers requires both values just prior to the swap.

The researchers had four frontier models generate the final values of the variables. On accuracy, each model scored 13% or less on the longest sequences in the most general class of the researchers’ synthetic benchmark. For the deployment exercise below, we use a similar approach to control a comparison and rely on Python to evaluate lookups. [1, 2]

When the newest record gives the wrong build

The same deployment may be logged in two ways. The entry “set production to b17” gives the build ID. The entry “promote staging” tells us to look for the build in staging and states when to stop looking. The value of staging at 09:05 tells us what went live. The value at 09:10 tells us what staging ran afterward.

Using the builds b17, b24, and b31, form nine ordered pairs. The first element is the build ID of staging before a promotion and the second is the build ID of staging after it. Allow repeats. Record each ordered pair twice, once with the build ID written in the promotion entry and once with the instruction to copy staging. The first build of the pair is always the correct answer.

The function below reads events one after the other. By default, it saves the build ID for copies. Set use_latest to True to keep the instruction instead. The function then resolves the instruction against staging at question time. With or without this flag, it simulates the entire log.

from itertools import productdef production(events, *, use_latest=False):    state = {}    for target, value in events:        if value == "COPY_STAGING" and not use_latest:            value = state["staging"]        state[target] = value    result = state["production"]    if result == "COPY_STAGING":        return state["staging"]    return resultif __name__ == "__main__":    builds = ("b17", "b24", "b31")    total = len(builds) ** 2    for form in ("literal", "copy"):        latest = replay = 0        for before, after in product(builds, repeat=2):            value = before if form == "literal" else "COPY_STAGING"            events = [                ("staging", before),                ("production", value),                ("staging", after),            ]            latest += production(events, use_latest=True) == before            replay += production(events) == before        print(f"{form}: latest={latest}/{total}, replay={replay}/{total}")
literal: latest=9/9, replay=9/9copy: latest=3/9, replay=9/9

Both methods score 9 out of 9 on explicit writes. Replaying the copy scores 9 out of 9. Looking up staging at question time scores 3 out of 9 on copies. In each of those three histories, staging finishes on the build that went live.

Read Also:  Anonymizing Production Data for Data Science with Mimesis

In all six cases where staging changes after the copy, the shortcut fails to score any points. Now hide the first staging entry in each of the nine copy cases. Consider the three cases where staging ends on b31. The two visible entries are identical across those three cases. The correct production build is b17 in one case, b24 in another and b31 in the third. The same holds for the other two endings.

A rule that always gives the same answer for the same two lines can get at most three of these nine equally weighted cases right. Perfect memory of these lines does not help determine the correct answer for these cases.

Four inputs for a release assistant

Use the prompt below in a new conversation for each variation, using the same model and settings. Give the assistant only the events in that variation. By leaving UNKNOWN as an option in each case, you can assess the assistant’s ability to determine when it has insufficient information to answer a question.

A promotion copies staging to production once.The log is in execution order. Use only these events.09:00 Set staging to b17.09:05 Promote staging to production.09:10 Set staging to b31.Which build is live in production at 09:11?Give the build ID and the timestamps that establish it.If the ID cannot be determined, answer UNKNOWNand identify the missing information.

Evaluate each variant as described below, using the starting log for each. Consider the build ID and the supporting evidence separately.

Read Also:  Data Science, No Degree - KDnuggets

Edit to the log

Answer and evidence

None

b17 (09:00 and 09:05)

09:00 uses b24

b24 (09:00 and 09:05)

09:10 uses b24

b17 (09:00 and 09:05)

Omit 09:00

UNKNOWN (staging at 09:05 is missing)

Study the edits for b24. The earlier edit requires a different answer from the assistant. The later edit requires the same answer. In the last edit, reward the assistant for recognizing that the missing evidence is the staging value at the time of promotion. A guess of b17 would agree with the original log, but the assistant would have no justification for this.

If your assistant relies on retrieval to provide an answer, keep the exact passages it received. If the assistant states b17 using the full log, and b31 using the last two lines, check why the 09:00 assignment was not retrieved. Check why the assistant stated a build without enough justification. Keeping each answer with its input lets you test the two issues separately.

What to keep in the release record

Maintain a release log to record build IDs for each successful build promotion. This aids rollback investigations. In a system that records only events such as “promote staging,” determine the immediately preceding staging assignment. When two events share a timestamp, a sequence number can tell you which ran first. Without this ordering, more than one build may fit the same record.

To perform a regression test, retain the original release log and the three variants. The edits show when the answer should change to b24, when it should stay b17 and when the assistant should ask for the earlier staging record. A single correct answer to “What build was promoted?” doesn’t tell you whether the assistant can make all three distinctions.

References

[1] J. Petty, W. Merrill and A. Sabharwal, A Fine-Grained Hierarchy and Benchmark for State Tracking in Language Models (2026), arXiv:2611.03094v1, November 2.

[2] Ai2, StateBench: Testing how language models track state changes over long documents (2026), Allen Institute for AI, November 3.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top