Source-linked AI summary

When Does Pretraining Help? Assessing Self-Supervised Learning for Law and the CaseHOLD Dataset

Lucia Zheng, Neel Guha, Brandon R. Anderson, Peter Henderson, Daniel E. Ho

arXiv:2104.08671v3cs.CL

TL;DR

The paper asks when costly legal domain pretraining is warranted, given limited gains on prior legal NLP tasks. It introduces CaseHOLD and evaluates general BERT against Legal-BERT across legal benchmarks, finding that gains are largest for difficult, domain-specific tasks. The findings provide evidence for task difficulty and domain match as conditions associated with useful domain pretraining.

  • Problem

    It remains unclear when resource-intensive domain pretraining helps, while prior legal tasks have shown few substantial gains despite claims that legal language is distinct.

  • Method

    The paper introduces CaseHOLD and compares general BERT with custom-vocabulary Legal-BERT across legal tasks varying in difficulty and domain specificity.

  • Results

    Domain pretraining yields the largest gains on difficult, domain-specific tasks; on CaseHOLD, Legal-BERT improves F1 by 7.2%, a 12% relative boost from BERT.

  • Takeaways & Limitations

    Researchers should consider task difficulty and similarity to the pretraining corpus when deciding whether legal domain pretraining is warranted.

  • Takeaways & Limitations

    Some CaseHOLD gains may reflect exposure to keywords or similar holding formulations in the pretraining data, and BERT may have seen some cases in Wikipedia.

Abstract

from arXiv · show

While self-supervised learning has made rapid advances in natural language processing, it remains unclear when researchers should engage in resource-intensive domain-specific pretraining (domain pretraining). The law, puzzlingly, has yielded few documented instances of substantial gains to domain pretraining in spite of the fact that legal language is widely seen to be unique. We hypothesize that these existing results stem from the fact that existing legal NLP tasks are too easy and fail to meet conditions for when domain pretraining can help. To address this, we first present CaseHOLD (Case Holdings On Legal Decisions), a new dataset comprised of over 53,000+ multiple choice questions to identify the relevant holding of a cited case. This dataset presents a fundamental task to lawyers and is both legally meaningful and difficult from an NLP perspective (F1 of 0.4 with a BiLSTM baseline). Second, we assess performance gains on CaseHOLD and existing legal NLP datasets. While a Transformer architecture (BERT) pretrained on a general corpus (Google Books and Wikipedia) improves performance, domain pretraining (using corpus of approximately 3.5M decisions across all courts in the U.S. that is larger than BERT's) with a custom legal vocabulary exhibits the most substantial performance gains with CaseHOLD (gain of 7.2% on F1, representing a 12% improvement on BERT) and consistent performance gains across two other legal tasks. Third, we show that domain pretraining may be warranted when the task exhibits sufficient similarity to the pretraining corpus: the level of performance increase in three legal tasks was directly tied to the domain specificity of the task. Our findings inform when researchers should engage resource-intensive pretraining and show that Transformer-based architectures, too, learn embeddings suggestive of distinct legal language.

1 INTRODUCTION

The paper addresses why legal domain pretraining has shown limited gains by introducing a difficult, legally meaningful benchmark and evaluating Legal-BERT on it. The results indicate substantial gains when the task is challenging and aligned with legal language.

  • Motivation: Domain-specific pretraining has produced limited gains on existing legal NLP tasks despite widespread belief that legal language is distinct.The paper attributes this puzzle to tasks that may be too easy or poorly matched to the pretraining corpus.
  • Dataset: CaseHOLD provides 53,000+ multiple choice questions requiring identification of the relevant holding of a cited case.The dataset matches citing context and legal citations with correct and semantically similar incorrect holding statements.
  • Dataset: Table 1 defines each example as a citing-text prompt, one correct holding statement, four incorrect alternatives, and a 0-indexed correct-answer label.The dataset uses a fixed context window that may begin mid-sentence.
  • Results: BiLSTM F1 = 0.4 and BERT F1 = 0.6, showing that CaseHOLD is difficult for conventional NLP approaches.Law students and lawyers solve the task at high accuracy.
  • Results: A custom-vocabulary Legal-BERT model using U.S. case law achieves a 7.2% F1 gain, representing a 12% relative improvement from BERT.The paper presents this as a substantial and statistically significant gain from domain pretraining.
  • Implications: The findings inform decisions about resource-intensive pretraining, whose full BERT cost can exceed $1M while legal NLP may affect access to justice.The paper frames pretraining as a tradeoff between resource costs and potential social benefits.

2 RELATED WORK

Prior work finds strong benefits from domain pretraining in biomedical and scientific NLP but generally small or absent gains in legal NLP. The paper addresses this gap by introducing a challenging U.S. legal benchmark and studying when domain pretraining helps.

  • Non-legal precedent: BioBERT gains 6-9% in strict accuracy over BERT on biomedical question answering tasks, while SciBERT gains 7.07% in macro F1 on ACL-ARC.These results show substantial domain-pretraining gains outside law.
  • Legal precedent: Legal domain-pretraining studies report marginal, insignificant, or absent gains across several legal tasks.Reported examples include 0.4-0.7% F1 gains, no gains against LSTM baselines, and small improvements across ECHR-CASES and CONTRACTS-NER.
  • Open gaps: Existing legal benchmarks are few, often non-English or proprietary, and may overrepresent tasks already solvable by pre-self-supervised-learning methods.Labeling expense and legal-document compilation challenges limit large public U.S. law datasets.
  • Contribution: The paper contributes a large U.S. legal holding-identification dataset and evaluates conditions under which domain pretraining can help.These contributions directly target the benchmark and assessment gaps identified in prior work.

3 THE CASEHOLD DATASET

CaseHOLD is a U.S. legal multiple-choice question-answering benchmark built from citations in judicial decisions. Each item asks which holding statement correctly corresponds to the citing context.

  • Task motivation: Holdings are precedential governing legal rules that litigants can rely on in subsequent common-law cases.Identifying, stating, and reformulating holdings is described as a canonical first-year law-student task.
  • Task construction: CaseHOLD uses citing context as the prompt and holding statements derived from legal citations as five answer choices.One choice is correct and four are incorrect holding statements.
  • Data construction: The dataset is constructed from the Harvard Law Library case-law corpus, with holding statements extracted from citations and the preceding text used as the prompt.A <HOLDING> token marks where the extracted holding statement appeared.
  • Data construction: Incorrect answers are selected using TF-IDF similarity to the correct holding statement, producing semantically similar but inappropriate alternatives.This creates a multiple-choice discrimination task rather than a classification problem with meaningful answer classes.
  • Example format: Each example contains a citing-text prompt, one correct holding, four incorrect holdings, and a randomly ordered label from 0-4.The labels enumerate answer choices rather than represent underlying classes.

4 OTHER DATASETS

The paper compares two additional legal benchmarks with CaseHOLD to assess task difficulty and domain specificity. Overruling is easy despite legal language, while Terms of Service is less specific to case-law pretraining.

  • The benchmark tasks are costly or difficult to distribute, making pretraining appealing for legal NLP.
  • Overruling: Overruling is a binary classification task distinguishing sentences that nullify prior precedents from non-overruling sentences.
  • Overruling: Overruling is relatively easy because explicit keywords such as “overrule” and “disapprove” often distinguish positive examples.
  • Terms of Service: Terms of Service classifies contractual clauses as potentially unfair or clearly fair based on manual annotations from 50 online consumer contracts.
  • Terms of Service: Terms of Service has lower domain specificity than Overruling and CaseHOLD because consumer-contract language may be less prevalent in case-law corpora.

5 METHODS

The methods compare general BERT training with legal-domain pretraining while evaluating both Transformer models and a BiLSTM baseline. Legal-BERT variants are pretrained on a large case-law corpus using standard masked-language-modeling procedures and then fine-tuned on legal tasks.

  • Pretraining design: The study varies pretraining decisions across base BERT, longer general-domain training, and Legal-BERT trained on the Harvard Law case corpus.The legal corpus contains 3,446,187 decisions across federal and state courts.
  • Baselines: The BiLSTM baseline encodes single sentences or five prompt-answer pairs before classification.
  • Legal corpus: Legal-BERT is pretrained on decisions from 1965 onward, with 90% used for pretraining and 10% held out for CaseHOLD.
  • Legal-BERT variants: Custom Legal-BERT is trained from scratch with a legal vocabulary, while another Legal-BERT variant continues training BERT with BERT’s vocabulary.
  • Training procedure: Both Legal-BERT variants use whole-word masking, and the models are subsequently fine-tuned on legal benchmark tasks.

6.1 Base Setup

The base setup evaluates models across three legal tasks using cross-validation and task-appropriate F1 metrics. Domain-pretraining gains increase with task domain specificity, but are marginal on easier or less specific tasks and largest on CaseHOLD.

  • Evaluation: Performance was evaluated with 10-fold cross-validation using F1 for Overruling and Terms of Service and macro F1 for CaseHOLD.
  • Performance results: 7.2% is the largest gain over BERT (double), achieved by Custom Legal-BERT on the difficult, domain-specific CaseHOLD task.Legal-BERT gains 5.7% on the same comparison.
  • Performance results: 5.1% is the improvement from BERT (double) over base BERT on Terms of Service, while legal-domain variants do not substantially outperform BERT (double).
  • Domain specificity: The DS score measures the average difference between Legal-BERT and BERT pretraining losses on a downstream task before fine-tuning.
  • Domain specificity: Terms of Service, Overruling, and CaseHOLD rank from least to most domain-specific, matching the pattern of increasing pretraining gains.

6.2 Task Variants

The task variants examine whether training volume, prompt difficulty, and domain match affect Legal-BERT’s gains over BERT. Gains are strongest with limited training data, while prompt difficulty shows no clear pattern and domain-match analysis is constrained by narrow within-task DS-score ranges.

  • Train Volume: 17.6% ± 3.73 was Legal-BERT’s mean gain over BERT for a training set size of 1, the maximum across train-set sizes.Legal-BERT gains were strongest with low train volume and washed out with high train volume.
  • Prompt Difficulty: The prompt-difficulty variant shortens CaseHOLD prompts to prefixes of 5–100 words or the full prompt, but produces no clear pattern in Legal-BERT’s gains over BERT.The average full prompt length is 136 words.
  • Domain Match: The domain-match variant weights test examples by ascending DS-score rank, rewarding correct predictions on examples with higher domain specificity.This keeps training volume and the training-set domain-specificity distribution constant.
  • Domain Match: CaseHOLD’s narrow DS-score range limits the domain-match analysis, whereas combining tasks spans a larger range and explains more substantial cross-task differences.CaseHOLD is already highly domain specific, so within-task variation may be too restricted to test domain match meaningfully.
  • Domain Match: A further domain-match test could pretrain on one legal area and fine-tune on another, but the available corpus lacks meaningful case or issue-type features.The proposed example contrasts civil-law pretraining with criminal-law fine-tuning.

6.3 Error Analysis

The error analysis compares where Legal-BERT and BERT succeed or fail and examines divergent predictions for evidence of legal-language sensitivity. Legal-BERT is correct more often than BERT on divergent cases, but simple legal phrases do not explain performance differences statistically.

  • Error Breakdown: 55% of test cases were correct for both models, 13% only for Legal-BERT, 7% only for BERT, and 25% incorrect for both.The analysis focuses particularly on cases where Legal-BERT was correct and BERT was incorrect.
  • Divergent Predictions: Qualitative examples suggest Legal-BERT attends to distinctions such as “may” versus “must” and the negating citation signal “but see.”These examples were indicative rather than statistically predictive of performance differences.
  • Divergent Predictions: A bivariate probit analysis found that these simple legal phrases did not predict differences in model performance.The authors identify further analysis of what Legal-BERT uniquely attends to as an open opportunity.

6.4 Limitations

The paper notes that Legal-BERT may benefit from seeing words associated with similar holding formulations even when the evaluated cases were absent from pretraining. It also identifies prompt-length and corpus-feature limitations relevant to interpreting the variants and future work.

  • Pretraining and Memorization: Legal-BERT may gain from key words tied to similar holding formulations in pretraining, despite the CaseHOLD cases themselves being absent.This possibility may help explain varying prompt-difficulty results and zero-shot gains in the train-volume variant.
  • Future Work: A future CaseHOLD variant could paraphrase holdings to separate memorization of case names from understanding the citing text’s framing.The proposed framing reflects a first-year law-student exercise of reframing a holding to match an argument.
  • Pretraining and Memorization: Wikipedia may contain some cases and holdings, potentially contributing to BERT’s zero-shot performance above random.The paper points to a list of landmark U.S. court decisions as an example of such content.

7 DISCUSSION

The paper resolves the puzzle of weak legal domain-pretraining gains by showing that benefits depend on task difficulty, domain specificity, and available supervision. It also uses CaseHOLD and Legal-BERT to illustrate how domain knowledge can support challenging legal NLP benchmarks and dataset construction.

  • 7 DISCUSSION: The paper explains marginal prior gains by showing that existing legal benchmarks are often too easy or poorly matched to the pretraining corpus.These conditions limit the value of additional domain pretraining relative to general BERT.
  • 7 DISCUSSION: CaseHOLD is proposed as a challenging benchmark for legal decisions, addressing concerns that available datasets may be small, unavailable, or biased toward solvable tasks.The discussion contrasts this challenge with the Overruling task, whose BiLSTM baseline F1 is 0.91.
  • 7 DISCUSSION: Domain knowledge improves dataset construction because legal citation rules enable better representation and extraction than conventional segmentation alone.CaseHOLD leverages the complex structure of legal citation rather than treating legal text as conventionally segmented language.
  • 7 DISCUSSION: The paper recommends considering domain pretraining when labels are scarce and tasks are sufficiently in-domain, especially for difficult legal tasks.It proposes DS scores as a quick heuristic for judging whether resource-intensive adaptation may be warranted.
  • 7 DISCUSSION: The findings suggest that high-domain-specificity, adequately difficult tasks may benefit from custom, task-relevant corpora and preprocessing choices.The paper specifically mentions task-specific domains and tokenization or sentence segmentation tailored to in-domain text.
  • 7 DISCUSSION: Together, CaseHOLD and comprehensively pretrained Legal-BERT illustrate conditions for domain pretraining and suggest that language models can encode distinctive legal language.The conclusion connects benchmark difficulty, pretraining, and potentially unique legal-language representations.
Loading 2104.08671v3…