Abstract
Mapping cyber threat intelligence (CTI) reports to the MITRE ATT&CK framework is a critical but labor-intensive task for security analysts. We present TechniqueRAG, a novel framework that utilizes Retrieval-Augmented Generation (RAG) to automate this process. TechniqueRAG employs a three-stage pipeline: initial retrieval, LLM-based re-ranking using structured reasoning, and final technique generation via a fine-tuned small language model. Our results demonstrate that TechniqueRAG significantly outperforms existing state-of-the-art methods and even larger proprietary models like GPT-4o across multiple benchmarks, achieving up to a 91.1% F1 score on the Procedures dataset.
Introduction
In the world of cybersecurity, the MITRE ATT&CK framework is the gold standard for categorizing adversary behavior. However, manually mapping raw text from incident reports to specific ATT&CK IDs (such as "T1059.001: PowerShell") is a grueling, expert-level task.
Existing automated solutions face a "Goldilocks" problem. Generic Large Language Models (LLMs) are prone to "hallucinations," often suggesting techniques that do not exist or are irrelevant to the context. Conversely, specialized classifiers require massive, perfectly balanced datasets that are rarely available in the niche domain of cyber threat intelligence. Standard Retrieval-Augmented Generation (RAG) often fails in this domain because generic retrievers (like BM25) bring back "noisy" or irrelevant candidates, which then mislead the final generation model.
Methods
TechniqueRAG is a three-stage pipeline designed to bridge the gap between generic retrieval and domain-specific precision:
- Retrieval: An off-the-shelf retriever (BM25) pulls the top-K most similar text-technique pairs from a small "exemplar" dataset.
- LLM-Based Re-ranking: This stage acts as the system's core intelligence. Instead of trusting the initial retrieval order, a powerful LLM (DeepSeek v3) re-ranks the candidates. It utilizes a structured reasoning prompt that forces the LLM to decompose the query into distinct attack steps, map those steps to high-level tactics (e.g., "Persistence"), and explicitly link behaviors to specific techniques.
- Fine-tuned Generation: Finally, a smaller, efficient model (Ministral 8B) is fine-tuned to generate the final IDs. This model is trained to use the re-ranked exemplars as context, ensuring its output is grounded in the actual ATT&CK taxonomy rather than its internal weights.
Datasets and Evaluation
The framework was evaluated on three distinct benchmarks representing varying levels of complexity:
- Tram: A single-label dataset with 198 unique techniques.
- Procedures: A single-label dataset extracted from the MITRE knowledge base, featuring 488 unique techniques.
- Expert: A challenging multi-label dataset consisting of actual sentences from professional threat reports, covering 290 unique techniques.
Key Results
TechniqueRAG consistently outperformed both traditional retrieval methods and powerful generative baselines across all tested datasets.
- Superiority over SOTA: On the Procedures dataset, TechniqueRAG achieved an F1 score of 91.1%, significantly higher than previous state-of-the-art methods like NCE (82.3%).
- Beating Proprietary Models: The fine-tuned TechniqueRAG (using an 8B parameter model) outperformed GPT-4o in a vanilla RAG setup. For example, on the Tram dataset, TechniqueRAG reached a 74.0% F1 score compared to GPT-4o's 62.2%.
- Multi-label Success: On the complex Expert dataset, it achieved a 50.2% F1 score, nearly matching the performance of much larger proprietary models while remaining open-source and more efficient.
Key Insights
- Reasoning Over Retrieval: The research demonstrates that how you retrieve is less important than how you re-rank. By forcing the LLM to perform step-by-step reasoning during re-ranking, the system can identify implicit techniques that do not share keywords with the input text.
- The Sub-technique Advantage: Training the model on fine-grained sub-techniques (e.g., T1059.001) actually improves its performance on broader parent techniques (T1059). The hierarchy of the ATT&CK framework serves as a beneficial feature for model grounding.
- Data Efficiency: TechniqueRAG achieves superior results by fine-tuning only the generation component on a small set of in-domain examples, circumventing the need for the massive "hard-negative mining" usually required for training security-specific retrievers.
Limitations and Future Work
Despite its success, the model sometimes identifies the "primary" technique in a sentence but misses secondary, related techniques (e.g., catching "Process Injection" but missing the "Native API" call used to achieve it). Additionally, the "long tail" of rare ATT&CK techniques remains difficult to map; techniques with fewer than 50 training examples showed lower recall. Future work may involve exploring graph-based retrieval to better capture the complex relationships between different techniques in the ATT&CK matrix.
Summary updated