Organizations: IIT Kanpur, India · University of Birmingham, Dubai, United Arab Emirates · IIT Kharagpur, India · Symbiosis Law School Pune, India · Dattam Labs, India
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
Figure 1: Comparison of our NyayaMind System with existing prior approaches.
Figure 2: Representation of different stages in the flow of our NyayaMind System.
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
Table 1: Performance comparison of models on legal judgment explanation tasks. Lexical metrics include ROUGE, BLEU, and METEOR, while semantic similarity is measured using BERTScore and BLANC. Expert scores reflect human evaluation by legal professionals. Best scores are shown in bold.
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
Table 2: Expert evaluation of generated legal components across 25 sampled cases. Scores are reported on a 1–10 Likert scale.
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
Appendix
Table 3: Training and inference hyperparameters used for the Nyayamind system.
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
Appendix
Table 4: Token distribution statistics across dataset fields. Values represent percentile statistics for token counts in the training, validation, and test splits.
Table 5: Collections stored in the Endee vector database used for legal retrieval. Each collection contains chunked legal documents with associated metadata fields and filterable attributes enabling structured retrieval.
Table 6: Collections stored in the Vespa vector database. Each collection defines searchable BM25 fields along with structured metadata attributes used for filtering and retrieval.
id, embedding, doc_id, state_name, statute_name, section_no, section_title, text
Appendix
Table 7: Collections stored in the Milvus vector database. Each collection stores embedded legal text chunks along with structured metadata attributes used for filtering and retrieval.
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 ( k=60 )
RRF ( k=60 )
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)
Appendix
Table 8: Comparison of the three retrieval architectures used in Nyayamind . The systems differ in retrieval strategy, hybrid fusion mechanisms, and vector indexing configurations.
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]
Appendix
Table 9: Prompt for DeepSeek-R1-Distill-Qwen-14B model.
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:
Appendix
Table 10: Prompt for Phi-4-mini-reasoning model.
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:
Appendix
Table 11: Prompt for Phi-4-reasoning model.
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}
Appendix
Table 12: Prompt for Qwen3.5-27B model.
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)
Appendix
Table 13: Comparative analysis of output generated by different reasoning-oriented models, showing signs of hallucination, repetitive text, sementically redundant text, correct prediction and multi step legal reasoning.
In jurisdictions like India, where courts face an extensive backlog of cases, artificial intelligence offers transformative potential for legal judgment prediction. A critical subset of this backlog comprises appellate cases, which are formal decisions issued by higher courts reviewing the rulings of lower courts. To this end, we present Vichara, a novel framework tailored to the Indian judicial system that predicts and explains appellate judgments. Vichara processes English-language appellate case proceeding documents and decomposes them into decision points. Decision points are discrete legal determinations that encapsulate the legal issue, deciding authority, outcome, reasoning, and temporal context. The structured representation isolates the core determinations and their context, enabling accurate predictions and interpretable explanations. Vichara's explanations follow a structured format inspired by the IRAC (Issue-Rule-Application-Conclusion) framework and adapted for Indian legal reasoning. This enhances interpretability, allowing legal professionals to assess the soundness of predictions efficiently. We evaluate Vichara on two datasets, PredEx and the expert-annotated subset of the Indian Legal Documents Corpus (ILDC_expert), using four large language models: GPT-4o mini, Llama-3.1-8B, Mistral-7B, and Qwen2.5-7B. Vichara surpasses existing judgment prediction benchmarks on both datasets, with GPT-4o mini achieving the highest performance (F1: 81.5 on PredEx, 80.3 on ILDC_expert), followed by Llama-3.1-8B. Human evaluation of the generated explanations across Clarity, Linking, and Usefulness metrics highlights GPT-4o mini's superior interpretability.
Legal information in India remains largely inaccessible due to the complexity of legal language and the sheer volume of legal documentation involved in research and case analysis. This paper presents NyayaAI, an AI-powered legal assistant that automates and simplifies legal workflows for lawyers, law students, and general users. The system combines Large Language Models with a Retrieval-Augmented Generation pipeline grounded in a curated Indian legal knowledge base comprising constitutional provisions, statutes, case laws, and judicial precedents. A multi-agent architecture orchestrated through the Mastra TypeScript framework coordinates a main agent with specialized sub-agents handling legal research, document summarization, case law retrieval, and drafting assistance. A compliance module validates all responses before delivery. Domain classification achieved 70% precision across test samples, with RAG retrieval precision at 74% and overall response accuracy at 72%, demonstrating that structured multi-agent LLM systems can meaningfully improve legal accessibility and workflow efficiency. The code\footnote{https://github.com/B97784/NyayaAI} is made publicly available for the benefit of the research community.
Understanding and predicting judicial outcomes demands nuanced analysis of legal documents. Traditional approaches treat judgments and proceedings as unstructured text, limiting the effectiveness of large language models (LLMs) in tasks such as summarization, argument generation, and judgment prediction. We propose LexChronos, an agentic framework that iteratively extracts structured event timelines from Supreme Court of India judgments. LexChronos employs a dual-agent architecture: a LoRA-instruct-tuned extraction agent identifies candidate events, while a pre-trained feedback agent scores and refines them through a confidence-driven loop. To address the scarcity of Indian legal event datasets, we construct a synthetic corpus of 2000 samples using reverse-engineering techniques with DeepSeek-R1 and GPT-4, generating gold-standard event annotations. Our pipeline achieves a BERT-based F1 score of 0.8751 against this synthetic ground truth. In downstream evaluations on legal text summarization, GPT-4 preferred structured timelines over unstructured baselines in 75% of cases, demonstrating improved comprehension and reasoning in Indian jurisprudence. This work lays a foundation for future legal AI applications in the Indian context, such as precedent mapping, argument synthesis, and predictive judgment modelling, by harnessing structured representations of legal events.