Large Language Models (LLMs) encode extensive medical knowledge but struggle to apply it reliably to longitudinal patient trajectories, where evolving clinical states, irregular timing, and heterogeneous events degrade performance over time. Existing adaptation strategies rely on fine-tuning or retrieval-based augmentation, which introduce computational overhead, privacy constraints, or instability under long contexts. We introduce TRACE (Temporal Reasoning via Agentic Context Evolution), a framework that enables temporal clinical reasoning with frozen LLMs by explicitly structuring and maintaining context rather than extending context windows or updating parameters. TRACE operates over a dual-memory architecture consisting of a static Global Protocol encoding institutional clinical rules and a dynamic Individual Protocol tracking patient-specific state. Four agentic components, Router, Reasoner, Auditor, and Steward, coordinate over this structured memory to support temporal inference and state evolution. The framework maintains bounded inference cost via structured state compression and selectively audits safety-critical clinical decisions. Evaluated on longitudinal clinical event streams from MIMIC-IV, TRACE significantly improves next-event prediction accuracy, protocol adherence, and clinical safety over long-context and retrieval-augmented baselines, while producing interpretable and auditable reasoning traces.
翻译:大型语言模型(LLMs)编码了广泛的医学知识,但难以可靠地将其应用于纵向患者轨迹,其中演变的临床状态、不规则的时间间隔以及异质性事件会随时间推移降低模型性能。现有的适应策略依赖于微调或基于检索的增强方法,这些方法在长上下文场景下会引入计算开销、隐私限制或不稳定性。我们提出了TRACE(基于智能体上下文演化的时序推理),这是一个无需扩展上下文窗口或更新参数,而是通过显式构建和维护上下文来实现冻结LLMs进行时序临床推理的框架。TRACE运行于一个双记忆架构之上,该架构包含编码机构临床规则的静态全局协议和追踪患者特定状态的动态个体协议。四个智能体组件——路由器、推理器、审计员和管理员——在此结构化记忆上进行协调,以支持时序推理和状态演化。该框架通过结构化状态压缩保持有界的推理成本,并选择性审计安全关键的临床决策。在MIMIC-IV的纵向临床事件流上进行评估,TRACE在下一个事件预测准确性、协议遵循度和临床安全性方面显著优于长上下文和检索增强基线,同时产生可解释且可审计的推理轨迹。