BeQuantum AI Logo BeQuantum AI

SAGE Framework: LLM Vulnerability Detection 318% Smarter

A 7B model using SAGE outperforms 34B baselines with 318% MCC gains. Learn what Signal Submersion means for your DevSecOps pipeline and what to do next.

BeQuantum Intelligence · 8 min read
SAGE Framework: LLM Vulnerability Detection 318% Smarter

Key Takeaways

  • A 7B-parameter model augmented with SAGE achieves up to 319% MCC gain on classic vulnerability benchmarks and 318% gain on unseen distributions — while outperforming 34B-parameter baseline models (arXiv:2604.19031)
  • SAGE increases internal Signal-to-Noise Ratio by 12.7x via sparse manifold projection, solving a previously unnamed bottleneck the authors call “Signal Submersion”
  • For security teams: smaller, cheaper models can now outdetect larger ones — meaning your vulnerability detection budget can shrink while your coverage across 13 programming languages expands

Last updated: May 2025


The Hidden Reason Your LLM-Based Scanner Misses Vulnerabilities

Your security team deploys an LLM-based static analysis tool. It processes 50,000 lines of C++ and Python daily. It flags style issues, logic errors, and dependency conflicts with reasonable accuracy. But a buffer overflow in a memory allocation routine — the kind that becomes a critical CVE six months later — slips through undetected.

This isn’t a model size problem. It isn’t a training data problem. According to research published in April 2025 on arXiv, it’s a Signal Submersion problem.

LLMs trained on code develop rich internal representations of what code does — its functional semantics. Those representations dominate the model’s activation space. Vulnerability-related features do activate internally, but they’re numerically overwhelmed by the louder signal of functional meaning. The model “sees” the vulnerability at some level, then buries it under everything else it knows about the code.

The result: your scanner reports clean, and your attack surface quietly expands.

[IMAGE: Macro photograph of a circuit board with faint signal traces barely visible beneath dominant electrical pathways, cyan/teal accent lighting, dark background, 8K cinematic quality]


What SAGE Actually Does: Signal Recovery, Not Scale

SAGE (Signal-Amplified Guided Embeddings) is a framework that integrates task-conditional Sparse Autoencoders (SAEs) into LLM inference pipelines to isolate and amplify vulnerability-related features that would otherwise be suppressed by dominant functional semantics.

The core mechanism works in three stages:

  1. Sparse manifold projection: SAEs compress the model’s internal activation space, forcing it to represent information in a sparser, more interpretable form. Vulnerability signals — previously diluted across thousands of activation dimensions — concentrate into a smaller, higher-contrast representation.
  2. Task-conditional gating: SAGE applies conditioning specific to vulnerability detection, ensuring the sparse projection prioritizes security-relevant features over functional semantics.
  3. Amplified embedding output: The recovered, high-SNR signal feeds downstream classification, giving the model a cleaner basis for its vulnerability judgment.

This is mechanistic interpretability applied as a security engineering tool — not an academic exercise.

“SAGE mitigates Signal Submersion by increasing the internal Signal-to-Noise Ratio (SNR) by 12.7x via sparse manifold projection… enabling a 7B model to achieve up to 318% Matthews Correlation Coefficient (MCC) gains on unseen distributions and a 319% gain on classic datasets.” — arXiv:2604.19031

Why MCC Is the Right Metric Here

MCC (Matthews Correlation Coefficient) measures classification quality across imbalanced datasets — which is exactly what vulnerability detection produces. Real codebases contain far more non-vulnerable code than vulnerable code. Accuracy scores on imbalanced data are misleading; a model that flags nothing as vulnerable can still score 95%+ accuracy. MCC penalizes that behavior. A 318% MCC gain is not a marginal improvement — it represents a fundamental shift in the model’s ability to find real vulnerabilities in realistic code distributions.


Benchmark Results: SAGE vs. Current Approaches

SAGE was evaluated against BigVul, PrimeVul, and PreciseBugs — three standard vulnerability detection benchmarks with different characteristics and difficulty profiles.

DimensionTraditional Static Analysis / GNNsLLM Baseline (34B params)SAGE-Augmented LLM (7B params)
Primary mechanismRule-based / graph structurePattern matching at scaleSignal recovery via sparse projection
Language coverageTypically 1-5 languagesVaries by training data13 programming languages
Model size requirementN/A~34B parameters~7B parameters
MCC on unseen distributionsBaselineBaselineUp to +318% vs. 34B baseline
MCC on classic datasetsBaselineBaselineUp to +319% vs. 34B baseline
Benchmark coveragePartialPartialBigVul, PrimeVul, PreciseBugs
Signal Submersion mitigationNot applicableNone12.7x SNR improvement
Deployment cost implicationLow compute, low accuracyHigh compute, moderate accuracyLower compute than 34B, higher accuracy

The critical finding: SAGE-augmented 7B models achieve state-of-the-art performance on all three benchmarks while requiring roughly one-fifth the parameters of the baseline they outperform. For enterprise security teams running inference at scale, that parameter gap translates directly to infrastructure cost.


Industry Context: Why This Arrives at the Right Moment

Static analysis and Graph Neural Networks have served as the foundation for automated vulnerability detection for over a decade. Tools like Checkmarx, Semgrep, and Snyk built their detection engines on rule sets and structural code analysis. LLMs entered the space promising broader coverage and natural language reasoning about code — but early deployments revealed a consistent gap: LLMs struggled with the precise, low-signal nature of security vulnerabilities compared to their strong performance on functional code understanding.

The research community’s response was largely to scale — throw more parameters at the problem. SAGE represents a different thesis: the bottleneck is signal quality, not model size.

This has direct regulatory implications. NIST’s Secure Software Development Framework (SSDF) and the 2023 U.S. Executive Order on cybersecurity both push organizations toward automated vulnerability identification in software supply chains. The EU Cyber Resilience Act, entering enforcement phases through 2027, imposes vulnerability disclosure and remediation obligations on software manufacturers. Organizations that can demonstrate systematic, high-coverage vulnerability detection — across multiple languages, at scale — are better positioned for compliance audits.

If a 7B SAGE-augmented model can cover 13 programming languages with detection quality that exceeds a 34B baseline, the compliance burden of deploying and maintaining that detection infrastructure drops significantly.

The shift from passive signal submersion to active signal recovery marks a maturation point for LLM-based security tooling — moving from “LLMs that happen to analyze code” toward “security-specialized inference architectures.”

Who Is Moving and Who Is Lagging

Enterprise adoption of LLM-based vulnerability detection is accelerating, but most deployments still treat LLMs as drop-in replacements for rule-based scanners rather than as architectures requiring security-specific optimization. The organizations gaining ground are those integrating LLM-based detection into CI/CD pipelines with feedback loops — not those running periodic batch scans.

The SAGE framework, once integrated into open-source or commercial tooling, could accelerate this shift by making smaller, faster models viable for production security workflows. The 7B parameter footprint fits comfortably on a single A100 GPU, enabling on-premise deployment for organizations with data residency requirements — a significant advantage over cloud-hosted 34B inference endpoints.


The BeQuantum Perspective: Signal Recovery as a Security Architecture Principle

At BeQuantum, we work at the intersection of AI-driven content authenticity, post-quantum cryptography, and code verification. The Signal Submersion problem SAGE addresses is structurally similar to a challenge we encounter in AI-generated content detection: high-confidence surface signals (fluent prose, correct formatting) can mask low-amplitude authenticity signals (statistical fingerprints of generation).

The sparse manifold projection approach — forcing representations into a sparser, higher-contrast space before classification — is a technique with broader applicability than vulnerability detection alone. Organizations building AI-assisted code review pipelines, supply chain integrity verification, or automated compliance checking face the same fundamental problem: the signal you care about is real, but it’s buried.

Here’s how security-forward organizations are addressing this architecturally:

  • Layer signal recovery before classification: Don’t treat your LLM’s final output embedding as ground truth. Intermediate activation analysis — the core of what SAGE does — gives you a richer, more honest signal.
  • Benchmark on distribution shift, not just held-out test sets: The 318% MCC gain on unseen distributions is the number that matters for production. Vulnerability patterns in your codebase will drift from any training set. Tools that degrade on distribution shift create false confidence.
  • Size your models for your threat model, not your benchmark leaderboard: A 7B model that outperforms a 34B model on your specific language stack and vulnerability classes is the right model. Parameter count is not a proxy for security coverage.

What Your Security Team Should Do in the Next 90 Days

Step 1: Audit your current vulnerability detection coverage by language (within 30 days) Map every programming language in your codebase against the detection capabilities of your current tooling. If your scanner’s documentation doesn’t explicitly list language-specific vulnerability detection (not just syntax support), assume gaps exist. SAGE’s 13-language coverage sets a new baseline expectation.

Step 2: Evaluate LLM-based detection tools on distribution-shifted test sets (within 60 days) Don’t accept vendor benchmark numbers at face value. Request or construct evaluation sets drawn from your own codebase’s vulnerability history. MCC on your distribution is the metric that predicts production performance. Any tool that can’t provide MCC scores on held-out, distribution-shifted data is giving you incomplete information.

Step 3: Assess your inference infrastructure for on-premise 7B model deployment (within 90 days) If SAGE-augmented models reach production tooling in the next 12-18 months — a reasonable expectation given the benchmark results — your team should be positioned to evaluate them. A single A100 or equivalent GPU can serve a 7B model at production inference speeds. If your current security tooling stack requires cloud-hosted inference for LLM features, document that as a data residency risk and begin the vendor conversation now.


Frequently Asked Questions

Q: Does SAGE require retraining the base LLM, or is it an inference-time augmentation? A: Based on the SAGE architecture as described in arXiv:2604.19031, the Sparse Autoencoder components operate as augmentation layers that modify how internal activations are processed — consistent with inference-time or fine-tuning-stage integration rather than full base model retraining. However, the paper does not publish full training procedure details, so organizations evaluating SAGE-based tooling should request clarification from vendors on deployment requirements before committing to integration.

Q: How does Signal Submersion affect false positive rates, not just detection rates? A: The published results focus on MCC gains, which account for both false positives and false negatives in imbalanced classification. The 12.7x SNR improvement suggests that cleaner signal separation should reduce false positives alongside improving true positive detection — but the paper does not publish explicit false positive rate comparisons. This is a data gap security teams should probe when evaluating any SAGE-based implementation.

Q: Is SAGE relevant for organizations not yet using LLM-based vulnerability detection? A: Yes — and perhaps more so. If your current stack relies on traditional static analysis or GNN-based tools, SAGE’s benchmark results establish what LLM-based detection can now achieve. That performance gap is your migration justification. Organizations that delay evaluating LLM-based detection are not avoiding risk; they’re deferring a coverage decision while their attack surface continues to evolve.

Tags
vulnerability-detectionLLM-securityDevSecOpsstatic-analysisAI-security-tooling

Ready to future-proof your platform?

See how BQ Provenance API can certify your content with quantum-resistant cryptography.