CoolFace
Modelpublic

Dinegonos/slm-rag-anonymization-tram

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
Model Card

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)

Strategy IDMethodDescription
baselineNoneNo anonymization (control)
placeholderNER → Typed PlaceholderAPT29[THREAT_ACTOR_1]
slm_replaceSLM generates synthetic replacementsAPT29ThreatGroup-Alpha
slm_ragSLM + RAG-guided anonymizationRAG retrieves ATT&CK context, SLM preserves behavioral terms
full_redactFull entity redactionAPT29[REDACTED]

Datasets

DatasetHF IDUsage
Security-TTP-Mapping`tumeteor/Security-TTP-Mapping`Train/eval ATT&CK classifier
CTI-Bench (ATE)`AI4Sec/cti-bench` config cti-ateEval benchmark
CTI-Bench (TAA)`AI4Sec/cti-bench` config cti-taaNatural anonymization baseline
AnnoCTR`priamai/AnnoCTR`NER training data

Models

ComponentModelHF IDSize
ATT&CK ClassifierSecureBERT`ehsanaghaei/SecureBERT`125M
ATT&CK Classifier v2SecureBERT 2.0`cisco-ai/SecureBERT2.0-base`149M
Semantic RankerSentSecBert`QCRI/SentSecBert_10k`~110M
SLM AnonymizerFoundation-Sec-8B`fdtn-ai/Foundation-Sec-8B-Instruct`8B
NER ModelGLiNER`urchade/gliner_mediumv2.1`90M

Quick Start

Phase 1: Regex-only anonymization (no GPU needed)

bash
python experiments/run_experiment.py \
  --classifier-model ehsanaghaei/SecureBERT \
  --epochs 5 \
  --batch-size 16 \
  --hub-model-id Dinegonos/securbert-ttp-classifier

Phase 2: GLiNER NER + anonymization (GPU needed)

bash
python experiments/run_experiment.py \
  --classifier-model ehsanaghaei/SecureBERT \
  --use-gliner \
  --hub-model-id Dinegonos/securbert-ttp-classifier

Phase 3: Full SLM+RAG pipeline (A10G/A100 needed)

bash
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-classifier

Key References

  1. 1.TRAM: github.com/center-for-threat-informed-defense/tram
  2. 2.NCE Matching for TTP: arXiv:2401.10337 — F1@3=0.555 on TRAM
  3. 3.Privacy-Preserving NLP: arXiv:2306.05561 — NER-PS drops <0.4% F1
  4. 4.CTIBench: arXiv:2406.07599 — GPT-4 F1=0.639 on CTI-ATE
  5. 5.SecureBERT: arXiv:2204.02685
  6. 6.SecureBERT 2.0: arXiv:2510.00240 (ModernBERT-based)
  7. 7.Foundation-Sec-8B: arXiv:2508.01059
  8. 8.AnnoCTR: arXiv:2404.07765
  9. 9.Adaptive Anonymization: arXiv:2602.20743
  10. 10.LLM-in-the-Loop De-identification: arXiv:2412.10918

Literature Evidence Supporting Hypothesis

StudyFindingRelevance
arXiv:2306.05561NER-based pseudonymization drops classification F1 by only 0.27-0.36%Strongest evidence for H₀
arXiv:2309.03057Hide-and-Seek framework maintains translation quality after anonymizationArchitectural precedent
arXiv:2412.10918Fine-tuned small NER models achieve F1=0.97+ for de-identificationSLM capability evidence
arXiv:2411.01073RAG over ATT&CK KB achieves context recall ~0.85RAG effectiveness for ATT&CK