N yay G raph: A Knowledge Graph Enhanced Approach for Legal Statute Identification in I ndian Law using Large Language Models (2025)

Abstract: One of the first steps in the judicial processis finding the applicable statutes/laws basedon the facts of the current situation. Manu-ally searching through multiple legislation andlaws to find the relevant statutes can be time-consuming, making the Legal Statute Identi-fication (LSI) task important for reducing theworkload, helping improve the efficiency ofthe judicial system. To address this gap, wepresent a novel knowledge graph-enhanced ap-proach for Legal Statute Identification (LSI) inIndian legal documents using Large LanguageModels, incorporating structural relationshipsfrom the Indian Penal Code (IPC) the main leg-islation codifying criminal laws in India. Onthe IL-TUR benchmark, explicit KG inferencesignificantly enhances recall without sacrific-ing competitive precision. Augmenting LLMprompts with KG context, though, merely en-hances coverage at the expense of precision,underscoring the importance of good rerank-ing techniques. This research provides the firstcomplete IPC knowledge graph and shows thatorganized legal relations richly augment statuteretrieval, subject to being integrated into lan-guage models in a judicious way. Our code anddata are publicly available at Github. (https://github.com/SiddharthShukla48/NyayGraph)

## introduction in india, there are about 44 million pending cases in multiple courts at various levels (district, state, federal) accreting to the national judicial data grid. such a massive backlog of cases goes against the fundamental human right of fair access to justice. automating parts of the legal workflow, such as identifying relevant statutory provisions from legal documents, can help reduce this burden by aiding judges, lawyers, and legal researchers in retrieving the right laws more efficiently. legal statute identification (lsi)-the task of mapping text (e.g., facts or case descriptions) to * *joint first authors and contributed equally to this work. large language models (llms) that are solely trained on text, however, frequently lack explicit structural knowledge of the law, which results in predictions that are either ungrounded or incomplete. we fill this gap by creating a domain-specific knowledge graph (kg) of the indian penal code (ipc) that encodes cross-references between sections sourced from the national crime records bureau as well as relationships between chapters, sections, and their titles and descriptions from ipc. we incorporate this kg, an external, verifiable source of legal knowledge, into llms to enhance their accuracy, interpretability, and statutory identification foundation. ## related work over the past few years, legal nlp has been a fertile area for research. researchers have explored different aspects of the legal domain via various tasks. legal statute identification (lsi) is one of the first steps in the judicial process is finding the applicable statutes/laws based on the facts of the current situation. current research has started to integrate graph structures into the analysis of legal documents. @xcite proposed lesicin, a graph-based heterogeneous model for legal statute identification (lsi) that represents citation networks between case documents and ipc sections. their method integrates textual features with structural graph information utilizing metapath-based aggregation for inductive link prediction. though lesicin reflects advancement in comparison to text-only approaches, it is only applicable to criminal law codes. it also requires pre-existing citation networks, and hence not viable for statutory examination in the absence of established case law precedents. likewise, wendlinger et al. (2025) (wendlinger et al., 2025) suggest mutual citation heterogeneous graph enrichment-based prediction, but with caseby-case citation instead of statutory connections. early methods of constructing legal knowledge graphs primarily focused on information extraction from court rulings and case files. jain et al. (2022) (jain et al., 2022) proposed a rule-based approach to constructing knowledge graphs from indian supreme court rulings. although jain et al.'s work provides valuable insights into legal entity extraction, it suffers from a number of important limitations that prevent the use of the work to conduct in-depth legal analysis. their case-focused approach identifies metadata from court decisions but does not focus on identifying the underlying statutory design or inter-section relation among legal codes. recent efforts have looked into various ways to model semantic relationships in legal texts. bhardwaj et al. (2022) @xcite ) created thematic similarity measures for indian legal documents using knowledge graphs, focusing on capturing conceptual relationships between legal concepts rather than statutory structure. the issue of multi-semantic relationships in legal knowledge graphs has been tackled using different embedding methods. zhou et al.'s multi-task model incorporating translational embedding shows the importance of capturing complex semantic relationships beyond simple citation patterns @xcite . although the majority of the current work has concentrated on case documents, scant literature has examined holistic statutory structure modeling. conventional methods have depended greatly on citation networks and case precedents, restricting their use to full legal frameworks. paul et al. (2022) @xcite presented lesicin, employing citation inter-relations between case documents and ipc sections via heterogeneous graph modeling but was limited by citation dependency. existing methods need either large case document sets @xcite or pre-existing citation networks @xcite , thus limiting applicability to new or developing legal systems. existing methods only address highly cited provisions or certain case types, and not overall statutory analysis. existing methods are based on citation or co-occurrence relationships alone, lacking sophisticated statutory relationships like hierarchical dependencies, crime classification groupings, amendment histories etc. existing knowledge graphs cannot be updated with the evolving legal framework and amendments, as updates need to be made by reconstructing them entirely. in contrast to citation-based techniques or casedocument centric methods, our research builds knowledge graphs from official crime statistics and statutory structure directly. by combining ncrb crime classification statistics with ipc hierarchical structure, we establish factual statistical relationships embodying actual legal practice patterns from real life. our method overcomes important limitations of previous efforts through the ability to perform total statutory framework analysis without the need for precedential established cases, providing automated construction without legal domain expertise, utilizing a multiplicity of relationship types founded on legal structure and empirical crime evidence, and incorporating a hierarchy-agnostic framework applicable to any hierarchically structured statutory system. ## dataset we compare our approach on the legal statute identification (lsi) sub-task of the il-tur benchmark @xcite , the largest and most recently available dataset for this task in the in- dataset characteristic value dataset ilsi # documents 66,090 # labels 100 train/dev/test split train 42,835 dev 10,200 test 13,039 avg. document size (in #words) 2406 avg. no. of citations (#labels per doc) 3.78 we selected this il-tur lsi due to the following reasons. it possesses: (1) real-world coverage of indian legal statutes, (2) realistic multilabel nature of data, (3) dataset size sufficient for deep learning algorithms, (4) coverage of case facts and statute descriptions, and (5) standard preprocessing and quality control. these properties are best suited for evaluating the impact of our knowl-edge graph-assisted approach on legal statute identification performance. the multilabel nature of the dataset-mean of 3.78 statutory citations per case-is best served by our knowledge graph design, in which interstatute relationships are explicitly modeled. ## conclusion in summary, this work contributes (1) a reproducible ipc knowledge graph anchored in official statutory and ncrb sources, (2) an interoperable retrieval + kg + llm pipeline for lsi, and (3) an empirical analysis showing that kg-derived structure meaningfully increases coverage but requires careful retrieval/ranking design to improve end-toend statutory identification performance. we believe the kg and the experimental recipe provided here can serve as a foundation for future work in kg-grounded legal nlp, especially for targeted reranking, human-in-the-loop validation, and scalable extensions across additional indian statutes and case-law corpora.