LexGLUE: A Benchmark Dataset for Legal Language Understanding in English

Ilias Chalkidis, Abhik Jana, Dirk Hartung, Michael J. Bommarito Ii, Ion Androutsopoulos, Daniel Martin Katz, Nikolaos Aletras · OpenReview

Abstract

Laws and their interpretations, legal arguments and agreements are typically expressed in writing, leading to the production of vast corpora of legal text. Their analysis, which is at the center of legal practice, becomes increasingly elaborate as these collections grow in size. Natural language understanding (NLU) technologies can be a valuable tool to support legal practitioners in these endeavors. Their usefulness, however, largely depends on whether current state-of-the-art models can generalize across various tasks in the legal domain. To answer this currently open question, we introduce the Legal General Language Understanding Evaluation (LexGLUE) benchmark, a collection of datasets for evaluating model performance across a diverse set of legal NLU tasks in a standardized way. We also provide an evaluation and analysis of several generic and legal-oriented models demonstrating that the latter consistently offer performance improvements across multiple tasks.

Introduction

Law is a field built entirely on language, yet it utilizes a "sub-language" that is notoriously difficult for general-purpose AI. Legal text is characterized by "legalese"—uncommon terminology (voir dire, estoppel), common words with specialized meanings (e.g., a "party" as a legal entity), and complex, nested sentence structures.

A significant technical hurdle is document length. Legal documents are often massive, frequently exceeding the 512-token limit of standard Transformer models like BERT. Prior to LexGLUE, legal NLP research was fragmented, with inconsistent datasets and evaluation metrics making it difficult to identify true state-of-the-art performance. LexGLUE (Legal General Language Understanding Evaluation) addresses this by providing a unified "decathlon" for legal AI.

Distribution of document lengths (sub-word units) across LexGLUE datasets, illustrating the prevalence of long-form text.

The LexGLUE Datasets

LexGLUE consists of seven English-language datasets selected for their diversity and difficulty, covering human rights, supreme court opinions, EU legislation, and commercial contracts.

Overview of the LexGLUE benchmark datasets, including sources, task types, and instance counts.
  1. ECtHR (Tasks A & B): Predicting violated articles of the European Convention on Human Rights.
  2. SCOTUS: Classifying US Supreme Court opinions into 14 issue areas.
  3. EUR-LEX: Multi-label classification of EU laws into 100 EuroVoc concepts.
  4. LEDGAR: Classifying specific provisions within legal contracts.
  5. UNFAIR-ToS: Detecting unfair clauses in online Terms of Service.
  6. CaseHOLD: A multiple-choice QA task identifying the correct legal ruling for a case excerpt.

Methodology

The authors established a rigorous experimental framework evaluating several model classes:

  • Baselines: Linear SVM with TF-IDF features.
  • Generic Foundation Models: BERT, RoBERTa, and DeBERTa.
  • Long-Context Models: Longformer and BigBird (handling up to 4,096 tokens).
  • Domain-Specific Models: Legal-BERT (pre-trained on legislation/contracts) and CaseLaw-BERT (pre-trained on 3.4M US court decisions).
  • Hierarchical Variants: Models that encode paragraphs independently and aggregate them via a second-level Transformer to handle long documents.

Key Insights and Results

The evaluation revealed several critical findings:

  • Domain Knowledge is Essential: Legal-BERT consistently outperformed generic models of the same size, confirming that foundation models require specialized training data to master professional domains.
  • The "SCOTUS Surprise": Simple TF-IDF SVMs outperformed some deep learning models on the SCOTUS dataset, suggesting that specific keywords remain highly predictive for certain legal classification tasks.
  • Structure vs. Sequence: Hierarchical BERT variants often outperformed specialized long-context models like Longformer. This suggests that the inherent structure of legal documents (paragraphs/sections) is a vital signal.
  • Broad vs. Niche Training: CaseLaw-BERT (US-only) did not consistently beat Legal-BERT (mixed law) even on US tasks, implying that a broad legal "education" is preferable for foundation models.

Overall, Legal-BERT emerged as the winner, achieving the highest aggregate scores (e.g., A-Mean Micro-F1 of 79.8). On the CaseHOLD task, legal-specific models showed their greatest strength, outperforming generic BERT by nearly 5 percentage points. However, the benchmark remains "unsolved," as Macro-F1 scores are significantly lower than Micro-F1, indicating that models still struggle with the "long tail" of rare legal issues.

Limitations and Future Work

Current limitations include the focus on English-only text and the lack of a human expert baseline to serve as a "North Star." Future work aims to expand LexGLUE to a multilingual context and explore larger model scales (300M+ parameters). Additionally, the authors highlight the ongoing challenge of balancing open data access with the need for anonymization in sensitive legal documents.

Summary updated

BibTeX
@inproceedings{chalkidis2022lexglue,
  author = {Ilias Chalkidis and Abhik Jana and Dirk Hartung and Michael J. Bommarito II and Ion Androutsopoulos and Daniel Martin Katz and Nikolaos Aletras},
  title = {{LexGLUE: A Benchmark Dataset for Legal Language Understanding in English}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  url = {https://openreview.net/forum?id=nC_RyqqJ90},
}
Figure