Researchers at Maqsut Narikbayev University in Astana, Kazakhstan, have introduced LegalGraph, a knowledge-representation architecture designed to convert statutory text from the Republic of Kazakhstan into structured, provenance-tracked legal knowledge for large language model reasoning. Published in Frontiers in Artificial Intelligence by Vitaly Ogleznev and Sergei Pen of the university’s Department of Public Law, the study addresses a foundational problem in legal artificial intelligence: retrieving relevant statutory passages does not by itself make explicit the normative structures required to apply law, including conditions of applicability, exceptions, normative modalities, temporal limits, and cross-references distributed across provisions. Combining manual semantic annotation of 2,420 statutory articles with model-assisted corpus expansion, a jurisdiction-sensitive ontology, and a property graph, LegalGraph inserts an auditable representational layer between legislative text and probabilistic language models. The authors emphasize that their study does not yet empirically demonstrate that graph-grounded reasoning outperforms text-based alternatives, instead framing legal knowledge representation itself as an explicit object of methodology and evaluation.
The conceptual starting point of the paper is a three-way distinction between statutory text, legal knowledge, and structured legal knowledge. Statutory text serves as the authoritative linguistic source, whereas legal knowledge consists of the normative content and inter-provision relations reconstructed through legal interpretation, and structured legal knowledge makes those entities and relations computationally explicit while preserving source traceability. Although recent retrieval-augmented generation systems and benchmarks—including LegalBench, LawBench, LegalBench-RAG, LexRAG, and LeReRAG—have improved how models locate relevant passages, the authors argue that text-centred retrieval remains normatively incomplete whenever a general obligation, an exception limiting it, and a temporal qualification reside in separate provisions. Even emerging graph-based legal frameworks such as LegalGraphRAG use hierarchical graphs primarily to organize heterogeneous documents for retrieval and evidence verification. LegalGraph begins one level earlier by encoding expert-interpreted normative dependencies reconstructed directly from statutory provisions, shifting the representational unit from isolated text chunks to legally connected structures.
To build that grounding layer without allowing probabilistic models to define their own evidential standard, LegalGraph relies on expert manual semantic annotation governed by two methodological principles: representational independence and interpretative provenance. Representational independence requires that the reference representation used to constrain and evaluate language-model reasoning be constructed and validated independently of the reasoning model, distinguishing LegalGraph from pipelines in which large language models automatically extract graph entities and relations from the outset. Interpretative provenance requires that every represented element remain traceable not only to its exact statutory wording through a complementary lexical layer, but also to the human interpretative decision that assigned its legal role. Informed by Daniel Braun’s review of 29 manually annotated legal datasets—which found that published gold standards routinely erased annotator disagreement—the LegalGraph workflow separates annotation errors from genuine interpretative uncertainty, retaining competing candidate readings and expert rationales for documented hard cases rather than forcing artificial consensus.
These interpretative commitments are organized by a jurisdiction-sensitive annotation ontology developed through iterative, constrained bottom-up modelling of Kazakhstani legislation rather than adapted from a universal legal ontology. The ontology divides into two layers: a legal-semantic layer containing 16 major annotation-category groups and an annotation-provenance layer containing three groups for metadata and quality control, annotator comments, and additional source attributes. The 16 legal-semantic groups encompass subjects of law, legal actions and modalities, conditions and legal facts, objects of legal relations, sanctions and consequences, quantitative parameters, procedures, exceptions, definitions, temporal characteristics, territorial jurisdiction, the post-Soviet hypothesis-disposition-sanction norm structure, norm modalities, norm types, qualifying circumstances, and purposes and principles. Eighteen directed semantic relation types—such as APPLIES_TO, HAS_CONDITION, EXCLUDES, SPECIFIES, REFERS_TO, ENTAILS, and HIERARCHY—define how annotated elements interact. An internal relation catalogue specifies each relation’s direction and admissible endpoints, though formal cardinality constraints and logical axioms remain outside the current operational schema.
Corpus construction proceeded in two phases to balance independent expert grounding against scalability. In the first phase, six research assistants—law PhD candidates and master’s graduates with more than three years of practical legal experience—worked alongside four top bachelor-level law graduates and the team lead to manually annotate 2,420 articles across five doctrinally diverse sources: 99 articles from the 1995 Constitution, 217 from the Labour Code, 847 from the Tax Code, 102 from the General Part of the Criminal Code, and 1,155 from the Civil Code. Annotation ran for six months in a self-hosted instance of Label Studio 1.20.0 using overlapping multi-layered spans, followed by a two-month checklist-based quality-assurance review by serving law professors and twice-weekly calibration sessions. Because most articles were singly annotated and roughly 10 percent of the Tax Code was double-annotated, the authors describe the product as an adjudicated expert reference corpus; planned offline inter-annotator agreement statistics, including pairwise span F1, labelled relation F1, and Cohen’s kappa, have not yet been computed.
In the second phase, the team scaled annotation to Kazakhstan’s remaining codified acts—including the Special Part of the Criminal Code—using compact Qwen-family models progressing from an 8-billion-parameter checkpoint to Qwen3.8-27B. Fine-tuned with QLoRA at rank 16 to 32 over seven epochs on a rented NVIDIA H200 GPU and quantized to Q4_K_M in GGUF format, Qwen3.8-27B ran locally on a single NVIDIA GeForce RTX 5090 GPU with an 8-bit key-value cache, disabled thinking mode, and a 16,384-token working context window so statutory texts stayed within institutional infrastructure. Model-proposed annotations entered Label Studio as predictions for mandatory human acceptance, correction, or deletion. In preliminary internal tests with planted legal-qualification errors, the local Qwen model over LegalGraph flagged mismatches that Gemini 3.5 Flash and Claude Opus 4.8 accepted, though the authors stress this confounded illustration is not a benchmark and acknowledge unmeasured risks of reviewer anchoring bias and undetected model omissions.
Validated annotations are deterministically transformed into a property-graph data model selected over RDF/OWL because property graphs natively attach provenance and validity attributes to edges and optimize multi-hop traversals, while remaining serializable to RDF. Across the full ingested corpus—covering Kazakhstan’s codes and republican-level subordinate legislation beyond the five manually annotated sources—the graph currently holds approximately 5.55 million nodes, including about 4.6 million substantive legal-semantic content nodes, and roughly 870,000 edges. Mechanical load-time validation rejects dangling edges, orphan nodes, and schema violations, requiring a W3C PROV-O-shaped provenance record on every admitted element. The authors detail clear representational boundaries: binary typed edges cannot express joint versus alternative conditions, negation, quantification, or defeasible rule priority; nodes represent source-anchored mentions rather than abstract norms or concepts; case facts and legal subsumption remain unrepresented inside the language model; and dual annotations preserved for hard cases currently lack a mutual-exclusivity relation and conflict-handling retrieval policy.
At query time, LegalGraph combines a rule-based Kazakhstani citation parser with hybrid search over graph text properties, fusing up to 120 BGE dense-embedding candidates and 30 BM25 lexical candidates through reciprocal rank fusion into a 30-unit pool. After filtering by user-asserted date and jurisdiction, the top six survivors seed deterministic, policy-fixed graph expansion: inbound EXCLUDES and SPECIFIES edges are always followed so exceptions and special norms are not omitted, alongside HAS_CONDITION, ESTABLISHES_MODALITY, HAS_PARAMETER, and depth-bounded REFERS_TO chains. Dependency-preserving context selection prunes the resulting candidate normative subgraph to a 35,000-character budget while treating seed rules and reachable exceptions or specializations as a non-removable core, serializing statutory excerpts, typed relations, and full citation identifiers for Qwen3.8-27B without further retrieval. Rather than claiming internal model transparency, this design enables reverse auditing from cited answers through the serialized context, logged traversal path, annotation record, and versioned statutory text.
Because an accurate final answer can conceal a defective legal basis or missed exception, the authors propose a layered evaluation framework that separates retrieval quality, representational quality, reasoning quality, and final outcome quality. Within representational evaluation, four criteria—normative completeness, applicability awareness, exception awareness, and normative consistency—assess whether the reasoning context contains and respects the legal dependencies required to decide an issue. Two additional accountability criteria, traceability and contestability, evaluate whether represented elements can be followed back to authoritative statutes and whether embedded interpretative choices can be identified, challenged, and revised. By keeping these layers distinct rather than collapsing them into one aggregate score, reviewers can localize candidate error sources across annotation, ontology instantiation, graph construction, retrieval, context selection, and downstream inference. The authors note that this framework is not yet a validated benchmark and requires expert-validated cases, controlled perturbations, and same-model ablations comparing text-based, hybrid, and graph-grounded pipelines.
Several documented limitations define the current scope of LegalGraph. First, the build captures a single snapshot of legislation as of 1 February 2026 anchored to Kazakhstan’s 1995 Constitution, which ceased to have effect when a new Constitution adopted by referendum on 15 March 2026 entered into force on 1 July 2026; every constitutional HIERARCHY, SPECIFIES, and REFERS_TO edge therefore requires a migration audit before application to current law, and multi-version loading and amendment lineage remain unimplemented. Second, annotation covered only official Russian-language statutory texts, omitting official Kazakh versions and cross-language discrepancies, while citation resolution captures only explicit textual references rather than uncited legal dependencies. Third, the ontology reflects Kazakhstan’s post-Soviet civil-law architecture and has not been tested on held-out codes or other jurisdictions, and the annotated corpus, guidelines, and pipeline code remain unreleased while benchmark evaluation is in progress. Together, these boundaries underscore that LegalGraph currently demonstrates traceable preconditions for accountable legal reasoning rather than empirically proven performance gains.
Subject of Research: Structured legal knowledge representation and graph-grounded large language model reasoning for Kazakhstan statutory law
Article Title: From statutory text to structured legal knowledge: manual annotation and graph-based representation for accountable LLM reasoning
Article References: Ogleznev, V., & Pen, S. (2026). From statutory text to structured legal knowledge: manual annotation and graph-based representation for accountable LLM reasoning. Frontiers in Artificial Intelligence, 9, Article 1988863. https://doi.org/10.3389/frai.2026.1988863
Image Credits: AI Generated
DOI: 10.3389/frai.2026.1988863
Keywords: LegalGraph, legal knowledge graphs, large language models, statutory interpretation, semantic annotation, annotation ontology, Kazakhstan legislation, retrieval-augmented generation, representational independence, interpretative provenance, property graphs, dependency-aware retrieval, normative completeness, explainable legal AI, Label Studio, Qwen3.8-27B, layered evaluation framework, PROV-O provenance
Cite Scienmag News
Denise Maddox. (December 2, 2026). LegalGraph maps Kazakhstan statutes into traceable graphs for accountable LLM reasoning. Scienmag. https://scienmag.com/legalgraph-maps-kazakhstan-statutes-into-traceable-graphs-for-accountable-llm-reasoning/
Denise Maddox. "LegalGraph maps Kazakhstan statutes into traceable graphs for accountable LLM reasoning." Scienmag, 2 December 2026, https://scienmag.com/legalgraph-maps-kazakhstan-statutes-into-traceable-graphs-for-accountable-llm-reasoning/. Accessed 2 December 2026.
Denise Maddox. "LegalGraph maps Kazakhstan statutes into traceable graphs for accountable LLM reasoning." Scienmag. December 2, 2026. https://scienmag.com/legalgraph-maps-kazakhstan-statutes-into-traceable-graphs-for-accountable-llm-reasoning/








