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

AUTOLAW: Enhancing Legal Compliance in Large Language Models via Case Law Generation and Jury-Inspired Deliberation

Tai D. Nguyen, Long H. Pham, Jun SunarXiv 2025

Abstract

The rapid advancement of domain-specific large language models (LLMs) in fields like law necessitates frameworks that account for nuanced regional legal distinctions, which are critical for ensuring compliance and trustworthiness. Existing legal evaluation benchmarks often lack adaptability and fail to address diverse local contexts, limiting their utility in dynamically evolving regulatory landscapes. To address these gaps, we propose AutoLaw, a novel violation detection framework that combines adversarial data generation with a jury-inspired deliberation process to enhance legal compliance of LLMs. Unlike static approaches, AutoLaw dynamically synthesizes case law to reflect local regulations and employs a pool of LLM-based "jurors" to simulate judicial decision-making. Jurors are ranked and selected based on synthesized legal expertise, enabling a deliberation process that minimizes bias and improves detection accuracy. Evaluations across three benchmarks: Law-SG, Case-SG (legality), and Unfair-TOS (policy), demonstrate AutoLaw's effectiveness: adversarial data generation improves LLM discrimination, while the jury-based voting strategy significantly boosts violation detection rates. Our results highlight the framework's ability to adaptively probe legal misalignments and deliver reliable, context-aware judgments, offering a scalable solution for evaluating and enhancing LLMs in legally sensitive applications.

Introduction

As Large Language Models (LLMs) are increasingly integrated into specialized domains such as law and finance, the requirement for regional regulatory compliance becomes paramount. A model's general understanding of legal concepts often fails to capture the specific, nuanced regulations of different jurisdictions—for instance, distinguishing between generally permissible behaviors and those that are punishable offenses in specific locales like Singapore.

Current legal evaluation methodologies face two primary challenges:

  1. Static Benchmarks: Existing datasets often focus on broad legal principles, missing the "long-tail" of regional edge cases.
  2. Evaluation Consistency: Individual LLMs often exhibit bias or inconsistency when judging legal scenarios directly, and traditional fine-tuning or RAG approaches can inadvertently degrade general reasoning capabilities.

The AUTOLAW Framework

To address these limitations, we introduce AUTOLAW, a three-stage pipeline designed to move beyond static evaluation and simulate a judicial deliberation process.

1. Adversarial Case Law Generation

Rather than relying on simple prompts, AUTOLAW extracts specific misconduct definitions from actual regulations. It then employs an iterative adversarial refinement process (the ALI method) to generate "implicit" scenarios—nuanced narratives designed to test if an LLM can detect violations when they are not explicitly stated.

2. Jury Selection and Deliberation

The framework maintains a diverse pool of LLMs, each assigned specific roles such as Judge, Lawyer, or Prosecutor. These "jurors" are ranked based on their historical performance against synthesized case law. For any given scenario, the system selects the top $k$ expert jurors to participate in a deliberation process. Their independent evaluations are then aggregated via a majority-voting mechanism to produce a final, more reliable verdict.

Experimental Evaluation

We evaluated the AUTOLAW framework across three distinct benchmarks:

  • Law-SG: 3,150 synthetic scenarios based on Singaporean regulations, refined through adversarial testing.
  • Case-SG: 58 real-world legal scenarios curated from Singaporean news reports.
  • Unfair-TOS: A subset of the LexGLUE benchmark focusing on unfair Terms of Service clauses.
  • DROP: A control dataset used to monitor potential degradation in general reading comprehension.

Key Insights

Our analysis reveals that adversarial probing is essential for a true assessment of model capabilities. While modern LLMs like Llama 3.1 and Qwen 2.5 perform well on "explicit" (obvious) violations, their performance drops significantly when faced with "implicit" scenarios, as shown in the performance breakdown below.

Performance comparison across explicit and implicit legal scenarios.

Furthermore, we observed that while model editing techniques (e.g., WISE, GRACE) can "patch" specific legal knowledge, they often lead to overfitting or "catastrophic forgetting" in unrelated tasks. In contrast, the jury-based approach leverages the collective intelligence of multiple models without altering their underlying weights.

Results

The AUTOLAW framework consistently outperformed standard majority voting across all tested benchmarks. In the Law-SG dataset, AUTOLAW achieved a detection rate (DR) of 90.36%, significantly higher than the ~78% achieved by standard voting. On the Case-SG real-world dataset, the framework achieved a 100% detection rate in several configurations, demonstrating its robustness in handling complex, real-world reporting.

Evaluation of AutoLaw vs. standard majority voting across three legal benchmarks.

The use of a ranked jury not only improves accuracy but also reduces performance variance, providing a more stable and reliable evaluation metric for legal compliance.

Conclusion

AUTOLAW provides a scalable and adaptive framework for evaluating LLMs in legally sensitive contexts. By combining adversarial data generation with a jury-inspired deliberation system, it effectively probes model weaknesses and delivers context-aware judgments. Future work will focus on expanding the framework to handle multi-regulation scenarios and implementing more sophisticated debate protocols between jurors.

Summary updated

BibTeX
@misc{nguyen2025autolaw,
  author = {Tai D. Nguyen and Long H. Pham and Jun Sun},
  title = {{AUTOLAW: Enhancing Legal Compliance in Large Language Models via Case Law Generation and Jury-Inspired Deliberation}},
  year = {2025},
  eprint = {2505.14015},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.14015},
}
Figure