When a non-player character (NPC) learns that a fact has changed, the next consequential reply should start from the corrected current record. An older statement can still explain what happened, but it should no longer supply the value the game acts on. In the 2026 preprint Long-Lived Characters, Local Inference: Incremental Memory Maintenance for Game NPCs, Zi-Mu Xu tested how a local language model handles those revisions. On one request to give away the remaining herbs, the model proposed the correct two when it processed the replacement at the end of its running context, but proposed one when the runtime reused the record’s old position. The difference matters when a reply can become a transaction: the model needs access to the correction, and the game needs its own source for the amount.

How a Completed Gift Became a Second Deduction

Xu’s herb test asked whether the model could distinguish a current count from the event that changed it. The character had collected three herbs and already given one to Granny He, leaving two. Xu replayed the same request to give away the remainder at the stage that turns dialogue into proposed game actions. A fresh read of the updated records produced a proposed quantity of two, both with ordinary sequential positions and with gaps between records. Maintaining the context while putting the revised record back in its original slot produced one instead.

Processing the revision at the end worked in this test only when the runtime also left it there. Three reconstructions that kept the replacement at the end all proposed two; three that moved its stored attention keys back to the old position all proposed one. One explanation makes the error visible: “According to memory, I have two warm-pulse herbs in total; I gave one to Granny He yesterday, so one remains.” The model used the current count as though it came from before the gift. The test records also contained a stale phrase saying the character held none, so this was a case of reconciling conflicting descriptions as well as tracking a transfer. The placement comparison shows a repeatable difference on that request, but it does not separate the effects of record order, position and prior computation.

What the Model Carries Into the Next Turn

Replacing a fact in the game’s records does not automatically replace everything the model computed from it. Xu tested a hybrid model that keeps both an attention cache, which lets later requests consult representations of earlier text, and a recurrent state, which carries information forward as the model processes new text. The runtime removes the superseded record’s entries from the attention cache and processes the replacement at the next actual sequence position, an approach Xu calls true-tail maintenance. The old entry is no longer directly available to attention, but the recurrent state and surviving cache entries can still carry its influence. That makes the method a way to revise a running context, not a guarantee that the model has forgotten the old fact.

The longer replay showed why a team might want an older event to stay accessible after a correction. Across eight scripted updates and nine dialogue turns, the character could treat a relative as dangerous now while still recalling that he had once rescued her. It also picked out the two remaining herbs when the action needed a quantity. Those successes did not carry through to every output: one action proposal dropped a daytime restriction, and a later reply invented a rank for the relative. Xu did not replay that nine-turn sequence from freshly rebuilt contexts, so those errors cannot be assigned to the update method.

The reason to keep a running context is to avoid rereading material that did not change. For one action-preparation context of roughly 11,900 tokens, the eight updates took 3.48 seconds in total. Xu estimated that rebuilding after every update would have taken 81.64 seconds at the measured construction rate. That comparison covers context preparation for one stage; it does not show that the player saw a reply sooner or that a whole cast could stay ready on the same device.

Applying this to your game

A team can give the current record authority by deciding what is allowed to change it. In a hypothetical version of the herb trade, the inventory system writes three when the character collects the herbs and changes the count to two only when the first gift goes through. It also keeps a receipt that says who received one. Because the count and receipt answer different questions, a later scene can mention the gift without deducting it again. If the changed fact is something the NPC believes rather than something the game can verify, the character’s record can instead say who supplied the claim and what led the NPC to revise it.

A diagram shows three panels: a past transfer card reading "Herb x1 to Granny He," a current inventory card showing two herb icons and "2 herbs," and a next request card where Granny He says, "Please give me the remainder." A dashed arrow labeled "Callback Only" runs from the past transfer to the request, while a solid arrow labeled "Read Count" runs from the current inventory to two herb icons in the request panel.

View full-size figure

The receipt explains why two herbs remain. When the player asks for the rest, the trade rule reads the inventory without subtracting the earlier gift again.[1]

The next model request can give the current count and the transfer history distinct jobs. When the player asks for the remainder, the model can identify the item and interpret the request as “all remaining,” while the trade rule looks up how many are actually held rather than accepting a number inferred from the dialogue. If the rule executes the gift, the reply can describe the confirmed amount. If the NPC is only making an offer, the reply can describe the offer without saying the gift already happened. That separation keeps the wording and the transaction tied to the same state.

If a scene only needs this one callback, a team can skip persistent model memory and have an authored line read the result of the trade. That gives up some freedom in how the character responds, but it also removes a context the team would otherwise have to keep current. If open-ended requests already depend on a long local context and rebuilding it takes time away from active dialogue, true-tail replacement is a candidate to compare against a fresh read of the updated records.

A revision replay can tell the team whether the faster path preserves what the player was promised. After a completed gift, the team can replay the request for the remainder, then try a later restock and a question about the original recipient. Checking the proposed action, the rule’s result and the spoken reply separately shows where an old fact re-enters the exchange. Timing the update alongside foreground dialogue then shows whether the saved preparation is worth maintaining the cache. The comparison should use the game’s expected state as the answer key, because a fresh read can also be wrong.

Sources

  1. Long-Lived Characters, Local Inference: Incremental Memory Maintenance for Game NPCs

    paper · Zi-Mu Xu, 2026; full text read via arXiv HTML on 2026-12-01 · Source accessed: