ethanolivertroy commited on
Commit
1ec026d
·
verified ·
1 Parent(s): b9bf80d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +405 -0
README.md ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc0-1.0
3
+ task_categories:
4
+ - text-generation
5
+ - question-answering
6
+ language:
7
+ - en
8
+ size_categories:
9
+ - 1K<n<10K
10
+ tags:
11
+ - hipaa
12
+ - healthcare
13
+ - compliance
14
+ - privacy
15
+ - security
16
+ - medical
17
+ pretty_name: HIPAA Compliance Training Dataset
18
+ ---
19
+
20
+ # HIPAA Compliance Training Dataset
21
+
22
+ ## Dataset Description
23
+
24
+ The first comprehensive HIPAA compliance training dataset for LLM fine-tuning, covering the Security Rule, Privacy Rule, Breach Notification Rule, and implementation guidance from NIST and FDA.
25
+
26
+ ### Dataset Summary
27
+
28
+ - **Total Examples**: 1,287 (1,029 train / 258 validation)
29
+ - **Source Documents**: 9 federal publications (~5.6 MB extracted content)
30
+ - **Format**: JSONL with chat-formatted messages
31
+ - **License**: CC0-1.0 (Public Domain)
32
+ - **Coverage**: Security Rule, Privacy Rule, Breach Notification, NIST implementation, FDA medical device guidance
33
+
34
+ ### Why This Dataset?
35
+
36
+ Healthcare organizations need practical HIPAA compliance guidance, but most LLMs lack deep knowledge of:
37
+ - The distinction between **required** vs **addressable** implementation specifications
38
+ - **Covered entity** vs **business associate** obligations
39
+ - **Administrative**, **physical**, and **technical** safeguards
40
+ - **Breach notification** thresholds and procedures
41
+ - Practical implementation of **NIST SP 800-66** recommendations
42
+
43
+ This dataset fills that gap with 1,287 high-quality Q&A pairs derived from authoritative federal sources.
44
+
45
+ ## Dataset Structure
46
+
47
+ ### Data Fields
48
+
49
+ - `messages`: List of chat messages (system, user, assistant)
50
+ - `metadata`: Source attribution and HIPAA-specific classification
51
+ - `source`: Source document title
52
+ - `cfr_section`: CFR section number (e.g., §164.308) if applicable
53
+ - `safeguard_type`: administrative | physical | technical | unknown
54
+ - `implementation_spec`: required | addressable | both
55
+ - `entity_type`: covered_entity | business_associate | both
56
+ - `type`: Question type (cfr_section, safeguard, implementation, breach_notification, etc.)
57
+ - `nist_control`: NIST control ID (e.g., AC-1) if from SP 800-66
58
+
59
+ ### Example
60
+
61
+ ```json
62
+ {
63
+ "messages": [
64
+ {
65
+ "role": "system",
66
+ "content": "You are a HIPAA compliance expert with deep knowledge of the Security Rule, Privacy Rule, and Breach Notification Rule. You provide accurate, practical guidance on HIPAA requirements, implementation specifications, and compliance procedures. You cite specific CFR sections and distinguish between covered entity and business associate obligations."
67
+ },
68
+ {
69
+ "role": "user",
70
+ "content": "What's the difference between required and addressable implementation specifications?"
71
+ },
72
+ {
73
+ "role": "assistant",
74
+ "content": "According to HITECH Omnibus Final Rule (2013):\n\nUnder the HIPAA Security Rule, implementation specifications are either Required or Addressable. Required specifications must be implemented as written. Addressable specifications require a more flexible approach: covered entities and business associates must assess whether each addressable specification is a reasonable and appropriate safeguard in their environment. If reasonable and appropriate, they must implement the specification as written. If not, they must document why the specification is not reasonable and appropriate, and implement an equivalent alternative measure if reasonable and appropriate, or document why no alternative measure is reasonable and appropriate and accept the residual risk. This risk-based, scalable approach allows entities of different sizes and complexities to implement appropriate security measures."
75
+ }
76
+ ],
77
+ "metadata": {
78
+ "source": "HITECH Omnibus Final Rule (2013)",
79
+ "implementation_spec": "both",
80
+ "safeguard_types": ["administrative", "physical", "technical"],
81
+ "type": "implementation"
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## Source Documents
87
+
88
+ ### Federal Register Preambles (5 documents)
89
+ These provide the **rationale and implementation guidance** behind HIPAA regulations:
90
+
91
+ 1. **Security Rule Final Rule (2003)** - 344 KB
92
+ - Security standards rationale
93
+ - Administrative, physical, and technical safeguards
94
+ - Required vs addressable specifications
95
+
96
+ 2. **Privacy Rule Final Rule (2000)** - 2.6 MB
97
+ - Privacy standards and uses/disclosures
98
+ - Individual rights (access, amendment, accounting)
99
+ - Minimum necessary standard
100
+
101
+ 3. **Privacy Rule Modifications (2002)** - 672 KB
102
+ - Clarifications and corrections
103
+ - Business associate provisions
104
+ - De-identification standards
105
+
106
+ 4. **HITECH Omnibus Final Rule (2013)** - 1.0 MB
107
+ - HITECH Act modifications
108
+ - Business associate direct liability
109
+ - Breach notification updates
110
+ - Enhanced enforcement
111
+
112
+ 5. **Breach Notification Rule (2009)** - 228 KB
113
+ - Breach definition and risk assessment
114
+ - Notification requirements (HHS, individuals, media)
115
+ - 500+ individual threshold
116
+
117
+ ### NIST Implementation Guidance (1 document)
118
+
119
+ 6. **NIST SP 800-66 Rev. 2: Implementing the HIPAA Security Rule (2024)** - 497 KB
120
+ - Step-by-step implementation guidance
121
+ - Control mapping (NIST 800-53 → HIPAA)
122
+ - Risk analysis methodology
123
+ - Practical examples and recommendations
124
+
125
+ ### FDA Medical Device Cybersecurity (2 documents)
126
+
127
+ 7. **FDA Cybersecurity in Medical Devices: Quality System Considerations (2023)** - 211 KB
128
+ - Device security requirements
129
+ - Cybersecurity bill of materials (SBOM)
130
+ - Premarket submission requirements
131
+
132
+ 8. **FDA Postmarket Management of Cybersecurity in Medical Devices (2016)** - 84 KB
133
+ - Vulnerability management
134
+ - Patching and updates
135
+ - Incident response for devices
136
+
137
+ ### Documents Excluded (Extraction Failures)
138
+
139
+ The following 4 documents failed to extract properly and are not included:
140
+ - 45 CFR Part 160, 162, 164 (data format errors - extracted HTML navigation only)
141
+ - FDA Content of Premarket Submissions Draft Guidance (2022) (extraction failed - 71 bytes)
142
+
143
+ These will be added in v1.1 using alternative extraction methods.
144
+
145
+ ## Q&A Generation Strategies
146
+
147
+ Examples were generated using 7 complementary strategies:
148
+
149
+ ### 1. CFR Section-Based Q&A
150
+ Extract specific regulatory requirements by CFR section number.
151
+
152
+ **Example**: "What does §164.308(a)(1)(i) require?" → Security Management Process details
153
+
154
+ ### 2. Safeguard-Based Q&A
155
+ Focus on administrative, physical, and technical safeguards.
156
+
157
+ **Example**: "What are the technical safeguards under HIPAA?" → Access control, audit controls, integrity, transmission security
158
+
159
+ ### 3. Implementation Specification Q&A
160
+ Clarify required vs addressable distinctions.
161
+
162
+ **Example**: "How do I determine if an addressable specification must be implemented?" → Risk assessment process
163
+
164
+ ### 4. Entity Type Q&A
165
+ Distinguish covered entity vs business associate obligations.
166
+
167
+ **Example**: "What are business associate obligations under HIPAA?" → Direct liability, security, privacy, breach notification
168
+
169
+ ### 5. Breach Notification Q&A
170
+ Explain breach determination and notification procedures.
171
+
172
+ **Example**: "When must a HIPAA breach be reported to HHS?" → 60-day timeline, 500+ threshold, risk assessment
173
+
174
+ ### 6. NIST Control Q&A
175
+ Map NIST 800-53 controls to HIPAA requirements (from SP 800-66).
176
+
177
+ **Example**: "How does NIST SP 800-66 recommend implementing control AC-2?" → Account management for HIPAA
178
+
179
+ ### 7. Semantic Chunking
180
+ General content preservation with context.
181
+
182
+ **Example**: "What does [document] say about HIPAA compliance?" → Contextual excerpts
183
+
184
+ ## Use Cases
185
+
186
+ ### Healthcare Providers
187
+ - **Internal HIPAA chatbot**: Answer staff questions about compliance
188
+ - **Training assistant**: Onboard new employees on HIPAA requirements
189
+ - **Policy generation**: Draft security policies based on HIPAA guidance
190
+
191
+ ### Health Tech Companies
192
+ - **Compliance review**: Check product features against HIPAA requirements
193
+ - **Risk assessment**: Identify gaps in HIPAA implementation
194
+ - **BAA review**: Understand business associate obligations
195
+
196
+ ### Medical Device Manufacturers
197
+ - **Device security**: Implement FDA cybersecurity requirements
198
+ - **SBOM generation**: Create cybersecurity bills of materials
199
+ - **Vulnerability management**: Follow FDA postmarket guidance
200
+
201
+ ### HIPAA Compliance Officers
202
+ - **Breach determination**: Assess if incidents require notification
203
+ - **Audit preparation**: Review requirements before assessments
204
+ - **Implementation planning**: Prioritize required vs addressable specs
205
+
206
+ ### Legal & Consulting
207
+ - **Client advisory**: Provide accurate HIPAA interpretations
208
+ - **Incident response**: Guide breach notification decisions
209
+ - **Contract review**: Verify BAA compliance
210
+
211
+ ## Dataset Statistics
212
+
213
+ ```
214
+ Source Documents: 9 (5 preambles, 1 NIST, 2 FDA, 1 report)
215
+ Total Examples: 1,287
216
+ Training Examples: 1,029 (80%)
217
+ Validation Examples: 258 (20%)
218
+ Avg Example Length: ~400 tokens (estimated)
219
+
220
+ By Safeguard Type:
221
+ Administrative: 8 documents
222
+ Physical: 8 documents
223
+ Technical: 8 documents
224
+ Unknown: 3 documents
225
+
226
+ By Entity Type:
227
+ Both (CE & BA): 9 documents
228
+ Covered Entity: 2 documents
229
+
230
+ Breach-Related: 8 documents
231
+
232
+ By Implementation Spec:
233
+ Both (Required & Addressable): 5 documents
234
+ Required only: 6 documents
235
+ ```
236
+
237
+ ## Model Training
238
+
239
+ ### Recommended Configuration
240
+
241
+ This dataset is designed for **LoRA fine-tuning** of 7B parameter models:
242
+
243
+ ```yaml
244
+ base_model: mlx-community/Qwen2.5-Coder-7B-Instruct-4bit
245
+ lora_rank: 16
246
+ lora_alpha: 32
247
+ num_layers: 16
248
+ batch_size: 4
249
+ learning_rate: 1e-5
250
+ num_iterations: 500-1000
251
+ ```
252
+
253
+ ### Expected Training Time
254
+ - **7B model on M4 Max**: ~45-90 minutes (500-1000 iterations)
255
+ - **Memory required**: 15-20 GB
256
+ - **Tokens/sec**: 130-160
257
+
258
+ ### Training Command
259
+
260
+ ```bash
261
+ python -m mlx_lm lora \
262
+ --model mlx-community/Qwen2.5-Coder-7B-Instruct-4bit \
263
+ --train \
264
+ --data data/hipaa/training \
265
+ --iters 1000 \
266
+ --batch-size 4 \
267
+ --lora-layers 16 \
268
+ --adapter-path models/hipaa-expert-lora
269
+ ```
270
+
271
+ ## Quick Start
272
+
273
+ ### Load Dataset
274
+
275
+ ```python
276
+ import jsonlines
277
+
278
+ # Load training data
279
+ with jsonlines.open('train.jsonl') as reader:
280
+ train_data = list(reader)
281
+
282
+ print(f"Training examples: {len(train_data)}")
283
+ print(f"First example: {train_data[0]}")
284
+ ```
285
+
286
+ ### Filter by Metadata
287
+
288
+ ```python
289
+ # Find all breach notification examples
290
+ breach_examples = [
291
+ ex for ex in train_data
292
+ if ex['metadata'].get('type') == 'breach_notification'
293
+ ]
294
+
295
+ # Find technical safeguard examples
296
+ technical_examples = [
297
+ ex for ex in train_data
298
+ if 'technical' in ex['metadata'].get('safeguard_types', [])
299
+ ]
300
+
301
+ # Find business associate-specific content
302
+ ba_examples = [
303
+ ex for ex in train_data
304
+ if ex['metadata'].get('entity_type') == 'business_associate'
305
+ ]
306
+ ```
307
+
308
+ ## Limitations
309
+
310
+ ### Coverage Gaps
311
+
312
+ 1. **Missing CFR Regulations**: The actual 45 CFR Part 160, 162, 164 text failed to extract (data format errors). Dataset relies on preambles and guidance, which provide implementation context but not the bare regulatory text.
313
+
314
+ 2. **Preamble-Heavy**: 5 of 9 documents are Federal Register preambles. These provide rationale and interpretation but may be verbose compared to concise regulatory text.
315
+
316
+ 3. **No OCR Guidance**: HHS Office for Civil Rights FAQs and guidance documents are not included (would require web scraping).
317
+
318
+ 4. **Limited Medical Device Coverage**: Only 2 FDA guidance documents vs comprehensive device security library.
319
+
320
+ 5. **No State Law Extensions**: California CMIA, Massachusetts 201 CMR 17.00, etc. not included.
321
+
322
+ ### Model Limitations
323
+
324
+ - **Not Legal Advice**: Outputs should not be considered legal advice
325
+ - **May Hallucinate**: Model may generate plausible but incorrect CFR sections
326
+ - **Context Window**: Limited to base model's context (typically 4K-8K tokens)
327
+ - **No Real-Time Updates**: Trained on documents up to 2024; regulations may change
328
+
329
+ ### Recommended Mitigations
330
+
331
+ 1. **RAG Integration**: Use with vector database of actual HIPAA regulations
332
+ 2. **Citation Verification**: Always verify CFR sections in official sources
333
+ 3. **Human Review**: Have compliance officers review model outputs
334
+ 4. **Regular Updates**: Retrain annually as regulations evolve
335
+
336
+ ## Roadmap
337
+
338
+ ### v1.1 (Planned)
339
+ - **Re-extract CFR regulations** using alternative methods (PDF repair tools)
340
+ - **Add OCR guidance** via web scraping HHS.gov/hipaa
341
+ - **Expand FDA coverage** with additional medical device guidance
342
+ - Target: +500-1,000 examples
343
+
344
+ ### v1.2 (Planned)
345
+ - **State-specific HIPAA extensions** (CA CMIA, MA 201 CMR 17.00, NY SHIELD Act)
346
+ - **CMS security standards**
347
+ - **FTC Health Breach Notification Rule**
348
+ - Target: +300-500 examples
349
+
350
+ ### v2.0 (Future)
351
+ - **Full OCR guidance library** (200-400 FAQs)
352
+ - **Settlement agreement case studies**
353
+ - **Enforcement examples**
354
+ - **Synthetic scenario generation**
355
+ - Target: +1,000-2,000 examples
356
+
357
+ ## Citation
358
+
359
+ If you use this dataset, please cite:
360
+
361
+ ```bibtex
362
+ @dataset{hipaa_compliance_2025,
363
+ title={HIPAA Compliance Training Dataset},
364
+ author={Troy, Ethan Oliver},
365
+ year={2025},
366
+ publisher={HuggingFace},
367
+ note={Derived from federal HIPAA regulations and guidance (Public Domain)}
368
+ }
369
+ ```
370
+
371
+ ## License
372
+
373
+ **CC0-1.0** (Public Domain) - All source documents are U.S. Federal Government works not subject to copyright protection under 17 U.S.C. §105.
374
+
375
+ You are free to:
376
+ - Use commercially
377
+ - Modify and distribute
378
+ - Create derivative works
379
+ - No attribution required (though appreciated!)
380
+
381
+ ## Acknowledgments
382
+
383
+ This dataset is built from publications by:
384
+ - **HHS Office for Civil Rights** (OCR) - HIPAA regulations and guidance
385
+ - **National Institute of Standards and Technology** (NIST) - SP 800-66 implementation guide
386
+ - **U.S. Food and Drug Administration** (FDA) - Medical device cybersecurity guidance
387
+ - **Federal Register** - Official regulatory preambles
388
+
389
+ ## Contact
390
+
391
+ For questions, issues, or contributions:
392
+ - **GitHub**: https://github.com/ethanolivertroy/nist-tuned-model
393
+ - **HuggingFace**: https://huggingface.co/ethanolivertroy
394
+ - **Dataset Issues**: Open an issue on GitHub
395
+
396
+ ## Version History
397
+
398
+ - **v1.0** (January 2025): Initial release
399
+ - 1,287 examples from 9 federal documents
400
+ - Coverage: Security Rule, Privacy Rule, Breach Notification, NIST SP 800-66, FDA guidance
401
+ - Known limitation: CFR regulations failed to extract (data format errors)
402
+
403
+ ---
404
+
405
+ **Last Updated**: January 2025