atlas

Research map / Large language models / Language, safety and interpretability

Lawma: The Power of Specialization for Legal Annotation

ICLR 2025 · Large language models › Language, safety and interpretability · approach: Data and evaluation methodology · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces CaselawQA, a 260-task legal annotation benchmark built from the Supreme Court and Courts of Appeals databases, and shows lightly fine-tuned open models (Lawma 135M to 70B) outperform commercial LLMs.

Problem

Legal annotation and classification is a costly bottleneck in empirical legal research, and it is unclear how well prompted large language models perform on such tasks compared with specialized models.

Approach

Construct 260 multiple-choice legal classification tasks from the SCDB and USCAD labels, then fine-tune small open-weights models jointly on all tasks; even the 135M model beats commercial zero-shot LLMs, and a few hundred labeled examples per task suffice to match them.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Fine-tune a small open model on the CaselawQA annotation tasks instead of using a general commercial modelLegal annotation models · CaselawQAaccuracy: 78% to 83%Helped
Increase the fine-tuned model size from 135M to 70BLawma · CaselawQAaccuracy: 83% to 88%Helped
Fine-tune on Court of Appeals tasksLlama 3.1 8B Instruct · Supreme Court tasksaccuracy: 50% to 64%Helped
Fine-tune on the precise target annotation tasks rather than only Court of Appeals tasksLlama 3.1 8B Instruct · Supreme Court tasksaccuracy: 25 percentage pointsHelped
Use chain-of-thought prompting instead of few-shot direct QA (ablation)Llama 3 Instruct models with at least 8B parameters · CaselawQAaccuracyHelped
Add in-context examples with few-shot direct QA (ablation)Llama 3 Instruct models with at most 3B parameters · CaselawQAaccuracyHelped
Add in-context examples (ablation)Llama 3.3 70B Instruct · CaselawQAaccuracyNo clear effect
Fine-tune Mixtral 8x7B Instruct on legal text to produce SaulLM 54B (ablation)Mixtral 8x7B Instruct · CaselawQAaccuracy: +4 accuracy pointsHelped
Train on increasing numbers of labeled examples (ablation)Llama 3.1 8B Instruct fine-tuned per task · 10 highlighted CaselawQA tasksaccuracyHelped
Fine-tune on all 260 tasks for one epoch instead of specializing from scratch on one task (ablation)Llama 3 8B Instruct · 10 highlighted CaselawQA tasksaccuracyHelped
Further fine-tune the broadly trained model on one task (ablation)Llama 3 8B Instruct fine-tuned on all tasks for one epoch · 10 highlighted CaselawQA tasksaccuracyHelped
Fine-tune on all tasks for three epochs instead of one epoch or one epoch plus single-task specialization (ablation)Llama 3.1 8B Instruct · 10 highlighted CaselawQA tasksaccuracyHelped

Surprising findings

Limitations

Experimental setup

Datasets: U.S. Supreme Court Database (SCDB) U.S. Courts of Appeals Database (USCAD) CaselawQA

Benchmarks: CaselawQA

Metrics: accuracy balanced accuracy macro-F1

Baselines: Claude 3.7 Sonnet GPT-4o GPT-4.5 o3-mini Llama 3.1 405B Instruct Llama 3.3 70B Instruct Qwen 2.5 72B Instruct DeepSeek R1 SaulLM 54B Legal-BERT

Builds on: LegalBench MMLU Legal-BERT SaulLM

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy