The Hidden Structure -- Improving Legal Document Understanding Through Explicit Text Formatting
Christian Braun, Alexander Lilienbeck, Daniel Mentjukov

TL;DR
This study explores how explicit text formatting and prompt engineering influence GPT-4 models' performance on legal document understanding, revealing that well-structured inputs and strategic prompts significantly enhance accuracy.
Contribution
It empirically demonstrates the importance of input structure and prompt design in improving LLM performance on legal QA tasks, especially for newer models.
Findings
GPT-4o is robust but less accurate overall.
GPT-4.1's performance improves with structured input.
Prompt engineering boosts GPT-4.1 accuracy by 10-13 percentage points.
Abstract
Legal contracts possess an inherent, semantically vital structure (e.g., sections, clauses) that is crucial for human comprehension but whose impact on LLM processing remains under-explored. This paper investigates the effects of explicit input text structure and prompt engineering on the performance of GPT-4o and GPT-4.1 on a legal question-answering task using an excerpt of the CUAD. We compare model exact-match accuracy across various input formats: well-structured plain-text (human-generated from CUAD), plain-text cleaned of line breaks, extracted plain-text from Azure OCR, plain-text extracted by GPT-4o Vision, and extracted (and interpreted) Markdown (MD) from GPT-4o Vision. To give an indication of the impact of possible prompt engineering, we assess the impact of shifting task instructions to the system prompt and explicitly informing the model about the structured nature of the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Artificial Intelligence in Law · Multi-Agent Systems and Negotiation
MethodsAttention Is All You Need · Linear Layer · Byte Pair Encoding · Label Smoothing · Dropout · Adam · Multi-Head Attention · Dense Connections · Layer Normalization · Softmax
