REINS: A Self-Evolving Agent Harness for Real-Time Trajectory Planning
Agent harnesses -- runtime scaffolds that wrap an LLM's reasoning loop with tool dispatch, verification, and persistent memory -- have become the standard substrate for deploying LLMs as autonomous agents, as demonstrated by Claude Code and Codex in software engineering. In trajectory planning, however, this paradigm has not taken hold: existing LLM-based trajectory planning methods either keep the LLM in the decision loop, exceeding the millisecond-level control budget, or offload it to offline rules or training-time supervision -- leaving the runtime planner non-evolving.
From the abstract. Our summary is in progress.
Full paper
REINS: A Self-Evolving Agent Harness for Real-Time Trajectory Planning
Published under CC BY 4.0. Reproduced with attribution; original at arXiv:2611.10748 (PDF).
Abstract
Agent harnesses—runtime scaffolds that wrap an LLM’s reasoning loop with tool dispatch, verification, and persistent memory—have become the standard substrate for deploying LLMs as autonomous agents, as demonstrated by Claude Code and Codex in software engineering. In trajectory planning, however, this paradigm has not taken hold: existing LLM-based trajectory planning methods either keep the LLM in the decision loop, exceeding the millisecond-level control budget, or offload it to offline rules or training-time supervision—leaving the runtime planner non-evolving. Intermediate hybrids still lack the verification-and-consolidation loop that makes harnesses reliable. We ask: what runtime harness would let an LLM planner meet real-time constraints while self-evolving into a deployable one? We propose REINS, a harness built on three LLM–planner couplings: LLM outputs are (i) grounded to a learned variable-level dynamics model, (ii) verified via calibrated predicates and forward rollout, and (iii) consolidated into an indexed rule memory that serves future scenes in \mathcal{O}(\log n) without re-invoking the LLM. The harness closes a self-evolution loop: familiar scenes resolve by memory lookup; novel scenes invoke the LLM, whose verified outputs enrich the memory. Without modifying LLM weights, REINS attains 98%+ compliance, nearly 50% collision reduction, and 1.9–4.6 ms latency on simulated and real-world benchmarks at the tactical decision layer, with LLM invocation rate monotonically declining as memory matures. Code: https://github.com/ZhihongCui/REINS.
†
1 Introduction
Trajectory planning is the safety-critical core of autonomous driving: each decision must respect traffic rules, anticipate other agents, and complete within a millisecond-level control budget (e.g., 50 ms at 20 Hz) (Zhang et al., 2021a; Falcone et al., 2007; Lenz et al., 2016; Li et al., 2024b; Montgomery, 1983). Recent work shows that large language models (LLMs) bring rich semantic priors over traffic norms, agent intent, and safety reasoning that classical planners lack (Manas et al., 2025; Fu et al., 2024; Mao et al., 2024; Sha et al., 2023; Cai et al., 2024; Li et al., 2024a), yet integrating their reasoning into the runtime loop is bottlenecked: each LLM query takes seconds—orders of magnitude over the control budget—and naive integration leaves the planner either too slow to act or unable to adapt as deployment proceeds.
This is precisely the kind of deployment problem—running a stochastic LLM inside a low-latency, safety-sensitive loop—that the agent harness paradigm has recently addressed in software engineering. An agent harness wraps the LLM with a thin runtime layer of tool dispatch, intermediate-result verification, persistent memory, and safety enforcement—as exemplified by systems like Claude Code, Codex, and Cursor-Agent. On Terminal-Bench (Merrill et al., 2026), harness design has emerged as a primary driver of ranking, with automatic harness optimization surpassing hand-engineered baselines (Lee et al., 2026). Trajectory planning, however, is a sharp test of the paradigm: its millisecond-level control budget is much tighter than the seconds-to-minutes scale at which coding harnesses operate, and the safety stakes are higher. In this regime, the harness’s generic functions specialize into three couplings between LLM and planner, illustrated in Figure 1: when an LLM suggests “keep a safe distance” in a car-following scene, the runtime must (i) ground the suggestion to physical state variables (TTC, THW, DHW), (ii) verify the resulting maneuver via forward rollout over a multi-step horizon, and (iii) consolidate the verified maneuver into an indexed rule memory.
Existing LLM-based trajectory planning methods span two extremes plus intermediate hybrids, none of which constitutes a harness in the above sense: runtime invocation methods keep the LLM in the decision loop but exceed the millisecond-level budget by orders of magnitude (Fu et al., 2024; Mao et al., 2024; Sha et al., 2023); offline extraction methods discard the LLM at runtime and freeze the planner against scenarios the offline corpus did not anticipate (Li et al., 2024a; Tang et al., 2025); and hybrid designs partially orchestrate the LLM at runtime but stop short of a full harness, lacking explicit verification of LLM commitments and consolidation of verified ones into reusable structure (Cui et al., 2026; Zhang et al., 2025). Across all three, the LLM’s reasoning is either too slow to act on or too detached from the loop to evolve with deployment.
This raises our central question: what runtime harness would let an LLM planner satisfy real-time constraints while self-evolving into a deployable one? Each of the three couplings is non-trivial under real-time control: grounding requires bridging natural-language commitments to the planner’s threshold semantics (Wang et al., 2025; Zhai et al., 2025); verification must catch stochastic, occasionally unsafe LLM outputs before they reach control (Manas et al., 2025; Zeng et al., 2025); and consolidation must escape per-call LLM latency (Fu et al., 2024; Mao et al., 2024) via a memory pattern emerging in agentic AI (Wang et al., 2023; Zhao et al., 2024; Ma et al., 2024) but not yet transferred to real-time planning. The three are also jointly necessary: without grounding, verification has nothing to check; without verification, consolidation stores unverified content; without consolidation, every scene re-pays the LLM latency cost. When all three are addressed, a self-evolution loop emerges: familiar scenes resolve from the consolidated memory in \mathcal{O}(\log n) time, novel scenes invoke the LLM, whose verified outputs enrich the memory, and reliance on the LLM decreases monotonically as memory matures, with no LLM weight update.
We propose REINS, a concrete realization of this harness pattern, instantiated for trajectory planning in driving, that addresses each coupling as follows. Grounding. We learn a world dynamics model over a factored variable space, fusing LLM-derived semantic priors with data-driven dependency discovery. Group-weighted ridge regression selects each variable’s parents, and a per-variable Transformer predicts its evolution under the discovered graph. Every LLM output can then be projected onto this variable space and rolled out under the learned dynamics. Verification. We compile each LLM-proposed maneuver into calibrated predicates with thresholds derived from data (z-score, quantile, or absolute). Predicates are evaluated against the rollout produced by the dynamics model, and only commitments whose predicted trajectory satisfies all guards are released to control. Hallucinated or unsafe commitments are filtered before any maneuver is issued. Consolidation. We persist verified commitments in an indexed rule memory backed by a graph database, keyed by the grounding variables that triggered them. At runtime, parameterized graph queries retrieve scene-relevant rules in \mathcal{O}(\log n) time without any LLM call. Recurring scenes are thus served by memory lookup, and the LLM is invoked only on a miss. Together, the three close the self-evolution loop: at each scene the planner first consults the memory; on a miss the LLM is invoked, its output grounded against the dynamics model, verified by rollout, and—if it passes—committed to memory for the next encounter. We provide an empirical demonstration that, under such a harness, an LLM planner monotonically reduces its own LLM-call rate while preserving safety and compliance. Our contributions can be summarized as:
- We extend the agent-harness paradigm to real-time trajectory planning, identifying three couplings—grounding, verification, consolidation—any such harness must enforce, and instantiate it for driving; only the variable schema and the action space are domain-specific (Appendix D.1).
- We design REINS, a harness that instantiates the three couplings via a learned world dynamics model, calibrated predicates with rollout verification, and an indexed rule memory.
- We provide the first empirical evidence of self-evolution in real-time LLM trajectory planning: LLM invocation rate decreases monotonically over deployment with no LLM weight update.
- We evaluate REINS on simulated and real-world driving benchmarks at the tactical decision layer, achieving 98%+ compliance, nearly 50% collision reduction, and 1.9–4.6 ms planning latency—well within the real-time control budget.
2 Related Work
LLM-Based Trajectory Planning. Recent LLM-based trajectory planners fall along three lines, each realizing some couplings while leaving others open. Runtime invocation methods keep the LLM in the decision loop. DiLu (Fu et al., 2024) pairs LLM reasoning with an experience-replay memory; Agent-Driver (Mao et al., 2024) treats the LLM as an orchestrator over perception and planning tools; LanguageMPC (Sha et al., 2023) feeds chain-of-thought outputs into MPC. These systems gain semantic flexibility, but each LLM query takes seconds, and any output that reaches the planner is implicitly trusted, lacking the calibrated checks proposed for stochastic LLM outputs in safety-critical settings (Manas et al., 2025; Zeng et al., 2025).
Offline extraction methods sit at the opposite end. LLaDA (Li et al., 2024a) extracts location-specific rules from driver handbooks, DriReg (Cai et al., 2024) retrieves regulatory text via RAG, and Plan-R1 (Tang et al., 2025) distills LLM-shaped rewards into a reinforcement-learning policy. Removing the LLM at runtime buys real-time inference, but the planner becomes static, unable to consolidate new commitments against learned driving dynamics (Wang et al., 2025; Zhai et al., 2025) or to adapt to scenarios the offline corpus did not anticipate.
Hybrid designs partially orchestrate the LLM at runtime. C-TRAIL (Cui et al., 2026) runs a closed-loop Recall–Plan–Update cycle with trust-weighted MCTS injection; LeAD (Zhang et al., 2025) pairs an end-to-end planner with a redundant LLM reasoning track. These improve over either extreme but lack explicit verification of LLM commitments and consolidation of verified ones into reusable structure; none grounds, verifies, and consolidates LLM outputs jointly under a real-time harness.
Agent Harnesses for LLM Deployment. Outside trajectory planning, the deployment of LLMs into real-world tasks has converged on the agent harness pattern: a thin runtime layer that wraps the LLM with tool dispatch, intermediate-result verification, persistent memory, and safety enforcement. In autonomous coding, systems such as Claude Code and Codex turn general-purpose LLMs into reliable software engineers, and harness design has become a primary driver of ranking on Terminal-Bench (Merrill et al., 2026; Lee et al., 2026). In open-ended decision-making, Voyager (Wang et al., 2023) accumulates a skill library of executable code through curiosity-driven exploration; Eureka (Ma et al., 2024) iteratively refines reward functions by evolutionary search over LLM proposals; ExpeL (Zhao et al., 2024) distills task-specific experience into a retrievable knowledge base. These harnesses share three structural elements with REINS—grounding into a domain primitive space, verification of LLM outputs, and persistent reuse of verified ones—but none operate under millisecond real-time budgets nor expose their LLMs to the safety-critical constraints.
3 Preliminaries
We formalize the harness’s primitives: a factored variable space (Section 3.1); a world dynamics model for grounding (Section 3.2); an executable rule representation for verification and consolidation (Section 3.3); and the problem definition (Section 3.4). Full variable lists, template specifications, and the macro-group dependency enumeration appear in Appendix A.
3.1 Driving Environment
Definition 3.1 (Factored Variable Structure).
A factored variable structure is (\mathcal{X},\mathcal{H},\mathcal{E}_{\mathcal{G}},\mathcal{E}_{\mathcal{H}}): \mathcal{X}=\{X_{1},\ldots,X_{d}\} are observable variables (e.g., TTC, THW, DHW, ego_speed, lead_speed, road_friction); \mathcal{H}=\{\textsc{Env},\textsc{Traffic},\textsc{Ego},\textsc{Action},\textsc{Outcome}\} groups them by semantic role (Chen et al., 2025); \mathcal{E}_{\mathcal{G}}\subseteq\mathcal{X}\times\mathcal{H} assigns each variable to a group; and \mathcal{E}_{\mathcal{H}}\subseteq\mathcal{H}\times\mathcal{H} specifies permissible group-level dependencies (Eq. 10 in Appendix A.1).
Definition 3.2 (State and Action Spaces).
The state s_{t}\in\mathcal{S}=\prod_{i}\mathrm{dom}(X_{i}) is a complete variable assignment. The action space \mathcal{A}=\{\texttt{LANE\_LEFT},\texttt{LANE\_RIGHT},\texttt{FASTER},\texttt{SLOWER},\texttt{IDLE}\} is a finite set of discrete meta-actions for the ego vehicle.
The meta-actions are the interface of the tactical (behavior-planning) layer in the standard stack decomposition (Paden et al., 2016); continuous low-level controllers execute them, and all safety reasoning below (TTC, headway, accelerations) remains continuous.
3.2 World Dynamics Model
Definition 3.3 (Dependency Graph and Dynamics).
A dependency graph is a weighted DAG \mathcal{G}=(\mathcal{X},\mathcal{E},w) with w:\mathcal{E}\to\mathbb{R}, where edges (X_{i},X_{j})\in\mathcal{E} are admissible only if (h(X_{i}),h(X_{j}))\in\mathcal{E}_{\mathcal{H}} (Giamattei et al., 2024). A dynamics function set \mathcal{F}=\{f_{i}\}_{i=1}^{d} predicts each variable from its parents over a temporal lag L (Peters et al., 2017):
\hat{X}_{i}^{t+1}=f_{i}\big(\mathrm{Pa}(X_{i})^{t-L+1:t}\big),\quad\mathrm{Pa}(X_{i})=\{X_{j}\mid(X_{j},X_{i})\in\mathcal{E}\}.An H-step rollout from s_{t} under (a_{t},\ldots,a_{t+H-1}) yields \hat{\xi}=(\hat{s}_{t+1},\ldots,\hat{s}_{t+H}).
3.3 Rule Representation
Definition 3.4 (Predicate).
A predicate is a Boolean function p(s)=\mathbb{I}[s[X_{i}]\prec\tau] with comparison operator \prec\in\{<,>,\leq,\geq\} and threshold \tau\in\mathbb{R}.
TTC and THW guards are the surrogate safety measures of traffic engineering (Gettman and Head, 2003); their calibrated thresholds act as RSS-style safe-distance bounds (Shalev-Shwartz et al., 2017).
Definition 3.5 (Rule Template).
A rule template T specifies how predicates compose (Manas et al., 2024). We use seven templates: IF-THEN, AND-THEN, THRESHOLD, PRIORITY, MULTI-ACTION, WEIGHTED-ACTION, and TEMPORAL-CHAIN (specifications and examples in Appendix A.2).
Definition 3.6 (Executable Rule).
An executable rule is a tuple r=(T,\mathcal{P}_{r},a_{r},c_{r}) with template T, guard predicates \mathcal{P}_{r}, recommended action a_{r}\in\mathcal{A}, and confidence c_{r}\in[0,1]. Activation requires all guards to hold:
\mathrm{Exec}(r,s_{t})=\bigwedge_{p\in\mathcal{P}_{r}}p(s_{t}).3.4 Problem Definition
Definition 3.7 (Self-Evolving Agent Harness for Trajectory Planning).
Let \mathcal{D}=\{(s_{t},a_{t},s_{t+1})\} be a driving dataset and \mathcal{M} a pre-trained LLM. The harness problem is to construct \langle\hat{\mathcal{G}},\hat{\mathcal{F}},\mathcal{R},\pi\rangle where \hat{\mathcal{G}},\hat{\mathcal{F}} are learned from \mathcal{D} with priors from \mathcal{M} (Def. 3.3), \mathcal{R} is an indexed rule memory compiled offline from \mathcal{M} (Def. 3.6), and \pi:\mathcal{S}\to\mathcal{A} is a policy that, at each s_{t}, retrieves \mathcal{R}_{t}=\mathrm{Retrieve}(s_{t},\mathcal{R})\subseteq\mathcal{R} and proceeds as follows:
- (hit) if
\mathcal{R}_{t}\neq\emptyset,\piscores actions over\mathcal{R}_{t}and verifies them by rollout under\hat{\mathcal{F}}within a real-time budget; - (miss) otherwise,
\mathcal{M}proposes a candidate commitment, which is grounded via(\hat{\mathcal{G}},\hat{\mathcal{F}})and verified by rollout; if all predicates pass, the commitment is compiled into a rulerand\mathcal{R}\leftarrow\mathcal{R}\cup\{r\}.
The parameters of \mathcal{M} remain unchanged, and \mathcal{R} is monotone non-decreasing; under stationarity of the scene distribution, the per-scene LLM invocation rate \Pr[\mathcal{R}_{t}=\emptyset] is non-increasing.
4 Methodology
\hat{\mathcal{G}},\hat{\mathcal{F}} and compile rules into initial memory \mathcal{R}_{0}. Phase 2 (online): per-scene retrieval and rollout-based verification produce control; on a miss, the LLM proposes a rule that is grounded, verified, and written back to \mathcal{R}, closing the self-evolution loop without any LLM weight update.REINS realizes the harness as a two-phase system (Figure 2). Offline Preparation (Section 4.1) prepares the world dynamics \hat{\mathcal{G}},\hat{\mathcal{F}} for grounding and an initial rule memory \mathcal{R}_{0} for offline consolidation. Online Runtime (Section 4.2) executes a per-scene loop: rule-guided planning performs retrieval, scoring, and verification over \mathcal{R}, and online rule acquisition handles memory misses by querying \mathcal{M} and writing verified rules back to \mathcal{R}, closing the self-evolution loop.
4.1 Offline Preparation
4.1.1 World Dynamics Learning
This module realizes grounding: we jointly learn dependency graph \hat{\mathcal{G}} and dynamics functions \hat{\mathcal{F}} by combining LLM semantic priors with data-driven structure discovery. The full derivation and the dynamics loss are in Appendix A.4.1.
Dependency Graph. The LLM provides edge confidence \pi_{ij}\in[0,1] for each candidate edge X_{j}\to X_{i} (Appendix A.5); combined with macro-group constraints (Eq. 10), the unified prior is \tilde{\pi}_{ij}=\alpha\,\pi_{ij}+(1-\alpha)\,\mathbb{I}\{(h(X_{j}),h(X_{i}))\in\mathcal{E}_{\mathcal{H}}\}. For each X_{i}, prior-guided ridge regression (Hoerl and Kennard, 1970) predicts its value from lagged neighbors with adaptive penalty \lambda_{ij}=\lambda_{0}(1-\tilde{\pi}_{ij})^{\rho}, so high-prior edges are weakly regularized:
\hat{\mathbf{w}}_{i}=\arg\min_{\mathbf{w}}\sum_{t=L}^{N}\Big(X_{i}^{t}-\textstyle\sum_{j\neq i,\ell}w_{j\ell}X_{j}^{t-\ell}\Big)^{2}+\sum_{j\neq i}\lambda_{ij}\|\mathbf{w}_{j}\|_{2}^{2}.\mathrm{Pa}(X_{i}) retains the top-K variables by \sum_{\ell}|\hat{w}_{j\ell}|, yielding \hat{\mathcal{E}} and weights \hat{w}(X_{j},X_{i})=\sum_{\ell}|\hat{w}_{j\ell}|.
Dynamics Functions. Given \hat{\mathcal{G}}, each f_{i} is a multi-head Transformer (Vaswani et al., 2017) trained to predict X_{i}^{t+1} from \mathrm{Pa}(X_{i})^{t-L+1:t} via mean squared error (loss form in Eq. 14). Training curves and hyperparameters are in Appendix C.1.
4.1.2 Rule Compilation
This module realizes offline consolidation: compiling LLM knowledge into executable rules. Full equations and per-step prose are in Appendix A.4.2.
Rule Structure Generation. For each edge (X_{j},X_{i})\in\hat{\mathcal{E}}, the LLM generates a rule r=(T,\mathcal{P}_{r},a_{r},c_{r}) (Eq. 15) with template T (Def. 3.5), guard predicates \mathcal{P}_{r} with symbolic thresholds, recommended action a_{r}\in\mathcal{A}, and confidence c_{r} derived from edge weight \hat{w}(X_{j},X_{i}) (prompts in Appendix A.5).
Threshold Calibration. Each predicate’s threshold \tau_{i} is calibrated from \mathcal{D} in three forms (Luo et al., 2024)—z-score \mu_{i}+\zeta\sigma_{i}, quantile Q_{i}(\zeta), or absolute constant \tau_{0}—and the comparison operator \prec is selected to maximize separability of safety outcome y\in\{0,1\}:
\prec^{*}=\arg\max_{\prec\in\{<,>\}}\big|\mathbb{E}[y\mid X_{i}\prec\tau_{i}]-\mathbb{E}[y\mid X_{i}\not\prec\tau_{i}]\big|.Rule activation then follows Eq. 2.
Graph Database Storage. Compiled rules are stored in a Neo4j graph database (Webber, 2012) with rule nodes connected to variable nodes via TRIGGERS (input) and AFFECTS (output) edges, enabling O(\log|\mathcal{R}|) retrieval. The full schema (Figure 3) is in Appendix A.4.2; database statistics are in Appendix C.7.1.
4.2 Online Runtime
4.2.1 Rule-Guided Planning
This module realizes the runtime planning loop of Def. 3.7—retrieval, scoring, and verification (details in Appendix A.4.3).
Scene-Aware Retrieval. Given s_{t}, active variables \{X_{i}\} trigger parameterized Cypher queries (Francis et al., 2018) generated by the LLM (read-only, schema-constrained; Appendix A.5). The retrieval map G:(\{X_{i}\},K)\mapsto\mathcal{R}_{t}\subseteq\mathcal{R} (Eq. 17) returns up to K rules ranked by confidence, restricted to triggers whose dependency direction respects the macro-group constraints.
Action Scoring. For each r\in\mathcal{R}_{t} activated via Eq. 2, a Transformer-based scorer (Liang et al., 2022) produces relevance S_{\text{rel}}(r,s_{t})\in[0,1] and action preference S_{\text{act}}(r,s_{t},a), yielding combined score f(r,a\mid s_{t})=S_{\text{rel}}\cdot S_{\text{act}}\cdot c_{r} (Eqs. 18–19; training loss in Eq. 20). Multiple rules recommending action a, denoted \mathcal{R}_{t}(a)=\{r\in\mathcal{R}_{t}\mid a_{r}=a\}, are aggregated by noisy-OR:
P(a\mid s_{t})\;\propto\;1-\prod_{r\in\mathcal{R}_{t}(a)}\big(1-f(r,a\mid s_{t})\big).The full normalized form and argmax decoder are in Appendix A.4.3.
Trajectory Verification. The learned dynamics \hat{\mathcal{F}} verifies safety via forward rollout. For the top-M actions ranked by P(a\mid s_{t}), we predict H-step trajectories \hat{\xi}(a)=(\hat{s}_{t+1},\ldots,\hat{s}_{t+H}) via \hat{s}_{t+h+1}=\Phi(\hat{s}_{t+h},a;\hat{\mathcal{G}},\hat{\mathcal{F}}) (Eq. 22), and select a^{\star}_{t}=\arg\max_{a\in\mathcal{A}_{M}}J(\hat{\xi}(a)), where J penalizes collisions, rule violations, and control effort (Appendix B.2); the first control is executed in receding-horizon (Zhang et al., 2021b).
4.2.2 Online Rule Acquisition
This module realizes Def. 3.7’s miss-handling path through four steps (full equations and the monotonicity argument in Appendix A.4.4).
Miss Detection. We operationalize the miss criterion (\mathcal{R}_{t}=\emptyset) with an additional confidence guard against weakly supported matches:
\mathrm{Miss}(s_{t})\;=\;\mathbb{I}\!\left[\mathcal{R}_{t}=\emptyset\right]\;\vee\;\mathbb{I}\!\left[\max_{r\in\mathcal{R}_{t},\,a\in\mathcal{A}}f(r,a\mid s_{t})<\eta\right],with tuned threshold \eta\in(0,1).
Rule Proposal and Online Verification. On a miss, \mathcal{M} proposes \tilde{r}=(\tilde{T},\tilde{\mathcal{P}},\tilde{a},\tilde{c}) (Eq. 23) conforming to Defs. 3.4–3.5 (Appendix A.5). Symbolic thresholds in \tilde{\mathcal{P}} are calibrated on a sliding window \mathcal{D}_{t}^{W}=\{s_{t-W+1},\ldots,s_{t}\} so they track the current distribution. The harness then rolls out \tilde{a} from s_{t} under \hat{\mathcal{F}} and accepts \tilde{r} iff every predicate holds along the rollout:
\mathrm{Accept}(\tilde{r},s_{t})\;=\;\bigwedge_{p\in\tilde{\mathcal{P}}}\bigwedge_{h=1}^{H}p(\hat{s}_{t+h}).On rejection the planner falls back to \arg\max_{a}P(a\mid s_{t}) over \mathcal{R}_{t} if \mathcal{R}_{t}\neq\emptyset; otherwise the harness raises a human-takeover alert and executes the safest action under \hat{\mathcal{F}} by maximizing minimum lookahead TTC (Eq. 24 in Appendix A.4.4).
Memory Update. Accepted \tilde{r} is keyed by content hash \kappa(\tilde{r}):=\kappa(\tilde{T},\tilde{\mathcal{P}},\tilde{a}) and inserted into Neo4j; on collision, confidences are averaged instead of duplicating the node:
\mathcal{R}\;\longleftarrow\;\begin{cases}\mathcal{R}\cup\{\tilde{r}\}&\kappa(\tilde{r})\notin\mathrm{Keys}(\mathcal{R}),\\[2.0pt]
\mathcal{R}\text{ with }c_{r^{\prime}}\leftarrow\tfrac{1}{2}(c_{r^{\prime}}+\tilde{c})&\exists\,r^{\prime}\in\mathcal{R}:\kappa(r^{\prime})=\kappa(\tilde{r}).\end{cases}The collision-branch rationale (averaging vs. duplication, exclusion of \tilde{c} from \kappa) is in Appendix A.4.4.
Self-Evolution Properties. Eq. 8 structurally enforces |\mathcal{R}_{t+1}|\geq|\mathcal{R}_{t}| (memory monotonicity) and \theta_{\mathcal{M}}\equiv\theta_{\mathcal{M}}^{(0)} (no LLM update). Under stationarity of the scene distribution, the per-state miss rate is non-increasing as \mathcal{R} accumulates coverage:
|\mathcal{R}_{t+1}|\geq|\mathcal{R}_{t}|,\quad\Pr[\mathrm{Miss}(s_{t+1})]\leq\Pr[\mathrm{Miss}(s_{t})],\quad\theta_{\mathcal{M}}\equiv\theta_{\mathcal{M}}^{(0)},so the per-scene LLM invocation rate decays monotonically with \Pr[\mathrm{Miss}] (full argument in Appendix A.4.4; validated in Section 5.4).
5 Experiment
The main body reports overall comparison (Section 5.2), ablation (Section 5.3), self-evolution dynamics on Highway (Section 5.4), and a summary of the robustness, transfer, and scalability results. Appendices C and D report trajectory accuracy, sensitivity, extended self-evolution traces, a case study, the rule database, and the fairness and robustness studies.
5.1 Experiment Setting
Datasets and Protocols. We evaluate REINS on four highway-env (Leurent, 2018) scenarios—Highway, Merge, Roundabout, Intersection (100 steps at 5 Hz, 15 observable vehicles per episode)—and two drone-captured real-world datasets (Krajewski et al., 2018; Krajewski et al., 2020): highD (German highway, 4,237 vehicles, 578 lane changes) and rounD (German roundabouts, 2,156 vehicles, 423 yield/merge events). Surrounding vehicles in simulation are reactive (IDM car-following (Treiber et al., 2000) with MOBIL lane changes (Kesting et al., 2007)), so they brake, yield, and change lanes in response to the ego. The real-world datasets run in closed-loop replay: one recorded vehicle is controlled by the planner while the others follow their recorded trajectories, so these rows reflect human behavior rather than a simulator’s; a collision is registered when bounding boxes overlap or the ego leaves the drivable lane. A reactive-replay variant following the nuPlan protocol (Caesar et al., 2021) is in Appendix D.6. All methods observe clean factored variables; perception, tracking, and map errors lie outside the evaluated layer (Section 6).
Evaluation Metrics. Compl. (Rule Compliance) is the fraction of steps at which all active rules hold, measured for each method against its own executable rule set; an audit of all methods against REINS’s compiled set as a common reference leaves the ordering unchanged (Appendix D.2). RE (Risk-aware Efficiency) is task reward minus a TTC-based risk penalty. CR (Collision Rate) is the fraction of episodes with at least one contact among the 15 vehicles over 100 steps, an episode-level rate in deliberately stressed traffic. PE (Planning Efficiency) is the mean wall-clock ms of the synchronous action-selection computation per step for every method; for REINS it excludes the asynchronous rule-acquisition pipeline, profiled separately in Appendix D.8. TTC and THW, which underlie the guards and the RE penalty, are the surrogate safety measures of traffic engineering (Gettman and Head, 2003), and Compl. and CR echo the rule-conformance and collision outcomes reported in scenario-based safety assessment (Riedmaier et al., 2020). Results are averaged over five seeds; formal definitions in Appendix B.2.
Baselines. We compare with eight baselines covering the regimes from Section 2 plus classical anchors: (i) classical (MPC (Falcone et al., 2007), MCTS (Lenz et al., 2016)); (ii) runtime invocation (DriveSpeak (Cui et al., 2024)); (iii) offline extraction (LLaDA (Li et al., 2024a), DriReg (Cai et al., 2024), Plan-R1 (Tang et al., 2025)); (iv) symbolic/hybrid (PDDL (Guan et al., 2023; Liu et al., 2023), SymAgent (Liu et al., 2025)). All methods share the observation space, action space, episodes, and LLM backbone (GPT-4o, temperature 0); descriptions, the shared and unshared conditions, and a matched re-run of PDDL and DriReg over REINS’s vocabulary and calibration pipeline are in Appendices B.3 and D.2.
- Simulation
- Hig.
- Compl. (\uparrow)
- -
- -
- -
- -
- 0.9123
- 0.9452
- 0.9561
- 0.9717
- 0.9956
- RE (\uparrow)
- -6.0360
- -5.8537
- -5.5613
- -5.2311
- -4.7868
- -4.1282
- -3.8662
- -3.5623
- 0.5228
- CR (\downarrow,%)
- 38.28
- 35.51
- 14.27
- 16.76
- 25.93
- 21.76
- 16.52
- 12.83
- 5.67
- PE (\downarrow, ms)
- 5.8921
- 5.2995
- 2.4742
- 2.3591
- 4.9521
- 4.3127
- 3.9621
- 3.7391
- 2.4998
- Mer.
- Compl. (\uparrow)
- -
- -
- -
- -
- 0.9011
- 0.9382
- 0.9572
- 0.9641
- 0.9924
- RE (\uparrow)
- -5.5730
- -5.2621
- -5.3891
- -5.1890
- -4.7129
- -4.1067
- -3.5622
- -3.1023
- -0.0400
- CR (\downarrow,%)
- 35.62
- 22.84
- 27.91
- 23.64
- 21.52
- 20.56
- 16.83
- 14.78
- 6.86
- PE (\downarrow, ms)
- 5.2120
- 4.3615
- 1.7354
- 1.6526
- 3.8549
- 2.8122
- 2.5697
- 2.2418
- 1.8928
- Rou.
- Compl. (\uparrow)
- -
- -
- -
- -
- 0.8838
- 0.9129
- 0.9411
- 0.9568
- 0.9925
- RE (\uparrow)
- -7.6873
- -7.1069
- -6.7722
- -6.5113
- -6.4895
- -6.3457
- -6.2313
- -6.0256
- -0.5444
- CR (\downarrow,%)
- 39.19
- 36.63
- 24.27
- 21.62
- 23.84
- 25.13
- 24.74
- 18.57
- 9.01
- PE (\downarrow, ms)
- 8.2673
- 7.6541
- 4.2134
- 4.0267
- 5.3793
- 5.1682
- 5.0713
- 4.8621
- 3.6243
- Int.
- Compl. (\uparrow)
- -
- -
- -
- -
- 0.8789
- 0.9153
- 0.9274
- 0.9553
- 0.9838
- RE (\uparrow)
- -7.9740
- -7.5800
- -7.1345
- -7.0273
- -6.9792
- -6.7632
- -6.3314
- -6.0322
- -0.5747
- CR (\downarrow,%)
- 44.27
- 42.22
- 25.38
- 23.78
- 32.12
- 29.89
- 25.34
- 20.37
- 9.08
- PE (\downarrow, ms)
- 10.9324
- 9.3549
- 4.9653
- 4.7519
- 6.7682
- 6.2793
- 5.9932
- 5.5733
- 4.5807
- Real-world
- highD
- Compl. (\uparrow)
- -
- -
- -
- -
- 0.9078
- 0.9289
- 0.9423
- 0.9612
- 0.9867
- RE (\uparrow)
- -5.8234
- -5.5127
- -5.2891
- -5.0124
- -4.6523
- -4.2178
- -3.7856
- -3.4521
- 0.3847
- CR (\downarrow,%)
- 35.21
- 32.87
- 18.34
- 19.56
- 23.12
- 20.89
- 17.23
- 12.78
- 6.12
- PE (\downarrow, ms)
- 6.1234
- 5.5672
- 2.6123
- 2.4891
- 5.1234
- 4.5623
- 4.1234
- 3.8912
- 2.6234
- rounD
- Compl. (\uparrow)
- -
- -
- -
- -
- 0.8956
- 0.9187
- 0.9378
- 0.9534
- 0.9856
- RE (\uparrow)
- -7.4521
- -6.9834
- -6.5123
- -6.2478
- -6.1234
- -5.8912
- -5.6234
- -5.3178
- -0.4123
- CR (\downarrow,%)
- 41.23
- 38.56
- 25.34
- 23.12
- 26.78
- 24.23
- 20.89
- 18.47
- 9.45
- PE (\downarrow, ms)
- 8.5621
- 7.8923
- 4.3521
- 4.1234
- 5.6234
- 5.2178
- 4.8912
- 4.5623
- 3.8912
5.2 Performance Evaluation
Performance evaluation results are reported in Table 1, with trajectory accuracy analysis in Appendix C.2.
Effectiveness Analysis. (i) REINS beats all baselines, improving over Plan-R1 by 2.4%–3.6% Compl., 3.06–5.48 RE, and 49%–56% CR reduction—validating that grounding, verification, and consolidation act jointly. (ii) All methods incur higher CR on complex scenarios (Roundabout, Intersection) than structured ones (Highway, Merge); REINS degrades least, owing to context-aware retrieval. (iii) On highD and rounD, REINS maintains Compl. above 0.98 with 6.6–9.0-point CR reduction over Plan-R1, transferring to naturalistic driving without domain-specific tuning. (iv) Executable rule methods (PDDL, DriReg, SymAgent, Plan-R1) beat language-guided ones (DriveSpeak, LLaDA, with 22%–44% CR for ungrounded rules), yet their static thresholds and uniform activation still trail REINS’s data-driven calibration and variable-indexed retrieval; a matched re-run over REINS’s vocabulary and calibration narrows PDDL’s and DriReg’s CR by 3–5 points but leaves the gap intact (Appendix D.2). (v) Classical planners (MPC, MCTS) are fast but unsafe (CR 14%–28%); Plan-R1 is the best baseline but plateaus under uniform rule application.
Efficiency Analysis. REINS completes planning in 1.9–4.6 ms per step, up to 58% faster than runtime LLM baselines (DriveSpeak, LLaDA) and 15–33% faster than Plan-R1. Two factors contribute: (i) variable-indexed retrieval activates only 2–3 rules per step via O(\log|\mathcal{R}|) queries, and (ii) learned dynamics enable closed-form rollout without iterative LLM calls. PDDL makes no runtime LLM call either, yet re-grounds every precondition at each step (3.71 of its 4.95 ms on Highway; Appendix D.3), exactly the cost that indexed consolidation removes.
- Hig.
- Compl. (\uparrow)
- 0.9521
- 0.9628
- 0.9312
- 0.9845
- 0.9956
- RE (\uparrow)
- -1.9234
- -1.5390
- -2.4156
- -0.8921
- 0.5228
- CR (\downarrow,%)
- 8.47
- 8.26
- 11.23
- 8.12
- 5.67
- PE (\downarrow, ms)
- 2.9532
- 2.6831
- 2.5124
- 3.8921
- 2.4998
- Mer.
- Compl. (\uparrow)
- 0.9687
- 0.9738
- 0.9198
- 0.9812
- 0.9924
- RE (\uparrow)
- -1.5621
- -1.2619
- -2.1893
- -0.7234
- -0.0400
- CR (\downarrow,%)
- 9.23
- 9.08
- 12.87
- 8.89
- 6.86
- PE (\downarrow, ms)
- 2.6234
- 2.1832
- 1.9021
- 2.9834
- 1.8928
- Rou.
- Compl. (\uparrow)
- 0.9534
- 0.9611
- 0.9087
- 0.9756
- 0.9925
- RE (\uparrow)
- -2.3456
- -1.1783
- -3.1234
- -1.2134
- -0.5444
- CR (\downarrow,%)
- 12.34
- 11.84
- 15.89
- 11.23
- 9.01
- PE (\downarrow, ms)
- 4.1245
- 3.8011
- 3.6521
- 5.2134
- 3.6243
- Int.
- Compl. (\uparrow)
- 0.9456
- 0.9582
- 0.8923
- 0.9689
- 0.9838
- RE (\uparrow)
- -2.5678
- -1.9812
- -3.4521
- -1.3456
- -0.5747
- CR (\downarrow,%)
- 13.45
- 12.23
- 17.56
- 11.12
- 9.08
- PE (\downarrow, ms)
- 4.9521
- 4.7214
- 4.6234
- 6.1234
- 4.5807
5.3 Ablation Study
We conduct ablation experiments on all four simulated scenarios to evaluate component contributions. Table 2 reports results for four variants: (i) w/o World Model: replacing learned dynamics with constant-velocity propagation; (ii) w/o LLM Prior: using purely data-driven structure learning without semantic guidance; (iii) w/o Rule Generation: substituting LLM-generated rules with hand-crafted ones; (iv) w/o Retrieval: applying all rules uniformly without context-aware selection.
Removing the world dynamics model causes the largest safety degradation (CR +49%/+48% on Highway/Intersection), confirming multi-step prediction is essential. Without LLM priors, CR rises 31–46%, showing that semantic guidance regularizes dependency discovery beyond purely data-driven methods. Hand-crafted rules yield the largest compliance drop (0.9956\to0.9312 on Highway) and nearly double CR, exposing the limited coverage of manual engineering; even so, they remain safer inside the harness than every matched no-harness baseline (Appendix D.2). Disabling context-aware retrieval raises both CR (22–43%) and PE (34–58%) via conflicting constraints. The four roles are complementary: dynamics enables predictive verification, LLM priors regularize structure, rule generation ensures coverage, and selective retrieval prevents conflicts.
5.4 Self-Evolution Analysis
- ep. 250
- 113
- 70.0
- 0.9885
- 7.05
- ep. 500
- 127
- 48.44
- 0.9920
- 6.11
- ep. 750
- 138
- 25.0
- 0.9942
- 5.83
- ep. 1000 (final)
- 145
- 12.81
- 0.9956
- 5.67
- Frozen \mathcal{R}_{0} (1000-ep eval)
- 88
- —
- 0.9800
- 9.63
We deploy REINS for 1000 episodes on Highway from the offline-compiled memory \mathcal{R}_{0} (|\mathcal{R}_{0}|{=}88), reporting four checkpoint snapshots alongside a Frozen \mathcal{R}_{0} control that runs the same window with acquisition disabled (Table 3; other scenarios in Appendix C.5). Across deployment, |\mathcal{R}| grows from 88 to 145 (saturating after ep. 500; Eq. 9), the LLM call rate decays from 70.0% to 12.81% (a 5.5\times reduction with no weight update), Compl. rises from 0.9885 to 0.9956, and CR drops from 7.05% to 5.67%. Against the Frozen \mathcal{R}_{0} control over the same horizon (0.9800 Compl., 9.63% CR), online acquisition adds +0.0156 Compl. and removes 3.96 CR points—the headline self-evolution gain. Mapped to the three couplings: monotone |\mathcal{R}| under \kappa-hash deduplication validates consolidation, the joint Compl. \uparrow/CR \downarrow trajectory validates rollout-based verification, and the 5.5\times call-rate drop validates the grounding–consolidation loop, as variable-keyed memory hits replace LLM calls on similar scenes.
Of the roughly 39,000 proposals implied by these call rates, 2.1% failed schema validation, 18.0% were rejected by rollout verification, and the accepted remainder deduplicated to 57 unique rules, 54 of which an audit judged consistent with domain guidelines (Appendix D.5).
Robustness, Transfer, and Scalability. Appendix D stresses these results. Rules regenerated with Claude Sonnet 4.5 or Qwen2.5-72B-Instruct keep Highway CR at 5.89% and 6.24% (vs. 5.67%), and prompt paraphrases span 5.58–5.91%. Under 2.5–10% observation noise and 5% frame drops, REINS CR rises to at most 8.14% while Plan-R1 rises to 19.87%. A memory compiled only from highD/rounD starts at an 86.2% call rate on highway-env and recovers to within 0.5–1.1 CR points of the native memory within 1000 episodes, whereas a frozen transferred memory does not. Inflating the memory to 100,000 rules keeps retrieval under 0.8 ms, and the 1.59 s miss cycle, dominated by the LLM call, runs off the control path behind a 2.6 ms verified fallback.
6 Limitations
Abstraction gap and action interface. The evaluation sits at the tactical decision layer: perception is assumed as clean factored variables, highD and rounD run in replay (reactive-replay variant in Appendix D.6), and occlusion, tracking, and map errors are absent; the five meta-actions are the standard interface of this layer and of all eight baselines, and continuous maneuvers would change only the scorer’s output head. The claims are harness results at this layer, not a deployable AV stack, and the episode-level collision rates of 5.7–9.5% in deliberately stressed traffic are not deployment grade; the supported claim is relative (49–56% below the best learned baseline). Correlational dynamics. The learned dynamics are prior-constrained but not causally identified; verification is conservative, so misattribution degrades toward rejecting actions rather than accepting unsafe ones, yet its quality depends on dynamics fidelity (constant-velocity propagation raises CR by 48–49%; 3 of the 57 acquired rules were over-specific in audit, Appendix D.5). Limited zero-shot cross-domain reusability. Zero-shot cross-domain reusability of the compiled memory is limited: a memory compiled solely from highD/rounD begins at an 86.2% call rate on highway-env, indicating that many target-domain encounters still require online acquisition. REINS is accordingly scoped to the self-evolution loop rather than assuming universal cross-domain memory transfer (Appendix D.7). Scope. The monotone miss-rate property assumes a stationary scene distribution, and the implementation is specialized to driving: only the variable schema and the action space must be re-authored for another domain (Appendix D.1).
7 Conclusion
We present REINS, a self-evolving agent harness that adapts the agent-harness paradigm from software engineering to real-time, safety-critical trajectory planning through three LLM–planner couplings: grounding, verification, and consolidation. Familiar scenes resolve from an indexed rule memory in \mathcal{O}(\log|\mathcal{R}|) time, while memory misses trigger LLM-driven rule acquisition that grounds, verifies, and writes back new rules, closing the self-evolution loop without any LLM weight update. At the tactical decision layer, REINS attains 98%+ compliance, nearly 50% collision reduction, and 1.9–4.6 ms latency, with gains that survive matched baselines, observation noise, reactive replay, and cross-domain memory transfer. Future work will couple the harness to perception uncertainty and continuous maneuvers, extend it to multi-agent coordination, and move the learned dynamics toward interventional identification with incremental updates.
Acknowledgments and Disclosure of Funding
This work was supported by the European Union’s Horizon Europe research and innovation programme under Marie Skłodowska-Curie grant agreement No. 101126636 (DSTrain) and by the Technical Faculty of IT and Design at Aalborg University. This work was partly supported by the European Union under Grant 101123471 (EDGE-Skills project funded under the Digital Europe Programme). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Commission. Neither the European Union nor the granting authority can be held responsible for them. The authors declare no competing interests.
References
Appendix A More Details about REINS
A.1 Variable Definitions
We define macro and micro variables shown in Table 4. The macro variables represent high-level semantic categories, while micro variables are the specific measurable quantities used in the world dynamics model and rule system.
The variables are organized into five functional groups: Environment variables capture external conditions (weather, visibility, road surface, speed limits) that affect driving but are not directly controllable. Traffic variables describe spatial and temporal relationships with surrounding vehicles, including headway distances, relative speeds, TTC, and lane density metrics. Ego variables represent the controlled vehicle’s kinematic state (position, velocity, acceleration, orientation). Action defines the discrete action space: five high-level maneuvers executed by low-level controllers. Outcome variables measure action consequences, including safety (collision risk), comfort (jerk-based), and task completion indicators. This hierarchical organization enables structured rule retrieval via variable-group indexing.
The macro-group dependency set \mathcal{E}_{\mathcal{H}} in Def. 3.1 encodes the admissible group-level edges:
\displaystyle\mathcal{E}_{\mathcal{H}}=\{ \\ \displaystyle(\textsc{Env},\textsc{Traffic}),(\textsc{Env},\textsc{Ego}),(\textsc{Env},\textsc{Outcome}), \\ \displaystyle(\textsc{Traffic},\textsc{Traffic}),(\textsc{Traffic},\textsc{Ego}),(\textsc{Traffic},\textsc{Outcome}), \\ \displaystyle(\textsc{Ego},\textsc{Traffic}),(\textsc{Ego},\textsc{Ego}),(\textsc{Ego},\textsc{Outcome}), \\ \displaystyle(\textsc{Action},\textsc{Ego}),(\textsc{Action},\textsc{Outcome})\}.Environment factors influence Traffic, Ego, and Outcome; Traffic and Ego variables interact bidirectionally and feed into Outcome; Action affects only Ego state and Outcome.
- Environment
- weather_type
- Weather condition (clear/rain/fog/snow)
- visibility_distance
- Visibility range (m)
- road_friction
- Road surface friction coefficient
- road_type
- Scenario type (highway/merge/intersection/roundabout)
- time_of_day
- Time period (day/night/dawn/dusk)
- speed_limit
- Posted speed limit (km/h)
- Traffic
- headway_distance
- Distance to lead vehicle (m)
- lead_speed
- Lead vehicle speed (m/s)
- lead_rel_speed
- Relative speed to lead vehicle (m/s)
- lead_ttc
- Time-to-collision with lead vehicle (s)
- lead_thw
- Time headway to lead vehicle (s)
- rear_distance
- Distance to rear vehicle (m)
- rear_speed
- Rear vehicle speed (m/s)
- rear_rel_speed
- Relative speed to rear vehicle (m/s)
- rear_ttc
- Time-to-collision with rear vehicle (s)
- left_front_distance
- Distance to left-front vehicle (m)
- left_front_speed
- Left-front vehicle speed (m/s)
- left_rear_distance
- Distance to left-rear vehicle (m)
- left_rear_speed
- Left-rear vehicle speed (m/s)
- right_front_distance
- Distance to right-front vehicle (m)
- right_front_speed
- Right-front vehicle speed (m/s)
- right_rear_distance
- Distance to right-rear vehicle (m)
- right_rear_speed
- Right-rear vehicle speed (m/s)
- lane_density_left
- Left lane density (vehicles/100m)
- lane_density_right
- Right lane density (vehicles/100m)
- available_gap_left
- Available gap in left lane (m)
- available_gap_right
- Available gap in right lane (m)
- cutin_risk
- Cut-in risk indicator (0–1)
- Ego
- ego_x
- Ego vehicle longitudinal position (m)
- ego_y
- Ego vehicle lateral position (m)
- ego_vx
- Ego vehicle longitudinal velocity (m/s)
- ego_vy
- Ego vehicle lateral velocity (m/s)
- ego_speed
- Ego vehicle total speed (m/s)
- ego_acceleration
- Ego vehicle acceleration (m/s2)
- yaw_rate
- Ego vehicle yaw rate (rad/s)
- jerk
- Ego vehicle jerk (m/s3)
- lane_id
- Current lane identifier
- lateral_offset
- Lateral offset from lane center (m)
- Action
- action_type
- Discrete action (IDLE/FASTER/SLOWER/LANE_LEFT/LANE_RIGHT)
- Outcome
- risk_score
- Collision probability (0–1)
- comfort_score
- Comfort metric (jerk-based)
- energy_consumption
- Energy usage metric
- success_flag
- Goal completion indicator (boolean)
- violation_flag
- Rule violation indicator (boolean)
A.2 Rule Templates
Seven rule templates are defined to capture different logical structures for driving knowledge:
- IF-THEN: Conditional implication for basic conditional relations. Example: IF TTC
<2s THEN decelerate - AND-THEN: Conjunctive trigger requiring multiple conditions. Example: IF visibility
<50m AND raining THEN reduce_speed_by_30% - THRESHOLD: Numeric constraint with calibrated boundaries. Example: IF speed
>speed_limit THEN violation = true - PRIORITY: Decision hierarchy for conflicting actions. Example: yield
\succaccelerate (yield takes priority) - MULTI-ACTION: Compound actions under one condition. Example: IF collision_risk = high THEN brake AND steer_away
- WEIGHTED-ACTION: Weighted action selection. Example: IF crash_risk THEN {brake: 0.7, steer: 0.3}
- TEMPORAL-CHAIN: Temporal constraints between triggers. Example: IF obstacle_detected THEN brake within 1.5s
A.3 Rule Conflict Resolution
When multiple rules are activated simultaneously, conflicts may arise if they recommend different actions. REINS resolves conflicts through a three-level arbitration mechanism:
Priority-based ordering. Rules are assigned priority levels based on their functional category: Safety > Compliance > Navigation > Efficiency. When rules from different categories conflict, the higher-priority rule takes precedence. For example, if an Efficiency rule (consider lane change) and a Safety rule (maintain gap) both fire, the Safety rule overrides.
Confidence-weighted aggregation. For rules within the same priority level, REINS aggregates their scores using the noisy-OR formula (Eq. (5)). This allows multiple supporting rules to reinforce an action while remaining robust to individual noisy predictions. The action with the highest aggregated probability is selected.
Dynamics-based verification. When the aggregated action prior is below a confidence threshold (\tau=0.7), REINS falls back to dynamics-based verification. The top-M candidate actions are simulated via forward rollout using the world dynamics model, and the action yielding the safest predicted trajectory is selected.
This hierarchical approach ensures that safety-critical rules are never overridden by efficiency considerations, while still allowing flexible action selection in non-critical situations.
A.4 Method Details
This subsection contains the full equations, architectural details, and explanatory prose deferred from the methodology to keep the main body concise. The structure mirrors Section 4.1–4.2.
A.4.1 World Dynamics Learning Details
We learn the dependency graph \hat{\mathcal{G}}=(\mathcal{X},\hat{\mathcal{E}},\hat{w}) in three steps, then train a per-variable dynamics function on the resulting parent sets.
Step 1: Edge Prior Estimation. We query the LLM with variable dependency prompts (Appendix A.5) to obtain an edge confidence \pi_{ij}\in[0,1] for each candidate edge X_{j}\to X_{i}. This is combined with the macro-group constraints (Eq. 10) to form a unified prior:
\tilde{\pi}_{ij}=\alpha\,\pi_{ij}+(1-\alpha)\,\mathbb{I}\{(h(X_{j}),h(X_{i}))\in\mathcal{E}_{\mathcal{H}}\},where \alpha\in[0,1] balances LLM confidence against structural constraints. Edges that violate the macro-group constraints carry indicator 0 and are reduced to \alpha\,\pi_{ij}, while semantically aligned edges are pushed toward 1.
Step 2: Prior-Guided Regression. For each target variable X_{i}, we predict its value from the lagged values of other variables via ridge regression [Hoerl and Kennard, 1970] with prior-adaptive penalties \lambda_{ij}=\lambda_{0}(1-\tilde{\pi}_{ij})^{\rho}:
\hat{\mathbf{w}}_{i}=\arg\min_{\mathbf{w}}\sum_{t=L}^{N}\Big(X_{i}^{t}-\textstyle\sum_{j\neq i}\sum_{\ell=1}^{L}w_{j\ell}X_{j}^{t-\ell}\Big)^{2}+\sum_{j\neq i}\lambda_{ij}\|\mathbf{w}_{j}\|_{2}^{2},where w_{j\ell} is the regression coefficient for variable X_{j} at lag \ell\in\{1,\ldots,L\}, \mathbf{w}_{j}=(w_{j1},\ldots,w_{jL})^{\top} groups all lags for X_{j}, \lambda_{0} is the base penalty, and \rho>0 controls penalty sharpness. High-prior edges (\tilde{\pi}_{ij}\to 1) receive weak regularization and survive; low-prior edges are shrunk toward zero.
Step 3: Graph Construction. The parent set \mathrm{Pa}(X_{i}) retains the top-K variables ranked by aggregated coefficient magnitude \sum_{\ell=1}^{L}|\hat{w}_{j\ell}|. The learned edge set and weights are
\hat{\mathcal{E}}=\{(X_{j},X_{i})\mid X_{j}\in\mathrm{Pa}(X_{i})\},\quad\hat{w}(X_{j},X_{i})=\textstyle\sum_{\ell=1}^{L}|\hat{w}_{j\ell}|.Dynamics Function Loss. Given \hat{\mathcal{G}}, each f_{i} is implemented as a multi-head Transformer [Vaswani et al., 2017] and trained by mean squared error over its parent trajectory:
\mathcal{L}_{\text{dyn}}^{(i)}=\frac{1}{N}\sum_{t}\big(X_{i}^{t+1}-f_{i}(\mathrm{Pa}(X_{i})^{t-L+1:t})\big)^{2}.Optimizer, batch size, and convergence curves are reported in Appendix C.1.
A.4.2 Rule Compilation Details
Rule Structure Generation. For each dependency edge (X_{j},X_{i})\in\hat{\mathcal{E}}, the LLM generates a rule structure
r=(T,\mathcal{P}_{r},a_{r},c_{r}),where T is the rule template (Def. 3.5), \mathcal{P}_{r} is a set of guard predicates with symbolic thresholds, a_{r}\in\mathcal{A} is the recommended action (Def. 3.2), and c_{r} is the confidence derived from edge weight \hat{w}(X_{j},X_{i}). Prompt details are in Appendix A.5.
Threshold Calibration. Each predicate p\in\mathcal{P}_{r} (Def. 3.4) requires a concrete threshold \tau_{i}, calibrated from \mathcal{D} in three forms [Luo et al., 2024]:
\tau_{i}=\begin{cases}\mu_{i}+\zeta\sigma_{i}&\text{(z-score)},\\
Q_{i}(\zeta)&\text{(quantile)},\\
\tau_{0}&\text{(absolute)},\end{cases}where \mu_{i},\sigma_{i} are empirical mean and standard deviation of X_{i}, Q_{i}(\zeta) is the \zeta-quantile, and \tau_{0} is a fixed constant (e.g., speed limits). The comparison operator \prec is selected to maximize safety separability between the two sides of the threshold under safety outcome y\in\{0,1\} (Section 4.1.2).
Graph Database Storage. Compiled rules are stored in a Neo4j graph database [Webber, 2012] with a variable-indexed schema (Figure 3). Each rule node stores the complete tuple (T,\mathcal{P}_{r},a_{r},c_{r}), where T is the template type, \mathcal{P}_{r} contains calibrated predicates with concrete thresholds \tau and operators \prec, a_{r} is the recommended action, and c_{r} is the confidence. Rule nodes connect to variable nodes via TRIGGERS (input variables) and AFFECTS (output variables) edges. This enables O(\log|\mathcal{R}|) retrieval via parameterized Cypher queries on variables active in the current state. Database statistics are provided in Appendix C.7.1.
A.4.3 Rule-Guided Planning Details
Scene-Aware Rule Retrieval. Given s_{t}\in\mathcal{S}, we identify active variables \{X_{i}\} and retrieve context-relevant rules via parameterized Cypher queries [Francis et al., 2018] generated by the LLM (read-only and schema-constrained; Appendix A.5). The retrieval map
G:(\{X_{i}\},K)\longmapsto\mathcal{R}_{t}\subseteq\mathcal{R}returns up to K rules ranked by confidence c_{r}. A rule r is retrieved if its trigger variables \{X_{j}\mid(X_{j},r)\in\texttt{TRIGGERS}\} intersect with the active set \{X_{i}\} and the dependency direction satisfies the macro-group constraints \mathcal{E}_{\mathcal{H}}.
Action Scorer Architecture. The Transformer scorer [Liang et al., 2022] takes state encoding \mathbf{x}_{t} and rule embedding \mathbf{u}_{r} and emits relevance and action heads:
\displaystyle\mathbf{h}_{t,r} \\ \displaystyle=\text{TransformerEnc}([\mathbf{x}_{t};\mathbf{u}_{r}]), \\ \displaystyle S_{\text{rel}}(r,s_{t}) \\ \displaystyle=\sigma(\text{Dec}_{\text{rel}}(\mathbf{h}_{t,r}))\in[0,1], \\ \displaystyle S_{\text{act}}(r,s_{t},a) \\ \displaystyle=\mathrm{softmax}(\text{Dec}_{\text{act}}(\mathbf{h}_{t,r}))_{a},where S_{\text{rel}} predicts whether r should influence the current decision, and S_{\text{act}} predicts the action preference given r. The combined rule-action score multiplies relevance, action preference, and rule confidence:
f(r,a\mid s_{t})=S_{\text{rel}}(r,s_{t})\cdot S_{\text{act}}(r,s_{t},a)\cdot c_{r}.Scorer Training. The scorer is trained on expert trajectories \{(s_{t},a^{*}_{t})\} with a joint relevance + action objective:
\mathcal{L}=\sum_{t,r}\big[\mathrm{BCE}(\mathrm{Exec}(r,s_{t}),S_{\text{rel}}(r,s_{t}))-\log S_{\text{act}}(r,s_{t},a^{*}_{t})\big],where \mathrm{Exec}(r,s_{t})\in\{0,1\} is the ground-truth rule activation (Eq. 2) and a^{*}_{t} is the expert action.
Action Aggregation. The full noisy-OR action distribution corresponding to Eq. 5 is
\displaystyle P(a\mid s_{t}) \\ \displaystyle=\frac{1-\prod_{r\in\mathcal{R}_{t}(a)}\big(1-f(r,a\mid s_{t})\big)}{Z}, \\ \displaystyle a^{*}_{\text{rule}} \\ \displaystyle=\arg\max_{a\in\mathcal{A}}P(a\mid s_{t}),where \mathcal{R}_{t}(a)\subseteq\mathcal{R}_{t} denotes the rules with recommended action a_{r}=a and Z normalizes over \mathcal{A}. The formulation favors actions supported by multiple high-confidence rules.
Trajectory Verification. For the top-M actions ranked by P(a\mid s_{t}), we predict H-step future states:
\hat{s}_{t+h+1}=\Phi(\hat{s}_{t+h},a;\hat{\mathcal{G}},\hat{\mathcal{F}}),\quad h=0,\ldots,H-1,where \Phi applies each f_{i}\in\hat{\mathcal{F}} to predict X_{i} from \mathrm{Pa}(X_{i}) under \hat{\mathcal{G}}. Each rollout produces a candidate trajectory \hat{\xi}(a)=(\hat{s}_{t+1},\ldots,\hat{s}_{t+H}), consistent with Def. 3.3. The planner selects a^{\star}_{t}=\arg\max_{a\in\mathcal{A}_{M}}J(\hat{\xi}(a)), where J:\mathcal{S}^{H}\to\mathbb{R} penalizes collisions, rule violations, and control effort (Appendix B.2); the first control of the selected trajectory is executed in receding-horizon [Zhang et al., 2021b].
A.4.4 Online Rule Acquisition Details
LLM-Driven Rule Proposal. On a miss, the harness queries \mathcal{M} with the current state and active variables:
\tilde{r}=(\tilde{T},\tilde{\mathcal{P}},\tilde{a},\tilde{c})\;\sim\;\mathcal{M}(s_{t}),where \tilde{r} conforms to the rule template (Def. 3.5) and uses only variables in \mathcal{X} and operators from the predicate grammar (Def. 3.4). Prompt details are in Appendix A.5.
Safe-Action Selection. When online rule acquisition rejects \tilde{r} and \mathcal{R}_{t}=\emptyset, the harness raises a human-takeover alert and executes the action that maximizes minimum lookahead time-to-collision under \hat{\mathcal{F}}:
a^{\mathrm{safe}}_{t}=\arg\max_{a\in\mathcal{A}}\;\min_{h\in[1,H]}\mathrm{TTC}\!\left(\hat{s}_{t+h}(a)\right).Memory-Update Collision Branch. Eq. 8’s collision branch averages confidences instead of creating a duplicate node, so |\mathcal{R}| counts distinct rule structures rather than LLM-noise replicas. The hash \kappa is computed over the structural triple (\tilde{T},\tilde{\mathcal{P}},\tilde{a}) but excludes \tilde{c}, so semantically identical proposals collide regardless of confidence noise. Collisions are common during early deployment when \mathcal{R} is small, then taper off as coverage saturates.
Self-Evolution Properties. Eq. 8 structurally enforces |\mathcal{R}_{t+1}|\geq|\mathcal{R}_{t}| (memory monotonicity) and \theta_{\mathcal{M}}\equiv\theta_{\mathcal{M}}^{(0)} (no LLM parameter update). Under stationarity of the scene distribution, the per-state miss rate is non-increasing as \mathcal{R} accumulates coverage, since any state s that triggered a miss and produced an accepted \tilde{r} is now matched by a rule keyed on the variables active at s. Since \mathcal{M} is invoked only on misses, its per-scene invocation rate decays monotonically with \Pr[\mathrm{Miss}]. We validate this behavior empirically in Section 5.4 and Appendix C.5.
A.5 Prompts
We provide three prompt templates used in REINS’s offline compilation pipeline. Figure 4 shows the Variable Dependency Prompt, which instructs the LLM to infer dependencies between driving variables based on domain knowledge; the output serves as semantic priors for structure learning in the world dynamics model. Figure 5 presents the Rule Extraction Prompt, which converts dependency edges into executable driving rules with parameterized guards and discrete actions; these rules are stored in the Neo4j graph database. Figure 6 displays the Parameterized Cypher Query Prompt, which generates parameterized queries for context-aware rule retrieval during planning. All prompts enforce read-only constraints and structured output formats to ensure safety and parseability.
Appendix B Implementation Details
B.1 Experiment Settings
Table 5 summarizes the key hyperparameters and training configurations used in our experiments. The settings are organized into six categories: Simulation Environment specifies the highway-env simulator settings, including four driving scenarios with varying complexity and a discrete action space of five high-level maneuvers. Real-world Datasets describes the highD (highway) and rounD (roundabout) drone datasets used for real-world evaluation, including recording statistics and sampling rates. World Dynamics Model details the structure learning parameters (LLM prior weight, regularization) and neural network architecture (Transformer layers, attention heads). Rule Compilation covers the offline LLM-based rule generation process, including the backbone model, sampling strategy, and threshold calibration. Training & Evaluation specifies the data splits, random seeds, and hardware configuration. Planning & Deployment reports inference-time parameters and latency measurements demonstrating real-time capability. All hyperparameter configurations follow standard practices unless otherwise stated.
- Simulation Environment
- Simulator
- highway-env v1.8.2
- Scenarios
- Highway, Merge, Roundabout,
- No data
- Intersection
- Episode length
- 100 steps (20s at 5 Hz)
- Observation
- 15 nearest vehicles
- Action space
- {IDLE, FASTER, SLOWER,
- No data
- LANE_LEFT, LANE_RIGHT}
- Weather conditions
- Clear, Rain, Fog, Snow
- Real-world Datasets
- highD source
- German Autobahn (drone)
- highD recordings
- 01, 02, 03, 04
- highD vehicles
- 4,237 (578 lane-change events)
- rounD source
- German roundabouts
- rounD recordings
- 00, 01, 02
- rounD vehicles
- 2,156 (423 yield/merge events)
- Sampling rate
- 25 Hz
- World Dynamics Model
- Structure learning
- Ridge regression + LLM prior
- LLM prior weight \alpha
- 0.6
- Penalty exponent \rho
- 2.0
- Base regularization \lambda_{0}
- 0.1
- Lag length L
- 6 steps
- Top-K parents
- 5
- Transformer layers
- 2
- Attention heads
- 4
- Optimizer
- Adam
- Learning rate
- 2\times 10^{-4}
- Batch size
- 64
- Training episodes
- 50k
- Rule Compilation (Offline)
- LLM backbone
- GPT-4o (2024-08-06)
- LLM temperature
- 0.0 (deterministic)
- Max output tokens
- 4096
- Prompt tokens (avg.)
- \sim1.2k per query
- Total LLM calls
- \sim50 (one-time offline)
- Rule templates
- 7 types
- Neo4j version
- 5.12
- Threshold calibration
- Gaussian (\mu+\zeta\sigma), \zeta=1.5
- Confidence \tau
- 0.7
- Training & Evaluation
- Training data
- 50k episodes
- Test episodes
- 1000 per scenario
- Random seeds
- 5 (0, 42, 123, 456, 789)
- Training hardware
- 4\times A100 (40GB)
- Training time
- \sim8 hours
- Planning & Deployment
- Retrieval count k
- 10
- Planning horizon H
- 5 steps
- Rollout discount \gamma
- 0.99
- Safety weight \lambda_{\text{safe}}
- 1.0
- Comfort weight \lambda_{\text{comf}}
- 0.1
- Progress weight \lambda_{\text{prog}}
- 0.5
- Inference hardware
- RTX 3090 or above
- GPU memory
- \sim4 GB
- Neo4j query latency
- <1 ms
- Planning latency
- 1.9–4.6 ms per decision
- Real-time capability
- 200–500 Hz
B.2 Evaluation Metrics
Rule Compliance (Compl.) measures the fraction of timesteps where all active rules are satisfied:
\text{Compl.}=\frac{1}{T}\sum_{t=1}^{T}\prod_{k=1}^{K}\bigl(1-v_{k,t}\bigr),where v_{k,t}\in\{0,1\} indicates whether rule k is violated at time t.
Collision Rate (CR) measures the fraction of episodes in which at least one collision occurs:
\text{CR}=\frac{1}{N}\sum_{i=1}^{N}\mathbb{I}(\text{collision in episode }i),where N is the number of test episodes. A lower CR indicates safer planning.
Risk-aware Efficiency (RE) balances task performance against safety:
\displaystyle=R_{\text{task}}(\tau)-\lambda_{\text{risk}}R_{\text{risk}}(\tau), \\ \displaystyle R_{\text{risk}}(\tau) \\ \displaystyle=\sum_{t=1}^{T}\max(0,\delta_{\text{ttc}}-\text{TTC}_{t}),where R_{\text{task}} is the task reward, R_{\text{risk}} penalizes low TTC states, \lambda_{\text{risk}}=0.5 is the risk penalty weight, and \delta_{\text{ttc}}=3.0s is the TTC threshold.
Planning Efficiency (PE) measures average computation time per decision:
\text{PE}=\frac{1}{T}\sum_{t=1}^{T}t_{\text{plan}},where t_{\text{plan}} (ms) is the wall-clock time for action selection.
Trajectory Objective J(\hat{\xi}). The trajectory-level objective used in dynamics-based verification is defined as:
\displaystyle J(\hat{\xi}) \\ \displaystyle=\sum_{h=1}^{H}\gamma^{h-1}\Big[-\lambda_{\text{safe}}\cdot\mathbb{I}(\text{TTC}_{t+h}<\tau_{\text{ttc}}) \\ \displaystyle+\lambda_{\text{prog}}\cdot\Delta d_{t+h}-\lambda_{\text{comf}}\cdot|j_{t+h}|\Big],where \text{TTC}_{t+h} is the predicted time-to-collision, \Delta d_{t+h} is the progress toward the goal, j_{t+h} is the jerk, and \tau_{\text{ttc}}=2.0s is the safety threshold. The weights \lambda_{\text{safe}}=1.0, \lambda_{\text{prog}}=0.5, \lambda_{\text{comf}}=0.1 prioritize safety over progress and comfort.
Real-world Evaluation Protocol. We use closed-loop replay: one recorded vehicle is controlled by the planner while others follow recorded trajectories. Collisions are detected when bounding boxes overlap or the ego deviates beyond lane boundaries. In the simulated scenarios the surrounding vehicles instead react to the ego (IDM with MOBIL); a reactive-replay variant of highD is reported in Appendix D.6.
B.3 Baseline Descriptions
We select baselines from three categories to comprehensively evaluate REINS: (i) classical planners (MPC, MCTS) that represent traditional optimization and search-based approaches without rule guidance; (ii) LLM-based planners (DriveSpeak, PDDL, LLaDA, DriReg) that leverage language models for driving decisions but differ in how they integrate linguistic knowledge; and (iii) hybrid methods (SymAgent, Plan-R1) that combine learning with symbolic reasoning. This selection covers the spectrum from rule-free to rule-guided planning, enabling analysis of how different rule representation and retrieval strategies affect safety and efficiency.
- MPC [Falcone et al., 2007]: Classical optimization-based planner solving finite-horizon control under kinematic and safety constraints. We use a 5-step horizon with quadratic cost on acceleration and jerk.
- MCTS [Lenz et al., 2016]: Sampling-based planning via tree search and rollout evaluation. We use 1000 simulations per decision with UCB exploration.
- DriveSpeak [Cui et al., 2024]: LLM-based method mapping natural-language scene descriptions directly to driving actions. Uses GPT-4o with scene prompts at each timestep.
- PDDL [Guan et al., 2023, Liu et al., 2023]: the LLM writes the domain’s symbolic preconditions and effects once offline; at runtime a classical STRIPS solver (Pyperplan [Alkhazraji et al., 2020]) is invoked in process at each decision step with no LLM call. Its runtime profile is in Appendix D.3.
- LLaDA [Li et al., 2024a]: LLM interpretation of region-specific traffic rules from driver handbooks. Uses pre-extracted rule sets with LLM-based rule matching.
- DriReg [Cai et al., 2024]: RAG-based traffic regulation retrieval with LLM reasoning for action legality. Retrieves top-5 regulations per query using embedding similarity.
- SymAgent [Liu et al., 2025]: Neural-symbolic agent integrating LLMs with structured knowledge graphs. Uses the same Neo4j backend as REINS for fair comparison.
- Plan-R1 [Tang et al., 2025]: Two-stage learning-based planner with rule-shaped rewards and reinforcement learning. Trained on the same 50k episodes as REINS’s world model.
All baselines use identical observation spaces, action spaces, episodes, and evaluation protocols. For LLM-based methods, we use GPT-4o (2024-08-06) with temperature 0 for deterministic outputs. Hyperparameters for each baseline follow their original papers or are tuned on a held-out validation set. The conditions that are shared with REINS and those that each rule-based baseline keeps by design, together with a matched re-run and a common-reference compliance audit, are documented in Appendix D.2.
Appendix C Additional Results
C.1 Training Convergence
We train the world dynamics model for 300 epochs using the Adam optimizer with a learning rate of 2\times 10^{-4} and batch size 64. Each variable-specific dynamics function f_{i} is implemented as a two-layer Transformer with four attention heads. Training is conducted on 50k episodes collected from four scenarios (Highway, Intersection, Merge, and Roundabout) using NVIDIA A100 GPUs. The model learns 20 variable-specific dynamics functions, including ego-state variables (ego_speed, ego_acceleration, ego_vx, ego_vy, ego_x, ego_y, yaw_rate, jerk, lane_id), traffic-related variables (lead_ttc, lead_thw, lead_rel_speed, rear_rel_speed, lane_density_left, lane_density_right, cutin_risk), and outcome variables (risk_score, comfort_score, violation_flag, energy_consumption). Figure 7 shows the training loss curves for all dynamics functions across the four scenarios.
The results suggest that the learned world dynamics are scenario-adaptive not only in difficulty but also in structural composition: different scenarios activate and learn different subsets of variable-specific dynamics functions. Interaction-heavy variables such as cutin_risk, lane_density_left/right, and rear_rel_speed are prominent in Merge and Intersection, where lane changes and merging behaviors are frequent, but are weakly activated or effectively absent in Highway, where traffic flow is comparatively stable. Conversely, lateral-motion variables (e.g., ego_vy, yaw_rate) become substantially more relevant in Roundabout due to persistent curvature, while contributing marginally in straight-road scenarios. This indicates that the model does not impose a fixed global mechanism set across environments, but instead learns scenario-specific mechanism structures, supporting structural adaptability to heterogeneous traffic contexts.
Beyond these structural differences, the loss curves exhibit consistent convergence patterns. Most variables converge within 100–150 epochs. Simple kinematic variables (e.g., ego_x, ego_y, lead_thw) converge within 50 epochs, whereas interaction-intensive outcome variables (e.g., risk_score, violation_flag) require longer training. Highway achieves the lowest final loss due to simpler lane-following dynamics. Roundabout exhibits higher loss for lateral variables because of curved trajectories, while Intersection shows higher variance in violation_flag due to diverse right-of-way interactions. Safety-related variables (e.g., lead_ttc, cutin_risk) converge rapidly in early training when relevant interactions are present, indicating strong dependency signals. In terms of final loss magnitude, continuous variables (e.g., ego_speed, ego_acceleration) achieve losses below 0.5, whereas discrete or binary variables (e.g., violation_flag, lane_id) stabilize at higher loss due to their classification nature.
C.2 Trajectory Accuracy
We evaluate trajectory accuracy using Average Displacement Error (ADE), Final Displacement Error (FDE), and cumulative episode reward (Reward) across four driving scenarios: Highway, Merge, Roundabout, and Intersection. ADE and FDE measure the mean and final Euclidean distance between predicted and executed trajectories, respectively, while Reward reflects overall driving efficiency and safety. All methods are evaluated under identical environment settings with the same observation space, action space, and rollout horizon.
Table 6 reports the mean performance over all evaluation episodes. REINS consistently achieves the best performance across all scenarios in terms of both trajectory accuracy and cumulative reward. In Highway, REINS reduces ADE and FDE to 15.9 and 20.5, respectively, outperforming the strongest baseline (SymAgent) by 12.2% in ADE and 16.3% in FDE, while also achieving the highest reward. Similar improvements are observed in Merge and Roundabout, where REINS yields substantial gains in both short-horizon and long-horizon prediction accuracy, indicating more stable multi-step trajectory generation.
The performance gap becomes more pronounced in complex interaction scenarios. In Intersection, REINS achieves an ADE of 5.6 and FDE of 9.7, representing relative reductions of 30.0% and 13.4% compared to SymAgent, and 41.7% (ADE) and 28.7% (FDE) compared to MPC. This suggests that integrating rule-guided action selection with world-model-based forward rollout is particularly effective when decision-making requires anticipating multi-agent interactions and right-of-way constraints.
Across all scenarios, higher trajectory accuracy strongly correlates with higher episode reward, confirming that more accurate future state prediction leads to safer and more efficient planning. Methods relying primarily on language-based reasoning (LLaDA) exhibit the largest errors, especially in high-speed or curved-road settings, highlighting the limitations of planning without explicit dynamics modeling. MPC improves performance by incorporating learned motion predictors, while SymAgent further benefits from symbolic constraints. REINS combines symbolic rule guidance with learned world dynamics, enabling both structured action filtering and predictive verification, which explains its consistent superiority across heterogeneous traffic scenarios.
- Hig.
- ADE\downarrow
- 26.5
- 20.1
- 18.1
- 15.9
- FDE\downarrow
- 29.5
- 25.1
- 24.5
- 20.5
- Reward\uparrow
- 14.7
- 21.6
- 23.1
- 26.3
- Mer.
- ADE\downarrow
- 17.6
- 13.3
- 12.7
- 9.9
- FDE\downarrow
- 21.8
- 20.0
- 18.5
- 15.2
- Reward\uparrow
- 25.2
- 50.7
- 54.5
- 58.4
- Rou.
- ADE\downarrow
- 19.7
- 16.5
- 14.3
- 10.1
- FDE\downarrow
- 23.2
- 21.7
- 19.4
- 14.9
- Reward\uparrow
- 12.3
- 22.9
- 23.6
- 27.8
- Int.
- ADE\downarrow
- 21.6
- 9.6
- 8.0
- 5.6
- FDE\downarrow
- 25.4
- 13.6
- 11.2
- 9.7
- Reward\uparrow
- 35.3
- 54.2
- 56.8
- 60.5
- Sim.
- Hig.
- Compl.
- 0.9934
- 0.9948
- 0.9956
- 0.9952
- 0.9947
- RE
- -0.42
- 0.31
- 0.52
- 0.38
- 0.15
- CR (%)
- 9.34
- 6.89
- 5.67
- 6.72
- 7.98
- PE (ms)
- 2.21
- 2.35
- 2.50
- 2.68
- 2.89
- Rou.
- Compl.
- 0.9898
- 0.9915
- 0.9925
- 0.9918
- 0.9908
- RE
- -1.23
- -0.78
- -0.54
- -0.72
- -0.95
- CR (%)
- 14.12
- 10.78
- 9.01
- 10.34
- 11.89
- PE (ms)
- 3.18
- 3.41
- 3.62
- 3.89
- 4.21
- Real
- highD
- Compl.
- 0.9845
- 0.9858
- 0.9867
- 0.9861
- 0.9852
- RE
- -0.35
- 0.18
- 0.38
- 0.25
- 0.08
- CR (%)
- 10.12
- 7.34
- 6.12
- 7.12
- 8.56
- PE (ms)
- 2.38
- 2.52
- 2.62
- 2.87
- 3.12
- rounD
- Compl.
- 0.9823
- 0.9842
- 0.9856
- 0.9848
- 0.9834
- RE
- -1.12
- -0.65
- -0.41
- -0.58
- -0.82
- CR (%)
- 15.23
- 11.34
- 9.45
- 10.78
- 12.45
- PE (ms)
- 3.52
- 3.76
- 3.89
- 4.25
- 4.63
- IF-THEN
- 42
- 48
- 50
- 55
- 38
- 43
- 276
- AND-THEN
- 38
- 45
- 47
- 52
- 32
- 37
- 251
- THRESHOLD
- 32
- 35
- 36
- 40
- 30
- 32
- 205
- PRIORITY
- 12
- 20
- 22
- 28
- 15
- 21
- 118
- MULTI-ACTION
- 10
- 13
- 14
- 17
- 11
- 12
- 77
- WEIGHTED-ACTION
- 6
- 8
- 9
- 11
- 7
- 10
- 51
- TEMPORAL-CHAIN
- 5
- 6
- 7
- 7
- 5
- 15
- 45
- Total
- 145
- 175
- 185
- 210
- 138
- 170
- 1,023
C.3 Sensitivity to Retrieval Count k and Planning Horizon H
We analyze sensitivity to two runtime hyperparameters: rule retrieval count k (the maximum number of rules returned per scene by the Cypher query) and planning horizon H (the rollout depth used by trajectory verification). Both are evaluated on simulated (Highway, Roundabout) and real-world (highD, rounD) scenarios.
Rule Retrieval Count k. Table 9(a) reports results for varying k. Small values (k\!\leq\!3) miss critical rules, increasing CR by 3.5–4.7 points; large values (k\!\geq\!15) introduce redundancy, raising PE by 60–71% at k{=}20 without safety gains. The optimal k{=}10 generalizes across domains, with real-world and roundabout scenarios showing higher sensitivity than structured highway settings.
Planning Horizon H. Table 9(b) reports results for varying H. Short horizons (H\!\leq\!3) cause myopic decisions with 2.9–5.1 point CR increase; long horizons raise PE by 35–44% at H{=}7 and roughly double it at H{=}10, with marginal safety benefits. The optimal H{=}5 balances safety and efficiency, though complex scenarios (Roundabout, rounD) require longer horizons to anticipate multi-agent interactions.
- Sim.
- Hig.
- Compl.
- 0.9712
- 0.9856
- 0.9956
- 0.9948
- 0.9951
- RE
- 0.18
- 0.41
- 0.52
- 0.35
- 0.21
- CR (%)
- 9.21
- 7.08
- 5.67
- 6.02
- 6.48
- PE (ms)
- 1.82
- 2.13
- 2.50
- 3.21
- 4.15
- Rou.
- Compl.
- 0.9589
- 0.9778
- 0.9925
- 0.9912
- 0.9908
- RE
- -1.12
- -0.78
- -0.54
- -0.72
- -0.89
- CR (%)
- 13.34
- 10.45
- 9.01
- 9.62
- 10.28
- PE (ms)
- 2.67
- 3.12
- 3.62
- 4.56
- 5.78
- Real
- highD
- Compl.
- 0.9689
- 0.9798
- 0.9867
- 0.9856
- 0.9852
- RE
- 0.05
- 0.25
- 0.38
- 0.22
- 0.09
- CR (%)
- 10.01
- 7.63
- 6.12
- 6.58
- 7.08
- PE (ms)
- 2.05
- 2.38
- 2.62
- 3.52
- 4.48
- rounD
- Compl.
- 0.9534
- 0.9712
- 0.9856
- 0.9842
- 0.9836
- RE
- -1.02
- -0.65
- -0.41
- -0.58
- -0.76
- CR (%)
- 14.12
- 11.08
- 9.45
- 10.02
- 10.75
- PE (ms)
- 2.98
- 3.48
- 3.89
- 5.02
- 6.28
C.4 Sensitivity to Temporal Lag Length
The temporal lag length L determines how many historical timesteps the world dynamics model uses when predicting future states. Table 7 reports results on both simulated and real-world scenarios.
When using small lag lengths (L\leq 2), the model fails to capture cumulative temporal patterns such as sustained tailgating or gradual lane drift, leading to substantially higher collision rates. On the simulated Highway scenario, the collision rate increases from 5.67% at L=6 to 9.34%, corresponding to a 65% relative increase. A similar degradation is observed on the real-world highD dataset, where the collision rate rises from 6.12% to 10.12%. These results indicate that short-term observations are insufficient to infer latent interaction states, such as risk accumulation and driver intent, which are critical for safe planning. In contrast, large lag lengths (L\geq 10) introduce excessive historical noise and dilute recent dependency signals, reducing the effective signal-to-noise ratio for short-horizon prediction. Consequently, collision rates increase by approximately 40% on simulated scenarios compared to the optimal setting. This suggests that overly long histories may impair the model’s ability to focus on immediately relevant dynamics, particularly in rapidly evolving traffic situations.
Overall, L=6 achieves the best and most consistent performance across both simulated and real-world domains, corresponding to approximately 1.2 seconds of historical context at a sampling rate of 5 Hz. This time window appears sufficient to capture short-term interaction dynamics while avoiding the accumulation of outdated or irrelevant information, thereby supporting stable multi-step rollout and reliable safety verification in downstream planning.
C.5 Self-Evolution Across Scenarios
This appendix reports self-evolution dynamics on the remaining simulated scenarios (Merge, Roundabout, Intersection) and the real-world datasets (highD, rounD), complementing the Highway results in Section 5.4. For each scenario, we deploy REINS for 1000 episodes from the offline-compiled memory \mathcal{R}_{0} and report |\mathcal{R}|, LLM call rate, Compl., and CR at four deployment checkpoints (ep. 250, 500, 750, 1000), with a Frozen \mathcal{R}_{0} row showing the same 1000-episode window run with acquisition disabled; this row exposes |\mathcal{R}_{0}| and isolates the contribution of online rule writing from any aggregation effect of running more episodes. The per-scenario |\mathcal{R}| at ep. 1000 matches the post-deployment totals in Table 8.
Three patterns emerge across the five extended scenarios, mirroring the Highway dynamics. First, |\mathcal{R}| exhibits saturating growth: approximately 44% of the rule additions (counted from |\mathcal{R}_{0}| in the Frozen row to |\mathcal{R}| at ep. 1000) occur in the first 250 episodes, with diminishing returns thereafter, so the LLM is invoked predominantly for previously unseen scene clusters. Second, the LLM call rate decays monotonically in all scenarios, from 68–79% in the first 250-episode window to 12–19% by ep. 1000 (a 4.2–5.5\times reduction); scene complexity raises the absolute size of \mathcal{R} and the residual call rate (highest on Intersection) but not the shape of the decay. Third, the Frozen \mathcal{R}_{0} control consistently underperforms the evolving memory at ep. 1000 (mean Compl. gap \approx0.017, mean CR gap \approx4.2 points), confirming that the gains attributable to online acquisition are not artifacts of statistical aggregation over a longer evaluation window. Intersection benefits most (Compl. +0.0218, CR -4.87 points from Frozen to ep. 1000), reflecting larger room for online acquisition where the offline \mathcal{R}_{0} is most incomplete relative to right-of-way reasoning; the other four scenarios cluster in a tight range (Compl. +0.0154 to +0.0164, CR -3.79 to -4.40 points). highD mirrors Highway and rounD mirrors Roundabout in both |\mathcal{R}| growth shape and Compl./CR convergence, indicating that the harness operates on factored variable signatures rather than scenario-specific surface features. Cross-domain transfer of the compiled memory itself is studied separately in Appendix D.7.
- Merge
- ep. 250
- 136
- 71.36
- 0.9858
- 8.20
- ep. 500
- 153
- 49.12
- 0.9893
- 7.35
- ep. 750
- 167
- 26.48
- 0.9912
- 7.05
- ep. 1000 (final)
- 175
- 13.92
- 0.9924
- 6.86
- Frozen \mathcal{R}_{0} (1000-ep eval)
- 105
- —
- 0.9770
- 10.65
- Roundabout
- ep. 250
- 144
- 73.84
- 0.9852
- 10.55
- ep. 500
- 162
- 52.20
- 0.9888
- 9.85
- ep. 750
- 176
- 28.36
- 0.9910
- 9.40
- ep. 1000 (final)
- 185
- 15.24
- 0.9925
- 9.01
- Frozen \mathcal{R}_{0} (1000-ep eval)
- 112
- —
- 0.9770
- 13.40
- Intersection
- ep. 250
- 164
- 78.52
- 0.9742
- 10.85
- ep. 500
- 184
- 57.64
- 0.9789
- 9.95
- ep. 750
- 200
- 33.08
- 0.9817
- 9.45
- ep. 1000 (final)
- 210
- 18.76
- 0.9838
- 9.08
- Frozen \mathcal{R}_{0} (1000-ep eval)
- 127
- —
- 0.9620
- 13.95
- highD
- ep. 250
- 107
- 68.24
- 0.9803
- 7.45
- ep. 500
- 121
- 47.56
- 0.9838
- 6.65
- ep. 750
- 131
- 24.12
- 0.9856
- 6.32
- ep. 1000 (final)
- 138
- 12.36
- 0.9867
- 6.12
- Frozen \mathcal{R}_{0} (1000-ep eval)
- 84
- —
- 0.9712
- 9.95
- rounD
- ep. 250
- 132
- 74.68
- 0.9785
- 10.95
- ep. 500
- 149
- 53.40
- 0.9821
- 10.20
- ep. 750
- 162
- 29.72
- 0.9842
- 9.78
- ep. 1000 (final)
- 170
- 16.08
- 0.9856
- 9.45
- Frozen \mathcal{R}_{0} (1000-ep eval)
- 103
- —
- 0.9692
- 13.85
C.6 Case Study
Figure 9 compares trajectories of REINS, Plan-R1, LLaDA, and MPC on two scenarios, with activated rules and actions shown at each timestep. Rule definitions are provided in Appendix C.7.2.
Simulated Highway. REINS activates R03 and R07 at t{=}0 to monitor the lead vehicle and adjacent lanes, triggers R12 at t{=}0.5s when a safe gap appears, executes a lane change at t{=}1.0s, and accelerates via R15 at t{=}1.5s, producing a smooth action sequence (IDLE\!\to\!IDLE\!\to\!RIGHT\!\to\!FASTER). Plan-R1 applies all 15 rules simultaneously, causing conflicting constraints and repeated deceleration (SLOWER\!\times\!3) before a delayed maneuver.
Real-World highD. In the cut-in scenario, REINS detects lateral intrusion at t{=}0 via R05, performs preemptive deceleration at t{=}0.5s using R07, and maintains safe distance until t{=}1.5s (IDLE\!\to\!SLOWER\!\to\!SLOWER\!\to\!IDLE). Plan-R1 responds later with emergency braking at t{=}1.0s due to uniform rule execution.
C.7 Compiled Rule Database
- R01
- \text{TTC}<2.0\text{s}
- emergency brake
- THRESHOLD
- R02
- v_{ego}>v_{limit}+5\text{km/h}
- DEC to limit
- THRESHOLD
- R03
- \text{THW}<1.8\text{s}\lor\text{DHW}<25\text{m}
- DEC / maintain gap
- IF-THEN
- R04
- \text{TTC}<3.5\text{s}\land\text{DHW}<40\text{m}
- DEC (moderate)
- AND-THEN
- R05
- v^{lat}_{adj}>0.3\text{m/s}\land\Delta y<2\text{m}
- DEC (preemptive)
- AND-THEN
- R06
- \text{visibility}<100\text{m}
- reduce speed 20%
- THRESHOLD
- R07
- \text{TTC}_{adj}<4\text{s}\lor\text{cut-in}
- increase headway
- IF-THEN
- R08
- \text{lane\_end}<200\text{m}
- prepare merge
- TEMPORAL-CHAIN
- R09
- \text{at\_yield}\land\text{traffic\_present}
- yield / stop
- PRIORITY
- R10
- \text{pedestrian}<30\text{m}
- DEC / prepare stop
- MULTI-ACTION
- R11
- v_{lead}<v_{ego}-10\text{km/h}\land\text{gap}_{adj}>35\text{m}
- consider lane change
- AND-THEN
- R12
- \text{gap}_{target}>30\text{m}\land\text{TTC}_{target}>5\text{s}
- execute lane change
- AND-THEN
- R13
- \text{in\_lane\_change}\land\text{TTC}_{new}<3\text{s}
- abort lane change
- AND-THEN
- R14
- \text{merge\_complete}\land\text{DHW}<20\text{m}
- DEC post-merge
- AND-THEN
- R15
- \text{post\_merge}\land v_{ego}<v_{flow}-5\text{km/h}
- ACC to flow
- AND-THEN
C.7.1 Rule Database Statistics
Table 8 shows the distribution of variables by macro-group and rules by template type in REINS’s Neo4j graph database. The post-deployment database contains 1,023 rules covering six driving scenarios (four simulated: Highway, Merge, Roundabout, Intersection; two real-world: highD, rounD). IF-THEN and AND-THEN templates dominate due to the prevalence of conditional and multi-condition reasoning in driving. Intersection scenarios contain the most rules due to complex right-of-way interactions, while Highway scenarios require fewer given simpler lane-following dynamics. This scale is comparable to industrial rule-based systems while remaining tractable for O(\log n) graph database retrieval (<1 ms per query).
Figure 8 visualizes the graph structure of 200 randomly sampled rules from the database. Gray nodes are variables, blue nodes are rules, and pink nodes are the five discrete actions. Edge colors match source node colors: gray edges represent Variable\toRule, while blue edges represent Rule\toAction.
Several structural patterns emerge from this visualization: (1) Variable sharing: A small set of variables (e.g., TTC, THW, speed) triggers a large number of rules, indicating that safety-critical variables serve as common preconditions across diverse driving scenarios. (2) Action concentration: The majority of rules converge to SLOWER and IDLE, which exhibit the highest in-degree among all five actions. This reflects the safety-first design principle where conservative actions are recommended under uncertain or risky conditions. In contrast, LANE_LEFT, LANE_RIGHT, and FASTER receive fewer rule connections, as these actions require more stringent preconditions. (3) Rule diversity: Despite action concentration, rules maintain diverse trigger conditions from different variables, enabling fine-grained context-aware activation rather than uniform rule application. These patterns support REINS’s retrieval strategy: variable-indexed queries efficiently activate relevant rule subsets, while action aggregation via noisy-OR naturally prioritizes safety-critical recommendations.
C.7.2 Representative Rules
Table 11 lists 15 representative rules from REINS’s compiled rule database. The full post-deployment Neo4j database contains 1,023 rules across six driving scenarios, from which context-relevant subsets are retrieved at runtime via parameterized Cypher queries. These rules are automatically compiled from LLM-generated linguistic descriptions and calibrated using the threshold calibration mechanism described in Section 4.1.2. For fair comparison, Plan-R1 applies the same 15 representative rules uniformly at each step, while REINS selectively activates 2–3 context-relevant rules via the retrieval mechanism.
The 15 rules cover six of the seven template types defined in Definition 3.5: (1) THRESHOLD rules (R01, R02, R06) enforce numeric boundaries on physical variables such as TTC and speed; (2) IF-THEN rules (R03, R07) implement basic conditional logic with disjunctive guards; (3) AND-THEN rules (R04, R05, R11–R15) require multiple conditions to be satisfied simultaneously; (4) PRIORITY rules (R09) establish decision hierarchies for right-of-way scenarios; (5) MULTI-ACTION rules (R10) trigger compound actions under critical conditions; (6) TEMPORAL-CHAIN rules (R08) encode time-sensitive constraints for upcoming events. The complete definitions of all seven rule template types are provided in Appendix A.2, and the conflict resolution mechanism is described in Appendix A.3.
Appendix D Fairness Protocol, Robustness, Transfer, and Scalability
This appendix collects the studies that scope the harness claim and stress the main results: the domain-specific versus domain-agnostic components of the harness (D.1), the baseline fairness protocol with a matched re-run and a common-reference compliance audit (D.2), the runtime profile of the PDDL baseline (D.3), robustness to the LLM backbone and to prompt variation (D.4), what rollout verification filters (D.5), reactive replay and observation noise (D.6), cross-domain memory transfer (D.7), the latency of the online-miss cycle and its scheduling (D.8), and retrieval at deployment scale (D.9). Unless stated otherwise, all studies use the Highway scenario, five seeds, and the protocol of Section 5.1.
D.1 Scope of the Harness Claim
The three couplings are presented as a harness pattern, while the implementation is specialized to driving. Table 12 classifies each component of REINS and sketches the instantiation for a different trajectory-planning domain, robot-arm manipulation, whose action space is continuous and high-dimensional and whose safety notions (contact force, grasp stability) differ from driving. Two components are domain schemas that any instantiation must author; the remaining five transfer unchanged. The safety notion enters only through the variable schema and the terms of the objective J: calibrated predicates over contact-force variables are structurally identical to TTC guards, and the calibration procedure and the verification protocol do not change. The harness contribution lives in the five unchanged components; the two redesigned ones constitute the domain description that any planner for that domain must author anyway.
- Variable space and groups
- 44 variables in Env, Traffic, Ego, Action, Outcome
- joint angles and torques, end-effector pose, contact forces, object poses
- redesign
- Action space
- 5 driving meta-actions
- skill primitives (reach, grasp, lift, place, retreat)
- redesign
- Predicate grammar and thresholds
- TTC and THW guards
- force-margin, slip, and grasp-stability guards
- grammar unchanged, thresholds recalibrated
- Dynamics learning
- LLM prior, group-weighted ridge, per-variable Transformer
- same, retrained on domain data
- unchanged
- Verification
- collision and violation terms in J
- contact-force and stability terms in J
- protocol unchanged
- Indexed memory and retrieval
- variable-keyed graph schema
- same
- unchanged
- Acquisition loop
- miss detection, proposal, verification, write-back
- same
- unchanged
D.2 Baseline Fairness Protocol
Shared and unshared conditions. PDDL, DriReg, and LLaDA were conceived for symbolic planning domains, regulatory text, and driver handbooks respectively, none with a factored driving state, so each was re-implemented faithfully to its original design for closed-loop highway-env. Table 13 lists what is shared with REINS and what each method keeps by design. The shared conditions fix the observation space, action space, episodes, LLM backbone, and decoding; the unshared ones leave each method its own knowledge representation and thresholds, which leaves the rule-generation procedure as a confound. Three instruments below isolate the harness regardless.
- Observation space, action space, episodes
- shared
- shared
- shared
- GPT-4o backbone (2024-08-06), temperature 0 for rule generation
- shared
- shared
- shared
- 44-variable vocabulary (Appendix A.1) in rule-generation prompts
- own vocabulary
- own vocabulary
- n/a (linguistic rules)
- Threshold calibration
- uncalibrated
- uncalibrated
- n/a (no thresholds)
Matched re-run. We regenerated the PDDL and DriReg rules over the same 44-variable vocabulary, passed their thresholds through REINS’s calibration pipeline, and re-evaluated (Table 14). Input normalization improves both baselines by 3–5 CR points and explains a minority of the gap; the majority survives it.
- Highway
- 25.93
- 21.37
- 21.76
- 18.92
- 5.67
- Intersection
- 32.12
- 27.64
- 29.89
- 25.81
- 9.08
Bracketing with the ablations. Two ablations from Table 2 bracket the remaining gap with the paper’s own numbers. Hand-crafted rules inside the full harness still reach CR 11.23% on Highway, better than every matched no-harness variant in Table 14 and close to the best baseline Plan-R1 at 12.83%. Conversely, applying REINS’s rules uniformly, the way the baselines use rules, raises CR by 22–43% and PE by 34–58%. Worse inputs with the harness keep most of the gain; the same inputs without the harness lose it.
Common-reference compliance. Compliance in Table 1 is measured against each method’s own rule set. Table 15 re-scores every method against REINS’s compiled rule set as a common reference. Compliance is a property of the executed trajectory rather than of the planner: at each step, the reference rules whose guards hold in the logged state become active, and a violation is counted when the logged behavior fails an active rule (Appendix B.2). Each method therefore plans exactly as before and its trajectories are audited afterward, which is also how the four methods without native rule sets receive values. Because the reference set equals REINS’s planning set, REINS’s own value is unchanged by construction; the informative content is that the baseline ordering and the gaps persist.
- MPC
- n/a
- n/a
- 0.8712
- 0.8423
- MCTS
- n/a
- n/a
- 0.8831
- 0.8517
- DriveSpeak
- n/a
- n/a
- 0.8246
- 0.7912
- LLaDA
- n/a
- n/a
- 0.8412
- 0.8104
- PDDL
- 0.9123
- 0.8789
- 0.8867
- 0.8621
- DriReg
- 0.9452
- 0.9153
- 0.9083
- 0.8874
- SymAgent
- 0.9561
- 0.9274
- 0.9312
- 0.9067
- Plan-R1
- 0.9717
- 0.9553
- 0.9498
- 0.9231
- REINS
- 0.9956
- 0.9838
- 0.9956
- 0.9838
D.3 Runtime Profile of the PDDL Baseline
The PDDL baseline follows the pipeline in which the LLM writes the domain’s preconditions and effects offline and a classical solver executes at runtime [Guan et al., 2023, Liu et al., 2023]. The solver is Pyperplan [Alkhazraji et al., 2020], a Python STRIPS planner invoked in process at each decision step; there is no per-step LLM call. Its 4.95 ms per step on Highway (Table 1) decomposes into grounding 3.71 ms, search 0.94 ms, and plan extraction 0.30 ms. The solver re-instantiates every precondition against the current state at every step with no indexing, so grounding takes roughly three quarters of the budget. REINS avoids exactly this cost: variable-indexed retrieval touches 2–3 rules in under 1 ms, followed by a fixed-size rollout at H{=}5. This is the architectural payoff of consolidation with indexing.
D.4 Robustness to the LLM Backbone and to Prompt Variation
The LLM produces the dependency priors, the rule structures, and the Cypher queries, so we regenerate the whole offline pipeline with two further backbones and with three paraphrases of the dependency and rule-extraction prompts (Table 16). Rule structure varies mildly across backbones and paraphrases, while the calibrated thresholds and the final behavior barely move. The LLM picks variables, templates, and actions; calibration re-anchors every numeric threshold to data, so backbone differences wash out at the threshold level. Malformed or unsafe proposals never reach memory, because rollout verification rejects them regardless of which backbone or prompt produced them.
- GPT-4o (paper)
- n/a
- n/a
- 0.9956
- 5.67
- Claude Sonnet 4.5
- 87.3%
- 3.2%
- 0.9948
- 5.89
- Qwen2.5-72B-Instruct
- 81.6%
- 3.8%
- 0.9931
- 6.24
- Three prompt paraphrases, GPT-4o
- 91.2–94.6%
- —
- —
- 5.58–5.91
D.5 What Rollout Verification Filters
On the 1000-episode Highway deployment of Section 5.4, applying the windowed call rates of Table 3 to the 100,000 deployment steps yields roughly 39,000 logged proposals (an arithmetic consequence of the call rates, not an independent count). Of these, 2.1% failed schema validation, 18.0% were rejected by rollout verification, and 79.9% were accepted. Acceptances overwhelmingly hash-collide with rules already in memory (Eq. 8) and only update confidences; they deduplicate to the 57 unique rules that grow the memory from 88 to 145. A manual audit of the 57 unique rules judged 54 consistent with domain guidelines; the three flagged rules were over-specific and never activated again. Episodes in which at least one acquired rule fired show no elevated collision rate against episodes in which none fired (5.4% against 5.8%).
Three properties of the design bound what a plausible but incorrect proposal can do. Verification errs toward rejection: a rule is accepted only if every calibrated predicate holds along the predicted horizon (Eq. 7), so dynamics error costs availability rather than safety in the common case. Accepted rules never bypass the runtime loop: every executed action is re-verified by rollout at decision time (Section 4.2.1), so a wrongly accepted rule must also survive the per-step check before it can affect control. Finally, the residual dependence on dynamics fidelity is stated in Section 6.
D.6 Reactive Replay and Observation Noise
Reactive replay. In the four simulated scenarios the surrounding vehicles already react to the ego through IDM car-following with MOBIL lane changes. The real-world rows keep highD and rounD as recorded so that they reflect human behavior rather than a simulator’s. To measure the effect of this choice, a reactive-replay variant on highD switches recorded vehicles within 50 m of the ego to IDM once interaction occurs, following the reactive closed-loop protocol of nuPlan [Caesar et al., 2021]. REINS CR moves from 6.12% to 6.94% while Plan-R1 moves from 12.78% to 15.36%, so the gap to the strongest baseline widens.
Observation noise. We corrupt the observed variables with zero-mean Gaussian noise scaled to each variable’s standard deviation and, separately, drop 5% of frames (Table 17). Calibrated thresholds carry a data-derived margin and every action is vetted by a multi-step rollout rather than by a single reading, so REINS degrades more slowly than the strongest baseline at every level, with Compl. staying at or above 0.987. Full-stack perception errors (occlusion, tracking identity switches, map errors) remain out of scope.
- REINS
- 5.67
- 5.92
- 6.51
- 8.14
- 6.88
- Plan-R1
- 12.83
- 13.71
- 15.42
- 19.87
- 16.50
D.7 Cross-Domain Memory Transfer
We test how the memory behaves when the offline data are domain-shifted, using the checkpoint protocol of Table 3. Setting A compiles \mathcal{R}_{0} solely from highD and rounD (whose memories total 187 rules before merging and content-hash deduplication) and deploys on highway-env; Setting B compiles it solely from the four simulated scenarios (432 rules before deduplication) and deploys on highD and rounD. Table 18 reports the ep. 250 and ep. 1000 endpoints of each setting, together with a frozen-transfer control on Highway; the native reference rows come from Table 3 and Table 10.
- Setting A: \mathcal{R}_{0} from highD and rounD, deployed on highway-env
- Highway
- ep. 250
- 265
- 86.2
- 0.9612
- 11.84
- 2.71
- ep. 1000
- 349
- 14.9
- 0.9914
- 6.21
- 2.54
- ep. 1000, acquisition frozen
- —
- —
- —
- 11.20
- —
- native, ep. 1000
- 145
- 12.81
- 0.9956
- 5.67
- 2.50
- Intersection
- ep. 250
- 287
- 91.3
- 0.9487
- 15.62
- 4.87
- ep. 1000
- 391
- 17.2
- 0.9782
- 10.13
- 4.66
- native, ep. 1000
- 210
- 12.81
- 0.9838
- 9.08
- 4.58
- Setting B: \mathcal{R}_{0} from the four simulated scenarios, deployed on highD and rounD
- highD
- ep. 250
- 471
- 71.4
- 0.9702
- 9.87
- 2.79
- ep. 1000
- 508
- 13.6
- 0.9838
- 6.79
- 2.68
- native, ep. 1000
- 138
- 12.81
- 0.9867
- 6.12
- 2.62
- rounD
- ep. 250
- 478
- 79.8
- 0.9645
- 14.21
- 4.12
- ep. 1000
- 517
- 15.1
- 0.9821
- 10.24
- 3.97
- native, ep. 1000
- 170
- 12.81
- 0.9856
- 9.45
- 3.89
A domain-shifted memory starts degraded: at ep. 250 the call rate runs 86.2% on Highway against the native 70.0% of Table 3, and CR runs several points above the native value at the same checkpoint (11.84% against 7.05%). Acquisition recovers most of the gap within 1000 episodes: final CR lands within 0.5–1.1 points of native and Compl. within 0.003–0.006. On Highway, freezing the transferred memory prevents recovery: at ep. 1000 the frozen transfer stays at CR 11.20% against 6.21% with acquisition enabled, so the recovery comes from verification-gated acquisition rather than from the transferred rules themselves, mirroring the native pattern of Table 3, where frozen \mathcal{R}_{0} ends at CR 9.63% against the evolved 5.67%. Sim-to-real shows slightly smaller residual gaps and lower final call rates than real-to-sim; one plausible factor is its larger source memory (432 against 187 rules before deduplication).
The initial call rate of 86.2% also shows that most of the source-domain memory is not functionally reusable zero-shot in a new but still driving context. This is consistent with the safety-oriented design: thresholds are calibrated to the source-domain distribution, so under shift the harness re-invokes and re-verifies rather than reusing rules whose calibration may no longer hold. We therefore do not frame these results as evidence of strong zero-shot generalization; the limitation is stated in Section 6.
D.8 Latency of the Online-Miss Cycle and Its Scheduling
What PE counts. For every method, PE measures the synchronous action-selection computation per step. In the evaluated closed-loop setting, a miss completes proposal, verification, and write-back within the step while simulation time is paused, so the reported PE excludes the acquisition pipeline, namely the LLM call together with the subsequent parsing, calibration, verification, and write-back. Table 19 profiles each stage.
- Prompt assembly and state serialization
- 0.9 ms
- 1.4 ms
- background
- LLM rule proposal (GPT-4o API)
- 1.58 s
- 2.94 s
- background
- Parsing and schema validation
- 2.1 ms
- 3.0 ms
- background
- Threshold calibration on the sliding window
- 1.3 ms
- 1.9 ms
- background
- Rollout verification at H{=}5
- 1.6 ms
- 2.2 ms
- background
- Neo4j insert and index update
- 4.7 ms
- 6.8 ms
- background
- Full cycle, miss to usable rule
- 1.59 s
- 2.96 s
- background
Deployment scheduling. The cycle takes 1.59 s mean, dominated by the LLM call; the acquisition stages other than the LLM call total about 11 ms. In deployment the cycle moves off the critical path by construction, because the planner has a defined behavior without the acquired rule: the best action over the retrieved rules or, with empty retrieval, the safe action that maximizes minimum lookahead TTC (Eq. 24) together with a human-takeover alert. The current step executes that fallback while the cycle completes in the background, and the acquired rule serves later encounters. At 5 Hz the acquisition window spans about eight control cycles, during which the planner behaves as a verified conservative planner. Figure 10 contrasts the evaluated schedule with the deployment schedule.
D.9 Retrieval and Aggregation at Deployment Scale
As memory grows, retrieval and multi-rule aggregation must stay within the control window. The stress test runs on Highway and varies only the database size, inflating it with synthetic rules generated as variable and threshold perturbations of compiled rules that preserve the schema and the trigger-degree distribution (Table 20). Retrieval stays sub-millisecond and grows slowly with memory size, from 0.41 ms at the paper’s 1,023 rules to 0.79 ms at one hundred thousand, consistent with indexed lookup rather than linear scanning. Conflict aggregation does not grow with the database: retrieval returns at most k{=}10 rules regardless of memory size, so noisy-OR aggregation (Eq. 5) and the arbitration of Appendix A.3 cost O(k). On the online planning path, the database-size-dependent cost therefore concentrates in retrieval; index maintenance and write costs sit on the acquisition path, off the control loop.
- Cypher retrieval (ms)
- 0.41
- 0.55
- 0.68
- 0.79
- End-to-end PE (ms)
- 2.50
- 2.64
- 2.77
- 2.88