NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LegalDrill: Diagnosis-Driven Synthesis for Legal Reasoning in Small Language Models

Tianchun Li, Haochen Liu, Vishwa Pardeshi, Xingchen Wang, Tianci Liu, Huijun Zhao, Wei Fan, Jing Gao

TL;DR

LegalDrill is a novel framework designed to train Small Language Models (SLMs, <3B parameters) for high-stakes legal reasoning without relying on expensive human annotations. By using a larger teacher model to diagnose the SLM's specific errors, synthesizing concise error-correcting preference data, and filtering it via a self-reflective verification step, LegalDrill bridges the performance gap between small on-device models and massive cloud-based LLMs.

What Problem Does This Paper Address?

In the legal domain, data privacy is paramount. Routing sensitive client information or financial contracts to external cloud APIs (like GPT-4 or Gemini) poses severe security risks. This makes Small Language Models (SLMs) highly attractive for secure, local, on-device deployment.

However, SLMs notoriously struggle with complex legal reasoning, which requires multi-step statute interpretation and logically consistent deduction. While we often use knowledge distillation (letting a smaller model copy a larger one) to boost SLM performance, standard approaches fail here. Large, reinforcement-learning-aligned models tend to generate verbose, exploration-heavy "Chain-of-Thought" (CoT) trajectories. Because of their limited parameter scale, SLMs cannot effectively internalize or mimic these ultra-long reasoning chains. They need concise, targeted reasoning paths that directly address their specific logical blind spots.

Methods

The authors introduce LegalDrill, an iterative, diagnosis-driven synthesis framework that operates in four distinct phases:

Figure 1: The overview of LegalDrill.
  1. Exploration: The student SLM generates preliminary answers to legal queries using Chain-of-Thought prompting to make its internal logic visible.
  2. Diagnosis: A specialized LLM "Audit Agent" scrutinizes the student's incorrect answers, identifies the root causes (e.g., misreading statutory terms or making logical leaps), and abstracts them into context-agnostic Error Simulation Instructions stored in a reusable bank.
  3. Targeted Generation: A powerful teacher LLM takes these abstracted error instructions and recombines them with various legal contexts to synthesize preference pairs: a rejected response that intentionally mimics the specific error, and a chosen response that rectifies it through a concise, logically tight deduction.
  4. Self-Reflective Quality Verification: To ensure the SLM only trains on high-value data, the framework calculates a Difficulty Score. It forces the student model to evaluate the generated pairs ("correct" vs "incorrect"). If the student is already capable of identifying the right answer, the sample is discarded. Only samples that genuinely confuse the student are kept.

Finally, the student model is optimized using Supervised Fine-Tuning (SFT) for a stable "cold start," followed by Direct Preference Optimization (DPO) on the filtered preference pairs.

Figure 2: Illustrative examples of legal reasoning refinement of LegalDrill. After the optimization, the student model is asked to generate a response under the same legal query, which is marked as LegalDrill response

Datasets

The framework was evaluated across six distinct document-grounded, binary (yes/no) question-answering datasets:

  • Public Benchmarks (from LegalBench): Consumer QA (400 pairs interpreting consumer contracts), Contracts QA (88 samples categorizing contract clauses), Sara Entailment (276 examples of statutory tax-law reasoning), and Privacy Policy Entailment (4,343 examples identifying privacy practices).
  • Proprietary Real-World Datasets: Two datasets from real-world financial-industry compliance workflows: Real-World Power of Attorney (POA) (780 examples) and Real-World Trust (468 examples).

Key Insights and Ideas

  • The Learnability Mismatch: Simply feeding an SLM the outputs of a giant LLM doesn't work if the reasoning style is too verbose. SLMs require compact, dense reasoning trajectories to learn effectively.
  • Combinatorial Data Expansion: By forcing the Audit Agent to write context-agnostic error instructions (e.g., "ignore the time frame when calculating the limitation period"), the authors decoupled error types from specific cases. This allows them to generate an arbitrarily large training set by pairing any error instruction with any legal text.
  • Subjective vs. Objective Difficulty: A training sample might be objectively high-quality but subjectively trivial if the student model already understands the concept. Filtering data based on the student's intrinsic confusion maximizes the efficiency of the optimization budget.

Key Results

LegalDrill consistently boosted the accuracy and F1 scores of baseline SLMs (Qwen3-0.6B and Qwen3-1.7B) across all datasets.

Table 1: Overall performances on public datasets.
  • Closing the Teacher-Student Gap: On the Contracts QA benchmark, the LegalDrill-trained 1.7B model achieved an accuracy of 0.93, approaching its 30B teacher's performance (0.96) while being a fraction of the size.
  • Industrial Viability: On proprietary financial datasets, distilling from GPT-4o yielded student performance on par with the teacher, showcasing a cost-effective path for automated compliance workflows.
  • DPO vs. SFT: Ablation studies confirmed that pairing chosen and rejected responses via DPO provided a critical contrastive signal, universally outperforming SFT-only training.
Figure 3: The ablation study on DPO.

Limitations and Future Work

While highly effective, LegalDrill relies on the DPO algorithm, which introduces additional hyperparameters to tune (such as learning rate, weight decay, and the $\beta$ parameter controlling deviation from the reference model). The authors note that finding the sweet spot typically requires 1–3 epochs of tuning. Additionally, the framework still fundamentally depends on access to a highly capable teacher model (like GPT-4o or Qwen-30B) during the offline data generation phase. Future work could explore completely self-contained boot-strapping methods for SLMs.

Summary updated

BibTeX
@inproceedings{li2026legaldrill,
  author = {Tianchun Li and Haochen Liu and Vishwa Pardeshi and Xingchen Wang and Tianci Liu and Huijun Zhao and Wei Fan and Jing Gao},
  title = {{LegalDrill: Diagnosis-Driven Synthesis for Legal Reasoning in Small Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-industry.120},
}
Figure