Cyber-Attack Technique Classification Using Two-Stage Trained Large Language Models

Weiqiu You, Youngja ParkarXiv 2024 · DOI

Introduction

Cybersecurity analysts are increasingly overwhelmed by the volume of unstructured threat reports, collectively known as Cyber Threat Intelligence (CTI). To effectively defend against evolving threats, analysts must map these reports to specific "Tactics, Techniques, and Procedures" (TTPs) defined by the industry-standard MITRE ATT&CK framework. However, manual mapping is labor-intensive and slow.

Automating this classification presents three significant challenges:

  1. Data Sparseness: Labeled CTI datasets are relatively small.
  2. Class Imbalance: Attack techniques follow a long-tail distribution; common techniques are over-represented while many others appear rarely.
  3. Distribution Shift: The formal language used in the MITRE framework differs significantly from the technical jargon and "messy" prose found in real-world CTI reports.
Distribution of sentences across classes in the TRAM and MITRE datasets, highlighting the severe class imbalance and data sparseness issues.

Methodology

To address these challenges, researchers from UPenn and IBM developed a specialized pipeline involving domain-specific pre-training and a novel training strategy.

CTI-BERT

The foundation of the system is CTI-BERT, a Large Language Model (LLM) trained from scratch on a massive 1.2-billion-word corpus of cybersecurity text. This domain-specific pre-training allows the model to understand technical security terminology far better than general-purpose models like standard BERT.

Similarity-Based Data Augmentation

To bolster performance on rare classes, the researchers utilized auxiliary data from MITRE ATT&CK descriptions. To bridge the "style gap" between formal descriptions and CTI reports, they used cosine similarity of sentence embeddings to select only the MITRE descriptions that most closely resembled the style of the primary CTI data ($D^{A\_sim}$).

Two-Stage Training

The core innovation is a two-stage training process designed to leverage auxiliary data without being misled by its different distribution:

  • Stage I: The model is trained on a combination of the primary CTI data ($D^P$) and the selected auxiliary MITRE data ($D^{A\_sim}$). This stage helps the model learn the general conceptual boundaries of various attack techniques.
  • Stage II: The resulting intermediate model is fine-tuned exclusively on the primary CTI data ($D^P$). This "steers" the model back toward the specific vocabulary and style of real-world threat reports.
Overview of the (a) similarity-based auxiliary data selection and (b) the two-stage training process used to refine the CTI-BERT model.

Experimental Results

The proposed method was evaluated on the TRAM dataset, which contains sentences from security news and technical reports labeled with MITRE ATT&CK techniques.

  • Macro-F1 Gains: The two-stage approach specifically improved Macro-F1—a metric that weighs all classes equally—by 5 to 9 percentage points compared to baseline models. This indicates significantly better performance on rare attack techniques.
  • Overall Accuracy: The model achieved a Micro-F1 of 71.3 and a Macro-F1 of 56.1, outperforming standard BERT (Micro-F1 61.2 / Macro-F1 38.0) and other security-specific models like SecureBERT.
  • The Style Gap: Experiments showed that simply adding all MITRE descriptions to the training set without the two-stage logic actually decreased performance, confirming that the formal framework language is out-of-distribution for real-world CTI tasks.

Conclusion

This research demonstrates that combining domain-specific pre-training with a two-stage training logic effectively mitigates the problems of class imbalance and distribution shift in cybersecurity text classification. By intelligently incorporating auxiliary data, the system provides a more robust tool for analysts to map the "long tail" of cyber-attack techniques, ultimately improving threat response times.

Summary updated

BibTeX
@misc{you2024cyber,
  author = {Weiqiu You and Youngja Park},
  title = {{Cyber-Attack Technique Classification Using Two-Stage Trained Large Language Models}},
  year = {2024},
  eprint = {2411.18755},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.18755},
}
Figure