Legal case-law RAG: models
Model weights read by the Legal case-law RAG Space (app.py, loaded with rag_core.py). Passages, indexes and role-labelled sentences are in a separate gated dataset repo.
| file | what it is |
|---|---|
models/gen_*.safetensors + .json | Generator: a 145M-parameter decoder-only legal LM trained from scratch (hybrid local/global attention with differential attention, tied embeddings, 32k legal BPE vocabulary). It was fine-tuned for judgment summarization with LoRMA+ (rank 8), and the adapter is merged into the weights: W' = (I + (alpha/r) B A) W0. Stored in bf16; the tied LM head is re-tied on load. |
models/enc_*.safetensors + .json | Dense retriever: the same backbone, fine-tuned contrastively as a bi-encoder for prior-case retrieval with LoRMA+ (merged). Each text is one chunk of at most 512 tokens with bidirectional attention, mean-pooled and L2-normalised. |
tokenizer.json | the 32k BPE tokenizer (<|endoftext|> = id 0) |
Intended use: research demo only. Role labels are often wrong on this corpus, and the generator can misstate the law. It is not legal advice.
Licence and data sources
Licence: CC BY-NC-SA 4.0 (non-commercial, share-alike, attribution), following the source datasets. The judgments come from public court records (IndianKanoon and Legal Information Institute of India); party names are masked in the source data.
- IL-TUR: the benchmark the retrieval corpus and rhetorical-role training data come from.
- IL-PCR: the prior-case retrieval corpus (5,825 judgments) searched here and used to train the bi-encoder.
- IN-Abs: Supreme Court judgments with expert headnotes, used to fine-tune the summarizer (generator).
@inproceedings{joshi-etal-2024-il,
title = {{IL}-{TUR}: Benchmark for {I}ndian Legal Text Understanding and Reasoning},
author = {Joshi, Abhinav and Paul, Shounak and Sharma, Akshat and Goyal, Pawan and Ghosh, Saptarshi and Modi, Ashutosh},
booktitle = {Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
pages = {11460--11499},
year = {2024},
doi = {10.18653/v1/2024.acl-long.618}
}
@inproceedings{joshi-etal-2023-u,
title = {{U}-{CREAT}: Unsupervised Case Retrieval using Events extr{A}c{T}ion},
author = {Joshi, Abhinav and Sharma, Akshat and Tanikella, Sai Kiran and Modi, Ashutosh},
booktitle = {Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
pages = {13899--13915},
year = {2023},
doi = {10.18653/v1/2023.acl-long.777}
}
@inproceedings{shukla-etal-2022-legal,
title = {Legal Case Document Summarization: Extractive and Abstractive Methods and their Evaluation},
author = {Shukla, Abhay and Bhattacharya, Paheli and Poddar, Soham and Mukherjee, Rajdeep and Ghosh, Kripabandhu and Goyal, Pawan and Ghosh, Saptarshi},
booktitle = {Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (AACL-IJCNLP)},
pages = {1048--1064},
year = {2022}
}