Dinegonos/slm-rag-anonymization-tram
0
SLM+RAG Anonymization for TRAM Threat Reports
Hypothesis
H₀: Anonymization of CTI threat reports via SLM (Small Language Model) + RAG does NOT significantly decrease the downstream ATT&CK technique classification accuracy.
H₁: Anonymization via SLM+RAG causes a statistically significant drop (>2% F1) in ATT&CK classification performance.
Experiment Architecture
┌─────────────────────────────────────────────────────────────┐
│ EXPERIMENT PIPELINE │
│ │
│ ┌──────────────┐ ┌─────────────────────┐ │
│ │ Raw CTI │───▶│ ATT&CK Classifier │──▶ F1_original │
│ │ Report │ │ (SecureBERT) │ │
│ └──────┬───────┘ └─────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────┐ │
│ │ SLM Anonymizer + RAG │ │
│ │ │ │
│ │ Step 1: NER Detection │ │
│ │ - GLiNER / SecBERT NER │ │
│ │ - Entity types: │ │
│ │ ORG, THREAT_ACTOR, │ │
│ │ MALWARE, TOOL, IP, │ │
│ │ LOC, CVE │ │
│ │ │ │
│ │ Step 2: RAG Context │ │
│ │ - ATT&CK KB embeddings │ │
│ │ - Guides what to │ │
│ │ preserve vs. mask │ │
│ │ │ │
│ │ Step 3: SLM Replacement │ │
│ │ - Typed placeholders │ │
│ │ - [MALWARE_1], etc. │ │
│ └──────────┬───────────────┘ │
│ ▼ │
│ ┌──────────────┐ ┌─────────────────────┐ │
│ │ Anonymized │───▶│ ATT&CK Classifier │──▶ F1_anon │
│ │ CTI Report │ │ (same SecureBERT) │ │
│ └──────────────┘ └─────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ EVALUATION │ │
│ │ - ΔF1 = F1_original - F1_anon │ │
│ │ - McNemar's test for statistical significance │ │
│ │ - Per-technique F1 comparison │ │
│ │ - Entity leakage rate │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘Anonymization Strategies (Ablation)
Datasets
Models
Quick Start
Phase 1: Regex-only anonymization (no GPU needed)
python experiments/run_experiment.py \
--classifier-model ehsanaghaei/SecureBERT \
--epochs 5 \
--batch-size 16 \
--hub-model-id Dinegonos/securbert-ttp-classifierPhase 2: GLiNER NER + anonymization (GPU needed)
python experiments/run_experiment.py \
--classifier-model ehsanaghaei/SecureBERT \
--use-gliner \
--hub-model-id Dinegonos/securbert-ttp-classifierPhase 3: Full SLM+RAG pipeline (A10G/A100 needed)
python experiments/run_experiment.py \
--classifier-model ehsanaghaei/SecureBERT \
--use-gliner \
--use-slm-rag \
--slm-model fdtn-ai/Foundation-Sec-8B-Instruct \
--hub-model-id Dinegonos/securbert-ttp-classifierKey References
- TRAM: github.com/center-for-threat-informed-defense/tram
- NCE Matching for TTP: arXiv:2401.10337 — F1@3=0.555 on TRAM
- Privacy-Preserving NLP: arXiv:2306.05561 — NER-PS drops <0.4% F1
- CTIBench: arXiv:2406.07599 — GPT-4 F1=0.639 on CTI-ATE
- SecureBERT: arXiv:2204.02685
- SecureBERT 2.0: arXiv:2510.00240 (ModernBERT-based)
- Foundation-Sec-8B: arXiv:2508.01059
- AnnoCTR: arXiv:2404.07765
- Adaptive Anonymization: arXiv:2602.20743
- LLM-in-the-Loop De-identification: arXiv:2412.10918
