← Back to work
Case Study · 03 / 07 Fine-tuning PEFT LoRA

Legal
Assistant.

Agentic AI assistant for the Indian Penal Code with a fine-tuned Gemma 2B model and citation-grounded retrieval.

Role
Solo build
Timeline
2024
Domain
Legal Tech
Accuracy
85% on hard queries
Sample query
"What are IPC §420 penalties for cheating?"
Agent output
§420 · Up to 7 years + fine
↳ source: IPC_amendment_2023.pdf § 420 · paragraph 3
↳ precedent: State of Kerala v. Varghese (SCC 2021)
01 / Problem

The context.

General-purpose LLMs hallucinate citations in legal domains — a dealbreaker when a mis-cited section could mislead a lawyer or a student. Indian legal texts are particularly dense with cross-references (IPC, CrPC, Evidence Act) that need precise retrieval, not vibes.

The goal: an assistant that answers IPC queries with grounded citations, navigates precedent, and admits uncertainty rather than confabulating.

02 / Solution

Specialized model + grounded retrieval.

01
Fine-tuned Gemma 2B

PEFT + LoRA adaptation on curated IPC + case-law corpus. 85% accuracy on complex query resolution.

02
Citation-Backed RAG

PDF ingestion, precedent retrieval, and structured citations — every answer points back to the source section and paragraph.

03
Multi-Agent Orchestration

Agents autonomously navigate legal documents and execute dynamic task critics for accuracy validation.

03 / My Contributions

What I built.

A.
PEFT/LoRA fine-tuning

Adapted Gemma 2B with parameter-efficient tuning on curated IPC + case-law corpus. Achieved 85% accuracy on complex legal queries.

B.
Comprehensive RAG system

Citation-backed responses, PDF ingestion, autonomous legal precedent research across complex document structures.

C.
Multi-agent orchestration

Designed agents that navigate legal docs autonomously with dynamic task-critic execution for retrieval accuracy.

04 / Stack

Technologies used.

Gemma 2BPEFTLoRALangChainRAGHugging FacePyTorchPython
Next case study →
Insurance Verifier
Agentic cross-verification · 91% precision
Read next →