Software vulnerabilities are getting more dangerous, and traditional methods for rating their severity are slow and prone to human error. LSNet (Latent Space Networks) is a new AIβdriven solution that better understands these risks. Researchers first examined Common Vulnerability Scoring System (CVSS) data and found natural clusters among the metrics. Building on this, LSNet creates an adaptive transformer that captures both the overall meaning of the text and hidden nuances in latent spaces. It also uses bidirectional encoding and token masking, learning to link keywords with the exact location of the flaw in the code. By mixing Transformers with convolutions, LSNet becomes especially skilled at spotting vulnerable descriptions. Tests on public datasets and the CCF OSC2024 show LSNet beating classic methods like SVM, TextCNN, and advanced BERT models, achieving higher accuracy and speed. In practice, LSNet can help developers and analysts quickly pinpoint weak spots, cutting down manual assessment time and boosting system security.
LSNet relies on a hybrid of Transformer and convolutional neural network (CNN) architectures. The adaptive Transformer uses selfβattention mechanisms to model longβrange dependencies between tokens, while the CNN extracts local patterns typical of vulnerability descriptions (e.g., keyword sequences like "buffer overflow" or "SQL injection"). The CVSS metric clustering employs kβmeans or DBSCAN to identify groups of vulnerabilities with similar scores, providing more coherent preβtraining labels. Token masking, inspired by BERT, randomly hides words in the input text, forcing the model to predict the missing content and strengthening contextual understanding. Bidirectional encoding allows the model to consider both preceding and following context, improving the ability to link terms to specific code locations. Training runs on datasets labeled with CVSS v3.1, including base metrics (Attack Vector, Attack Complexity) and temporal metrics (Exploitability, Remediation Level). Experiments show an average 4β6% increase in F1βscore over BERT and RoBERTa, plus a 30% reduction in inference time thanks to optimized attention layers. LSNet thus demonstrates how integrating latent representations with masking techniques can markedly enhance automated vulnerability severity assessment, paving the way for more reactive, less manuallyβdependent security systems.
