LEGAL-BERT: "Preparing the Muppets for Court'"

Ilias Chalkidis, Manos Fergadiotis, Prodromos Malakasiotis, Nikolaos Aletras, Ion Androutsopoulos

Abstract

Ilias Chalkidis, Manos Fergadiotis, Prodromos Malakasiotis, Nikolaos Aletras, Ion Androutsopoulos. Findings of the Association for Computational Linguistics: EMNLP 2020.

2020.

Introduction

While BERT has revolutionized natural language processing (NLP), its performance often degrades when applied to specialized domains like law. Legal text is frequently considered a "sublanguage" characterized by archaic terminology, unique syntax, and highly specific semantic meanings that diverge significantly from everyday usage. This paper addresses the gap in domain adaptation for legal NLP, investigating whether further pre-training on legal data or training from scratch with a domain-specific vocabulary is more effective than using general-purpose models.

Methods

The researchers explored three primary strategies for applying BERT to the legal domain, as illustrated in the figure below:

Overview of domain adaptation strategies for BERT.
  • Strategy (a) BERT-BASE: Using the original BERT-BASE model, trained on generic corpora (Wikipedia and BooksCorpus), and fine-tuning it directly on legal tasks.
  • Strategy (b) Further Pre-training (FP): Continuing the pre-training of the original BERT-BASE on a large legal corpus before task-specific fine-tuning.
  • Strategy (c) Pre-training from Scratch (SC): Training a model from random initialization using a custom vocabulary built entirely from legal sub-words.

Beyond architecture, the authors introduced a broader hyper-parameter search during fine-tuning. They found that the standard, narrow guidelines suggested in the original BERT paper often lead to underfitting in specialized domains. By experimenting with lower learning rates and higher dropout rates, they established a more robust recipe for legal NLP.

Datasets and Evaluation

The models were pre-trained on a 12 GB corpus of diverse English legal text, including EU and UK legislation, court cases from the ECJ and ECHR, and US contracts from the SEC-EDGAR database. Evaluation was conducted across three distinct benchmarks:

  1. EURLEX57K: Large-scale multi-label classification of EU laws.
  2. ECHR-CASES: Binary and multi-label classification of European Court of Human Rights cases.
  3. CONTRACTS-NER: Named entity recognition for identifying parties, dates, and jurisdictions in US contracts.

Key Results

LEGAL-BERT variants consistently outperformed the standard BERT-BASE across all evaluation datasets. The performance gains were most pronounced in complex tasks like multi-label classification and NER, where a deep understanding of legal semantics is critical.

Performance comparison across legal benchmarks.

Key Insights:

  • The Vocabulary Gap: Pre-training from scratch (SC) allows the model to learn a domain-specific vocabulary that handles technical terms more efficiently than the generic BERT vocabulary.
  • Hyper-parameter Impact: The "tuned" versions of models, which utilized an enriched grid search and more training epochs, showed substantial improvements over default fine-tuning strategies.
  • Efficiency with LEGAL-BERT-SMALL: The authors introduced a lightweight 6-layer version (35M parameters) that achieved comparable performance to the 12-layer BERT-BASE while being 4x faster and significantly more memory-efficient.

Conclusion

LEGAL-BERT demonstrates that domain-specific pre-training and thoughtful hyper-parameter tuning are essential for high-performance legal NLP. The release of these models, including the efficient LEGAL-BERT-SMALL, provides a powerful resource for practitioners. Future work will look toward sub-domain specialization, broader task evaluation, and expanding these techniques to multilingual legal contexts.

Summary updated

BibTeX
@inproceedings{chalkidis2020legal,
  author = {Ilias Chalkidis and Manos Fergadiotis and Prodromos Malakasiotis and Nikolaos Aletras and Ion Androutsopoulos},
  title = {{LEGAL-BERT: "Preparing the Muppets for Court'"}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  url = {https://openreview.net/forum?id=xyuZ_mfLml},
}
Figure