mlsanityData to 7 Oct 2026

Processing Long Legal Documents with Pre-trained Transformers: Modding LegalBERT and Longformer

arXiv 2211.00974 ↗First posted 2 Nov 2022cs.CLcited by 20

Not on the map. Why?

Abstract (arXiv)

Pre-trained Transformers currently dominate most NLP tasks. They impose, however, limits on the maximum input length (512 sub-words in BERT), which are too restrictive in the legal domain. Even sparse-attention models, such as Longformer and BigBird, which increase the maximum input length to 4,096 sub-words, severely truncate texts in three of the six datasets of LexGLUE. Simpler linear classifiers with TF-IDF features can handle texts of any length, require far less resources to train and deploy, but are usually outperformed by pre-trained Transformers. We explore two directions to cope with long legal texts: (i) modifying a Longformer warm-started from LegalBERT to handle even longer texts (up to 8,192 sub-words), and (ii) modifying LegalBERT to use TF-IDF representations. The first approach is the best in terms of performance, surpassing a hierarchical version of LegalBERT, which was the previous state of the art in LexGLUE. The second approach leads to computationally more efficient models at the expense of lower performance, but the resulting models still outperform overall a linear SVM with TF-IDF features in long legal document classification.

Key facts. Cited by 20 papers in the map (data through 7 Oct 2026). Builds on 30 of its 44 references that are in the map. First posted on arXiv 2 Nov 2022.

Builds on

30 of 44 references.

References · 30

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  4. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  5. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  6. 2020Longformer: The Long-Document Transformercited by 3,362
  7. 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
  8. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
  9. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  10. 2019SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systemscited by 1,718
  11. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
  12. 2015Show, Attend and Tell: Neural Image Caption Generation with Visual Attentioncited by 1,421
18 more
  1. 2021LexGLUE: A Benchmark Dataset for Legal Language Understanding in Englishcited by 302
  2. 2019Neural Legal Judgment Prediction in Englishcited by 208
  3. 2021When Does Pretraining Help? Assessing Self-Supervised Learning for Law and the CaseHOLD Datasetcited by 199
  4. 2021Masked Language Modeling and the Distributional Hypothesis: Order Word Matters Pre-training for Littlecited by 176
  5. 2021Lawformer: A Pre-trained Language Model for Chinese Legal Long Documentscited by 115
  6. 2019Large-Scale Multi-Label Text Classification on EU Legislationcited by 104
  7. 2021ILDC for CJPE: Indian Legal Documents Corpus for Court Judgment Prediction and Explanationcited by 78
  8. 2021Paragraph-level Rationale Extraction through Regularization: A case study on European Court of Human Rights Casescited by 77
  9. 2018CLAUDETTE: an Automated Detector of Potentially Unfair Clauses in Online Terms of Servicecited by 72
  10. 2022Revisiting Transformer-based Models for Long Document Classificationcited by 48
  11. 2020Beyond 512 Tokens: Siamese Multi-depth Transformer-based Hierarchical Encoder for Long-Form Document Matchingcited by 35
  12. 2022Word Order Does Matter (And Shuffled Language Models Know It)cited by 32
  13. 2020ERNIE-Doc: A Retrospective Long-Document Modeling Transformercited by 31
  14. 2022Corpus for Automatic Structuring of Legal Documentscited by 25
  15. 2018Obligation and Prohibition Extraction Using Hierarchical RNNscited by 18
  16. 2022An Empirical Study on Cross-X Transfer for Legal Judgment Predictioncited by 16
  17. 2021How not to Lie with a Benchmark: Rearranging NLP Leaderboardscited by 9
  18. 2016Using Centroids of Word Embeddings and Word Mover's Distance for Biomedical Document Retrieval in Question Answeringcited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 6; 2024: 7; 2025: 3; 2026: 4.

20 papers.

Sort:

  1. 2024Natural Language Processing for the Legal Domain: A Survey of Tasks, Datasets, Models, and Challengescited by 42
  2. 2023Bringing order into the realm of Transformer-based language models for artificial intelligence and lawcited by 13
  3. 2023Large Language Models are legal but they are not: Making the case for a powerful LegalLLMcited by 12
  4. 2024LegalLens: Leveraging LLMs for Legal Violation Identification in Unstructured Textcited by 12
  5. 2023Legal Extractive Summarization of U.S. Court Opinionscited by 9
  6. 2023LexGPT 0.1: pre-trained GPT-J models with Pile of Lawcited by 9
  7. 2023Large Language Model Prompt Chaining for Long Legal Document Classificationcited by 7
  8. 2024LegalLens Shared Task 2024: Legal Violation Identification in Unstructured Textcited by 5
  9. 2024Unfair TOS: An Automated Approach using Customized BERTcited by 3
  10. 2024Summarizing long regulatory documents with a multi-step pipelinecited by 3
  11. 2024Extracting Norms from Contracts Via ChatGPT: Opportunities and Challengescited by 2
  12. 2024The Right Model for the Job: An Evaluation of Legal Multi-Label Classification Baselinescited by 1
8 more
  1. 2026Validate Your Authority: Benchmarking LLMs on Multi-Label Precedent Treatment Classificationcited by 1
  2. 2023Legal NLP Meets MiCAR: Advancing the Analysis of Crypto White Paperscited by 0
  3. 2025A Data Science Approach to Calcutta High Court Judgments: An Efficient LLM and RAG-powered Framework for Summarization and Similar Cases Retrievalcited by 0
  4. 2025Skim-Aware Contrastive Learning for Efficient Document Representationcited by 0
  5. 2025Classifying long legal documents using short random chunkscited by 0
  6. 2026Legal Experts Disagree With Rationale Extraction Techniques for Explaining ECtHR Case Outcome Classificationcited by 0
  7. 2026A Two-Stage Architecture for NDA Analysis: LLM-based Segmentation and Transformer-based Clause Classificationcited by 0
  8. 2026LLM-Assisted Causal Structure Disambiguation and Factor Extraction for Legal Judgment Predictioncited by 0