Processing Long Legal Documents with Pre-trained Transformers: Modding LegalBERT and Longformer
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
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2019SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systemscited by 1,718
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2015Show, Attend and Tell: Neural Image Caption Generation with Visual Attentioncited by 1,421
18 more
- 2021LexGLUE: A Benchmark Dataset for Legal Language Understanding in Englishcited by 302
- 2019Neural Legal Judgment Prediction in Englishcited by 208
- 2021When Does Pretraining Help? Assessing Self-Supervised Learning for Law and the CaseHOLD Datasetcited by 199
- 2021Masked Language Modeling and the Distributional Hypothesis: Order Word Matters Pre-training for Littlecited by 176
- 2021Lawformer: A Pre-trained Language Model for Chinese Legal Long Documentscited by 115
- 2019Large-Scale Multi-Label Text Classification on EU Legislationcited by 104
- 2021ILDC for CJPE: Indian Legal Documents Corpus for Court Judgment Prediction and Explanationcited by 78
- 2021Paragraph-level Rationale Extraction through Regularization: A case study on European Court of Human Rights Casescited by 77
- 2018CLAUDETTE: an Automated Detector of Potentially Unfair Clauses in Online Terms of Servicecited by 72
- 2022Revisiting Transformer-based Models for Long Document Classificationcited by 48
- 2020Beyond 512 Tokens: Siamese Multi-depth Transformer-based Hierarchical Encoder for Long-Form Document Matchingcited by 35
- 2022Word Order Does Matter (And Shuffled Language Models Know It)cited by 32
- 2020ERNIE-Doc: A Retrospective Long-Document Modeling Transformercited by 31
- 2022Corpus for Automatic Structuring of Legal Documentscited by 25
- 2018Obligation and Prohibition Extraction Using Hierarchical RNNscited by 18
- 2022An Empirical Study on Cross-X Transfer for Legal Judgment Predictioncited by 16
- 2021How not to Lie with a Benchmark: Rearranging NLP Leaderboardscited by 9
- 2016Using Centroids of Word Embeddings and Word Mover's Distance for Biomedical Document Retrieval in Question Answeringcited by 6
Built on by
Citing papers per year: 2023: 6; 2024: 7; 2025: 3; 2026: 4.
20 papers.
Sort:
- 2024Natural Language Processing for the Legal Domain: A Survey of Tasks, Datasets, Models, and Challengescited by 42
- 2023Bringing order into the realm of Transformer-based language models for artificial intelligence and lawcited by 13
- 2023Large Language Models are legal but they are not: Making the case for a powerful LegalLLMcited by 12
- 2024LegalLens: Leveraging LLMs for Legal Violation Identification in Unstructured Textcited by 12
- 2023Legal Extractive Summarization of U.S. Court Opinionscited by 9
- 2023LexGPT 0.1: pre-trained GPT-J models with Pile of Lawcited by 9
- 2023Large Language Model Prompt Chaining for Long Legal Document Classificationcited by 7
- 2024LegalLens Shared Task 2024: Legal Violation Identification in Unstructured Textcited by 5
- 2024Unfair TOS: An Automated Approach using Customized BERTcited by 3
- 2024Summarizing long regulatory documents with a multi-step pipelinecited by 3
- 2024Extracting Norms from Contracts Via ChatGPT: Opportunities and Challengescited by 2
- 2024The Right Model for the Job: An Evaluation of Legal Multi-Label Classification Baselinescited by 1
8 more
- 2026Validate Your Authority: Benchmarking LLMs on Multi-Label Precedent Treatment Classificationcited by 1
- 2023Legal NLP Meets MiCAR: Advancing the Analysis of Crypto White Paperscited by 0
- 2025A Data Science Approach to Calcutta High Court Judgments: An Efficient LLM and RAG-powered Framework for Summarization and Similar Cases Retrievalcited by 0
- 2025Skim-Aware Contrastive Learning for Efficient Document Representationcited by 0
- 2025Classifying long legal documents using short random chunkscited by 0
- 2026Legal Experts Disagree With Rationale Extraction Techniques for Explaining ECtHR Case Outcome Classificationcited by 0
- 2026A Two-Stage Architecture for NDA Analysis: LLM-based Segmentation and Transformer-based Clause Classificationcited by 0
- 2026LLM-Assisted Causal Structure Disambiguation and Factor Extraction for Legal Judgment Predictioncited by 0
- 2026Validate Your Authority: Benchmarking LLMs on Multi-Label Precedent Treatment Classification17 May 2026
- 2026LLM-Assisted Causal Structure Disambiguation and Factor Extraction for Legal Judgment Prediction12 Mar 2026
- 2026A Two-Stage Architecture for NDA Analysis: LLM-based Segmentation and Transformer-based Clause Classification13 Feb 2026
- 2026Legal Experts Disagree With Rationale Extraction Techniques for Explaining ECtHR Case Outcome Classification18 Jan 2026
- 2025Classifying long legal documents using short random chunks31 Dec 2025
- 2025Skim-Aware Contrastive Learning for Efficient Document Representation30 Dec 2025
- 2025A Data Science Approach to Calcutta High Court Judgments: An Efficient LLM and RAG-powered Framework for Summarization and Similar Cases Retrieval28 Jun 2025
- 2024Natural Language Processing for the Legal Domain: A Survey of Tasks, Datasets, Models, and Challenges25 Oct 2024
- 2024LegalLens Shared Task 2024: Legal Violation Identification in Unstructured Text15 Oct 2024
- 2024Summarizing long regulatory documents with a multi-step pipeline19 Aug 2024
- 2024Extracting Norms from Contracts Via ChatGPT: Opportunities and Challenges2 Apr 2024
- 2024LegalLens: Leveraging LLMs for Legal Violation Identification in Unstructured Text6 Feb 2024
8 more
- 2024The Right Model for the Job: An Evaluation of Legal Multi-Label Classification Baselines22 Jan 2024
- 2024Unfair TOS: An Automated Approach using Customized BERT20 Jan 2024
- 2023Large Language Models are legal but they are not: Making the case for a powerful LegalLLM15 Nov 2023
- 2023Legal NLP Meets MiCAR: Advancing the Analysis of Crypto White Papers16 Oct 2023
- 2023Bringing order into the realm of Transformer-based language models for artificial intelligence and law10 Aug 2023
- 2023Large Language Model Prompt Chaining for Long Legal Document Classification8 Aug 2023
- 2023LexGPT 0.1: pre-trained GPT-J models with Pile of Law5 Jun 2023
- 2023Legal Extractive Summarization of U.S. Court Opinions15 May 2023
- 2024Natural Language Processing for the Legal Domain: A Survey of Tasks, Datasets, Models, and Challengescited by 42
- 2023Bringing order into the realm of Transformer-based language models for artificial intelligence and lawcited by 13
- 2023Large Language Models are legal but they are not: Making the case for a powerful LegalLLMcited by 12
- 2024LegalLens: Leveraging LLMs for Legal Violation Identification in Unstructured Textcited by 12
- 2023Legal Extractive Summarization of U.S. Court Opinionscited by 9
- 2023LexGPT 0.1: pre-trained GPT-J models with Pile of Lawcited by 9
- 2023Large Language Model Prompt Chaining for Long Legal Document Classificationcited by 7
- 2024LegalLens Shared Task 2024: Legal Violation Identification in Unstructured Textcited by 5
- 2024Unfair TOS: An Automated Approach using Customized BERTcited by 3
- 2024Summarizing long regulatory documents with a multi-step pipelinecited by 3
- 2024Extracting Norms from Contracts Via ChatGPT: Opportunities and Challengescited by 2
- 2024The Right Model for the Job: An Evaluation of Legal Multi-Label Classification Baselinescited by 1
12 most cited of 20 All 20 (JSON)
- 2026Validate Your Authority: Benchmarking LLMs on Multi-Label Precedent Treatment Classification17 May 2026
- 2026LLM-Assisted Causal Structure Disambiguation and Factor Extraction for Legal Judgment Prediction12 Mar 2026
- 2026A Two-Stage Architecture for NDA Analysis: LLM-based Segmentation and Transformer-based Clause Classification13 Feb 2026
- 2026Legal Experts Disagree With Rationale Extraction Techniques for Explaining ECtHR Case Outcome Classification18 Jan 2026
- 2025Classifying long legal documents using short random chunks31 Dec 2025
- 2025Skim-Aware Contrastive Learning for Efficient Document Representation30 Dec 2025
- 2025A Data Science Approach to Calcutta High Court Judgments: An Efficient LLM and RAG-powered Framework for Summarization and Similar Cases Retrieval28 Jun 2025
- 2024Natural Language Processing for the Legal Domain: A Survey of Tasks, Datasets, Models, and Challenges25 Oct 2024
- 2024LegalLens Shared Task 2024: Legal Violation Identification in Unstructured Text15 Oct 2024
- 2024Summarizing long regulatory documents with a multi-step pipeline19 Aug 2024
- 2024Extracting Norms from Contracts Via ChatGPT: Opportunities and Challenges2 Apr 2024
- 2024LegalLens: Leveraging LLMs for Legal Violation Identification in Unstructured Text6 Feb 2024
12 newest of 20 All 20 (JSON)