← Lab /AI/ML

Contrastive multi-modal learning reduces shortcut learning in threat classification

The proposed two-stage multi-modal contrastive framework improves generalization by reducing shortcut learning in payload classification

AI/ML arXiv 20 Mar 2026 Method Prototype evidence

Published as “Improving Generalization on Cybersecurity Tasks with Multi-Modal Contrastive Learning”

Why it matters

The work shows that multi-modal contrastive alignment can modestly improve temporal generalization for payload classification, suggesting a path toward reducing reliance on large labeled payload datasets, but it is not yet ready for deployment.

Summary

SALM reaches 68.1% accuracy on a temporally shifted private dataset, outperforming TF-IDF+RF (65.7%) and fine-tuned CodeBERT (62.3%). The improvement is modest and limited to a single task; macro F1 remains low (30.1%) and performance collapses on a synthetic benchmark (24%). Evidence comes from reported accuracy/F1 numbers on one real-world split and a synthetic test, so the claim is supported but not broadly validated.

What they found 1

  1. SALM achieves higher accuracy than baselines on the challenging temporal split.

    “SALM achieves 68.1% accuracy, outperforming TF-IDF+RF (65.7%, +2.4%) and FT CodeBERT+MLP (62.3%, +5.8%).”

Caveats 8

  • Macro F1 is only 30.1% despite 68.1% accuracy, indicating poor performance on low-frequency classes.
  • Many classes have zero F1 (e.g., Trojan, Webshell) across all methods, showing limited usefulness for rare attack types.
  • On the synthetic benchmark accuracy drops to 24%, revealing sensitivity to distribution shift.
  • The authors note that 0.68 accuracy is far from production-grade reliability.
  • We evaluate on a single cybersecurity task; broader validation on other tasks is needed before claiming general applicability.
  • 0.68 accuracy remains far from production-grade reliability.
  • The vendor’s classes mix abstraction levels, textual descriptions lack detail for some classes, and the dataset exhibits strong class imbalance.
  • The temporal split tests generalization to techniques within seen types, not zero-shot transfer to entirely new categories.

What’s new here 3

  • Applies a two-stage contrastive learning framework that first aligns a frozen LLM text encoder to vulnerability descriptions and then aligns payload encoders to this semantic space.
  • Uses textual vulnerability descriptions as anchors to transfer semantic structure to a data-scarce payload modality.
  • Demonstrates gains on a temporal generalization split and a synthetic out-of-distribution benchmark, which prior work on pure supervised fine-tuning did not address.