Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- GDPR
|
5 |
+
- Law
|
6 |
+
- English
|
7 |
+
- Data Protection
|
8 |
+
license: mit
|
9 |
+
datasets:
|
10 |
+
- sims2k/GDPR_QA_instruct_dataset
|
11 |
+
language:
|
12 |
+
- en
|
13 |
+
metrics:
|
14 |
+
- bleu
|
15 |
+
- rouge
|
16 |
+
- meteor
|
17 |
+
- bertscore
|
18 |
+
base_model: Equall/Saul-7B-Instruct-v1
|
19 |
+
---
|
20 |
+
|
21 |
+
## **Model Overview**
|
22 |
+
|
23 |
+
**Model Name**: Equall/Saul-7B-Instruct-GDPR-v1
|
24 |
+
**Base Model**: Equall/Saul-7B-Instruct-v1
|
25 |
+
**Finetuning Method**: QLoRA (Quantized Low-Rank Adaptation)
|
26 |
+
|
27 |
+
Equall/Saul-7B-Instruct-GDPR-v1 is a fine-tuned version of the Equall/Saul-7B-Instruct-v1 model, specifically optimized for handling **GDPR compliance tasks**. The model is designed to generate accurate, legally grounded responses aligned with the General Data Protection Regulation (GDPR). It supports various compliance-related tasks such as data audits, legal advisory, and ensuring adherence to GDPR requirements for data controllers and processors.
|
28 |
+
|
29 |
+
---
|
30 |
+
|
31 |
+
## **GDPR Task Focus**
|
32 |
+
|
33 |
+
The model is optimized to address detailed queries related to GDPR compliance, providing step-by-step instructions aligned with relevant GDPR articles. Below is an example illustrating how the model approaches a specific GDPR task related to conducting a Data Protection Impact Assessment (DPIA):
|
34 |
+
|
35 |
+
### Example Task: Conducting a Data Protection Impact Assessment (DPIA)
|
36 |
+
|
37 |
+
**Input**: What are the benefits of conducting a DPIA?
|
38 |
+
|
39 |
+
**Response**:
|
40 |
+
Conducting a **Data Protection Impact Assessment (DPIA)** provides several benefits in ensuring GDPR compliance:
|
41 |
+
1. **Identifying Risks**: DPIAs help identify and mitigate risks to individuals’ rights and freedoms by evaluating potential impacts on personal data processing activities.
|
42 |
+
2. **Accountability**: DPIAs demonstrate compliance with **GDPR Article 24(1)**, which requires controllers to implement appropriate technical and organizational measures to ensure and maintain data protection.
|
43 |
+
3. **Building Compliance**: Through a structured approach, DPIAs facilitate building compliance by identifying necessary measures for processing activities.
|
44 |
+
4. **Legal Basis**: A DPIA can serve as a legal basis for processing personal data, especially when dealing with special categories of data or large-scale monitoring (referencing **Article 6(1)(c)** and **Article 9(2)(i)**).
|
45 |
+
5. **Regulatory Compliance**: Meeting DPIA requirements helps prevent fines imposed by supervisory authorities for non-compliance with GDPR articles, including **Articles 35(1), (3)-(4)**, **Article 35(2)**, **Article 35(7)-(9)**, and **Article 36(3)(e)**.
|
46 |
+
|
47 |
+
**Relevant GDPR Articles**:
|
48 |
+
- **Article 35** (DPIA requirements)
|
49 |
+
- **Article 24** (Accountability of controllers)
|
50 |
+
- **Article 6(1)(c)** (Legal basis for processing)
|
51 |
+
- **Article 9(2)(i)** (Processing of special categories of data)
|
52 |
+
- **Article 36(3)(e)** (Consultation with supervisory authorities)
|
53 |
+
|
54 |
+
This demonstrates the model's capacity to generate structured, article-specific responses that assist organizations in navigating GDPR compliance tasks.
|
55 |
+
|
56 |
+
---
|
57 |
+
|
58 |
+
## **Fine-Tuning Methodology**
|
59 |
+
|
60 |
+
The fine-tuning of this model was conducted using **QLoRA** (Quantized Low-Rank Adaptation) to optimize model efficiency and accuracy, particularly when handling legal texts. QLoRA enabled the fine-tuning process to maintain a high level of performance while significantly reducing the computational load by quantizing the model weights to 4-bit precision.
|
61 |
+
|
62 |
+
Training was conducted using the **bwUniCluster 2.0 computing facility**, utilizing **Tesla V100 GPUs** for efficient training over multiple iterations. Each iteration aimed to improve the model’s capacity to understand and generate responses to GDPR-specific inquiries by referencing the appropriate articles of the regulation.
|
63 |
+
|
64 |
+
---
|
65 |
+
|
66 |
+
## **Datasets**
|
67 |
+
|
68 |
+
### **1. Training Dataset**
|
69 |
+
**Dataset Name**: sims2k/GDPR_QA_instruct_dataset
|
70 |
+
- **Number of Entries**: 316 Question-Answer pairs
|
71 |
+
- **Creation Method**: This dataset was synthetically generated using **ChatGPT-4** to create specialized Q&A pairs focused on GDPR compliance tasks. The dataset was carefully crafted by synthesizing information from trusted sources, including **GDPR articles**, **Legal FAQs**, and **Guidelines, Recommendations, and Best Practices from the European Data Protection Board (EDPB)**.
|
72 |
+
- **Advanced Prompt Engineering** techniques were employed, including **one-shot** and **chain-of-thought prompting**, to create precise, contextually relevant responses. The output generation was controlled using a **temperature setting of zero**, ensuring determinism and reliability in the responses.
|
73 |
+
- Each dataset entry was fact-checked for accuracy and cross-referenced with the related GDPR articles, ensuring legal validity and practical utility in real-world settings.
|
74 |
+
|
75 |
+
### **2. Evaluation Dataset**
|
76 |
+
**Dataset Name**: sims2k/GDPR_QA_instruct_eval_dataset
|
77 |
+
- **Number of Entries**: 63 Question-Answer pairs
|
78 |
+
- **Description**: This evaluation dataset was designed to rigorously test the model's ability to generalize its learning. Each entry focuses on unseen GDPR queries, ensuring the model’s ability to respond accurately to new contexts. The dataset was evaluated using advanced NLP metrics like **ROUGE**, **BLEU**, **METEOR**, and **BERTScore**, which help measure the structural and semantic quality of the responses.
|
79 |
+
|
80 |
+
---
|
81 |
+
|
82 |
+
## **Performance Metrics**
|
83 |
+
|
84 |
+
The model’s performance was assessed using advanced NLP metrics to evaluate both the quality of generated text and the adherence to legal standards in GDPR queries.
|
85 |
+
|
86 |
+
### **Metrics Used**:
|
87 |
+
1. **BLEU**: Measures precision by calculating n-gram overlap between the generated response and the reference text.
|
88 |
+
2. **ROUGE**: Focuses on recall, assessing how much of the reference content is captured in the generated response.
|
89 |
+
3. **METEOR**: Combines both precision and recall, weighting recall more heavily and evaluating the quality of text alignment.
|
90 |
+
4. **BERTScore**: Uses contextual embeddings to compare the generated and reference texts, focusing on semantic coherence.
|
91 |
+
|
92 |
+
The results are presented in the **Composite Scores for All Evaluated Models** graph below, showcasing the model’s performance across these metrics.
|
93 |
+
|
94 |
+
<p align="center">
|
95 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/653e07af6d28265c85c84f6b/O011sXNOkCMOVnT-QtQ8F.png" alt="image/png">
|
96 |
+
</p>
|
97 |
+
|
98 |
+
### **Understanding the Graph**:
|
99 |
+
- **Higher Composite Scores** represent a stronger performance in generating accurate, legally valid, and contextually appropriate responses.
|
100 |
+
- **Normalization** was applied to all metrics using **Min-Max scaling**, ensuring an equal contribution of each metric to the final score.
|
101 |
+
- **Equal Weighting** was used across metrics to provide a balanced assessment of the model’s capabilities.
|
102 |
+
|
103 |
+
---
|
104 |
+
|
105 |
+
## **Limitations and Future Work**
|
106 |
+
|
107 |
+
Despite its strong performance in GDPR compliance tasks, the model may face challenges in handling **edge cases** or **complex legal nuances**. The model's accuracy could further be improved by expanding the dataset to include additional legal scenarios and by incorporating domain-specific datasets from other regulatory frameworks.
|
108 |
+
|
109 |
+
Future improvements will focus on:
|
110 |
+
- Expanding the dataset size and diversity.
|
111 |
+
- Conducting more fine-tuning iterations to address subtle legal interpretations.
|
112 |
+
- Potentially integrating legal reasoning from other regulatory domains beyond GDPR.
|
113 |
+
|