Retrieval Augmented Generation Framework for the Nepali Legal Domain Question Answering
This study introduces the first Retrieval Augmented Generation framework for Nepali legal question answering, leveraging the Nepal Kanun Patrika archive to achieve high precision and truthfulness scores, thereby addressing data scarcity challenges in low-resource legal domains.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine the legal system of Nepal as a massive, ancient library. This library contains thousands of court rulings (case laws) written in Nepali. However, there are two big problems:
- The books are messy: They are written in old-fashioned language, scattered across different places, and not all of them are digitized properly.
- The librarian is new: Artificial Intelligence (AI) models are usually trained on English books. When you ask them about Nepali laws, they often get confused or make things up because they haven't "read" enough Nepali legal texts to learn the rules.
This paper introduces a new way to fix this using a system called RAG (Retrieval-Augmented Generation). Think of RAG not as a student trying to memorize a textbook, but as a smart research assistant who is allowed to look up answers in a library before speaking.
Here is how the researchers built and tested this assistant:
1. The Library (The Data)
The team went to the official digital archive of the Nepal Supreme Court (called Nepal Kanun Patrika). They scraped and cleaned 10,320 legal documents.
- The Challenge: They couldn't just feed these huge documents to the AI. It's like trying to find a specific sentence in a 500-page book by reading the whole thing at once.
- The Solution: They chopped the documents into smaller "chunks" (like cutting a long story into short paragraphs) so the AI could handle them better.
2. The Search Engine (Finding the Right Page)
Before the AI can answer a question, it needs to find the right page in the library. The researchers tested two different ways to search:
Method A: The "Keyword Hunter" (BM25)
- How it works: This is like a traditional librarian who looks for exact words. If you ask, "What is the penalty for theft?", the librarian scans for the exact words "penalty," "theft," and "law."
- The Result: This method was the champion. It found the correct document 91% of the time when looking at small chunks, and 88% when looking at whole documents. It was very precise because legal language is often very specific and repetitive.
Method B: The "Meaning Matcher" (Dense Retrieval)
- How it works: This is like a librarian who understands the vibe or meaning of a question, even if the words are different. It uses advanced math (embeddings) to guess that "stealing" and "theft" are the same.
- The Result: This method was good, but not great for this specific job. It only found the right document 75% of the time. The researchers found that for Nepali law, exact word matching works better than guessing the meaning, likely because legal terms are very rigid.
The Speed Trap:
The "Keyword Hunter" (BM25) had a catch. When they chopped the documents into tiny chunks to make it more accurate, the search became very slow (like searching through 110,000 tiny index cards instead of 10,000 books). To keep the system fast enough to be useful, they chose the "Whole Document" version of the Keyword Hunter. It was slightly less accurate but much faster.
3. The Answer Writer (Generating the Response)
Once the system found the right document, it needed to write the answer.
- The Rule: The AI was strictly told: "Do not make things up."
- The Strategy: The researchers used a two-step process. First, the AI had to point to the exact sentence in the document that proved the answer. Second, it wrote the answer based only on that sentence. If it couldn't find proof, it was told to say, "I don't know," rather than guessing.
4. The Results (Did it work?)
The team tested this system with 100 questions written by legal experts. Here is how the best version (Keyword Hunter + Whole Documents) performed:
- Success Rate: It successfully generated an answer for 92% of the questions.
- Truthfulness: When checked by another AI and by human lawyers, the answers were 85% truthful (meaning they didn't lie or hallucinate facts).
- Groundedness: 74% of the answers were directly supported by the text found in the library.
The Bottom Line
This paper proves that for a low-resource language like Nepali, you don't need a super-smart AI that has memorized everything. Instead, you need a reliable search tool that finds the exact legal text and a strict AI that refuses to speak unless it has the text in front of it.
By combining a simple, fast search method (BM25) with a careful writing process, they created the first system that can reliably answer legal questions in Nepali without making up facts. It's a foundation that could eventually help ordinary people understand their legal rights without needing a law degree.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.