Source-linked AI summary

State-Grounded Conditioning: Wrapping User-Facing LLM Agents Where Direction Depends on Live State

Qi Liu, Xiaoyang Yuan, Yubin Ruan, Zhuomeng Zhang, Wenjin Wang, Di Wu, Mingye Xu, Xinyi Mou, Xingxi Yin, Ke Feng, Zixun Sun

arXiv:2609.27606v1cs.AI

TL;DR

User-facing LLM agents must respond to live state, but task-complete replies can still choose a direction that conflicts with that state. SGC externalises state-dependent control into three wrappers with explicit conditioning dependencies. On the in-game coaching benchmark, all three wrappers improve grounding while maintaining low first-token latency.

  • Problem

    Live-state agents can produce task-complete responses whose chosen direction misaligns with the user's current state.

    Source: §3.1 · p. 3
  • Method

    SGC externalises state-dependent control into rules over structured interpretations and live state, then conditions generation through three wrappers.

    Source: §1 · p. 2
  • Results

    96.7% turn-level grounded accuracy and 83.5% session-level grounded accuracy with all wrappers, versus 61.1%/69.8% and 20.0%/26.5% for Prompting/PE-Agent, respectively; mean first-token latency is 1.5 s.

    Source: §1 · p. 2
  • Takeaways & Limitations

    Cumulative comparisons support approximate state-slice orthogonality, while not establishing independent per-wrapper effects.

    Source: §3.3 · p. 3

    Cumulative comparisons measure gains conditional on preceding wrappers and do not establish isolated effects or invariance to addition order.

    Source: §3.3 · p. 3

Abstract

from arXiv · show

We introduce State-Grounded Conditioning (SGC), a design principle for user-facing LLM agents that must condition on live user state (game state, session history, live inventory), and a distinct failure class we call direction drift: task-complete responses whose chosen direction misaligns with the current state. SGC externalises state-dependent control into rule kernels over structured inputs and three primary state slices, via Perception, Grounding, and Interaction wrappers with explicit conditioning dependencies. We evaluate SGC on a 200-session anonymised benchmark ($\approx$1,000 assistant model turns) from an in-game conversational coaching agent that guides players through consecutive competitive matches, reporting mean first-token latency and five human-annotated dialogue-quality metrics that jointly cover factual grounding and coach-like guidance progression. The Perception wrapper holds mean first-token latency at 1.5s (vs. 6.1s for PE-Agent inside a production tool-use harness); enabling all three wrappers lifts turn-level grounded accuracy from 61.1%/69.8% (Prompting / PE-Agent) to 96.7% and session-level grounded accuracy from 20.0%/26.5% to 83.5%; session-level grounding-failure incidents drop by $\approx$78% relative to the strongest baseline. A cumulative ablation shows complementary incremental gains as the wrappers are added. These results inform approximate state-slice orthogonality, without establishing independent per-wrapper effects.

1 Introduction

Live user-facing agents must condition on changing state, yet can produce task-complete replies that steer in the wrong direction. SGC externalises state-dependent control into three wrappers; on the coaching benchmark, the full design improves grounding while keeping first-token latency low.

1 Introduction

  • Prompt-based and harness-based agents can answer questions but may fail to coach players through in-match problems with timely, coherent, progressive guidance.The agent must condition on live state such as recent utterances, inventory, and session history within tight latency budgets.Source: §1 · p. 1
  • Direction drift describes task-complete, on-topic replies whose chosen direction misaligns with the user's current state.The observed forms include latency, slot, fatigue, and coherence drift.Source: §1 · p. 1
  • SGC moves state-dependent control decisions from implicit LLM reasoning into rules over structured interpretations and live state, then supplies their outputs to generation.The rule kernels are deterministic for fixed inputs and configuration, while LLM interpretation and wording need not be.Source: §1 · p. 2
  • The three wrappers target intent-context, fact-slots, and session-history slices, respectively, addressing tool freezing, slot conflicts, and repeated recommendations.Their primary targets are latency drift, slot and coherence drift, and fatigue drift.Source: §1 · p. 2
  • 96.7% turn-level grounded accuracy and 83.5% session-level grounded accuracy with all wrappers, versus 61.1%/69.8% and 20.0%/26.5% for Prompting/PE-Agent, respectively.Mean first-token latency is 1.5 s, versus 6.1 s for PE-Agent and 2.3 s for Prompting; session-level grounding-failure incidents drop by approximately 78% relative to the strongest baseline.Source: §1 · p. 2
  • The paper formalises direction drift as distinct from task-completion failures and analytically extends wrapper applicability to code completion, e-commerce explanations, and voice assistants.The domain transfer is analytical rather than an empirical study.Source: §1 · p. 2

2 Related Work

Prior work addresses agent orchestration, constrained generation, retrieval, and deployment, while SGC focuses on aligning an agent's direction with live state. The paper presents SGC as complementary to these approaches.

Generic agent harness

  • Generic harnesses organize planning, tools, and memory, whereas SGC targets whether an agent's chosen direction fits live state; the approaches are composable.The paper positions SGC above generic harnesses, including Plan-and-Execute (Wang et al., 2023; Xu et al., 2023) and Workflow Graphs.Source: §2 · p. 2

Fast-slow and structured/constrained generation

  • Fast-slow and structured-generation systems split agent functions or shape output, while W1 dispatches tools early and W2 selects compatible response paragraphs.W2 targets contradictory judgements about the same constraint, not praise–apology co-occurrence in general or guaranteed semantic correctness.Source: §2 · p. 2

Retrieval and production deployment

  • RAG supplies retrieved evidence, whereas SGC derives structured control variables from parsed inputs and live state; deterministic rules do not ensure input correctness.The paper also distinguishes SGC's pre-deployment design focus from Agent-in-the-Loop's post-deployment improvement (Zhao et al., 2025).Source: §2 · p. 2
  • The paper addresses real-time coaching for a human player, unlike game-agent work focused on autonomous NPC play.The agent is meant to serve the human user rather than replace them.Source: §2 · p. 3

3 State-Grounded Conditioning: The Design Principle

The section defines direction drift as a task-complete response that conflicts with the direction implied by live state. It then presents SGC's explicit conditioning design and qualifies its state-slice orthogonality as approximate.

3.1 Problem Formulation

  • Direction drift occurs when a task-complete response misaligns with the correct direction implied by live state, as judged against an operational reference direction.It differs from hallucination and task failure: a response can state true facts and complete the task yet still steer incorrectly for that user and moment.Source: §3.1 · p. 3

3.2 The SGC Principle

  • SGC externalises state-dependent control into explicit rules over structured interpretations and live state, then injects their outputs as conditioning variables for generation.The reply LLM also conditions on shared input and static state; rule determinism for fixed inputs does not extend to upstream interpretation or final wording.Source: §3.2 · p. 3, Figure 1 · p. 3

3.3 Approximate State-Slice Orthogonality

  • The design assigns intent-context, fact-slot, and session-history as primary live-state slices, with history covering the prior 20 turns.These slices partition source fields, but c1 also conditions W2 and W3, so separate responsibilities do not imply computational or statistical independence.Source: §3.3 · p. 3
  • Approximate orthogonality means differentiated primary roles with cross-slice effects; cumulative comparisons measure gains conditional on preceding wrappers, not isolated effects or order invariance.State-field separation alone is not empirical proof of orthogonality.Source: §3.3 · p. 3

4 Perception Wrapper: State-Aware Intent-to-Tool Freezing

The Perception Wrapper targets latency-induced direction drift by deciding whether to dispatch a tool call before the full plan and narration finish. A structured intent lookup enables early dispatch when current state is available, while unmatched or state-unavailable cases wait for the fallback plan.

  • Under tight response budgets, serial intent classification and planning can leave too little time for tool execution and live-state retrieval, prompting decisions based on stale state.The paper calls this latency-induced direction drift.Source: §4 · pp. 3–4
  • W1 streams intent, sub-intent, narration, and fallback plan in a fixed order, triggering an early decision when the sub-intent closes.Narration can stream to TTS while the plan provides fallback tool calls.Source: §4 · p. 4
  • A lookup hit among about 50 intent–sub-intent pairs freezes and dispatches a tool call when the required state snapshot is available; otherwise the system waits for the plan.Dispatch overlaps tool execution and state loading with remaining streamed segments and speech playback.Source: §4 · p. 4

5 Grounding Wrapper: State-Coupled Fact-Slot Diff

The Grounding Wrapper separates fact-slot reconciliation from reply generation. It grades discrepancies between extracted request slots and live facts, then selects compatible paragraph candidates to condition the reply.

  • When reconciliation is left to reply generation, the LLM may invent unowned entities, apologize for owned entities, or give incompatible judgements about one constraint.The paper distinguishes praise and apology about different constraints from actual inconsistency.Source: §5 · p. 4
  • W2 uses a dedicated LLM call with independent context to extract request slots, then reconciles them against live facts.Rules grade discrepancies as hard, soft, or hint; eligibility rules determine candidate paragraphs and required paragraphs.Source: §5 · p. 4
  • For each constraint, the paragraph scheduler selects among incompatible alternatives while retaining required paragraphs, and the selected plan conditions reply generation.A hard conflict blocks praise affirming the violated constraint and requires an explanation; deterministic reconciliation does not guarantee extraction accuracy or generated-text consistency.Source: §5 · p. 4

6 Interaction Wrapper: Cross-Turn State Machine

The Interaction Wrapper uses session history to control guidance across turns, targeting fatigue-induced direction drift. Its seeded scheduler filters and selects guidance candidates, then writes metadata for the next turn.

  • Guidance that is reasonable alone can repeat, contradict still-applicable advice, or acquire a mechanical tone across a session.The paper terms this fatigue-induced direction drift.Source: §6 · p. 4
  • W3 selects guidance as a pure function of resolved state, candidates, and seed, using live history and intent context as separate conditioning inputs.Its decision tree depicts fire and abstain paths with a meta writeback loop.Source: §6 · p. 5, Figure 2 · p. 5
  • The scheduler removes cooling candidates and rule violators, applies a seeded Bernoulli leak and weighted choice, then writes back the selection or no-guidance result.Cooldown prevents the same candidate in consecutive turns, and an injectable seed makes a session's guidance sequence reproducible.Source: §6 · p. 5

7 Benchmark Evaluation

On a 200-session benchmark, Full SGC improves grounded accuracy and guidance metrics over Prompting and PE-Agent while maintaining lower first-token latency than PE-Agent. The cumulative ablation shows incremental gains, but does not isolate independent wrapper effects.

7.1 Benchmark Construction

  • The benchmark contains 200 anonymised production-trace dialogue sessions, about 1,000 scored responses, and varied state-dependent interactions.The same evidence and scoring criteria apply across configurations.Source: §7.1 · p. 5

7.2 Evaluation Protocol and Metrics

  • Dual independent human annotators, with third-annotator adjudication, score grounding against query, context, live state, and evidence; no LLM-judge label enters test-set metrics.The evaluation reports mean first-token latency plus five dialogue-quality metrics; grounded accuracy is measured at turn and session scales.Source: §7.2 · pp. 5–6

7.3 Main Results and Cumulative Ablation

  • 96.7% TGA and 83.5% SGA for Full SGC, versus 69.8% TGA and 26.5% SGA for PE-Agent; session grounding failures fell from 73.5% to 16.5%.Full SGC held mean first-token latency at 1.5 s, compared with 6.1 s for PE-Agent; guidance metrics also improved over both baselines.Source: §7.3 · p. 6
  • In the cumulative ablation, W1 raises SGA to 46.5%, adding W2 raises it to 56.5%, and adding W3 raises it to 83.5%.The gains are conditional on preceding configurations and include propagated effects; the design does not isolate every wrapper or establish addition-order invariance.Source: §7.3 · p. 6

8 Analytical Transfer to Three Domains

The paper frames SGC as analytically transferable beyond game coaching, while its empirical claims remain bounded by one deployed in-game coaching system. Its stated scope, unresolved failure classes, evaluation boundaries, and deployment safeguards qualify that transfer.

8 Analytical Transfer to Three Domains

  • SGC is analytically extended to code completion, e-commerce explanations, and voice-assistant scheduling, but these examples are not empirically evaluated.The paper conditions analogous designs on live state that can be divided into intent-context, fact-slots, and session-history slices.Source: §8 · p. 6

Limitations

  • The empirical claims rest on one deployed in-game coaching system, with no experimental validation outside that primary case study.The paper says a minimal W1 Copilot-style benchmark is committed as supplementary material.Source: Limitations · pp. 6–7
  • SGC is presented as applicable when real-time state constraints, measurable direction-drift costs, and machine-readable state slices co-occur.For one-shot Q&A, creative writing, or low-stakes tasks, the paper says a generic harness or RAG alone suffices.Source: Limitations · p. 7
  • Unmodelled cross-slice interactions, unavailable state, and unmapped intents remain outside the wrappers; the interaction estimate is a pilot figure, not a final benchmark value.The pilot estimate is approximately 4% of benchmark sessions on an annotated subset; the full 200-session value is reserved for the camera-ready version.Source: Limitations · p. 7
  • Reported quality metrics rely on human annotation, correct-direction judgments remain subjective, and the paper reports neither tail-latency tables nor direct user-side outcomes.The text also notes wider intervals for DGP- and CCC-eligible strata and says the PE-Agent comparison is not effort-matched, so part of its gap may reflect tuning.Source: Limitations · pp. 7–8

Ethics Statement

  • Deployment safeguards make coaching advisory, apply it symmetrically in supported competitive modes, and anonymise benchmark data while withholding raw production logs.The paper says the system is version-locked to game balance patches; the retained artefact contains 200 sessions and approximately 1,000 assistant turns.Source: Ethics Statement · p. 8

A Full Wrapper Interface Contracts and State-Field Table

The appendix specifies wrapper interfaces, derived conditioning dependencies, and implementation boundaries. It distinguishes primary state fields from shared derived inputs and documents how W1 dispatch, W2 fact-talk separation, and W3 replay behave.

A Full Wrapper Interface Contracts and State-Field Table

  • The three wrappers have separate primary state fields, but W2 and W3 both consume W1’s c1, so field separation does not establish metric orthogonality or independence.The appendix describes approximate orthogonality as differentiated primary roles with cross-slice effects, and cumulative gains as conditional on preceding wrappers.Source: A Full Wrapper Interface Contracts and… · pp. 10–11
  • W1, W2, and W3 emit control outputs consumed alongside static state by the LLM, while W2 and W3 also receive W1’s conditioning output.The signatures assign intent-context to W1, fact-slots to W2, and session-history to W3.Source: A Full Wrapper Interface Contracts and… · pp. 10–11
  • On a W1 mapping hit with required live state, the system freezes tools after sub-intent recognition and dispatches without waiting for narration or the fallback plan.A lookup miss waits for the fallback plan; unavailable required state prevents the early path, and a cache hit alone does not establish freshness.Source: §A.1 · p. 11, §A.5 · p. 11
  • W3 stores a per-turn answer.meta record, and identical seeds with identical prior records produce byte-identical outputs across replays.The record includes guidance type, lineup ID, cooldown writeback, seed, and candidate-pool hash.Source: §A.3 · p. 11
  • The appendix presents state-slice-aligned deterministic conditioning as the shared pattern behind three engineering decisions that arose separately from production incidents.Its claimed contribution is elevating the pattern to a transferable design principle, rather than presenting the wrappers only as isolated code.Source: §A.4 · p. 11

A.6 · W2 Fact-Talk Separation Pipeline

  • W2’s FACT layer extracts and repairs slots, diffs them against live facts, grades conflicts, and controls eligible paragraphs before constrained TALK generation.Structural paragraph selection does not guarantee semantic correctness of the final text.Source: Figure 3 · p. 12

A.8 · Baseline Comparison

  • The cited appendix entry is A.7, “Aggregate Benchmark Metrics”: Table 3 is referenced from Section 7.3, and Table 4 gives the cumulative configuration differences.Source: §A.7 · p. 12

B Drift Taxonomy: Diagnostic Tags on the 200-Session Benchmark

The benchmark records diagnostic drift tags alongside human metric labels, with tags distinct from sampling strata and primary scores. The intent-to-tool mapping and paragraph scheduler describe related control mechanisms.

B Drift Taxonomy: Diagnostic Tags on the 200-Session Benchmark

  • Drift tags diagnose latency, slot, fatigue, coherence, and cross-slice failures; they are not sampling strata or primary metrics, and sessions may carry multiple tags.All 200 sessions are tagged, while TGA, SGA, TGQ, DGP, and CCC remain the primary scores.Source: B Drift Taxonomy: Diagnostic Tags on… · p. 12
  • The released benchmark records turn-indexed state snapshots, diagnostic tags, metric labels, and replies from full and wrapper-ablated systems.The snapshots omit wall-clock timestamps, geolocations, and device identifiers.Source: B Drift Taxonomy: Diagnostic Tags on… · p. 12

C Intent-to-Tool Mapping Table Φ

  • W1’s partial function Φ is defined over approximately 50 registered intent/sub-intent pairs; unmatched inputs fall through to an LLM-generated plan and increment a maintained counter.The mapping table is an illustrative excerpt, and fall-through rate is maintained as a metric.Source: C Intent-to-Tool Mapping Table Φ · p. 12
  • The paragraph scheduler chooses a plan P that includes required paragraphs and stays within eligible candidates, selecting at most one incompatible alternative for a constraint.Eligibility may include multiple alternatives.Source: D Paragraph Mutex Rules · p. 12

D Paragraph Mutex Rules

The appendix specifies paragraph eligibility and selection constraints, W3 cooldown configuration, and interface adaptations for three analytical transfer domains. It distinguishes deterministic selection rules from guarantees about generated-text consistency and identifies open engineering challenges.

D Paragraph Mutex Rules

  • Paragraph eligibility and required-paragraph constraints are established before selection; recomputing eligibility from the same slots, state, and rules is deterministic, but does not guarantee semantic consistency in generated replies.Required paragraphs constrain selection rather than compete as optional alternatives; structural exclusion of incompatible candidates does not prevent incompatible judgments in the reply.Source: D Paragraph Mutex Rules · pp. 13–14, Table 7 · p. 14

E Cooldown Configuration for W3

  • W3 versions cooldown windows, leak probabilities, and weighted-sample weights; one session-id-seeded RNG reproduces the guidance sequence across all three reply branches.The branches share a sampler kernel and differ in candidate pools and associated leak probabilities.Source: E Cooldown Configuration for W3 · p. 14

F Analytical Transfer Interface Contracts

  • The transfer appendix maps state slices to interface adaptations and open engineering challenges for each domain, providing implementation-level detail for the targets.The three targets are code completion, e-commerce recommendation explanation, and voice-assistant cross-session scheduling.Source: F Analytical Transfer Interface… · p. 14

F.1 · Code Completion (W1)

  • For code completion, W1 maps trigger types to signature, LLM, or cache paths; its open challenge is inferring implicit intent from cursor and keystroke context.The interface includes the live file path, cursor position, recent edits, project type, and invocation origin.Source: §F.1 · p. 15

F.2 · E-commerce Recommendation Explanation (W2, W2 ◦W3)

  • For e-commerce, W2 uses item and preference slots with hard, soft, and advisory conflict tiers; resolving implicit versus explicit preferences remains an open challenge.W2 ◦ W3 is the only natural single-target composition identified, and paragraph selection avoids incompatible judgments about the same preference without banning all praise–apology co-occurrence.Source: §F.2 · p. 15, §F.3 · p. 15

F.3 · Voice Assistant (W3)

  • Voice-assistant W3 uses session summaries and ambient state for reminders and follow-ups; continuous ambient state may require polling-based cooldown resolution.Only e-commerce is identified as a natural W2 ◦ W3 composition on a single target.Source: §F.3 · p. 15

G Benchmark Construction Protocol

The benchmark protocol samples and scores anonymised production sessions using shared grounding references, locked rubrics, and human annotation. It also documents judge and latency procedures, residual blinding and anonymisation risks, and observed engineering costs.

G Benchmark Construction Protocol

  • The benchmark uses 200 production-trace sessions sampled across evaluation eligibility and session length, with dual human annotation and third-annotator adjudication.The shared reference set records turn-indexed rules, live-state snapshots, tool results, and preferences; pre-registered rubrics are locked before scoring.Source: §G.1 · p. 15, §G.2 · p. 16, §G.4 · p. 16
  • Configuration labels are stripped and turn order shuffled before annotation, reducing position-based unblinding but not eliminating inference from reply formats.Annotators may still infer a configuration from surface features.Source: §G.4 · p. 17
  • Pilot agreement exceeds preregistered targets: weighted κ is 0.68–0.76 for TGQ/DGP/CCC, and unweighted κ is 0.71–0.79 for TGA/SGA claim verdicts.Full-sample κ values and confidence intervals are deferred to the camera-ready table; the benchmark has 200 sessions, with 60 each eligible for DGP and CCC.Source: §G.5 · p. 17

G.6 · LLM-as-a-judge reference

  • The LLM judge is used for development-set rubric calibration and test-set diagnostic cross-checks, never as a primary source for reported test labels.A paired-inversion audit on 30 development sessions changed aggregate score direction on at most 5% of sessions.Source: §G.6 · p. 17

G.7 · Latency measurement condition

  • Latency is mean request-to-first-token time, measured across the same sessions on identical hardware and network settings after excluding two warm-up requests per batch.The authors attribute PE-Agent’s higher latency to its serial planner–executor–response path and W1’s early tool freezing to removal of that serial path.Source: §G.7 · p. 17

G Benchmark Construction Protocol

  • The benchmark is pseudonymised rather than fully anonymised under a strict interpretation; reidentification risk against external data has not been formally quantified.Direct identifiers are removed, but entity and lineup aliases are retained by the authors and not released with the benchmark.Source: §G.9 · p. 18

H Extended Discussion: Cost and Learned Wrappers

  • Observed maintenance is roughly one engineer-week per month, with costs distributed across slot-schema updates, intent-to-tool mappings, scheduler tuning, and instrumentation.This is a rough internal engineering-time estimate, not a precisely measured cost.Source: H Extended Discussion: Cost and… · p. 18
Loading 2609.27606v1…