PolicyGPT: Automated Analysis of Privacy Policies with Large Language Models

Chenhao Tang, Zhengliang Liu, Chong Ma, Zihao Wu, Yiwei Li, Wei Liu, Dajiang Zhu, Quanzheng Li, Xiang Li, Tianming Liu, Lei FanarXiv 2023

Abstract

Privacy policies serve as the primary conduit through which online service providers inform users about their data collection and usage procedures. However, in a bid to be comprehensive and mitigate legal risks, these policy documents are often quite verbose. In practical use, users tend to click the "Agree" button directly rather than reading them carefully. This practice exposes users to risks of privacy leakage and legal issues. Recently, the advent of Large Language Models (LLM) such as ChatGPT and GPT-4 has opened new possibilities for text analysis, especially for lengthy documents like privacy policies. In this study, we investigate a privacy policy text analysis framework, PolicyGPT, based on the LLM. This framework was tested using two datasets: one comprising privacy policies from 115 websites and another from 304 popular mobile applications. Under zero-shot learning conditions, PolicyGPT demonstrated robust performance, achieving up to 97% accuracy and surpassing baseline machine learning and neural network models.

Introduction

Since the introduction of the General Data Protection Regulation (GDPR), privacy policies have exploded in length and complexity—increasing by over 35% in some regions. For the average user, these documents are essentially unreadable, leading to a "click-and-hope" behavior where users agree to terms they do not fully understand.

From a technical perspective, analyzing these policies is a significant challenge. They are characterized by legal jargon, nested logic, and long-range dependencies, where a clause in one section might modify a statement several pages later. Traditional Natural Language Processing (NLP) tools, such as Support Vector Machines (SVMs) or earlier neural networks like LSTMs, often struggle to capture the nuanced semantics required to accurately classify data practices. PolicyGPT addresses these challenges by leveraging the advanced reasoning capabilities of modern transformer-based architectures.

The PolicyGPT Framework

PolicyGPT utilizes the emergent abilities of Large Language Models like GPT-4 to automate the categorization of policy text. Unlike traditional models that require extensive task-specific fine-tuning, PolicyGPT operates effectively in a zero-shot learning environment.

Prefix Prompt Design

The core innovation of PolicyGPT is its "Prefix Prompt" strategy. Instead of providing a simple classification instruction, the framework structures the input into three distinct segments to provide the model with necessary context and constraints:

  1. Background Definition: Sets the stage by defining the nature of the task (e.g., "I will give you an annotation scheme for a website's privacy policy").
  2. Information Instruction: Provides detailed definitions for the specific data practice categories (e.g., explaining exactly what constitutes "First Party Collection").
  3. Task Description: The specific instruction to classify the target text, followed by the text itself.
The structured 'Prefix Prompt' design used in PolicyGPT, illustrating the three-part instruction strategy.

The researchers found that this structured approach allowed the model to understand complex legal categories simply from their definitions, making the system highly token-efficient compared to few-shot learning methods.

Experimental Evaluation

Datasets

The study evaluated PolicyGPT against two gold-standard datasets:

  • OPP-115: A collection of privacy policies from 115 websites, meticulously annotated by legal experts at the paragraph level into 10 categories.
  • PPGDPR: A dataset of policies from 304 popular mobile apps. This dataset is unique because its 10 categories are directly mapped to Article 13 of the GDPR, focusing on user rights like the "Right to Access" and "Data Portability."

Results and Comparison

The quantitative leap over previous state-of-the-art (SOTA) models was substantial. Traditional models like SVM, Logistic Regression, and even BERT showed a clear performance ceiling that PolicyGPT was able to shatter.

  • On the OPP-115 (Web) Dataset: GPT-4 achieved a 97% accuracy rate (0.97 Macro F1), while ChatGPT reached 92%. Both significantly outperformed the previous baseline, Polisis, which achieved approximately 88%.
  • On the PPGDPR (Mobile/GDPR) Dataset: GPT-4 attained an 87% accuracy rate (0.84 Macro F1), compared to ChatGPT's 84%. The BERT baseline trailed behind at 72%.

In almost every category—from "Data Retention" to "Specific Audiences"—the LLM-based approach provided more precise and reliable classifications than previous neural network attempts. However, results varied across models; while GPT-4 was consistently strong, Claude2 struggled significantly on the mobile dataset, highlighting that not all LLMs are equally suited for GDPR-centric legal analysis.

Discussion and Conclusion

PolicyGPT demonstrates that well-structured prompting can allow general-purpose LLMs to outperform specialized models trained specifically on privacy data. The model's success in zero-shot scenarios suggests that LLMs have already internalized sufficient legal structures during pre-training to understand the underlying logic of privacy disclosures.

Despite these successes, challenges remain regarding token costs for large-scale analysis and the potential for "hallucinations" in legal contexts. Future work will focus on integrating these classification capabilities into user-facing tools that can summarize policies in real-time, finally providing users with a practical alternative to the "I Agree" button.

Summary updated

BibTeX
@misc{tang2023policygpt,
  author = {Chenhao Tang and Zhengliang Liu and Chong Ma and Zihao Wu and Yiwei Li and Wei Liu and Dajiang Zhu and Quanzheng Li and Xiang Li and Tianming Liu and Lei Fan},
  title = {{PolicyGPT: Automated Analysis of Privacy Policies with Large Language Models}},
  year = {2023},
  eprint = {2309.10238},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.10238},
}
Figure