BharatGen

Models

LegalParam: making Indian legal knowledge easier to reach

A heritage court building in Mumbai. Photo: Prerna Rajkumar, Unsplash

India's legal landscape is a labyrinth. With hundreds of central Acts in force, many more state laws and regulations, and courts that handle millions of cases every year, finding reliable legal information is hard for citizens, practitioners and policymakers alike. Yet most AI systems are still designed around Western legal frameworks, leaving a real gap in accessible, India-centric legal knowledge.

LegalParam is our specialised 2.9 billion parameter language model for Indian law. Built on our Param-1-2.9B-Instruct foundation, it is trained across India's constitutional framework, statutes, regulations and legal traditions, in English and Hindi. Beyond answering legal questions, it can help summarise lengthy legal documents and simplify complex policy texts.

Engineering legal intelligence: technical foundation

LegalParam keeps the transformer architecture of Param-1-2.9B-Instruct and adapts it for legal reasoning and document comprehension through fine-tuning.

Core architecture

  • Scale: 2.9 billion parameters, fine-tuned for the legal domain.
  • Design: 32-layer decoder-only transformer with grouped-query attention.
  • Context: 2,048-token window.
  • Efficiency: 16 attention heads with 8 key-value heads.
  • Precision: bf16-mixed training for computational efficiency.
  • Vocabulary: 256,000 tokens plus six special tokens for structured prompts and step-by-step reasoning.

The architecture balances computational efficiency with the contextual understanding needed for legal interpretation, which matters when statutes, precedents and regulations are closely interconnected.

Curating the legal corpus

Dataset composition

  • Source volume: About 2 million Q&A pairs curated from openly available datasets on Indian laws, Acts and policies, including historical versions of Acts.
  • Synthetic expansion: 3 million additional examples generated through taxonomy-guided processes.
  • Total training data: 5 million question-answer pairs.
  • Validation set: 1.2 million held-out examples for model evaluation.
  • Language coverage: Bilingual training across English and Hindi.

Knowledge architecture

Our training approach organised legal knowledge around key stakeholder perspectives:

  • Citizens: Rights, obligations and accessible legal guidance.
  • Practitioners: Case law, procedural requirements and professional applications.
  • Policymakers: Regulatory frameworks and legislative interpretation.
  • Researchers: Academic legal theory and comparative jurisprudence.

Domain taxonomy

LegalParam's training spans the breadth of Indian legal practice:

  • Constitutional and Administrative Law.
  • Criminal Justice and Civil Procedure.
  • Corporate and Commercial Regulations.
  • Family, Property and Personal Law.
  • Tax, Labour and Environmental Legislation.
  • Intellectual Property and Technology Law.
  • International and Comparative Legal Studies.

This lets LegalParam address queries ranging from basic citizen rights to commercial disputes.

Training at scale: optimising for legal reasoning

LegalParam was trained with supervised fine-tuning, using custom prompt templates designed for legal queries. Training balanced efficient convergence with preserving the nuanced reasoning that legal analysis needs.

Training infrastructure

  • Foundation: Param-1-2.9B-Instruct base model.
  • Framework: Hugging Face Transformers with multi-node torchrun distribution.
  • Scale: 12 million total training samples across 3 epochs.
  • Optimisation: Linear learning rate schedule with warmup (5e-6 base rate).
  • Batch processing: Global batch size of 1,024 with 32-step gradient accumulation.

Specialised adaptations

The training process included legal-specific enhancements:

  • Custom prompt templates designed for Indian legal consultation patterns.
  • Special tokens for structured prompts and step-by-step reasoning.
  • Multi-turn conversation capabilities for complex legal scenarios.
  • Bilingual training that keeps legal terminology consistent across English and Hindi.

Measuring legal competency: BhashaBench‑Legal results

Evaluating legal AI needs more than standard benchmarks. It needs assessments that capture the complexity and specificity of Indian jurisprudence. LegalParam is evaluated on BhashaBench-Legal (BBL), our benchmark for Indian legal knowledge. You can read more in our BhashaBench-Legal write-up.

Benchmark overview

  • Question volume: 24,365 validated questions from 50+ official legal examinations.
  • Source authority: Judicial service examinations, bar examinations and legal education assessments.
  • Domain coverage: 20+ legal disciplines, from constitutional law to cyber regulation.
  • Language distribution: 17,047 English and 7,318 Hindi questions.
  • Difficulty stratification: Easy (8,200), Medium (12,150) and Hard (4,015) questions.

Performance highlights

LegalParam delivers competitive performance on BBL:

  • Overall accuracy: 35.17%.
  • English performance: 36.15%.
  • Hindi performance: 32.89%.
  • Bilingual gap: 3.26 points, smaller than most of the compared models.

Comparative analysis

How LegalParam compares with general-purpose models of similar size:

  • Qwen2.5-3B-Instruct: 37.39% (2.22 points ahead of LegalParam).
  • Llama-3.2-3B-Instruct: 36.86% (1.69 points ahead).
  • Nemotron-4-Mini-Hindi-4B-Instruct: 36.12% (0.95 points ahead).
  • Granite-3.1-2B-Instruct: 34.91% (LegalParam is 0.26 points ahead).
  • Gemma-2-2B-IT: 33.22% (LegalParam is 1.95 points ahead).
BhashaBench-Legal (BBL) Performance

Domain‑specific strengths

LegalParam's highest domain scores:

  • Healthcare and Medical Law: 48.00% accuracy.
  • Tax and Revenue Law: 39.83% accuracy, the highest among the compared models.
  • Intellectual Property Law: 39.56% accuracy.
  • Constitutional and Administrative Law: 38.43% accuracy.
  • General Academic Subjects: 38.21% accuracy.

Difficulty analysis

  • Easy questions: 37.96% accuracy.
  • Medium questions: 31.61% accuracy.
  • Hard questions: 30.18% accuracy.

Areas for improvement

Some specialised domains offer clear room for improvement:

  • Technology and Cyber Law: 43.90%, behind Qwen2.5-3B-Instruct at 59.35% in a fast-moving field that needs regular model updates.
  • Human Rights and Social Justice: 10.53%, on a small set of 19 questions covering complex, intersectional legal areas.
  • Consumer and Competition Law: 32.00%, in a rapidly evolving regulatory landscape.

Real‑world impact: legal AI for Bharat

Legal knowledge should not be a privilege reserved for those who can afford expensive counsel or navigate complex bureaucratic systems. In a country where legal literacy is low and access to quality legal advice is limited, LegalParam is a step towards wider access to legal information.

Applications

  • Citizen empowerment: Accessible guidance on everyday questions about rights, procedures and obligations.
  • Professional support: Quick reference and research assistance for legal practitioners at every experience level.
  • Education: Interactive learning tools for law students and continuing legal education.
  • Policy development: Research support for legislators and regulatory bodies.
  • Rural access: Legal information for remote areas through digital channels.
  • Language access: Hindi support that lowers the language barrier to legal knowledge.

Bridging the justice gap

LegalParam addresses critical challenges in access to law in India:

  • Information asymmetry: Narrowing the knowledge gap between legal professionals and citizens.
  • Geographic barriers: Providing legal guidance regardless of location.
  • Cost: Offering foundational legal information at minimal cost.
  • Linguistic inclusion: Supporting legal queries in English and Hindi.
  • Procedural clarity: Simplifying complex legal processes and requirements.

The aim is to use AI to strengthen the rule of law by making legal knowledge accessible to every citizen, whatever their income, location or education.

The path forward

LegalParam is our first step towards comprehensive legal AI for India. Future work will expand language coverage, incorporate legal updates more quickly and improve performance in specialised domains. Our aim is a legal AI ecosystem that serves every stakeholder in India's justice system.

LegalParam shows that a compact model trained on Indian legal data can stay competitive with general-purpose models of similar size, with a smaller gap between English and Hindi than most of them.

Resources: