[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,65 +2,163 @@
|
||||
id: wiki-2026-0508-data-privacy-local-processing
|
||||
title: "Data Privacy & Local Processing"
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [mission_40e87d6b7bb9]
|
||||
aliases: [On-device AI, Local-First, Privacy-Preserving ML, Edge Privacy]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.92
|
||||
tags: [automated, datacollector, brain_sync]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [privacy, local-first, on-device, gdpr, federated-learning]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-08
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: Python/Swift/Rust
|
||||
framework: MLX / CoreML / ONNX Runtime / Flower
|
||||
---
|
||||
|
||||
# [[Data Privacy & Local Processing]]
|
||||
# Data Privacy & Local Processing
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
데이터 프라이버시와 로컬 프로세싱(엣지 컴퓨팅)은 클라우드가 아닌 기기 자체에서 AI 및 데이터 분석을 직접 실행하여 개인정보 보호를 강화하는 기술적 접근 방식입니다 [1]. 특히 민감한 건강 및 생리 주기 추적 데이터를 외부 서버로 전송하지 않고 로컬에서 처리함으로써 사용자의 신뢰를 얻고 프라이버시 우려를 해소하는 데 중요한 역할을 합니다 [2, 3].
|
||||
## 매 한 줄
|
||||
> **"매 data privacy + local processing 의 핵심: data minimization + on-device inference + cryptographic guarantees"**. 매 GDPR (2018), CCPA, AI Act (2024 EU) 의 regulatory pressure + 매 Apple Intelligence (2024), Google Gemini Nano (2024), 매 on-device LLM (Llama 3.2 1B/3B, Phi-4 mini, Gemma 3 nano) 의 등장 으로 매 2026 현재 cloud → device shift 가 현실화. 매 Local-First Software 운동 의 main-stream 진입.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
* **엣지 컴퓨팅으로의 전환:** 웨어러블 기기와 AI 기술 시장에서는 클라우드 기반 데이터 처리에서 기기 내에서 직접 실행되는 엣지 컴퓨팅(On-device AI)으로의 전환이 일어나고 있습니다. 이를 통해 지연 시간을 줄이고, 프라이버시를 향상시키며, 에너지 소비를 최소화하면서 실시간 분석을 수행할 수 있습니다 [1].
|
||||
* **민감한 건강 데이터의 로컬 처리:** 여성 건강 기술(FemTech) 분야 등에서는 데이터 프라이버시가 핵심 경쟁력으로 작용하고 있습니다. 특히 디지털 생리 추적 등에 대한 여성들의 정당한 프라이버시 우려가 커지면서, 데이터를 클라우드가 아닌 로컬에서 처리하는 기기(예: Oura)들이 순수 클라우드 기반 솔루션보다 더 큰 시장 이점을 확보하고 있습니다 [3].
|
||||
* **보안 규정 준수 및 데이터 제어:** 건강 관련 앱은 웨어러블 기기의 데이터에 접근할 때 사용자의 명시적인 동의를 얻어야 하며, 미국의 HIPAA나 유럽의 GDPR 같은 개인정보 보호 규정을 반드시 준수해야 합니다 [4]. 또한 사용자는 언제든 기기 설정을 통해 데이터 공유 권한을 철회할 수 있어야 하며, 앱은 데이터 전송 및 저장 시 종단간 암호화(End-to-end encryption) 및 안전한 인프라를 필수적으로 갖추어야 합니다 [4, 5].
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
* **로컬 프로세싱의 성능 한계:** 기기 내(On-device) AI 처리는 데이터를 로컬에 유지함으로써 많은 개인정보 보호 우려를 해결해주지만, 가장 강력하고 정교한 최신 AI 모델을 구동하기 위해서는 여전히 클라우드 컴퓨팅의 처리 능력이 필요하다는 근본적인 기술적 제약이 존재합니다 [2].
|
||||
* **인사이트 제공과 프라이버시 간의 딜레마:** 웨어러블 및 AI 기업들은 사용자의 민감한 건강 데이터를 외부 서버로 보내지 않고도 얼마나 고도화된 AI 분석과 인사이트를 제공할 수 있는지에 대한 기술적 딜레마에 직면해 있으며, 이 균형을 성공적으로 맞추는 기업만이 사용자 신뢰를 얻을 수 있습니다 [2].
|
||||
### 매 privacy primitives
|
||||
- **Data minimization**: 매 collect only 필요 — 매 GDPR Art. 5(1)(c).
|
||||
- **On-device inference**: 매 raw data 의 device 외 미전송.
|
||||
- **Differential Privacy (DP)**: 매 ε-noise — 매 Apple, Google 의 telemetry 사용.
|
||||
- **Federated Learning (FL)**: 매 model 의 device 학습 → gradient aggregate.
|
||||
- **Homomorphic Encryption (HE)**: 매 encrypted compute — 매 latency penalty 큼.
|
||||
- **Secure Enclave (TEE)**: 매 Apple Secure Enclave, Intel SGX, AWS Nitro.
|
||||
- **Zero-Knowledge Proof (ZKP)**: 매 prove without reveal.
|
||||
|
||||
---
|
||||
*Last updated: 2026-05-05*
|
||||
### 매 regulatory landscape (2026)
|
||||
- **EU AI Act**: 매 high-risk system 의 data governance + transparency.
|
||||
- **GDPR**: 매 right to erasure, data portability, DPIA.
|
||||
- **CCPA / CPRA**: 매 California 의 sale opt-out.
|
||||
- **HIPAA** (US health), **PIPEDA** (Canada), **APPI** (Japan), **PIPL** (China — 매 cross-border data transfer 매우 strict).
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 응용
|
||||
1. On-device LLM assistant (Apple Intelligence, Pixel Gemini Nano).
|
||||
2. Health apps (HealthKit, on-device biometric ML).
|
||||
3. Federated keyboard prediction (Gboard, SwiftKey).
|
||||
4. Local-first note apps (Obsidian, Anytype, automerge-based).
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
### On-device LLM with MLX (Apple Silicon)
|
||||
```python
|
||||
from mlx_lm import load, generate
|
||||
model, tokenizer = load("mlx-community/Llama-3.2-3B-Instruct-4bit")
|
||||
out = generate(model, tokenizer, prompt="Summarize: ...",
|
||||
max_tokens=200, verbose=False)
|
||||
# Data never leaves device
|
||||
```
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
### Differential privacy (Opacus)
|
||||
```python
|
||||
from opacus import PrivacyEngine
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
privacy_engine = PrivacyEngine()
|
||||
model, optimizer, loader = privacy_engine.make_private_with_epsilon(
|
||||
module=model, optimizer=optimizer, data_loader=loader,
|
||||
epochs=10, target_epsilon=3.0, target_delta=1e-5, max_grad_norm=1.0,
|
||||
)
|
||||
```
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
### Federated learning (Flower)
|
||||
```python
|
||||
import flwr as fl
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
class Client(fl.client.NumPyClient):
|
||||
def get_parameters(self, config): return get_weights(model)
|
||||
def fit(self, parameters, config):
|
||||
set_weights(model, parameters)
|
||||
train_local(model, local_data)
|
||||
return get_weights(model), len(local_data), {}
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
fl.client.start_numpy_client(server_address="server:8080", client=Client())
|
||||
```
|
||||
|
||||
- **Parent:** [[10_Wiki/Topics]]
|
||||
- **Related:** *(TODO: 최소 2개)*
|
||||
- **Opposite / Trade-off:** *(TODO)*
|
||||
- **Raw Source:** 직접 입력
|
||||
### CoreML on-device inference (iOS / macOS)
|
||||
```swift
|
||||
import CoreML
|
||||
let model = try MyModel(configuration: MLModelConfiguration())
|
||||
let input = try MyModelInput(text: userText)
|
||||
let output = try model.prediction(input: input)
|
||||
// Inference never sends data to network
|
||||
```
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
### Secure Enclave key wrapping (iOS)
|
||||
```swift
|
||||
let attrs: [String: Any] = [
|
||||
kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom,
|
||||
kSecAttrKeySizeInBits as String: 256,
|
||||
kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave,
|
||||
]
|
||||
var error: Unmanaged<CFError>?
|
||||
let key = SecKeyCreateRandomKey(attrs as CFDictionary, &error)!
|
||||
```
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
### Local-first sync (Yjs / Automerge)
|
||||
```ts
|
||||
import * as Y from "yjs";
|
||||
import { IndexeddbPersistence } from "y-indexeddb";
|
||||
|
||||
const doc = new Y.Doc();
|
||||
new IndexeddbPersistence("notes", doc); // Local persistence
|
||||
// Optional E2E-encrypted relay for sync
|
||||
```
|
||||
|
||||
### Data redaction before LLM API call (defense in depth)
|
||||
```python
|
||||
import re
|
||||
PII = [r"\b\d{3}-\d{2}-\d{4}\b", r"\b[\w.-]+@[\w.-]+\b"]
|
||||
def redact(text):
|
||||
for p in PII:
|
||||
text = re.sub(p, "[REDACTED]", text)
|
||||
return text
|
||||
# Use redact() before sending to remote LLM
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Health / financial data | On-device only + TEE |
|
||||
| Personalized model | Federated learning |
|
||||
| Aggregate analytics | Differential privacy |
|
||||
| Multi-party compute | HE / MPC (still slow) |
|
||||
| Compliance (GDPR / HIPAA) | DPIA + minimization + audit log |
|
||||
| Personal AI assistant | Local LLM (Llama 3.2 3B 4-bit on phone) |
|
||||
|
||||
**기본값**: 매 user-content processing 의 default 의 on-device, 매 cloud 의 explicit consent + minimization.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Information Security]] · [[Privacy]]
|
||||
- 변형: [[Federated Learning]] · [[Differential Privacy]] · [[Homomorphic Encryption]]
|
||||
- 응용: [[On-device AI]] · [[Local-First Software]]
|
||||
- Adjacent: [[Edge Computing]] · [[Cryptography]] · [[GDPR]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 privacy-impact-assessment drafting, 매 redaction-pipeline scaffolding, 매 GDPR/CCPA compliance checklist generation.
|
||||
**언제 X**: 매 actual user PII 의 cloud LLM 의 직접 send X — 매 on-device 또는 redact-first.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Plaintext PII to cloud LLM**: 매 GDPR violation potential.
|
||||
- **DP without ε accounting**: 매 cumulative leakage 의 무인지.
|
||||
- **Federated 의 raw gradient leak**: 매 gradient inversion attack — 매 secure aggregation 필요.
|
||||
- **Local-first 의 backup absent**: 매 device loss = data loss.
|
||||
- **"Anonymized" via removing names only**: 매 quasi-identifier 의 re-identification.
|
||||
- **Storing decryption key alongside ciphertext**: 매 obvious 하지만 흔한 fail.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (GDPR text, NIST Privacy Framework, Apple Differential Privacy white papers, Flower & Opacus docs, EU AI Act 2024).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — privacy primitives + on-device LLM 2026 |
|
||||
|
||||
Reference in New Issue
Block a user