Indian Bail Prediction System (IBPS): A Comprehensive Dataset and Model for Predicting Bail Outcomes in Indian Courts
Dataset Creation, Extraction, and Preprocessing
The foundation of our system rests on a rich dataset curated from authentic Indian bail judgments. This data includes details such as the type of bail application, statutes invoked, age and health of the accused, days in custody, and past criminal records. Given the unstructured nature of judicial documents, we employed natural language processing (NLP) techniques to extract structured features using custom rule-based parsers and Named Entity Recognition (NER). Each judgment was then converted into a standardized JSON schema capturing key legal and factual attributes. We ensured balanced representation across bail types and verdicts to avoid skewed learning, and applied preprocessing methods like token normalization, date formatting, and statute standardization to prepare the data for downstream learning tasks.
IBPS Interface and Model Explanation
Fine-Tuning
To make accurate, context-aware predictions, we fine-tuned the *Phi-4-mini* language model using our curated dataset. The model was trained to understand and generate structured outputs from full-text judgments by learning patterns across various legal factors and judicial reasoning. We adopted a parameter-efficient fine-tuning approach (like LoRA) to minimize computational overhead while maintaining performance. During training, the model learned to predict outcomes (bail granted or denied), along with human-readable legal reasoning and conditional recommendations in case bail was granted. Rigorous evaluation on a validation set showed promising results, with the model not only predicting decisions with good accuracy but also generating coherent legal justifications that mirrored judicial logic.
Model workinig out a sample bail case

Dataset used for training the model came from Daksh and E-Courts portal.
How confident is the model?
To quantify the model's confidence in its predictions, we first force the LLM to generate either 0 or 1 depending upon whether the LLM thinks the bail should be granted or denied, (1 for granted, 0 for denied). Then we measure the probability with which either 0 or 1 is generated and normalize it along with the probabilities of other tokens between 0 and 1. This score represents how sure the LLM is regarding its predictions.

Phi-4 model was fine-tuned on 15,000 bail cases using Nvidia A100 GPU with 40GB VRAM. The CNN model was trained on 150,000 bail cases.
Interface / Front End
We developed a seamless and intuitive chatbot interface to serve as the front end for users including lawyers, judges, and petitioners. The user begins by uploading a case document or answering guided questions. The backend system then processes the input through the fine-tuned LLM model, and displays the bail decision, legal reasoning, confidence score, and required conditions (if any) in a structured conversational format. The interface supports multilingual interaction, ensuring accessibility for a diverse user base. Additionally, we designed the interface with mobile-first principles and included options to export conversations as PDFs, supporting legal documentation and offline usage.
Future Scope and Improvements
Moving forward, we envision several enhancements to broaden the impact of the Indian Bail Prediction System. We plan to incorporate *precedent analysis, allowing the system to draw from past landmark judgments to improve its reasoning. Expanding multilingual support (e.g., Hindi, Bengali, etc.), integrating OCR for image-based case documents, and speech-to-text interfaces will significantly increase accessibility. We're also exploring the inclusion of other legal domains such as land disputes and dowry cases. On the model side, integrating more powerful reasoning models and improving explainability remain a priority. To support long-term adoption, we plan to offer secure user authentication and session history management.