State-Dependent PCFGs (PSDGs)
- State-dependent PCFGs are an extension of traditional PCFGs that condition rule probabilities on evolving observable and latent state variables.
- They enable efficient, exact online inference by leveraging a modular, tree-structured approach combined with dynamic state transitions.
- This methodology enhances plan recognition in complex environments such as traffic monitoring and air combat by overcoming limitations of fixed probability models.
State-dependent probabilistic context-free grammars (state-dependent PCFGs, or PSDGs) are extensions of PCFGs that capture stochastic plan-generation under uncertainty by conditioning production probabilities on an evolving hidden state. Such state variables may encode both observable environmental context and unobserved, internal agent variables, enabling rigorous, interpretable modeling of planning behavior in applications such as plan recognition, traffic monitoring, and adversarial air combat. PSDGs marry the tree-structured, modular expressivity of PCFGs with explicit, dynamic world-state, supporting efficient, exact online probabilistic inference not feasible with generic dynamic Bayes nets or vanilla PCFGs (Pynadath et al., 2013).
1. Formal Specification of Probabilistic State-Dependent Grammars
A Probabilistic State-Dependent Grammar is defined as a 7-tuple
where:
- : finite set of terminal symbols,
- : finite set of nonterminal symbols,
- : start symbol,
- : state-variable domain, which can be factored into external observable and internal latent variables,
- : prior distribution over initial state,
- : set of productions () each with a state-dependent probability function such that ,
- : state-transition kernel encoding the Markovian update rule for upon emission of a terminal.
Generative semantics proceed by sampling , then—at each step —expanding the current leftmost nonterminal in state via stochastic selection of production with probability . Expansion continues depth-first; terminals emitted increment and transition the state by . The joint probability over derivation , emitted string , and state sequence is
2. Comparison to Standard PCFGs
Ordinary PCFGs are defined as tuples with fixed, context-independent rule probabilities:
whereas
Thus, in PSDGs, production selection is conditioned on the agent's current planning state . This context conditioning is crucial for modeling dynamic behavior, such as varying the likelihood of driving maneuvers based on external (e.g., exit proximity) or internal (e.g., aggressiveness) state. All stochasticity in rule choice becomes explicitly state-dependent, increasing modeling fidelity for sequential decision applications (Pynadath et al., 2013).
3. State Dynamics and Observation Model
The state space in a PSDG is typically factored:
- : visible variables (e.g., position, velocity, observable traffic features, radar contacts).
- : hidden/latent features (e.g., goals, skill, preference, aggressiveness).
State transitions follow a one-step Markov property:
At recognition (inference) time, a subset of may be partially observed, so plan recognition operates over consistent with available evidence.
4. Efficient Inference and Belief Propagation
Online inference in PSDGs must efficiently update the posterior distribution over stack configuration, current productions, and hidden state. The critical insight is that, conditioned on parse stack level and current state, expansions are independent—enabling scalable belief propagation.
Define hierarchical belief states:
- probability nonterminal is active at stack level with prior state ,
- probability production is active at level with prior state ,
- probability that production at level terminated at given prior state .
After incorporating evidence via the Markov kernel and likelihood of terminal emissions, recurrences for belief update are
with computed bottom-up over . This enables explanation (filtering) and prediction (one-step ahead) passes with per-step computational cost , where is size of filtered state, total number of productions, the longest RHS, and max stack depth. This approach maintains exactness while remaining tractable for moderate , with practical inference times reported (e.g., 1s per timestep for traffic domains with , , , on legacy hardware) (Pynadath et al., 2013).
5. Empirical Examples in Plan Recognition Domains
Traffic Monitoring
A traffic-domain PSDG example illustrates state-dependence. Nonterminals: Drive, Pass, Exit; Terminals: {Left, Right, Stay}. The state . Productions include, e.g.,
| Production | Probability function |
|---|---|
| Drive Stay Drive | constant $0.2$ |
| Drive Left Drive | $0.1$ if exitDistance 1 km, else $0.01$ |
| Drive Pass Drive | $0.3$ if aggressiveness=high, else $0.05$ |
| Drive Exit | soft-threshold(exitDistance) |
After observing “Exit” taken and new state , only : Drive Exit is consistent with the trajectory. Inference updates the posterior on production and state accordingly, and predicts next moves via .
Air Combat
In the air-combat setting, nonterminals include Engage, Attack, Evade, Disengage. State features: range (close, medium, far), threatLevel (low, high). For example, production
Inference proceeds identically, with efficiency increases when all state variables are fully observable.
6. Context-Dependency and Relation to Probabilistic Context-Sensitive Grammars
PSDGs instantiate a form of probabilistic context-sensitive dependency by allowing production probabilities to depend on state, including unobservable latent variables and environmental context. Other models—such as probabilistic context-sensitive grammars (PCSGs) (Nakaishi et al., 2024)—make the dependence explicit in rule formulation by including left/right neighbor context in production application. In PCSGs, rewriting a nonterminal at position may depend on neighboring symbols , and rule probabilities interpolate between context-free and context-sensitive forms,
depending on parameter , with recovering the PCFG and breaking context-free independence, as evidenced by nontrivial pairwise and higher-order mutual information.
PSDGs differ in that their context is an explicit, possibly high-dimensional or latent state variable, and state transitions are tightly coupled to plan (production) execution. Both paradigms extend PCFG expressivity to domains where substructure probability must depend nontrivially on plan or environmental context.
7. Significance and Limitations
PSDGs address the key limitation of PCFGs for modeling structured agent or system behavior in partially observed, dynamic environments: namely, the inability of PCFGs to represent context-sensitive plan-generation. By encoding production probabilities as functions of state, PSDGs offer modular, interpretable modeling and allow exact, online inference leveraging state Markovity and stack factorization.
A limitation is the exponential scaling in state and stack depth, though specialized recurrences and state filtering maintain tractability when is moderate and only subsets of state are observable.
A plausible implication is that, as plan-recognition complexity and context-sensitivity increase, PSDGs or related models with explicit latent or contextual dependence will be crucial for practical, scalable inference in real-world sequential decision domains (Pynadath et al., 2013, Nakaishi et al., 2024).