NyayaMind- A Framework for Transparent Legal Reasoning and Judgment Prediction in the Indian Legal System
Organizations: IIT Kanpur, India · University of Birmingham, Dubai, United Arab Emirates · IIT Kharagpur, India · Symbiosis Law School Pune, India ·
Abstract
Court Judgment Prediction and Explanation (CJPE) aims to predict a judicial decision and provide a legally grounded explanation for a given case based on the facts, legal issues, arguments, cited statutes, and relevant precedents. For such systems to be practically useful in judicial or legal research settings, they must not only achieve high predictive performance but also generate transparent and structured legal reasoning that aligns with established judicial practices. In this work, we present NyayaMind, an open-source framework designed to enable transparent and scalable legal reasoning for the Indian judiciary. The proposed framework integrates retrieval, reasoning, and verification mechanisms to emulate the structured decision-making process typically followed in courts. Specifically, NyayaMind consists of two main components: a Retrieval Module and a Prediction Module. The Retrieval Module employs a RAG pipeline to identify legally relevant statutes and precedent cases from large-scale legal corpora, while the Prediction Module utilizes reasoning-oriented LLMs fine-tuned for the Indian legal domain to generate structured outputs including issues, arguments, rationale, and the final decision. Our extensive results and expert evaluation demonstrate that NyayaMind significantly improves the quality of explanation and evidence alignment compared to existing CJPE approaches, providing a promising step toward trustworthy AI-assisted legal decision support systems.
Figures & tables
| Lexical Evaluation (%) | Semantic Evaluation (%) | Expert | ||||||
| Models | R-1 | R-2 | R-L | BLEU | METEOR | BERTScore | BLANC | Rating |
| Generated Legal Issue vs Ground Truth | ||||||||
| DeepSeek-R1-Distill-Qwen-14B | 27.06 | 8.99 | 18.81 | 3.12 | 16.87 | 52.98 | 7.75 | 6.25 |
| Qwen3.5-27B | 27.73 | 9.68 | 19.23 | 3.56 | 17.84 | 53.21 | 8.37 | 6.95 |
| Generated Petitioner Arguments vs Ground Truth | ||||||||
| DeepSeek-R1-Distill-Qwen-14B | 30.65 | 10.08 | 18.30 | 3.90 | 22.19 | 57.09 | 9.85 | 6.50 |
| Generated Component | Expert 1 | Expert 2 | Average |
| DeepSeek-R1-Distill-Qwen-14B (32-bit) | |||
| Legal Issue | 6.48 | 6.00 | 6.24 |
| Arguments of Petitioner | 6.44 | 6.75 | 6.60 |
| Arguments of Respondent | 6.12 | 6.83 | 6.48 |
| Prediction | 6.60 | 6.25 | 6.43 |
| Explanation | 5.88 | 5.89 | 5.88 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Parameter | Value |
| System | |
| GPUs | NVIDIA H200 |
| LoRA Parameters | |
| Rank | 16 |
| Alpha | 16 |
| Dropout | 0 |
| Token Count Percentiles | ||||||||
| Dataset Field | P50 | P75 | P80 | P85 | P90 | P95 | P99 | Max |
| Train Dataset | ||||||||
| Input Text | 18,295 | 68,606 | 88,391 | 118,401 | 175,102 | 308,669 | 828,490 | 3,117,110 |
| Target Text | 2,096 | 3,274 | 3,747 | 4,407 | 5,485 | 8,289 | 15,243 | 33,839 |
| Case Text | 5,724 | 9,738 | 11,081 | 13,168 | 16,468 | 24,478 | 56,548 | 304,724 |
| Simplified Facts | 992 | 1,561 | 1,744 | 1,994 | 2,383 | 3,084 | 6,528 | 18,000 |
| Collection | #Chunks | #Collections | Metadata & Filterable Fields |
| Central_Acts | 36,991 | 1 | Metadata: id, text, case_name, section_no, section_title |
| Filters: section_no, title, doc_id | |||
| HC_Judgments | 1,069,017 | 1 | Metadata: id, text, court, judge, CNR, date, disposal, state, case_no |
| Filters: court, case_no, state, doc_id | |||
| SC_Judgments | 81,331 | 1 | Metadata: id, text, case_name, diary_no, type, petitioner, respondent, bench, citations |
| Filters: case_no, date, bench, case_name |
| Collection | #Chunks | #Collections | BM25 Fields & Metadata |
| centralacts | 36,921 | 1 | BM25 Fields: section_text, section_title, statute |
| Metadata: id, section_no | |||
| scjudgments | 52,796 | 1 | BM25 Fields: content |
| Metadata: case_name, diary_no, type, case_no, petitioner, respondent, bench, date, citations | |||
| hcjudgments | 811,492 | 1 | BM25 Fields: text, case_name |
| Metadata: id, judgment_date, citations, bench |
| Collection | #Chunks | #Collections | Metadata Fields |
| Central_Acts | 37,202 | 1 | id, embedding, text, case_name, section_no, section_title |
| SC_Judgments | 81,625 | 1 | id, embedding, text, case_name, diary_no, type, petitioner, respondent, bench, citations |
| HC_{Court} | 1,577,838 | 25 | id, embedding, case_no, pdf_path, state, disposal, decision_date, text, title, judge, CNR |
| State_Acts_{Name} | 146,804 | 33 | id, embedding, doc_id, state_name, statute_name, section_no, section_title, text |
| Feature | Endee | Milvus | VespaDB |
| Retrieval Strategy | |||
| Retrieval Philosophy | Single-stage Dense Retrieval | Three-stage Hybrid Semantic Lexical Fusion | Parallel Hybrid (Semantic + Lexical) Fusion |
| Fusion Method | – | RRF ( ) | RRF ( ) |
| BM25 Retrieval | Not used | Applied on top-500 vector results | Native parallel full-corpus BM25 |
| Vector Configuration | |||
| Embedding Model | snowflake-arctic-embed-m-v2.0 (768-d) | ||
| Input Text |
| System Message =“SYSTEM: |
| You are a smart and intelligent legal assistant for the Indian legal domain. Based on the user’s instructions, you will have to perform or assist in some tasks related to the Indian legal system. Since these tasks have some legal application, only provide responses you are extremely certain about, and avoid being ambiguous or uncertain. Ensure that your outputs adhere to the user’s instructions or requirements.” |
| User Content = “USER: |
| You are a legal expert tasked with making a judgment about whether an appeal should be accepted or rejected based on the provided case proceeding, cited statutes and cited cases. Your task is to evaluate whether the appeal should be accepted (1) or rejected (0) based on the input. ### Now, evaluate the following case: |
| Case Proceedings: {simplified_facts} Relevant Statutes: {sections_texts} Cited Cases Reference: {cited_case_judgments} Provide your judgment by strictly following this format: |
| ##PREDICTION: [Insert your prediction here] |
| Input Text |
| System Message =“<|system|> You are a smart and intelligent legal assistant for the Indian legal domain. Based on the user’s instructions, you will have to perform or assist in some tasks related to the Indian legal system. Since these tasks have some legal application, only provide responses you are extremely certain about, and avoid being ambiguous or uncertain. Ensure that your outputs adhere to the user’s instructions or requirements. |
| <|end|>” |
| User Content = “<|user|> You are a legal expert tasked with making a judgment about whether an appeal should be accepted or rejected based on the provided case proceeding, cited statutes and cited cases. Your task is to evaluate whether the appeal should be accepted (1) or rejected (0) based on the input. |
| ### Now, evaluate the following case: |
| Case Proceedings: {simplified_facts} |
| Relevant Statutes: |
| Input Text |
| System Message =“<|im_start|>system<|im_sep|> |
| You are a smart and intelligent legal assistant for the Indian legal domain. Based on the user’s instructions, you will have to perform or assist in some tasks related to the Indian legal system. Since these tasks have some legal application, only provide responses you are extremely certain about, and avoid being ambiguous or uncertain. Ensure that your outputs adhere to the user’s instructions or requirements. |
| <|im_end|>” |
| User Content = “<|im_start|>user<|im_sep|> |
| You are a legal expert tasked with making a judgment about whether an appeal should be accepted or rejected based on the provided case proceeding, cited statutes and cited cases. Your task is to evaluate whether the appeal should be accepted (1) or rejected (0) based on the input. |
| ### Now, evaluate the following case: |
| Input Text |
| System Message =“<|im_start|><|system|> |
| You are a smart and intelligent legal assistant for the Indian legal domain. Based on the user’s instructions, you will have to perform or assist in some tasks related to the Indian legal system. Since these tasks have some legal application, only provide responses you are extremely certain about, and avoid being ambiguous or uncertain. Ensure that your outputs adhere to the user’s instructions or requirements. |
| <|im_end|>” |
| User Content = “<|im_start|><|user|> You are a legal expert tasked with making a judgment about whether an appeal should be accepted or rejected based on the provided case proceeding, cited statutes and cited cases. Your task is to evaluate whether the appeal should be accepted (1) or rejected (0) based on the input. |
| ### Now, evaluate the following case: |
| Case Proceedings: {simplified_facts} |
| Model | Reasoning, Decision and Explanation |
| Ground Truth | Legal Issue Is the appellant considered to be in "possession" of the lands as khudkasht… Arguments of Petitioner It can be contended by Mr. J. P. Goyal, learned counsel for the appellant… Arguments of Respondent The respondentś arguments could be that the appellant may not be able to challenge the final… Decision We may hold that the judgment… appeal can be set aside . Explanation It can be inferred that the normal principle of possession by one co-sharer… |
| DeepSeek-R1-Distill-Qwen-14B (4-bit) | Legal Issue Analysis: Whether the plaintiff was in cultivatory possession of the plots in dispute on the date of vesting? Arguments of Petitioner: It can be inferred that the petitioner may argue that the plaintiff’s counsel… Arguments of Respondent: The respondent may contend that the plaintiff’s possession of the plots in dispute may have been limited to a mere physical presence … The respondent may argue that the plaintiff’s possession of the plots in dispute may have been subject to the rights of the defendants… (Sementic_Redundancy) ##PREDICTION: 16. The appeal may be dismissed. ## EXPLANATION: It can be inferred that the plaintiff’s possession of the plots ịn dispute was not cultivatory possession, as per the findings of the High Court. It can be inferred that the plaintiff’s possession of the plots … (Repetitive Text) |
| DeepSeek-R1-Distill-Qwen-14B (8-bit) | Alright, Iḿ trying to figure out whether the appeal in this case should be accepted or rejected. First, looking at the case proceedings, the plaintiff, Kailashrai… (Wrong output format) ##PREDICTION: 0 ##EXPLANATION: The High Court correctly determined that the plaintiff was not in cultivatory… |
| DeepSeek-R1-Distill-Qwen-14B (16-bit) | Legal Issue Analysis: Is the plaintiff entitled to a declaration that he is entitled to one-fourth share in the properties? … Arguments of Petitioner: It is contended that the plaintiff can establish his right to cultivate the plots in question … Arguments of Respondent: The respondent’s arguments could be that the plaintiff may not be able to establish his right … ##PREDICTION: The appeal can be dismissed with costs… (Correct Prediction) ##EXPLANATION: It can be inferred that the plaintiff’s claim is based on the … |
| DeepSeek-R1-Distill-Qwen-14B (32-bit) | Legal Issue Analysis: Is the plaintiff entitled to a declaration that he is entitled to one-fourth share in the properties? … Arguments of Petitioner: It is contended that the plaintiff can establish his right to cultivate the plots in question, … Arguments of Respondent: The respondent’s arguments could be that the plaintiff may not be able to establish his right … ##PREDICTION: The appeal may be dismissed… (Correct Prediction) ##EXPLANATION: It can be inferred that the plaintiff’s claim to the properties … |
| Phi4-mini-reasoning (16-bit) | Legal Issue Analysis: Is the defendant liable? … **Legal Process Analysis: Respondent Arguments Against Witness Statements …art therapy play therapy bibliotherapy music therapy …DeFi stablecoins tokenization NFTs metaverse Web3 … (Random text) |
Legal Judgment Prediction
Legal judgment prediction uses computational models to forecast court outcomes from case facts, legal arguments, statutes, and precedents.
See all 28 papers