1–2 · Parse & Formalize

For Both Executive and Technical Readers

Natural language arrives. A typed CausalQuery leaves. Nothing else passes the boundary.

Language in. Structure out. No prose crosses the boundary.

Parse is the first and only LLM step on the inbound path. It runs under a fixed schema, function-calling or constrained decoding, so its output is always a typed object, never free text. It does two things: entity-linking (binding terms in the question to variables in the model registry) and intent extraction (determining which rung the question belongs to).

Formalize is pure code. Given the rung and the bound variables from Parse, the formal estimand is mechanical, no language model involved. Rung 1 yields P(Y | Z). Rung 2 yields P(Y | do(X), Z). Rung 3 yields P(Yx | X=x′, Y=y′).

If a term will not bind or the rung is ambiguous, Parse returns a clarification request. It does not guess. A failed parse never reaches Step 2.

One natural-language string in. One typed estimand out.

IN Natural-language question (string)
LLM Constrained decode under fixed schema
OUT CausalQuery, typed, versioned, loggable

Causal Query parse output · typed, not prose
FieldValue
Rung2, interventional
TargetSepsis
InterventionTreatment = empirical
EvidenceSeptic Appearance (soft, p=0.76), Lactate (hard, gt_4)
Scopeicu_adult
Formalized estimand: P(Sepsis | do(Treatment=empirical), Septic Appearance=0.76, Lactate=gt_4). Pure code from here on; no LLM involved in this step.

Translator, not reasoner. It binds terms. It does not compute.

The LLM at Step 1 is constrained to a schema. It cannot produce prose. Its job is to map the clinician’s words to variables that exist in the model registry. If “lactate came back at 4.1” binds to Lactate = gt_4, that binding is logged and auditable. If it cannot bind, it asks.

This is the only point where natural language enters the deterministic pipeline. After Step 2, everything is typed objects until Step 8 (Narrate).

The rung is read from linguistic markers, not inferred.

Pattern Rung Estimand
“what is the rate of”, “how likely”1P(Y | Z)
“if we set”, “if we do X”2P(Y | do(X), Z)
“would have”, “had we”3P(Yx | X=x′, Y=y′)

Evidence and Pipeline. Nothing else runs at this step.

Pipeline →, defines the step sequence and the schema Parse operates under.
Evidence →, defines how soft and hard evidence is typed and passed to the model.