acceptodds
Under review as a conference paper at ICLR 2027

STAM: State-Transition-Aware Memory for Longitudinal Clinical Agents

Abstract

Large language model (LLM) agents that reason over clinical records must track changes in a patient’s state while preserving the history needed to understand them. Simply accumulating memories leaves unclear which information still applies, whereas overwriting earlier memories can erase evidence needed to reconstruct treatment history and clinical trajectories. We introduce STAM, a state-transition-aware memory framework that records state changes as new clinical entries arrive. STAM combines semantic retrieval with typed clinical relations to identify affected memories, maintaining current information in Active and superseded or resolved information in History. At read time, a query-dependent gate selectively serves historical memory. Across four longitudinal clinical benchmarks, we evaluate STAM with downstream question answering, direct state-maintenance diagnostics, and comparisons at matched evidence lengths. On MedMemoryBench, the full write-time pipeline increases supersession-pair recall from 28.6 to 53.9 and reduces false archival relative to deterministic state-maintenance rules. At matched evidence lengths, STAM also shows six significant improvements and no significant decreases across paired comparisons with memory and retrieval baselines. These findings support evaluating longitudinal memory systems for how they manage state as well as how they retrieve information.

Primary area:
foundation or frontier models, including LLMs
Keywords:
long-term memory, LLM agents, state tracking, temporal reasoning, longitudinal clinical records, clinical agents

Reviews

Among:
Shape:
1234this paper, Top 32%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.50 over 4 reviews, above 68% of the others.
Reviewer_5PTMOpenReview ↗
Rating
3(+1)
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper studies state maintenance in longitudinal clinical memory. An earlier fact may stop describing the patient’s current state while remaining useful for understanding their treatment history. STAM separates ACTIVE and HISTORY memories, combines semantic retrieval with clinical relations to identify facts affected by new records, and updates their status. Historical information is then served selectively at query time. The evaluation covers four clinical benchmarks, state-maintenance diagnostics, and approximately context-matched comparisons.

Critical strengths
  1. The clinical motivation is clear, and the workflow makes sense. Outdated medication doses and resolved symptoms should not be treated as current facts, but removing them would lose useful history. Separating state transitions from permanent deletion is a sensible design choice.

  2. I appreciate the evaluation beyond final QA scores. At the same candidate budget, adding relation-based discovery improves supersession recall from 51.6 to 53.9 and reduces false archival from 12.3 to 7.6. The context-length controls and historical-access ablations also help explain where the method is useful.

Critical weaknesses
  1. I am not yet convinced that the full state-maintenance design provides a sufficiently consistent downstream benefit. The gains over append-only memory are 3.24, 0.80, 1.46, and 0.95 points across the four benchmarks, without significance results for this central comparison. The matched-context advantages are also more convincing on MIMIC-QA than elsewhere. These results suggest that state maintenance can help, but do not yet establish the necessity of the full design.

  2. The novelty needs closer comparison with related approaches. MedCache, StateMem, and A-TMA already address temporal validity, supersession, relational dependencies, or state-aware evidence serving. The paper discusses these methods but does not evaluate against them. Clinical relation-based impact discovery seems to be the clearest additional contribution, yet its value relative to these closer alternatives remains

Questions for authors
  1. Could you provide paired confidence intervals or significance tests for the append-only comparison, and confirm whether evidence-serving settings are matched?
  2. What is the most consequential methodological difference from the closest approaches? Are direct comparisons available under a common writer, reader, and evidence budget?
  3. How are the gold supersession pairs and false-archival labels constructed, and how are the metric denominators and annotation quality determined?
5 comments
AuthorsOpenReview ↗

Response to Reviewer 5PTM (Part 1/3): Paired comparisons and downstream contributions

Thank you for recognizing the clinical motivation and the value of evaluating state maintenance beyond final QA. We have added paired tests, repeated serving controls, and comparisons with closely related methods.

Q1/W1. Paired significance tests and evidence-serving settings

Table 4 reports 37.40 macro accuracy for STAM versus 34.16 for append-only memory on MMB, a +3.24-point gain. We complement the paper's results with additional paired analyses and repeated serving controls.

Additional paired analysis. For the other benchmarks, the following confidence intervals apply to the corresponding matched-run estimates:

BenchmarkSTAM minus append-only [95% CI]
MMB+3.24 [−1.78, +4.36]
MedLoCoMo+0.82 [−0.60, +2.26]
MIMIC-QA+1.50 [−0.33, +3.39]
ClinicalBench+1.75 [−2.25, +5.75]

The three additional matched-run point estimates favor STAM. We report these additional analyses separately from Table 4.

Repeated serving controls. We evaluate 694 MMB questions from personas 6–12 using a shared maintained memory store. STAM selects from ACTIVE and HISTORY separately; merged serving ranks these memories together. This tests serving organization on the same memories, rather than independently rebuilding an append-only write pipeline.

With the Qwen3-4B reader, both arms use the same retriever, graph read quota, 1,707-word evidence budget, and reader protocol. Served medians are 1,665 words for STAM and 1,684 for merged serving. Neither arm displays ACTIVE/HISTORY labels.

Paired comparison, macro accuracySTAMMerged servingDifference [95% CI]
Qwen3-4B, six draws pooled across two runs of the same configuration36.5636.81−0.25 [−1.89, +1.32]
GPT-5, high reasoning effort, three draws56.7557.52−0.77 [−2.71, +1.10]

Across the broader grid of 13 prespecified settings, no difference survives max-T correction.

The GPT-5 arms use the same temporal prompt. STAM uses rank-ordered evidence, state tags, and successor checking. The merged arm's word budget targets STAM's median evidence-token volume: 4,049 versus 4,068.5 tokens.

STAM additionally maintains an explicit distinction between current and historical state. Part 3 evaluates the write-time contribution through fixed-budget discovery diagnostics.

Which components provide measurable downstream benefits?

Historical access. On the same 694 questions, we compare ACTIVE+HISTORY with ACTIVE-only serving, refilling ACTIVE-only packets with ACTIVE memories to match the evidence budget. The maintained store and reader are fixed. Each arm uses three draws.

ReaderACTIVE-onlyACTIVE+HISTORYGain [95% CI]Persona-level p
Qwen3-4B30.0435.59+5.55 [+3.07, +7.98].016
GPT-553.3656.75+3.40 [+0.71, +6.03].031

Scores are macro accuracy. Paired question-level p-values are <.001 and .012, respectively. On temporal-localization and state-update questions, gains are +9.64 and +11.67 points, respectively. This establishes the value of historical access under the matched-budget control.

Evidence beyond MIMIC-QA. In a prespecified GPT-5 comparison on 469 MMB questions whose raw records exceed the input window, whole-memory serving scores 64.18% versus 57.14% for Full Context: +7.04 [+2.99, +11.09], Holm p=.002; persona-level p=.031, using 38% of Full Context's input tokens.

Both arms use high reasoning effort, the same temporal instructions, and one draw. Whole memory serves all visible extracted memories chronologically; Full Context supplies raw turns up to a 272K-token input allowance. This tests evidence retention under truncation. Part 2 adds LongHealth.

AuthorsOpenReview ↗

Response to Reviewer 5PTM (Part 2/3): Write FT and Closest Baselines

Memory-side adaptation. Table 1 reports an MMB Write FT improvement from 37.4 to 39.3. Under the benchmark harness's reader prompt and decoding settings with a shared judge, STAM + Write FT improves 36.92 to 43.82: +6.90, Holm-adjusted over three benchmarks, p=.012. Only write modules are adapted in this MMB experiment; the Qwen3-4B reader and stock retriever remain frozen. Evaluation personas are disjoint from adapter-training data.

Methodological differences and closest baselines

Q2/W2. What is the most consequential methodological difference?

STAM addresses clinical impact discovery: identifying which earlier assertions require reconsideration when new clinical evidence arrives. For example, a treatment change can affect a related monitoring plan. Relations such as treatment-for and monitoring-for supply candidate paths alongside semantic retrieval; the updater then adjudicates each candidate's status.

Our controlled experiments use a B=48 updater candidate budget, which bounds the memories passed to the updater. Total write compute also includes extraction and relation linking. The fixed-budget controls in Part 3 measure the relation channel's contribution to discovery. Part 1 separately measures historical access.

State updates, dependency propagation, and history retention have important precedents. STAM's contribution is their clinical configuration, with relation-guided discovery of affected assertions and selective access to retained evidence.

StateMem: common-model comparisons

Our reimplementation follows StateMem's described whole-state ingestion procedure (Fan et al., Sections 5.1–5.3). With a 131,072-token encoder limit, it exceeded the context window on all five MMB personas and five of twelve MedLoCoMo patients.

The paper permits replacing whole-state ingestion with slice-based retrieval but does not report results for that variant. We therefore implemented bounded semantic top-K adaptations: K=48 on both benchmarks and K=200 on MMB. K denotes the encoder's write-time candidate count, not the reader's evidence-token budget.

For this new comparison, both STAM and StateMem use Qwen3-4B-Instruct-2507 as writer and reader, with three reader draws.

StateMem configurationSTAM minus StateMem [95% CI]StateMem/STAM write FLOPs
MMB, K=48+1.03 [−3.06, +4.95]0.92×
MMB, K=200−1.06 [−5.12, +3.30]3.8×
MedLoCoMo, K=48, quotes in both arms+1.78 [−1.40, +4.85]2.07×

MMB uses macro accuracy; MedLoCoMo uses type-macro Token-F1. The MedLoCoMo comparison approximately matches memory-content words, with medians of 650 and 637; both methods receive source quotes. These comparisons use common models and the stated serving configurations. We will report per-arm read budgets and rendered lengths explicitly.

Estimated write FLOPs show a configuration-dependent trade-off: StateMem costs 2.07× STAM on MedLoCoMo; on MMB, K=200 costs 3.8×, while K=48 costs 0.92×.

StateMem propagates dependency flags deterministically and excludes superseded units from its described answering stage, although it retains them for auditability. STAM uses clinical relations to discover candidates for adjudication and selectively serves historical evidence. The historical-access benefit in Part 1 is measured within STAM.

A-TMA: discovery and training requirements

A-TMA constructs candidates from host retrieval and existing state links, then applies a trained Sentry gate and a separately trained audit model (Shi et al., Section 4.3). It also preserves historical states and transition links.

STAM's base impact-discovery modules combine semantic retrieval with clinical-relation paths using prompted pretrained models; impact discovery requires no task-specific training. We could not locate the trained artifacts required for a faithful A-TMA evaluation, so this comparison is methodological.

AuthorsOpenReview ↗

Response to Reviewer 5PTM (Part 3/3): MedCache and State-Level Diagnostics

MedCache: LongHealth evaluation

On 400 LongHealth questions, STAM scores 63.5% accuracy [58.7, 68.1], compared with MedCache's reported 44.0%. We use STAM's published clinical write configuration and top-20 serving, MedCache's Qwen3.6-35B-A3B reader, greedy decoding, and the LongHealth prompt.

This uses a published result, not a MedCache rerun. Our Full Context calibration is 6.3 points above their reported value, indicating a setup difference. We therefore report this as an additional benchmark evaluation and published-reference comparison.

The revision will include these implementations and configurations, distinguishing the common-model StateMem results, the published MedCache reference, and the component controls within STAM.

Label construction, denominators, and state-level diagnostics

Q3. How are supersession pairs and false-archival labels constructed?

The benchmark provides annotated evidence points for state-update questions. The supersession pairs used in our diagnostics are silver labels derived from those annotations. A deterministic script orders each question's evidence points by time and pairs the latest point with earlier points. The source evidence is benchmark-annotated. We conducted a blinded model-judge audit of 71 silver predecessor pairs spanning all 20 personas. GPT-5 and Claude Opus 4.8 labelled the pairs, with Gemini 2.5 Pro resolving disagreements. Inter-judge agreement was 0.95. The judges classified 77% as describing the same evolving patient state and 61% as supersessions.

The diagnostics evaluate memory state when the session containing the later evidence becomes visible:

  • Pair recall: among pairs whose older evidence matches a stored memory, whether that memory has been archived.
  • False-archival proxy: whether the newer memory is already archived at that point.
  • Impact ceiling: whether an older memory reaches the updater's candidate set by the time its supersession is observed.
  • Cascade discovery: whether candidates at a dependent session contain a memory from its triggering session. This uses the benchmark's own triggered_by dependency annotations.

Metric denominators

QuantityUnit and denominator
Candidate supersession pairs, personas 1–51,398 automatically derived pairs
Pair recall, Table 5(a)1,344 pairs whose older evidence matches a stored memory
False-archival proxy, Table 5(a)1,398 pairs, evaluated through the newer memory
Additional chain-level analyses, personas 1–550 supersession chains
Additional-persona chain analyses, personas 6–1263 supersession chains
Cascade discoveryEvaluated dependent sessions with a triggered_by link

Table 5 reports pair-level diagnostics; the new confirmatory tests resample supersession chains, a different aggregation unit. We will state the denominators explicitly, identify which metrics use automatically derived labels, and provide the construction and memory-matching procedures.

Replicated candidate-discovery results

The relation channel is evaluated at the same B=48 updater candidate budget. Impact ceiling is aggregated per silver supersession chain:

Store set and comparisonImpact-ceiling gain [95% CI]Holm p
Published MMB store versus no relation linking+3.99 [+0.64, +7.01].034
Second store set, personas 1–5, versus semantic-only discovery+4.06 [+2.34, +5.76].0002
Second store set, personas 6–12, versus semantic-only discovery+3.50 [+1.32, +5.84].0016

On the published configuration, cascade discovery also improves by +4.60 points [+0.71, +8.45], Holm p=.034. A separate per-chain supersession-recall analysis on that configuration reports a +2.93-point improvement over no relation linking, p=.003.

These measures distinguish candidate availability, the updater's archival outcome, and downstream QA. The discovery benefit replicates across store sets and persona cohorts. The clinical relation vocabulary is configurable; the supported contribution is bringing affected memories into the update decision.

We will make the label provenance, metric definitions, denominators, and aggregation units explicit in the revision and release the diagnostic construction procedure.

Reviewer_uZdAOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

STAM proposes a memory framework for longitudinal clinical agents that separates current facts from historical information. It combines semantic retrieval and typed clinical relations to identify affected memories, update their status, and selectively retrieve historical evidence.

Critical strengths
  • The distinction between information becoming outdated and becoming useless is well motivated.

  • The write-time diagnostics are useful. In particular, the matched-budget comparison shows that relation-aware retrieval reduces false archival beyond semantic retrieval alone (Table 5).

Critical weaknesses
  1. The methodological contribution needs clearer validation. The paper discusses several closely related state-aware memory systems, but does not directly compare against alternatives such as MedCache or StateMem. It remains unclear how much the proposed clinical configuration adds beyond existing approaches to temporal validity and supersession.

  2. The downstream gains are uneven. Improvements over append-only memory are modest (Table 4), and most significant matched-context gains are concentrated on MIMIC-QA (Table 13). With GPT-5, Full Context performs better on three of four benchmarks. The large gains from STAM + FT also include reader fine-tuning, so they do not isolate the memory mechanism. I would like to see whether a strong reader with carefully designed temporal prompts and a simpler retrieval pipeline achieves comparable results under matched budgets.

  3. Important implementation and evaluation details remain underspecified. The manuscript does not fully specify the prompts, relation scoring, store-gate policy, or reader fine-tuning procedure. The annotation protocol and denominators for the central state-maintenance metrics also need clarification. These details are necessary to assess and reproduce the strongest claims.

  4. The practical cost–benefit trade-off is not established. Memory construction requires substantial computation (Table 29), while the reported latency savings exclude construction, retrieval, and gating. An end-to-end comparison across realistic update/query frequencies would help establish when this additional complexity is worthwhile.

Questions for authors

See Weaknesses

7 comments
AuthorsOpenReview ↗

Response to Reviewer uZdA (Part 1/5): StateMem, MedCache, and Clinical Relations

Thank you for highlighting the distinction between outdated and useless information and the value of the write-time diagnostics. We have added comparisons with related methods, strong-reader controls with matched budgets, implementation and metric details, and construction-inclusive analyses across query frequencies.

W1. Comparisons with StateMem and MedCache

StateMem. Our paper-based reimplementation follows its whole-state ingestion procedure, which supplies all active units to the encoder at each turn (Fan et al., Section 5.1). With a 131,072-token encoder limit, our implementation exceeded the window on all five MMB personas and five of twelve MedLoCoMo patients.

The paper permits slice-based retrieval but does not report results for that variant. We implemented bounded semantic top-K adaptations, with K=48 on both benchmarks and K=200 on MMB. Here, K denotes the number of active units supplied to StateMem's write-time encoder. Both use Qwen3-4B-Instruct-2507 as writer and reader, three reader draws, and controlled serving and evaluation settings. Both receive source quotes on MedLoCoMo.

Benchmark / StateMem configurationSTAM minus StateMem [95% CI]StateMem/STAM write FLOPs
MMB, K=48+1.03 [−3.06, +4.95]0.92×
MMB, K=200−1.06 [−5.12, +3.30]3.8×
MedLoCoMo, K=48+1.78 [−1.40, +4.85]2.07×

Historical answering is a functional distinction: StateMem retains superseded units for auditability but excludes them from its described answering stage. STAM serves historical evidence selectively.

MedCache. On LongHealth, a public benchmark used by MedCache, we use STAM’s published clinical write configuration: Qwen3-1.7B writer and top-20 serving. We use MedCache’s Qwen3.6-35B-A3B reader, greedy decoding, and the LongHealth prompt.

On 400 questions, STAM scores 63.5% accuracy [58.7, 68.1], compared with MedCache’s reported 44.0%. This uses their published result, not a rerun. Our Full Context calibration is 6.3 points above their reported value, indicating a setup difference. We therefore report this as an external evaluation and published-reference comparison.

What does the clinical configuration contribute?

A new clinical entry can affect existing assertions through their relationship to the new evidence. For example, a treatment change may affect a related monitoring plan. Clinical relations provide paths for bringing these assertions into the updater’s candidate set alongside semantic candidates. The framework does not require a fixed relation vocabulary; the measured contribution is relation-guided candidate discovery.

Controlled comparisonResult [95% CI]
Published Qwen3-1.7B MMB store configuration versus no relation linking, B=48Impact ceiling +3.99 [+0.64, +7.01]; cascade discovery +4.60 [+0.71, +8.45]
Relation channel in a second set of stores, same budgetImpact ceiling +4.06 [+2.34, +5.76] on personas 1–5, p=.0002; +3.50 [+1.32, +5.84] on personas 6–12

Impact ceiling is aggregated per silver supersession chain. Cascade discovery uses the benchmark’s annotated dependency links. The annotation and metric-denominator subsection below specifies their definitions and denominators.

AuthorsOpenReview ↗

Response to Reviewer uZdA (Part 2/5): Historical Access, GPT-5, and Write FT

Historical access. In a new matched-refill evaluation on 694 MMB questions from personas 6–12, we compare ACTIVE+HISTORY with ACTIVE-only serving refilled to the same evidence budget. Both arms use the same Qwen3-4B-written store, rank-ordered evidence, and three answer draws.

ReaderACTIVE-onlyACTIVE+HISTORYGain [95% CI]
Qwen3-4B30.0435.59+5.55 [+3.07, +7.98]
GPT-553.3656.75+3.40 [+0.71, +6.03]

Scores are macro accuracy (%). Paired p-values are <.001 and .012; persona-level p-values are .016 and .031. On temporal-localization and state-update questions, gains are +9.64 for Qwen3-4B and +11.67 for GPT-5.

Personas 6–12 are outside the paper’s evaluation cohort. They previously informed updater-prompt development and adapter training; personas 6–7 also appeared in earlier read-side development. These historical-access experiments use no adapter.

W2. Modest append-only gains and evidence beyond MIMIC-QA

Append-only memory retains every memory, including historical content. Table 4 therefore tests state transitions beyond accumulation; STAM is numerically higher on all four benchmarks, and we will describe these QA margins as modest. We complement downstream QA with the fixed-budget discovery diagnostics reported above, which measure the write-time effect directly.

When does memory improve on GPT-5 Full Context?

The strongest matched-context gains in Table 13 are concentrated on MIMIC-QA. Our new MMB experiments identify another setting in which memory improves GPT-5 performance over Full Context: long records that exceed the raw-context window.

We evaluate 694 questions from personas 6–12 using GPT-5 at high reasoning effort, with the same temporal instructions and judge across arms. Full Context supplies each raw turn once, chronologically, removing the oldest turns beyond a 272K-token input allowance. Whole-memory serving supplies all visible extracted memories chronologically.

  • Whole memory, 469 questions with truncated raw records: 64.18% versus 57.14% for Full Context, +7.04 points [+2.99, +11.09], using 38% of its input tokens.
  • Rank-ordered bounded memory, 167 questions whose annotated evidence was entirely removed: 54.69% versus 43.71%, +10.98 [+4.19, +17.96].

These comparisons were specified before the new reader calls. Full Context and whole memory use one answer draw each; bounded STAM uses three.

On the 225 questions whose records fit, Full Context scores 70.67% versus 65.78% for whole memory. A post hoc length-based policy therefore uses Full Context when the record fits and whole memory otherwise. Across all 694 questions, it scores 66.67 versus 62.55 macro accuracy, +4.11 [+1.19, +7.13], using 51% of Full Context’s input tokens. This policy uses record length and existing outputs.

These results support evidence retention under context limits. The matched-budget cosine retrieval control below separately examines retrieval over the same memories.

Temporal gains with a compact reader

We evaluate the 85 admissions of the original MIMIC-QA training split. They were not used to select a zero-shot setting, and the trained retriever and fine-tuned models that used them are absent from this experiment. Both arms use the same greedy Qwen3-4B reader; STAM’s 1,024-word evidence budget was fixed before this run.

On the prespecified temporal subset of 847 questions from 79 admissions, STAM scores 61.28 versus 57.18 Token-F1 for Full Context: +4.10 [+1.53, +6.84]. Temporal gains also occur when complete records fit: +2.32 [+0.43, +4.22], on the post hoc subset of 792 questions from 73 admissions.

Separating reader adaptation from Write FT

To isolate memory-side adaptation, the additional MMB experiment fine-tunes only the write modules while keeping the Qwen3-4B reader and stock retriever frozen. We re-evaluate both configurations using the benchmark harness’s reader prompt and decoding settings, with a shared judge:

MMB macro accuracyTable 1Additional common-protocol evaluation
STAM37.436.92
STAM + Write FT39.343.82
Improvement+1.9+6.90

The adapter-training personas are disjoint from the evaluation personas in this comparison. Thus, adapting memory construction improves MMB QA with the reader unchanged. We will add this experiment separately.

AuthorsOpenReview ↗

Response to Reviewer uZdA (Part 3/5): Matched-Budget Cosine Retrieval

W2 (continued). Simpler retrieval under matched budgets

STAM addresses both memory maintenance and access to historical evidence. Our component controls identify benefits in clinical impact discovery at write time (+3.99 points in impact ceiling and +4.60 in cascade discovery at the same candidate budget) and historical access at read time (+5.55 MMB macro-accuracy points with Qwen3-4B and +3.40 with GPT-5).

To address the requested simpler-retrieval comparison, we additionally test plain cosine serving over the same memory bank constructed and maintained by STAM, including its extracted, dated memories and retained history. This comparison holds memory construction fixed and evaluates the incremental contribution of the serving procedure. Both arms use the same temporal instructions and reader, and each cosine packet is capped at STAM's evidence-token budget for that question.

Benchmark and readerQuestionsSTAM servingCosine over the same STAM bankSTAM minus cosine [95% CI]
MMB, GPT-5 at high reasoning effort, chronological evidence in both arms69459.6560.11−0.46 [−2.27, +1.25], p=.61
MIMIC-QA, Qwen3-32B with thinking, prespecified temporal subset23172.9573.28−0.34 [−1.85, +1.17], p=.68
MIMIC-QA, Qwen3-32B with thinking, all questions40076.6976.46+0.22 [−1.17, +1.67]

MMB uses macro accuracy; MIMIC-QA uses Token-F1. Each arm has three answer draws. Median cosine/STAM evidence-token ratios are 0.996 on MMB and 0.998 on MIMIC-QA, with no cosine packet exceeding its corresponding budget.

For MIMIC-QA, the published STAM packets use a 1,024-word budget and remain unchanged. The primary temporal comparison meets the prespecified two-point non-inferiority margin.

The MMB comparison covers personas 6–12 and is a subsequent order-matched control. It follows an initial comparison that used different evidence orders. In the reported control, both arms present evidence chronologically.

What does this establish about the memory mechanism?

This is a serving ablation on a shared maintained memory bank. Separate component controls show that clinical relations improve write-time discovery of affected memories and that access to retained history improves downstream QA. The cosine control assesses the additional contribution of how those memories are selected and presented to the reader.

The following interventions summarize the evidence for historical access, memory-side adaptation, and evidence retention:

InterventionWhat it testsResult
ACTIVE+HISTORY versus refilled ACTIVE-only, fixed store and budgetAccess to retained historical evidence+3.40 with GPT-5 and +5.55 with Qwen3-4B on MMB
Write FT versus base STAM, frozen reader and retrieverAdaptation of memory construction+6.90 on MMB
Extracted memory versus raw Full Context on truncated recordsRetention of evidence beyond the raw input windowWhole memory +7.04; rank-ordered bounded memory +10.98 where all annotated evidence is cut

Together, these experiments demonstrate complementary benefits from historical access, memory-side adaptation, and compact evidence retention under context limits.

Reviewer_E9uMOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper presents STAM, a memory framework for longitudinal clinical records. It uses semantic retrieval and clinical relations to update memories, keeping current facts separate from superseded or resolved ones. A query-dependent gate controls access to historical memories. The authors evaluate STAM on four clinical benchmarks with QA results, state-maintenance diagnostics, and ablations.

Critical strengths
  1. The paper addresses a useful problem: tracking a patient's changing state while preserving the history needed for later questions.

  2. The evaluation covers four clinical benchmarks. I appreciate the state-maintenance diagnostics, component ablations, and context-matched comparisons, which help explain the results beyond overall QA scores.

Critical weaknesses
  1. The paper clearly explains why maintaining clinical state over time is important. However, it does not clearly explain the limitations of existing state-maintenance methods or why its particular clinical relation types and other additions are important. Prior work already addresses state updates, historical retention, and dependency propagation. Although STAM achieves improvements in some settings, I find the importance of these additions insufficiently motivated and the methodological contribution largely incremental.

  2. Some experimental details are missing, such as the complete prompts for memory extraction, relation linking, and state updating in the manuscript.

  3. Missing comparisons with the closest methods. The authors evaluate Graphiti and CUPMem, but do not directly compare STAM with A-TMA, StateMem, or MedCache, despite discussing these closely related methods in Section 2. I therefore remain unsure how much STAM improves over recent state-maintenance approaches. The component ablations are useful, but they do not establish this comparative advantage.

  4. Appendix G shows that omitting historical evidence reduces the reader's time to first token, but these measurements exclude retrieval and gate evaluation. The authors also report memory-construction costs separately. I would appreciate latency measurements for the complete query pipeline to show how much the system saves in practice, beyond the isolated reader-stage savings.

  5. The authors label Figure 1 as an illustrative example, but do not provide a source instance, model configuration, or actual model outputs for the depicted errors. I find the four-entry chest-pain example too simple to establish that strong contemporary models would fail this way on realistic clinical inputs. A traceable failure case from an evaluated model would make the motivation more convincing.

Questions for authors
  1. Could the authors clarify the main methodological contribution beyond existing state-update, history-retention, and dependency-propagation mechanisms? In particular, what limitation of prior methods makes the proposed clinical relation types necessary?

  2. How much does STAM improve over recent, closely related baselines such as A-TMA, StateMem, and MedCache under comparable settings? Which parts of the proposed method account for these gains?

6 comments
AuthorsOpenReview ↗

Response to Reviewer E9uM (Part 1/4): Contribution and Historical Access

Thank you for recognizing the importance of longitudinal state tracking and the value of our diagnostics, ablations, and context-matched comparisons. We have added experiments that clarify the contribution of clinical impact discovery and historical access.

W1/Q1. What does STAM contribute beyond existing state-maintenance mechanisms?

STAM addresses clinical impact discovery: when a new clinical event arrives, which existing assertions require reconsideration? It combines semantic retrieval with clinical-relation paths within a fixed updater candidate budget. The updater then determines whether each candidate remains applicable, while superseded evidence remains available for historical questions.

The following distinctions explain the design and the scope of our evidence:

Limitation addressedSTAM’s designEvidence
Semantic-only candidate retrieval can miss clinically dependent assertionsAdd clinical-relation candidates within the same budgetImproved impact ceiling and cascade discovery in STAM’s component controls
Whole-state ingestion can exceed the encoder window on long recordsSupply a bounded impact-candidate set to the updaterOur StateMem whole-state reimplementation exceeded the tested limit; bounded adaptations are evaluated separately
StateMem’s described answering stage excludes superseded unitsRetain and selectively serve HISTORYImproved MMB QA over evidence-matched ACTIVE-only serving

State updates, history retention, and dependency propagation have important precedents. Our experiments identify the benefits of STAM’s clinical discovery and serving design.

Why clinical relation types?

Whether a new clinical entry affects an earlier assertion depends on the relationship between them. For example, a treatment change may affect whether a related monitoring plan remains applicable. Relations such as treatment-for and monitoring-for make these dependencies available to impact retrieval, bringing linked assertions into the updater’s candidate set alongside semantic candidates.

As Section 3.2 states, STAM does not require this fixed vocabulary. The types define the clinical configuration evaluated here, and the benefit established by the controlled experiments is improved candidate discovery.

1. Clinical relations improve discovery at a fixed candidate budget.

On the published Qwen3-1.7B MMB store configuration, we compare relation linking with its no-linking control at B=48:

Discovery measureGain [95% CI]
Impact ceiling+3.99 [+0.64, +7.01]
Cascade discovery+4.60 [+0.71, +8.45]

Impact ceiling measures whether an older memory reaches the updater’s candidates by the time its supersession is observed, aggregated per silver supersession chain. Cascade discovery uses the benchmark’s annotated dependency links: whether candidates at a dependent session contain a memory from its triggering session.

The impact-ceiling gain also replicates in a second set of stores at the same budget, measured per silver supersession chain:

  • Personas 1–5: +4.06 [+2.34, +5.76]
  • Personas 6–12: +3.50 [+1.32, +5.84]

These are component comparisons within STAM. B=48 bounds updater candidates; construction cost is addressed under W4.

2. Historical access improves QA with the store and evidence budget fixed.

On 694 MMB questions from personas 6–12, we compare ACTIVE+HISTORY with ACTIVE-only serving, refilling the latter with ACTIVE memories to match the evidence budget. The maintained store and serving procedure are fixed; each arm uses three answer draws.

ReaderACTIVE-onlyACTIVE+HISTORYGain [95% CI]
Qwen3-4B30.0435.59+5.55 [+3.07, +7.98]
GPT-553.3656.75+3.40 [+0.71, +6.03]

Scores are macro accuracy (%). Paired p-values are <.001 and .012; persona-level p-values are .016 and .031, respectively. Gains are positive in 7/7 and 6/7 personas. On temporal-localization and state-update questions, gains are +9.64 for Qwen3-4B and +11.67 for GPT-5.

For example, persona 10 asks when the patient independently changed benazepril to every-other-day dosing. HISTORY retains the event dated 2024-02-05. ACTIVE-only omits it and contains a later mention dated 2024-02-12. GPT-5 returns the later date in all three ACTIVE-only draws and the original date in all three draws with HISTORY. Across these temporal question types, 25 questions show consistent correction, versus five with the reverse pattern.

Personas 6–12 are outside the paper’s evaluation cohort. They previously informed updater-prompt development and adapter training; personas 6–7 also appeared in earlier read-side development. These historical-access experiments do not use the Write FT adapter.

AuthorsOpenReview ↗

Response to Reviewer E9uM (Part 2/4): Related Methods and Component Evidence

W3/Q2. How does STAM compare with A-TMA, StateMem, and MedCache, and which components account for the gains?

Table 1 already reports higher Qwen3-4B scores for STAM than Graphiti and CUPMem on all four benchmarks. To address the requested closer comparisons, we have added a paper-based StateMem reimplementation and a LongHealth evaluation, alongside a methodological comparison with A-TMA.

StateMem: accuracy and write-compute comparisons.

StateMem’s described ingestion procedure supplies a compact rendering of all active state units to the encoder at each turn (Fan et al., Section 5.1). Our reimplementation follows this procedure. With a 131,072-token encoder limit, it exceeded the context limit on all five MMB personas and five of twelve MedLoCoMo patients.

The paper permits replacing whole-state ingestion with slice-based retrieval but does not report results for that variant. We therefore implemented bounded semantic top-K adaptations: K=48 on both benchmarks and K=200 on MMB.

Both systems use the same writer configuration and a common Qwen3-4B-Instruct-2507 reader, with three reader draws and controlled serving and evaluation settings. Both receive source quotes on MedLoCoMo.

Benchmark / StateMem configurationSTAM minus StateMem [95% CI]pStateMem/STAM write FLOPs
MMB, K=48+1.03 [−3.06, +4.95]1.000.92×
MMB, K=200−1.06 [−5.12, +3.30]1.003.8×
MedLoCoMo, K=48, quotes in both arms+1.78 [−1.40, +4.85].272.07×

Write compute depends on the configuration: MMB K=48 costs slightly less than STAM, while MMB K=200 and MedLoCoMo K=48 cost more.

Historical answering is a functional distinction. StateMem retains superseded units for auditability but excludes them from its described answering stage. STAM serves historical evidence selectively. Our historical-access ablation isolates the value of this access on a fixed STAM store; the table compares the complete systems under the tested configurations.

A-TMA: candidate discovery and training requirements.

A-TMA constructs candidates from host retrieval and existing state links, then applies a trained Sentry gate and a separately trained audit model (Shi et al., Section 4.3). It also preserves history and transition links.

STAM combines semantic retrieval with clinical-relation paths to identify potentially affected assertions. Its base impact-discovery modules use prompted pretrained models and require no task-specific training. The distinction concerns candidate discovery and training requirements. We could not locate the trained artifacts required for a faithful A-TMA run, so this comparison is methodological.

MedCache: LongHealth evaluation.

MedCache organizes temporally valid facts in specialty memories and reconstructs the applicable patient state at query time. STAM combines clinical impact discovery and write-time updates with selective historical access.

On LongHealth, we use STAM’s published clinical configuration, with a Qwen3-1.7B writer and top-20 serving. We use MedCache’s Qwen3.6-35B-A3B reader, greedy decoding, and the LongHealth prompt.

STAM achieves 63.5% accuracy [58.7, 68.1] on 400 questions, compared with MedCache’s reported 44.0%. This uses their published score, not a rerun. Our Full Context calibration is 6.3 points above their reported value, indicating a setup difference. We therefore report this as an external evaluation and published reference comparison.

Which components account for the measured benefits?

Our component ablations isolate two effects: relation-guided discovery improves access to affected memories at a fixed candidate budget, and historical serving improves MMB QA at a fixed evidence budget.

We also test memory-side adaptation with the reader and stock retriever frozen. Table 1 reports an MMB improvement from 37.4 to 39.3 with Write FT. We re-evaluated both configurations using the benchmark harness’s reader prompt and decoding settings, with a shared judge:

MMB macro accuracyTable 1Additional common-protocol evaluation
STAM37.436.92
STAM + Write FT39.343.82
Improvement+1.9+6.90

The Qwen3-4B reader remains frozen, and the evaluation personas are disjoint from the write-adapter training data. This demonstrates that adapting memory construction can improve QA without adapting the reader.

We will add this experiment, the baseline implementations, and their configurations to the revision.

AuthorsOpenReview ↗

Response to Reviewer E9uM (Part 3/4): Latency, Construction, and Reproducibility

W4. Latency including retrieval and gate evaluation

We evaluate end-to-end read-time latency by combining CPU query-path measurements with reader replay timings.

On 694 MMB questions, the CPU path includes query encoding, retrieval, graph processing, gate evaluation, successor checking, and prompt rendering. With eight CPU threads, median latency is 28.4 ms for STAM and 23.4 ms for plain cosine retrieval. The Store Gate decision takes 1.4 µs in a separate per-module measurement.

Reader timings use Qwen3-4B-Instruct-2507 on two A100-40GB GPUs, with the same server for all comparison arms, greedy decoding, and one request at a time after warm-up. We replay the chronological bounded packets from personas 6–12.

Median latency, including measured query overheadSTAMPlain cosineRaw Full Context
Question to first token, 60 questions0.236 s0.205 s64.07 s
Question to completed answer, 20 questions0.319 s0.278 s63.98 s

The rows use different question sets. On the 20-question completion set, Full Context’s median time to first token is 63.48 s. Full Context prompts contain approximately 256K tokens at the median. The smallest observed per-question speed-ups are 18× to first token and 7.8× to a completed answer.

STAM’s additional CPU query processing costs approximately 5 ms over plain cosine, which is small relative to the reader-time savings from compact evidence.

Including memory construction

Appendix G.7 reports construction cost. We additionally replay recorded write calls from the published Qwen3-1.7B MMB stores on an H200 capped at 315 W. Estimated construction cost is 244 GPU-seconds per persona at 64 concurrent calls, or 298 at 16 concurrent calls. These estimates scale seeded replays covering 5–20% of calls per write stage. The corresponding read measurements use the same GPU type and power setting, with one request at a time.

We model a record growing one session at a time, charging each incoming session’s write and one subsequent read. Full Context’s read cost grows with record length, fitted to measured latency. At write concurrency 64:

Full Context serving conditionQuestions after which cumulative STAM cost stays lower
Without prefix caching11
With a resident per-patient prefix cache37

All five personas reach these thresholds. At the end of the modeled schedule, pooled STAM GPU time is approximately 5% of uncached Full Context.

A separate fixed-record calculation gives a break-even of 4.9 questions per persona, or 6.2 with full-power reads. A sensitivity calculation assuming uncached Full Context prefill reaches the GPU’s peak FLOP throughput increases the estimate to 14.8 questions. These are analytical estimates under the stated compute assumptions; MMB contains approximately 99 questions per persona.

The construction-inclusive benefits concern repeated questions over growing records. We will distinguish measured query components from modeled amortization and report the hardware, concurrency, and cache assumptions.

W2. Complete prompts and experimental details

We will include the verbatim implemented system and user templates for memory extraction, relation linking, state updating, store routing, answering, and judging, including in-prompt examples where applicable. We will provide their input/output schemas and parsing rules and release these materials with the code.

A configuration table will map each result to writer and reader versions, prompt variants, candidate and serving budgets, evidence order, source-quote and state-label settings, decoding parameters, and answer-draw counts.

Reviewer_WaXTOpenReview ↗
Rating
3
Confidence
1
Informativeness
3
Presentation
3
Soundness
3
Read review
Paper summary

The paper proposes STAM, a framework to keep track of a patient's historical data to retrieve information and a time aware fashion, meant to tackle the problem of outdated patient information that affects agents on clinical records. The methodology uses an agent to extract atomic information from patient outcome. Then, it links the atomic relationship within the patient graph, which is used to augment the semantic impact retrieval that allows the framework to keep an updated state for the patient. In detail, this is done by using semantic retrieval and the relationship graph to feed candidates for update to an LLM that updates the state. At search time, both he history (full logs) and the active records are queried. The proposed approach offers strong performance compared to the competitors on the existing benchmark.

Critical strengths
  • The paper is well written and easy to follow.
  • The paper address a relevant and challenging problem, well motivated in the introduction.
  • The main idea of the paper is methodologically sound and novel.
Critical weaknesses
  • Gains rely on the authors’ own benchmark. Excluding MIMIC-QA, the only significant wins are against MemRL. With GPT-5, full context beats STAM on 3 of 4 datasets (even the proposed is more efficient, disk-based ann can relief the pressure on memory for full context while being easily maintainable.
  • Key baselines are missing. There is no comparison with MedCache, StateMem or A-TMA.
Questions for authors
  • Why are MedCache, StateMem and A-TMA not included as baselines, given that the paper calls MedCache “closely related”?
  • Can you quantify efficiency against Full Context, including write-time cost?
4 comments
AuthorsOpenReview ↗

Response to Reviewer WaXT (Part 1/4): Historical Access and GPT-5 Evidence

Thank you for recognizing the relevance, soundness, and novelty of STAM. Your questions motivated additional controlled experiments, comparisons with closely related methods, and an efficiency analysis that includes memory construction.

W1. Do the gains extend beyond our own benchmark?

Under approximately matched context lengths, Table 13 reports six significant improvements and no significant decreases across 17 paired comparisons. These include improvements over MemRL on both MedMemoryBench and MedLoCoMo, in addition to four improvements on MIMIC-QA. To strengthen the evidence beyond MIMIC-QA, we now add matched-budget historical-access controls on MedMemoryBench (MMB) and an evaluation on LongHealth.

1. Historical access improves MMB accuracy with both readers. We evaluate 694 questions from personas 6–12, outside the paper’s evaluation cohort. We compare ACTIVE+HISTORY with ACTIVE-only serving (refilling the latter with additional ACTIVE memories to match the evidence budget). Both configurations use the same maintained memory bank and reader, with approximately matched evidence budgets. Each configuration generates three answers per question.

ReaderACTIVE-onlyACTIVE+HISTORYGain [95% CI]
Qwen3-4B30.0435.59+5.55+5.55 [+3.07,+7.98][+3.07, +7.98]
GPT-553.3656.75+3.40+3.40 [+0.71,+6.03][+0.71, +6.03]

Scores are macro accuracy (%). Improvements are significant for both readers at the question level (p<.001p < .001 and p=.012p = .012, respectively) and at the persona level (p=.016p = .016 and p=.031p = .031, respectively). ACTIVE+HISTORY outperforms ACTIVE-only for all seven personas with Qwen3-4B and six of seven personas with GPT-5. On temporal-localization and state-update questions combined, the improvements are +9.64 and +11.67 points for Qwen3-4B and GPT-5, respectively.

Traced example. MMB persona 10 is asked when the patient independently changed benazepril to every-other-day dosing. HISTORY retains the event dated 2024-02-05. The ACTIVE-only packet omits it and contains a later mention dated 2024-02-12; GPT-5 returns that later date. With HISTORY, it returns the correct date in all three draws. Across temporal-localization and state-update questions, 25 questions are incorrect with ACTIVE-only and correct with STAM in all three draws, versus five with the reverse pattern.

These results demonstrate that retaining and selectively accessing historical evidence improves longitudinal question answering beyond simply retrieving more current-state memories.

W1. “With GPT-5, full context beats STAM on 3 of 4 datasets.”

Full Context provides a strong baseline when the reader has access to sufficient relevant evidence. Our additional experiments identify two settings where memory can help: when the input window excludes relevant evidence, and when a compact reader answers temporal questions from a long record.

GPT-5 on MMB: retaining evidence beyond the input window. We use the same 694 questions and maintained memory store as in Part 1. All GPT-5 configurations use identical reasoning effort, temporal instructions, and evaluation judge. Full Context includes raw conversation turns chronologically, truncating the oldest turns when the input exceeds 272K tokens. We compare two memory-serving settings: all extracted memories in chronological order and a bounded selection of approximately 4K evidence tokens.

Of the 694 questions, 469 require truncating the raw record, while 225 fit completely. Among the 469, there are 167 questions for which all annotated supporting evidence is removed by truncation.

  • Whole memory on 469 questions with truncated raw records: STAM scores 64.18% versus 57.14% for Full Context, a +7.04-point gain (95% CI [+2.99,+11.09][+2.99, +11.09]), using 38% of Full Context's input tokens.
  • When Full Context loses all supporting evidence (167 questions): STAM with ranked memory serving scores 54.69% versus 43.71%, a +10.98-point gain (95% CI [+4.19,+17.96][+4.19, +17.96]).

On the 225 questions whose raw records fit completely, Full Context performs better than whole memory (70.67% versus 65.78%).

We also examine an exploratory length-based policy that uses Full Context when the raw record fits and whole memory otherwise. Across all 694 questions, it achieves 66.67 versus 62.55 macro accuracy, a +4.11-point gain (95% CI [+1.19,+7.13][+1.19, +7.13]; persona-level p=.031p=.031), using 51% of Full Context's input tokens. The policy uses record length and reuses existing outputs.

AuthorsOpenReview ↗

Response to Reviewer WaXT (Part 2/4): Temporal Cases and Related Baselines

For comparison, bounded STAM with chronological memory ordering scores 59.65 versus 62.55 for Full Context across all 694 questions (p=.12p=.12), while using a median of 4,049 versus approximately 270K input tokens (1.5%). Full Context and whole memory use one answer draw; bounded STAM uses three.

Traced example 1: the evidence is outside the window. MMB persona 10 is asked when the patient first started hydrochlorothiazide. The documented start, 2024-04-18 in session 39, is outside the Full Context window. GPT-5 answers 2024-07-05, the date of a later medication mention inside its window. Rank-ordered bounded STAM retrieves the HISTORY memory of the original start and answers 2024-04-18 correctly in all three draws. In this subset, 30 questions have an incorrect Full Context answer and correct STAM answers in all three draws; nine show the reverse pattern.

Traced example 2: the update is inside the window. MMB persona 6 is asked for the most recent nightly CPAP use. An August entry reports two nights of all-night use. The latest session, dated 2024-09-26, reports two nights of just over three hours and two nights of about four hours. Both statements appear in GPT-5’s retained Full Context window.

Full Context answers with the earlier state: “all night for two consecutive nights,” adding an estimate of six to seven hours. With STAM, GPT-5 correctly answers approximately three to four hours per night in three rank-ordered and three chronological draws. This illustrates a temporal-selection error even when the relevant update is available.

Qwen3-4B on MIMIC-QA: temporal gains without truncation. We evaluate admissions from the original training split that were unused for zero-shot configuration selection. We use the original STAM configuration without the fine-tuned modules. STAM uses a 1,024-word evidence budget fixed before this run, and both arms use the Qwen3-4B reader.

Temporal-question analysisFull ContextSTAMGain [95% CI]
Preregistered: 847 questions, 79 admissions57.1861.28+4.10+4.10 [+1.53,+6.84][+1.53, +6.84]
Complete raw record fits: 792 questions, 73 admissions59.3261.64+2.32+2.32 [+0.43,+4.22][+0.43, +4.22]

Scores are Token-F1. Admission-level p-values are p=.0026p = .0026 and p=.019p = .019.

ClinicalBench provides another compact-reader result without raw-record truncation: on sequence questions, Qwen3-4B scores 47.5% with STAM versus 20.0% with Full Context (p=.003p = .003; Table 2(a)). These results are relevant to deployments that use compact local readers.

Traced example 3: the observed record fits completely. At this question, MMB persona 4’s record, covering sessions 1–30 and approximately 172K tokens, fits the window without truncation. Walking tolerance declines from approximately 600 m to 150 m, and then to “only about a dozen meters” in the latest observed session. Asked for the latest level, Qwen3-4B with Full Context answers with the previous 150 m value. With STAM’s memory, the same reader correctly identifies the latest decline.

Together, these results show where memory adds value over Full Context: it preserves evidence lost to the input window and can improve temporal answering with compact readers even when the observed record fits.

Q1 / W2. Why were MedCache, StateMem, and A-TMA not included?

We agree that these are important related methods. We could not identify publicly available implementations and artifacts sufficient for faithful reproduction under our evaluation settings. To address this limitation, we implemented StateMem based on its published description and additionally evaluated STAM on LongHealth, a public benchmark also used by MedCache.

StateMem: controlled comparison. Our reimplementation follows StateMem’s procedure of passing all active memories to the encoder at each turn (Fan et al., Section 5.1). With a Qwen3-4B writer and a 131,072-token limit, the input exceeded the context limit on all five MMB personas and five of twelve MedLoCoMo patients. StateMem proposes retrieving a subset of memories as an alternative, but does not evaluate this setting. We therefore evaluate variants retrieving K=48K=48 active memories on both benchmarks and K=200K=200 on MMB.

Both methods use the same Qwen3-4B writer and reader, three answer draws per question, and identical evaluation settings. On MedLoCoMo, both methods receive supporting excerpts from the original dialogue.

AuthorsOpenReview ↗

Response to Reviewer WaXT (Part 3/4): Baseline Results and Query Latency

Benchmark and StateMem configurationSTAM minus StateMem [95% CI]
MMB, K=48K = 48+1.03+1.03 [−3.06,+4.95][-3.06, +4.95]
MMB, K=200K = 200−1.06-1.06 [−5.12,+3.30][-5.12, +3.30]
MedLoCoMo, K=48K = 48, with source excerpts+1.78+1.78 [−1.40,+4.85][-1.40, +4.85]

Estimated write FLOPs vary by configuration. Relative to STAM, StateMem requires 2.07× the write FLOPs on MedLoCoMo (K=48K=48), and 3.8× (K=200K=200) or 0.92× (K=48K=48) on MMB.

A key methodological distinction is access to historical evidence. StateMem retains superseded units for auditability but does not use them for answer generation. STAM selectively serves historical evidence for questions about prior treatments and trajectories. The matched ACTIVE-only control in Part 1 shows that historical access improves MMB accuracy within STAM for both readers.

A-TMA: identifying affected memories. STAM combines semantic retrieval with typed clinical relations, including treatment for and monitoring for, to identify memories potentially affected by new evidence. This captures dependencies between clinical assertions beyond direct replacements. The base STAM configuration uses pretrained write modules without task-specific fine-tuning.

A-TMA uses a trained Sentry gate to identify potentially conflicting memory pairs from host retrieval and existing state links, followed by a separately trained Judge model (Shi et al., Section 4.3). Unlike A-TMA, STAM's base write path does not require task-specific training. We could not locate A-TMA's trained checkpoints for a faithful empirical comparison.

Effect of clinical relations on candidate discovery. On the original Qwen3-1.7B MMB memory store, adding relation-based discovery improves two measures over semantic-only retrieval at the same candidate budget (B=48B=48):

  • Impact ceiling (whether a superseded memory is retrieved for updating) increases by 3.99 points, 95% CI +0.64,+7.01+0.64, +7.01, Holm-adjusted p=.034p = .034.
  • Cascade discovery increases by 4.60 points, CI +0.71,+8.45+0.71, +8.45, Holm-adjusted p=.034p = .034, measuring retrieval of memories linked to earlier triggering events. We observe similar impact-ceiling gains on separately constructed stores, using automatically identified supersession chains: +4.06 points on MMB personas 1–5 (95% CI [+2.34,+5.76][+2.34, +5.76], Holm-adjusted p=.0002p=.0002) and +3.50 points on personas 6–12 (95% CI [+1.32,+5.84][+1.32, +5.84], Holm-adjusted p=.0016p=.0016).

These results support the contribution of clinical relations to candidate discovery within STAM, rather than establishing superiority over A-TMA.

MedCache: design comparison and LongHealth results. MedCache maintains temporally valid clinical facts in specialty-specific memories and selects relevant evidence at query time. STAM combines clinical impact discovery and write-time state updates with selective access to retained history.

On LongHealth, we use STAM’s original write configuration, with a Qwen3-1.7B writer and top-20 serving, together with MedCache’s Qwen3.6-35B-A3B reader, greedy decoding, and the LongHealth prompt.

On 400 questions, STAM scores 63.5%, CI 58.7,68.158.7, 68.1, compared with MedCache’s reported 44.0%. We did not rerun MedCache. Our Full Context calibration run scores 6.3 points above MedCache’s reported Full Context value, indicating a setup difference. Thus, the published MedCache result serves as a reference, not a controlled comparison.

We will include these comparisons and their reproducible configurations in the revision, distinguishing measured accuracy and cost trade-offs from methodological differences.

Q2. Can efficiency against Full Context include write-time cost?

Yes. Appendix G.7 reports memory-construction cost. We extend this analysis to include query latency, total write-and-read cost, and the effect of prefix caching.

End-to-end query latency. On MMB, we measure query latency for bounded STAM, plain cosine retrieval, and Full Context using Qwen3-4B-Instruct on two A100 40GB GPUs. All configurations use the same server, with requests processed sequentially after warm-up. We include CPU retrieval and prompt-preparation overhead, measured separately over questions: 28.4 ms for STAM and 23.4 ms for plain cosine retrieval.

Median latencySTAMPlain cosineFull Context
Question to first token, 60 questions0.236 s0.205 s64.07 s
Question to completed answer, 20 questions0.319 s0.278 s63.98 s
AuthorsOpenReview ↗

Response to Reviewer WaXT (Part 4/4): Read-Time and Construction Costs

The rows use different question sets. On the 20 questions in the second row, Full Context’s median time to first token is 63.48 s. The smallest observed per-question speed-ups are 18× to first token and 7.8× to completed answer. Full Context prompts contain approximately 256K tokens at the median.

In separate experiments measuring reader latency without prefix caching, Full Context's median time to first token is 9× that of STAM on MedLoCoMo, 16× on ClinicalBench, 64× on MIMIC-QA, and 352× on MMB. These experiments use Qwen3-4B on A100 40GB GPUs for the first two benchmarks and H200 GPUs for the latter two. The MMB result is measured on a subset using the H200 at full power. Across the 496-question MMB replay, 329 Full Context prompts require truncation.

Cost including memory construction. We replay the recorded write calls used to build the published Qwen3-1.7B MMB memory stores. Table 29(a) reports construction times of 444–595 seconds for representative records using one otherwise idle GPU. We additionally estimate GPU time at different concurrency levels using seeded replays covering 5–20% of calls at each write stage.

On an H200 capped at 315 W, estimated construction cost is 244 GPU-seconds per persona with 64 concurrent calls, or 298 GPU-seconds with 16 concurrent calls. Read latency is measured on the same GPU and at the same power setting, with one request at a time.

We model a patient record growing one session at a time, accounting for each session's write cost and one subsequent read. We estimate Full Context's read cost as a function of record length using measured latency. At write concurrency 64:

Full Context serving conditionQuestion from which STAM's cumulative cost stays lower
Without prefix caching11
With a per-patient prefix cache37

All five personas reach these break-even points. By the end of the modeled schedule, STAM's total GPU time across the five personas is approximately 5% of uncached Full Context.

For a fixed record, a separate calculation estimates a break-even of 4.9 questions per persona, or 6.2 with full-power reads. Assuming uncached Full Context prefill reaches the GPU's peak FLOP throughput increases this estimate to 14.8 questions per persona. These estimates remain below the benchmark's approximately 99 questions per persona.

Why disk-based ANN does not reduce Full Context's reader cost. Index storage and the reader's KV cache are different resources. For the original Qwen3-4B MMB configuration, estimated KV-cache memory is approximately 29.5 GiB for an average Full Context request versus 0.6 GiB for STAM.

The published MMB memory bank contains 18,905 vectors. At 384 dimensions and four bytes per dimension, these require approximately 28 MiB, excluding text and index overhead. In a separate microbenchmark, exact search over 33,127 vectors takes 0.3 ms.

Storing vectors on disk changes index storage but does not reduce the tokens processed by a reader given the full record. Using an index to retrieve top-K raw chunks instead is a retrieval approach, represented by our Flat RAG baseline. Under approximately matched context lengths, STAM outperforms Flat RAG on MIMIC-QA by 7.15 Token-F1.

STAM also updates its memory incrementally as new information arrives. Our construction-inclusive analysis accounts for the cost of these updates and subsequent reads.

Prefix caching changes the trade-off. Prefix caching can reduce Full Context's cost when the same patient record is queried repeatedly. When questions are grouped by patient record, cache hit rates reach approximately 90–94% on the three shorter-record benchmarks. When questions are interleaved across records, cache hit rates fall to 0.1–17% under the tested cache capacities.

Keeping each patient's prefix cached requires an estimated 2.2–12.6 GiB of KV memory per patient on those benchmarks and up to 34.5 GiB on MMB, for the tested KV representation. In a separate 28-query MMB replay, 21 records exceed the window; cache hits are 0.03%, and Full Context’s median TTFT is 64.4 s. As these records grow, oldest-first truncation shifts the retained prefix.

These results suggest that STAM is most efficient when repeated questions over long, evolving records amortize construction and reduce serving cost. For shorter records, infrequent questions, or high prefix-cache reuse, Full Context can remain cheaper. We will include these measurements and the conditions under which each approach is more efficient in the revision.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.