37 lines
1.2 KiB
Markdown
37 lines
1.2 KiB
Markdown
---
|
||
title: "Semantic Anomaly Compression"
|
||
type: concept
|
||
tags: []
|
||
last_updated: 2026-05-01
|
||
---
|
||
|
||
## Definition
|
||
|
||
通过向量嵌入(sentence-transformers)和语义聚类(ChromaDB/FAISS)将海量异常数据行压缩为少量语义模式家族,从而将大规模数据修复问题的 SLM/LLM 调用量降低 95%+ 的方法论。
|
||
|
||
## Core Mechanism
|
||
|
||
1. **Embedding**: 使用本地 sentence-transformers(如 all-MiniLM-L6-v2)对异常数据行生成向量表示
|
||
2. **Clustering**: 使用 ChromaDB 或 FAISS 对向量进行语义聚类,分组为 8-15 个模式家族
|
||
3. **Sampling**: 从每个聚类中提取 3-5 个代表性样本
|
||
4. **Fix Generation**: SLM 只需处理 ~12 个聚类代表,而非数万个原始数据行
|
||
|
||
## Formula
|
||
|
||
```
|
||
50,000 anomalous rows → ~12 semantic clusters → ~12 SLM calls (vs 50,000)
|
||
```
|
||
|
||
## Key Properties
|
||
|
||
- **Deterministic**: 聚类结果可复现
|
||
- **Offline**: 所有嵌入计算在本地完成,无外部 API 调用
|
||
- **Composable**: 可与任何数据管道集成,不改变上游 schema
|
||
- **Auditable**: 每个聚类的代表样本和处理过程均可记录
|
||
|
||
## Related
|
||
|
||
- [[Air-Gapped SLM Fix Generation]]
|
||
- [[Hybrid Fingerprinting]]
|
||
- [[Zero Data Loss Guarantee]]
|