LegalBench-RAG: A Benchmark for Retrieval-Augmented Generation in the Legal Domain

Nicholas Pipitone, Ghita Houir Alami
8/19/2024
cs.AI

No official code found. Best implementation: zeroentropy-ai/legalbenchrag (207 stars, MIT, last commit 2025-05-30).

Abstract

Retrieval-Augmented Generation (RAG) systems are showing promising potential, and are becoming increasingly relevant in AI-powered legal applications. Existing benchmarks, such as LegalBench, assess the generative capabilities of Large Language Models (LLMs) in the legal domain, but there is a critical gap in evaluating the retrieval component of RAG systems. To address this, we introduce LegalBench-RAG, the first benchmark specifically designed to evaluate the retrieval step of RAG pipelines within the legal space. LegalBench-RAG emphasizes precise retrieval by focusing on extracting minimal, highly relevant text segments from legal documents. These highly relevant snippets are preferred over retrieving document IDs, or large sequences of imprecise chunks, both of which can exceed context window limitations. Long context windows cost more to process, induce higher latency, and lead LLMs to forget or hallucinate information. Additionally, precise results allow LLMs to generate citations for the end user. The LegalBench-RAG benchmark is constructed by retracing the context used in LegalBench queries back to their original locations within the legal corpus, resulting in a dataset of 6,858 query-answer pairs over a corpus of over 79M characters, entirely human-annotated by legal experts. We also introduce LegalBench-RAG-mini, a lightweight version for rapid iteration and experimentation. By providing a dedicated benchmark for legal retrieval, LegalBench-RAG serves as a critical tool for companies and researchers focused on enhancing the accuracy and performance of RAG systems in the legal domain. The LegalBench-RAG dataset is publicly available at https://github.com/zeroentropy-cc/legalbenchrag.

View on arXivView PDF

Code Implementations(1)

MIT

This is the repo for the LegalBench-RAG Paper: https://arxiv.org/abs/2408.10343.

20723Shell, PythonAug 8, 20241 years agoMIT

Similar Papers

Cite this paper

@article{pipitone2024legalbenchrag,
  title  = {LegalBench-RAG: A Benchmark for Retrieval-Augmented Generation in the Legal Domain},
  author = {Nicholas Pipitone and Ghita Houir Alami},
  year   = {2024},
  eprint = {2408.10343},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.10343v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.10343.svg)](https://codeofpaper.com/paper/2408.10343)

Discussion