GoldCoin: Grounding Large Language Models in Privacy Laws via Contextual Integrity Theory

Wei Fan, Haoran Li, Zheye Deng, Yangqiu Song

Introduction

The interpretation of privacy laws presents a significant challenge for artificial intelligence. Unlike general reasoning tasks, legal compliance often hinges on nuanced contextual factors that dictate whether a specific data flow is permissible or prohibited. While Large Language Models (LLMs) have demonstrated remarkable capabilities in various domains, their performance in the legal privacy sector has been hampered by a lack of specialized training data and an inability to map abstract statutes to complex real-world scenarios. This paper introduces GOLDCOIN (GrOunds Large Language MoDels into Privacy Laws via COntextual INtegrity), a framework designed to bridge this gap by leveraging Contextual Integrity (CI) theory to fine-tune LLMs for privacy law reasoning.

Problem Statement: The Contextual Nature of Privacy

Privacy is fundamentally context-dependent. A data transmission that is standard in one setting—such as a doctor sharing medical records with a specialist for treatment—becomes a violation in another, such as sharing those same records with a marketing firm. Existing LLMs face two primary obstacles in navigating these distinctions:

  1. Data Scarcity: There is a dearth of high-quality, labeled datasets containing real-world privacy litigation.
  2. Context-Free Learning: Traditional training methods often involve exposing models to raw legal text (e.g., the HIPAA Privacy Rule) without providing the "background stories" or situational variables necessary to understand how those laws apply in practice.

The GOLDCOIN Framework

The GOLDCOIN framework addresses these challenges through a structured, three-stage pipeline that transforms legal statutes into actionable training data.

The researchers began by decomposing the HIPAA Privacy Rule into a structured graph. Each leaf node in this graph represents a specific legal "norm"—a rule that either permits or forbids a particular information flow. This structured approach ensures that the model's learning is grounded in actual statutory requirements rather than vague interpretations.

2. Law-Grounded Case Generation

To overcome data scarcity, the framework uses GPT-4 to generate synthetic "background stories" based on the identified legal norms. The generation process is guided by Contextual Integrity (CI) theory, which posits that privacy is the "appropriate flow of information." Every synthetic story is required to explicitly define five CI features:

  • Sender: The entity transmitting the information.
  • Recipient: The entity receiving the information.
  • Subject: The individual whom the information concerns.
  • Information Type: The specific nature of the data being shared.
  • Transmission Principle: The conditions or constraints governing the flow (e.g., consent, legal mandate, or purpose).

3. Quality Control and Diversity

To ensure the integrity of the synthetic dataset, the framework employs consistency filters to remove cases where the generated story contradicts the underlying legal norm. Additionally, a diversity ranking system using ROUGE-L scores is utilized to select semantically diverse cases, preventing the model from overfitting to repetitive scenarios.

4. Instruction Tuning

The final stage involves fine-tuning open-source models, such as Llama-2 and Mistral, using a multi-step reasoning chain. Instead of predicting a simple "Permit" or "Forbid" label, the model is taught to first extract the CI features from the narrative and then determine both the Applicability (whether the law applies to the situation) and Compliance (whether the action violates the law).

Datasets

The framework was evaluated using two primary datasets:

  • GOLDCOIN-HIPAA (Synthetic): A dataset comprising 309 cases (269 "permit" and 40 "forbid") generated and filtered by the GOLDCOIN pipeline.
  • Caselaw Access Project (CAP): A real-world evaluation set consisting of 107 HIPAA-related court cases and 107 unrelated privacy cases curated from US legal archives.

Results and Discussion

The GOLDCOIN-tuned models demonstrated significant improvements over baseline methods, including zero-shot prompting and law recitation.

  • Applicability Performance: Mistral-7B and Llama2-13B achieved near-perfect accuracy in determining if HIPAA applied to a case, with rates of 97.66% and 99.53%, respectively.
  • Compliance Reasoning: The framework improved the Macro F1-score for compliance detection by 8% to 18% compared to zero-shot settings.
  • Benchmarking against GPT-4: Notably, the fine-tuned open-source models (specifically Mistral-7B) surpassed the performance of ChatGPT and approached the accuracy of GPT-4 in identifying specific privacy risks within real-world court documents.

These results suggest that CI theory serves as an effective "conceptual bridge," providing a structured language that allows LLMs to translate abstract legal principles into concrete factual analysis. Furthermore, the study demonstrates that a small set of high-quality, diverse synthetic cases can be more effective for legal training than large-scale exposure to raw statutory text.

Limitations and Future Work

While GOLDCOIN represents a significant advancement, several limitations remain. The current framework evaluates cases based on a single legal norm, whereas real-world litigation often involves multiple overlapping or conflicting clauses. Future research will focus on expanding the framework to other privacy regimes, such as the GDPR (Europe) and COPPA (Children's privacy). Additionally, the researchers aim to integrate Retrieval-Augmented Generation (RAG) to allow models to dynamically pull relevant legal clauses from a database, further enhancing their reasoning capabilities in complex legal environments.

Summary updated

BibTeX
@inproceedings{fan2024goldcoin,
  author = {Wei Fan and Haoran Li and Zheye Deng and Weiqi Wang and Yangqiu Song},
  title = {{GoldCoin: Grounding Large Language Models in Privacy Laws via Contextual Integrity Theory}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.195},
}
Figure