[Paper Review] Large Language Model Prompt Chaining for Long Legal Document Classification
This paper proposes a prompt chaining framework for classifying long legal documents using few-shot in-context learning with large language models (LLMs), leveraging document summarization, semantic retrieval of exemplars, and iterative prompting. It achieves higher micro-F1 scores than zero-shot GPT-3.5-turbo (ChatGPT) on two legal text classification tasks, outperforming even larger models using smaller, efficient LLMs.
Prompting is used to guide or steer a language model in generating an appropriate response that is consistent with the desired outcome. Chaining is a strategy used to decompose complex tasks into smaller, manageable components. In this study, we utilize prompt chaining for extensive legal document classification tasks, which present difficulties due to their intricate domain-specific language and considerable length. Our approach begins with the creation of a concise summary of the original document, followed by a semantic search for related exemplar texts and their corresponding annotations from a training corpus. Finally, we prompt for a label - based on the task - to assign, by leveraging the in-context learning from the few-shot prompt. We demonstrate that through prompt chaining, we can not only enhance the performance over zero-shot, but also surpass the micro-F1 score achieved by larger models, such as ChatGPT zero-shot, using smaller models.
Motivation & Objective
- To address the challenge of classifying long, complex legal documents with specialized language and structure.
- To reduce reliance on costly fine-tuning and expert-annotated datasets by leveraging few-shot prompting.
- To improve classification performance over zero-shot prompting using a modular, interpretable prompt chaining strategy.
- To evaluate whether smaller LLMs can surpass larger models like GPT-3.5-turbo in zero-shot settings through structured prompting.
- To demonstrate the feasibility and effectiveness of prompt chaining in legal NLP tasks with real-world benchmarks.
Proposed method
- First, generate a concise summary of the input legal document to reduce context length and preserve key content.
- Then, perform a semantic search to retrieve relevant exemplar documents and their annotations from a training corpus.
- Construct few-shot prompts by concatenating the retrieved exemplars with their labels, providing in-context learning signals.
- Use the LLM to predict the final label based on the input document and the few-shot exemplars, forming a chained prompting pipeline.
- Apply the chain of prompts sequentially: summary → retrieval → classification, enabling step-by-step reasoning and improved context awareness.
- Utilize smaller LLMs (e.g., GPT-NeoX, FLAN-UL2) rather than larger models to reduce cost while maintaining or improving performance.

Experimental results
Research questions
- RQ1Can prompt chaining improve classification performance on long legal documents compared to zero-shot prompting?
- RQ2Can smaller LLMs outperform larger models like GPT-3.5-turbo in zero-shot settings when using structured prompt chaining?
- RQ3Does the use of document summarization and exemplar retrieval enhance label prediction accuracy in legal text classification?
- RQ4How does performance vary across high-frequency versus low-frequency legal issue categories in few-shot prompting?
- RQ5To what extent does prompt chaining improve interpretability and debuggability in legal document classification?
Key findings
- The prompt chaining approach achieved a micro-F1 score of 0.779 on the SCOTUS test set, surpassing the zero-shot GPT-3.5-turbo result of 0.438.
- On the ECtHR dataset, the method achieved a micro-F1 of 0.770 on the development set and 0.779 on the test set, outperforming zero-shot GPT-NeoX.
- The model showed significantly better performance on high-frequency classes (e.g., Criminal Procedure, Federal Taxation) compared to low-frequency ones, with F1 scores of 0.742 and 0.695 respectively.
- Despite a drop in macro-F1 on the test set, the micro-F1 remained strong, indicating robust performance on majority classes.
- The confusion matrix revealed systematic misclassification of issue areas like civil rights and judicial power into 'others', suggesting class imbalance challenges.
- The approach demonstrated that smaller LLMs can achieve superior performance to larger models when using structured prompting and in-context learning.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.