AI 数据保留与机器遗忘
ai-data-retention
管理 AI 模型的数据保留与机器遗忘(machine unlearning)要求。涵盖训练数据删除验证、面向合规的模型版本控制、机器遗忘技术(SISA、基于梯度的方法)以及重训触发条件。关键词:AI 数据保留、机器遗忘、模型版本控制、训练数据删除、重训、存储限制。
- License 许可
- Apache-2.0
- 最近更新
- 2026-03-17
- Stars
- ★ 338
- Forks
- 68
01 前言 Front Matter
- name
- ai-data-retention
- license
- Apache-2.0
- metadata
- { "tags": "ai-retention, machine-unlearning, model-versioning, training-data-deletion, retraining, storage-limitation", "author": "mukul975", "domain": "privacy", "version": "1.0", "subdomain": "ai-privacy-governance" }
- description
- Manages AI model retention and machine unlearning requirements. Covers training data deletion verification, model versioning for compliance, machine unlearning techniques (SISA, gradient-based), and retraining triggers. Keywords: AI retention, machine unlearning, model versioning, training data deletion, retraining, storage limitation.
02 资源文件 4
- 资产文件assets/template.md892 B
- 参考文档references/standards.md1.1 KB
- 参考文档references/workflows.md1.9 KB
- 脚本scripts/process.py6.0 KB
03 SKILL.md 正文
AI Model Retention and Unlearning
Overview
GDPR Art. 5(1)(e) storage limitation requires that personal data be kept no longer than necessary for the processing purpose. For AI systems, this creates complex retention challenges: training data used to build a model may no longer be needed once training is complete, but the model itself encodes information about the training data. Machine unlearning — the process of removing the influence of specific data from a trained model — is an emerging field that addresses the gap between deleting training data and eliminating its influence from model parameters. This skill provides retention policies, deletion verification methods, and machine unlearning techniques for AI compliance.
AI Data Retention Categories
| Data Category | Description | Retention Consideration |
|---|---|---|
| Raw training data | Original personal data used for model training | Delete after training unless retraining justifies retention |
| Processed training data | Cleaned, augmented, feature-engineered data | Same as raw — delete when training purpose exhausted |
| Validation/test data | Data used for model evaluation | Retain for model audit and comparison; pseudonymise |
| Model weights/parameters | Trained model artefacts encoding training data information | Retain while model is deployed; delete on decommission |
| Inference logs | Inputs and outputs of model predictions | Retention based on purpose (audit, debugging, rights exercise) |
| Model metadata | Training configuration, hyperparameters, provenance | Retain for compliance documentation; low privacy risk |
| Embedding vectors | Dense representations derived from personal data | May contain personal data — apply retention policy |
Retention Policy Framework
Training Data Retention Decision Tree
Training data category identified
│
├─ Is the data still needed for model retraining?
│ ├─ YES → Retain with documented justification and review date
│ └─ NO → Continue
│
├─ Is the data needed for model validation or audit?
│ ├─ YES → Retain in pseudonymised form with access controls
│ └─ NO → Continue
│
├─ Is the data needed for data subject rights exercise?
│ ├─ YES → Retain for rights exercise period, then delete
│ └─ NO → Continue
│
├─ Is there a legal obligation to retain?
│ ├─ YES → Retain per legal requirement
│ └─ NO → DELETE the training data
│
└─ After deletion: assess model for residual data encoding
Model Lifecycle Retention
| Phase | Retention Rule |
|---|---|
| Development | Training data retained during active development |
| Deployment | Training data deleted unless retraining is planned within defined period |
| Operation | Inference logs retained per purpose (30 days debug, 1 year audit) |
| Retraining | New training data collected; old data deleted post-training |
| Decommission | All model artefacts, training data, and logs deleted; retain only compliance documentation |
Machine Unlearning Techniques
Exact Unlearning
Full retraining: Retrain the model from scratch on the dataset minus deleted records.
| Property | Value |
|---|---|
| Guarantee | Complete — model has no knowledge of deleted data |
| Cost | Very high — full training cost for each deletion request |
| Feasibility | Impractical for large models or frequent deletion requests |
| When to use | Small models, infrequent requests, high-sensitivity data |
SISA (Sharded, Isolated, Sliced, Aggregated) Training
Train model on sharded data partitions. To unlearn, retrain only the affected shard.
| Property | Value |
|---|---|
| Guarantee | Exact within the affected shard |
| Cost | 1/k of full retraining (k = number of shards) |
| Feasibility | Requires SISA architecture from the start |
| Trade-off | Model accuracy may decrease with fewer shards contributing |
Approximate Unlearning
Gradient-Based Unlearning
Apply gradient ascent on the data to be forgotten, then fine-tune on remaining data.
| Property | Value |
|---|---|
| Guarantee | Approximate — statistically similar to retrained model |
| Cost | Low — few gradient steps |
| Feasibility | Works for most differentiable models |
| Verification | Requires membership inference testing to verify |
Influence Function-Based Unlearning
Use influence functions to estimate the effect of removing data and adjust model accordingly.
| Property | Value |
|---|---|
| Guarantee | Approximate — first-order approximation |
| Cost | Medium — requires Hessian computation |
| Feasibility | Best for smaller models or linear models |
Unlearning Verification
After applying unlearning, verify effectiveness:
- Membership inference test: Run MI attack on unlearned records — should classify as non-members
- Output comparison: Compare model outputs with and without the unlearned data
- Canary test: If canary records were included, verify they are no longer extractable
- Statistical test: Compare model to one retrained from scratch on the same data minus deleted records
Model Versioning for Compliance
Version Control Requirements
| Element | Documentation |
|---|---|
| Model version ID | Unique identifier (e.g., model-v2.3.1-20260314) |
| Training data snapshot | Hash of training dataset used for this version |
| Training date | When training was executed |
| Data deletions applied | Which data subject deletions are reflected in this version |
| Unlearning applied | Any approximate unlearning applied since last full retraining |
| Privacy properties | DP epsilon, MI test results for this version |
| Deployment dates | When deployed and when retired |
Retraining Triggers
| Trigger | Action |
|---|---|
| Accumulated deletion requests exceed threshold | Full retraining on updated dataset |
| Scheduled periodic retraining | Incorporate all pending deletions |
| Privacy audit reveals unacceptable leakage | Retrain with enhanced privacy measures |
| Model performance degradation | Retrain with current data (post-deletions) |
| Regulatory change | Assess if retraining needed for compliance |
Enforcement Relevance
- EDPB Guidelines 04/2025: Training data retention must be justified; deletion of training data does not automatically eliminate GDPR obligations for the model if it encodes personal data.
- Garante v. OpenAI (2023): Required mechanism for data deletion from training data; acknowledged technical challenges but expected good faith effort.
- EDPB ChatGPT Taskforce (2024): Controllers must demonstrate capability to address erasure requests affecting training data.
Integration Points
- ai-data-subject-rights: Erasure rights implementation requires unlearning
- ai-dpia: Retention and deletion capability assessed in DPIA
- ai-model-privacy-audit: Audit verifies deletion effectiveness
- ai-training-lawfulness: Retention justification part of lawful basis assessment
04 同仓库更多 Skills
职场邮件监控合规
workplace-email-privacy
依据 Barbulescu 诉罗马尼亚案(欧洲人权法院大法庭)、EDPB 指引及各国劳动法,实施工作场所电子邮件与互联网监控合规。涵盖可接受使用政策、合理的隐私期待、比例原则测试以及内容监控与元数据监控的区别。关键词:邮件监控、Barbulescu、职场隐私、互联网监控、可接受使用政策、ECHR、比例原则。
举报人数据保护合规
whistleblower-data
依据欧盟指令 2019/1937 和 GDPR,为举报(吹哨)系统实施数据保护合规。涵盖匿名举报渠道、举报人与被指控人的身份保护、保存期限限制、访问限制以及反报复措施。涉及成员国转化立法与数据保护机构(DPA)指引。关键词:举报人、指令 2019/1937、匿名举报、身份保护、报复、保存期限、举报渠道。
供应商终止数据返还与删除
vendor-termination-data
依据 GDPR 第 28(3)(g) 条的供应商终止数据返还与删除流程。涵盖数据提取格式、删除证明要求、过渡规划、残留数据处理以及终止后核验。
供应商隐私风险评分
vendor-risk-scoring
面向数据处理者管理的供应商隐私风险分级方法论。涵盖数据量、敏感度、传输地点、认证情况、泄露历史和控制成熟度等评分要素,通过加权风险计算进行风险分级与等级划分。
供应商隐私尽职调查
vendor-privacy-due-diligence
依据 GDPR 第 28(1) 条的签约前供应商隐私尽职调查。涵盖风险问卷、技术控制评估、认证审查、数据流分析以及针对处理者合作的书面充分性决策。
供应商隐私合规审计
vendor-privacy-audit
依据 GDPR 第 28(3)(h) 条进行现场和远程供应商审计程序。涵盖审计计划、证据收集方法、问题发现分类、整改跟踪以及用于处理者合规验证的审计报告生成。