Skip to main content
QUICK REVIEW

[Paper Review] Rethinking Legal Compliance Automation: Opportunities with Large Language Models

Shabnam Hassani, Mehrdad Sabetzadeh|arXiv (Cornell University)|Apr 22, 2024
Artificial Intelligence in LawSocial Sciences3 citations
TL;DR

This paper proposes a paragraph-level, context-aware legal compliance automation approach using Large Language Models (LLMs) to overcome limitations in sentence-level analysis and lack of justification in existing methods. By leveraging broader textual context and generating explainable compliance decisions, the approach achieves significant accuracy improvements—over 90% F1-score—on GDPR-compliant data processing agreements (DPAs), with justifications that are both human-readable and contextually grounded.

ABSTRACT

As software-intensive systems face growing pressure to comply with laws and regulations, providing automated support for compliance analysis has become paramount. Despite advances in the Requirements Engineering (RE) community on legal compliance analysis, important obstacles remain in developing accurate and generalizable compliance automation solutions. This paper highlights some observed limitations of current approaches and examines how adopting new automation strategies that leverage Large Language Models (LLMs) can help address these shortcomings and open up fresh opportunities. Specifically, we argue that the examination of (textual) legal artifacts should, first, employ a broader context than sentences, which have widely been used as the units of analysis in past research. Second, the mode of analysis with legal artifacts needs to shift from classification and information extraction to more end-to-end strategies that are not only accurate but also capable of providing explanation and justification. We present a compliance analysis approach designed to address these limitations. We further outline our evaluation plan for the approach and provide preliminary evaluation results based on data processing agreements (DPAs) that must comply with the General Data Protection Regulation (GDPR). Our initial findings suggest that our approach yields substantial accuracy improvements and, at the same time, provides justification for compliance decisions.

Motivation & Objective

  • Address the critical limitation of sentence-level analysis in legal compliance automation, which fails to capture cross-sentence and cross-reference dependencies.
  • Overcome the lack of explainability in existing NLP/ML-based compliance tools by enabling LLMs to generate justifications for compliance decisions.
  • Improve accuracy and generalizability of compliance automation by shifting from narrow, rule-based classification to end-to-end, context-aware LLM inference.
  • Demonstrate the feasibility of using paragraph-level context as a more effective unit of analysis than individual sentences for legal text processing.
  • Evaluate the approach on real-world DPAs under GDPR, focusing on accuracy, justification quality, and performance scalability.

Proposed method

  • Process legal texts by chunking content into paragraphs to provide sufficient context for LLM inference, avoiding the limitations of sentence-level analysis.
  • Use GPT-4 as the underlying LLM to perform end-to-end compliance analysis, including identifying compliance-relevant clauses and generating justifications.
  • Design prompts that incorporate surrounding context (e.g., definitions, cross-references, preceding clauses) to improve interpretability and reduce ambiguity.
  • Apply a content chunking strategy that identifies paragraph boundaries using structural cues like line breaks and headings to define optimal context spans.
  • Implement an offline, batch-processing pipeline to support high-throughput analysis, achieving ~0.7 seconds per paragraph.
  • Evaluate the model using a human-annotated DPA dataset, measuring F1-score, precision, recall, and qualitative assessment of justification quality.

Experimental results

Research questions

  • RQ1Can paragraph-level context significantly improve the accuracy of automated legal compliance checking compared to sentence-level analysis?
  • RQ2To what extent can LLMs generate human-readable, contextually grounded justifications for compliance decisions in legal texts?
  • RQ3How does the performance of the proposed LLM-based approach compare to prior BERT-based methods in terms of F1-score and explanation quality?
  • RQ4What is the optimal context span (e.g., sentence, paragraph) for LLM-based compliance analysis in regulatory documents?
  • RQ5How do factors like cross-references, definitions, and document structure affect the reliability and interpretability of LLM-generated compliance assessments?

Key findings

  • The proposed paragraph-level context approach achieved an F1-score of over 90% on a DPA compliance dataset, significantly outperforming sentence-level baselines.
  • The LLM-generated justifications were found to be contextually relevant and human-readable, offering traceable reasoning for compliance decisions.
  • The average execution time per paragraph was approximately 0.7 seconds, enabling processing of over 5,000 paragraphs per hour in offline mode.
  • Content chunking based on structural cues (e.g., line breaks and headings) effectively identified optimal context spans for compliance analysis.
  • Preliminary evaluation suggests that broader context reduces ambiguity and improves understanding of cross-references and definitional dependencies.
  • The approach demonstrated potential for scalability and integration into compliance workflows, though generalizability to other legal domains remains to be validated.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.