Lawma: The Power of Specialization for Legal Annotation
Ricardo Dominguez-Olmedo, Vedant Nanda, Rediet Abebe, Stefan Bechtold, Christoph Engel, Jens Frankenreiter, Krishna Gummadi, Moritz Hardt, Michael Livermore
TL;DR
The paper tackles the high cost of legal text annotation and introduces CaselawQA, a 260-task benchmark built from SCDB and USCAD to systematically evaluate ML annotation for legal data. It challenges the predominance of large commercial LLM prompting by showing that small, lightly fine-tuned open-weight models (Lawma) achieve higher accuracy with far fewer labeled examples. The results reveal strong sample efficiency, with hundreds to about a thousand labeled examples sufficing, and demonstrate broad generalization to unseen databases when tasks are precisely specialized. The work supports building an ecosystem of fine-tuned, task-specific models as a practical alternative to prompting large generalist models in empirical legal studies. CaselawQA is positioned as a benchmark for future model development and evaluation in the legal domain.
Abstract
Annotation and classification of legal text are central components of empirical legal research. Traditionally, these tasks are often delegated to trained research assistants. Motivated by the advances in language modeling, empirical legal scholars are increasingly turning to prompting commercial models, hoping that it will alleviate the significant cost of human annotation. Despite growing use, our understanding of how to best utilize large language models for legal annotation remains limited. To bridge this gap, we introduce CaselawQA, a benchmark comprising 260 legal annotation tasks, nearly all new to the machine learning community. We demonstrate that commercial models, such as GPT-4.5 and Claude 3.7 Sonnet, achieve non-trivial yet highly variable accuracy, generally falling short of the performance required for legal work. We then demonstrate that small, lightly fine-tuned models outperform commercial models. A few hundred to a thousand labeled examples are usually enough to achieve higher accuracy. Our work points to a viable alternative to the predominant practice of prompting commercial models. For concrete legal annotation tasks with some available labeled data, researchers are likely better off using a fine-tuned open-source model.
