Abstract
White-Basilisk is a compact, 200M-parameter hybrid model specifically engineered to detect vulnerabilities in large-scale codebases. By synthesizing Mamba layers, linear self-attention, and a Mixture of Experts (MoE) framework, the model processes sequences up to 524,000 tokens with 24x greater memory efficiency than traditional Transformers. Experimental results on major benchmarks like PRIMEVUL and BigVul show that White-Basilisk significantly outperforms much larger models, including StarCoder2-7B, establishing a new state-of-the-art for domain-specific security analysis.
Introduction
The economic impact of software vulnerabilities is an existential threat to cybersecurity, with losses projected to reach $10.5 trillion by 2025. Current detection strategies generally fall into two categories, both of which possess significant limitations. Traditional Static Analysis Security Testing (SAST) tools often suffer from high false-positive rates and struggle to identify complex, logic-based bugs. Conversely, Large Language Models (LLMs), while powerful, are computationally expensive and limited by the "quadratic complexity" of standard attention mechanisms. This scaling issue prevents LLMs from efficiently analyzing entire multi-file projects where vulnerabilities often span long-range dependencies.
White-Basilisk addresses these challenges by prioritizing architectural innovation over raw parameter count. The researchers sought to build a domain-specific architecture capable of handling massive context lengths efficiently, allowing the model to "read" entire files rather than isolated snippets.
Methodology
The White-Basilisk architecture represents a departure from the standard Transformer blueprint, utilizing a novel hybrid design to maximize efficiency and context retention.
The model integrates three core components:
- Mamba Layers: These utilize state-space models (SSMs) to provide linear-time sequence modeling. They are particularly effective at capturing local syntactic patterns without the memory overhead associated with traditional attention mechanisms.
- Basilisk Self-Attention: A modified version of the "Infini-attention" framework, this mechanism divides long sequences into segments while maintaining a "compressed global memory." This allows the model to accumulate context across the entire sequence rather than processing segments in isolation.
- Mixture of Experts (MoE): To maintain a "sparse" and efficient parameter set, MoE layers activate only a subset of parameters for each token. This provides the representational power of a much larger model at a fraction of the inference cost.
The model was pre-trained on 2 million general-purpose C/C++ code samples from the StarCoder dataset. Following pre-training, the model underwent Scale-Invariant Fine-Tuning (SIFT) to improve its robustness against small code perturbations and variations.
Experimental Results
White-Basilisk was rigorously evaluated against five major vulnerability benchmarks: PRIMEVUL, BigVul, Draper, REVEAL, and VulDeePecker.
As shown in the evaluation results, White-Basilisk achieved an F1 score of 0.291 on the PRIMEVUL dataset—a 35.5% improvement over the previous best baseline, UnixCoder. On the BigVul dataset, it reached an F1 score of 0.949, effectively outclassing all competing open-source models. Notably, the model achieved perfect F1 scores (1.000) for 22 different types of Common Weakness Enumerations (CWEs) in the BigVul evaluation, including critical "Out-of-bounds Write" (CWE-787) issues.
A key insight from the evaluation was the performance jump observed once sequences exceeded the 2,048-token threshold. This is the point where the Basilisk attention mechanism becomes most active, proving that the ability to "see" more of the code directly correlates with better reasoning. By testing on "Full-File" contexts (up to 524K tokens), the researchers demonstrated that many vulnerabilities are invisible when looking at isolated functions, requiring the model to analyze inter-function dependencies.
Discussion and Conclusion
The success of White-Basilisk challenges the "bigger is better" fallacy in AI development. Despite having only 200 million parameters, it consistently outperformed models like StarCoder2-7B, which are 35 times its size. This suggests that for specialized tasks like security, architectural innovation—specifically regarding long-range context handling—is more important than raw size.
Furthermore, by reducing memory consumption by 24x, White-Basilisk makes state-of-the-art security analysis accessible to organizations without massive GPU clusters. Future work will focus on expanding language support to include Java, Python, and Rust, as well as improving model explainability to provide developers with clear logic behind its vulnerability classifications.
Summary updated