Dual Fact and Statute Extraction
- The paper introduces dual extraction pipelines—Prosecutor-LLM and Defense-LLM—to isolate fact tuples and statute candidates for rigorous legal reasoning.
- It employs schema-driven prompting to enforce strict adversarial role isolation, ensuring that prosecutorial and defensive outputs remain unbiased.
- The method transforms natural-language case narratives into Z3-compatible logical constraints, enabling automated and verifiable adjudication.
Dual Fact and Statute Extraction is a principled procedure for isolating, representing, and formally grounding the adversarial views of legal actors from natural-language case narratives. As employed in Stage 2 of the L4M framework, this approach operationalizes rigorous role isolation by constructing two parallel extraction pipelines—one prosecutorial, one defensive—each tasked with mapping free-text case data to structured tuples and candidate statute lists. The process transforms ambiguous human narrative into Z3-consumable logical constraints, enabling subsequent automated, verifiable adjudication via SMT solvers (Chen et al., 26 Nov 2025).
1. Adversarial Role Isolation and Architectural Overview
Dual Fact and Statute Extraction occupies the pipeline segment between case narrative ingestion and solver-centric formal reasoning. Its core elements are two distinct LLM agents: Prosecutor-LLM (P-LLM) operating under an accusatory objective (“maximize conviction”), and Defense-LLM (D-LLM) operating under an exculpatory objective (“maximize acquittal”). Each agent interacts independently with the identical source text, governed by mutually exclusive system prompts. This strict prompt isolation ensures that neither model accesses nor contaminates the other’s contextual tokens, reasoning artifacts, or retrieval logs. The result is two independent artifact sets: fact tuples (, ) and statute candidates (, ), each tagged by their generating agent. This architectural choice enforces adversarial argument clarity and prevents bias-bleed, which would otherwise emerge if a single model or agent attempted to synthesize both prosecutorial and defensive extractions.
| Extractor Agent | Objective | Output Artifacts |
|---|---|---|
| Prosecutor-LLM | Maximize conviction | , |
| Defense-LLM | Maximize acquittal | , |
A plausible implication is that such dual extraction better mirrors procedural legal argumentation, retaining the adversarial signals required for clear symbolic reasoning by downstream formal adjudicators.
2. Prompting Strategies and Schema Templates
Prompt engineering is foundational for adversarial isolation. Each LLM receives a system prompt that prescribes a single legal stance and demands strict output conformance to a prescribed JSON schema. The P-LLM’s prompt restricts it to extracting only facts and statute provisions supportive of conviction, while the D-LLM’s prompt prioritizes mitigatory or exculpatory elements. Both employ identical output structure:
1 2 3 4 5 6 7 8 9 10 |
{
"facts": [
{ "subject":…, "predicate":…, "object":…, "confidence":… },
…
],
"statutes": [
{ "article":…, "clause":…, "snippet":…, "score":… },
…
]
} |
Few-shot examples guide each agent, with P-LLM samples highlighting inculpatory facts (e.g., “Alice sold ecstasy,” “consideration 200 USD”) and D-LLM admitting minimal, often mitigatory facts (e.g., “no prior convictions,” “full confession”). Statute extraction similarly bifurcates: the prosecutorial agent surfaces principal charges; the defense agent includes alternative provisions or mitigatory clauses when appropriate.
This schema-driven prompting yields high-quality, role-aligned extractions essential for formal grounding.
3. Data Structures: Fact Tuples and Statute Candidates
Both fact and statute extraction adopt rigorously defined tuple formats. Fact tuples are assembled as:
where is the normalized subject (e.g., case actor), a closed-set predicate (e.g., action, status), an object value (numeric, boolean, categorical, or textual), and a confidence score in . Typical instantiations include temporal, causal, and relational facts:
- Temporal: <“sale_event”, “time”, “2024-03-10T17:00”, 0.90>
- Causal: <“Gong_Qiang”, “prior_conviction_date”, “2019-05-01”, 0.95>
Statute candidates are represented as quadruples:
where is the statute article, its clause or paragraph, a snippet (15–25 words), and a retrieval or relevance score.
A plausible implication is that this tuple-based representation harmonizes both human-understandable and symbolic reasoning requirements, facilitating translation to formal logic.
4. Formal Logical Grounding and Constraint Generation
Post extraction, the agent outputs are merged via the Autoformalizer, forming a unified set of predicates and clause guards suitable for SMT input. Fact encoding proceeds as:
For statutes, a hierarchical meta-schema is adopted. Level 0 defines scope:
Level 1 reduces to article guards:
Level 2 specifies clause-guard formulas, e.g.:
Resulting Horn clauses instantiate statutory reasoning, e.g.,
The aggregate constraint set sent to Z3 merges all fact and statute predicates and meta-constraints (), enabling consistent, clash-free formal adjudication.
5. Autoformalizer Integration and Iterative Self-Critique
The Autoformalizer executes several critical responsibilities:
- Provenance tagging: Each fact and statute retains its agent source, supporting role-aware constraint revision.
- Knowledge base lookup and grounding: Quantitative and textual objects are normalized by referencing domain ontologies (e.g., legal thresholds for “qty”).
- Z3 translation: Each tuple yields corresponding Z3 code, with facts asserted as predicates and statute guards expressed as logical assertions.
- Self-critique loop: Upon detecting unsatisfiable constraint sets (“UNSAT” or “UNKNOWN”), Z3 returns a minimal unsat core. The Autoformalizer identifies the specific origin (prosecutor or defense) of conflicting artifacts and prompts targeted revision, permitting up to three rounds before escalation to human oversight.
This suggests that the Autoformalizer acts both as a formal integrator and as a quality assurance module, balancing adversarial vigor with logical tractability.
6. Representative Worked Example
In practice, the dual extraction process operates as follows:
Case narrative: “Gong Qiang received 1000 RMB from Luo and delivered 2 g of methamphetamine. He has prior drug convictions within 5 years and made a full confession.”
Prosecutor-LLM output:
f₁=‹“Gong_Qiang”, “sold_qty_meth”, 2.0, 0.95›, f₂=‹“Gong_Qiang”, “recidivist_5yr”, true, 0.90›, f₃=‹“Gong_Qiang”, “confession”, true, 0.85›
Defense-LLM output:
f₄=‹“Gong_Qiang”, “sold_qty_meth”, 2.0, 0.95›, f₅=‹“Gong_Qiang”, “small_qty_mitigate”, true, 0.80›, f₆=‹“Gong_Qiang”, “voluntary_confession”, true, 0.82›
Merged, grounded in Z3:
- Asserted conditions encode all relevant actors, quantities, and legal predicates.
- Statute guards and clause formulas are declared for articles 347, 65, and 67.
- Horn rules yield policy implications: base penalty (0–3 years), recidivist aggravation (5–10 years), confession mitigation (–1 year).
Adjudication outcome:
check-satverifies satisfiable sentencing.- Model extraction computes optimal penalty (minimum 4 years) per statutory formulae.
- Judge-LLM renders: “Defendant Gong Qiang is found guilty under Articles 347(4) and 65(1), with a mitigating confession under Article 67(1). The minimum satisfiable sentence is 4 years.”
This example concretely illustrates the end-to-end pipeline, from dual extraction to formalized verdict rendering.
7. Context and Significance
Dual Fact and Statute Extraction, as implemented in L4M, advances trustworthy legal AI by structurally aligning automated case reasoning with the rigorous principles of formal legal rationality. Its enforcement of role isolation, tuple-driven encoding, and integration with SMT-solvers facilitates not only transparency and explainability but also robust adversarial coverage, surpassing single-agent or "blended" approaches in both justifyability and error isolation (Chen et al., 26 Nov 2025). By bridging interpretive flexibility (natural language) with symbolic rigor (logic and SMT), this methodology sets a foundation for principled legal AI, ensuring both substantive and formal rationality in automated adjudication.
A plausible implication is that future work may extend these adversarial, formalized extraction pipelines to broader domains of reasoned argument, regulation, and policy automation where rigorous agent separation and formal encoding are required.