SymLift: Neural Semantic Lifting for Compile-Free Vulnerability Detection in Context-Incomplete Code Fragments

Xiarun Chen, Jiaxing Xu, Bozhi Wu, Chenhui Cui, Chunrong Fang, Weiping Wen, Tao Li, Rubing Huang, Tsong Yueh ChenarXiv 2026 · arXiv

TL;DR

SYMLIFT is a neuro-symbolic framework designed to detect vulnerabilities in code fragments that cannot compile, such as isolated functions or LLM-generated snippets. By using a fine-tuned LLM to "lift" raw code into a structured intermediate representation (IR) and then applying deterministic Datalog rules, it provides accurate, auditable security analysis without requiring a full build environment.

What Problem Does This Paper Address?

Traditional static analysis tools (like CodeQL or Clang Static Analyzer) are powerful but brittle: they generally require code to be compilable within a complete project context to build accurate Control-Flow Graphs (CFGs) and Data-Flow Graphs (DFGs). This creates a "compilation gap" when dealing with context-incomplete code—think of a single function copied from a large repository or a snippet generated by an AI coding assistant. If the code doesn't compile, these tools often fail to extract the relations needed to find bugs.

While Large Language Models (LLMs) can be used to predict vulnerabilities directly from raw text, they suffer from an "auditability gap." Their predictions are probabilistic "black boxes" that don't provide a clear, reproducible derivation trace. Security engineers need to know why a line is flagged (e.g., "this pointer is dereferenced here but was checked for NULL on a different path").

Methods

SYMLIFT tackles these challenges with a three-stage neuro-symbolic pipeline:

  1. Neural Semantic Lifting (Stage I): Instead of asking an LLM to find vulnerabilities, SYMLIFT asks it to reconstruct the program's logic into a constrained, LLVM-like Intermediate Representation (IR). The authors used a two-stage fine-tuning process for a Qwen-7B model: first for structural fidelity (ensuring the IR is syntactically valid) and then for vulnerability-oriented semantics (ensuring it preserves relations like bounds checks and pointer offsets).
  2. Deterministic IR-to-Fact Parsing (Stage II): A specialized parser validates the generated IR and converts it into "Base Facts"—structured data predicates that represent the program's operations.
  3. Symbolic Reasoning with Datalog (Stage III): These facts are fed into a Soufflé Datalog engine. SYMLIFT uses a library of explicit vulnerability rules (covering six major CWE families) to derive findings. Because the rules are deterministic, every reported vulnerability comes with a "proof tree" or derivation trace, making the results fully auditable.
Fig. 1. Overview of the SYMLIFT workflow.

Datasets

The authors evaluated SYMLIFT across three diverse settings:

  • FormAI: A dataset of 1,400 AI-generated C programs with verified vulnerabilities.
  • Juliet: A classic benchmark used here to test "context removal." The authors compared performance on full programs versus isolated function fragments.
  • MegaVul: A collection of 1,371 real-world functions related to historical CVEs (Common Vulnerabilities and Exposures).

For training the "lifter," they used a corpus of 30,000 source-IR pairs extracted from high-quality open-source projects like the Linux kernel, OpenSSL, and SQLite.

Key Insights and Ideas

  • Lifting vs. Labeling: The core "aha moment" is that LLMs are better at translating code into a structured intermediate format than they are at directly identifying subtle security flaws. By "lifting" the code to IR, the LLM handles the messy, incomplete context, while the symbolic engine handles the rigorous logic.
  • The Power of IR: Using an LLVM-like IR acts as a semantic bridge. It is constrained enough to be parsed deterministically but flexible enough that an LLM can reconstruct it even when headers or type definitions are missing.
  • Auditability as a First-Class Citizen: By separating the neural reconstruction from the vulnerability judgment, SYMLIFT ensures that even if the "lifting" is neural, the "reasoning" is symbolic and inspectable.

Key Results

SYMLIFT demonstrates remarkable resilience to missing context. On the Juliet dataset, when programs were reduced to isolated fragments, the success rate for standard Clang compilation plummeted from 100% to just 12%. In contrast, SYMLIFT’s analysis completion rate barely budged, dropping by only 1.17 percentage points.

Quantitatively, the SYMLIFT-Qwen-7B configuration achieved:

  • 94.41% Target-F1 on FormAI, outperforming the strongest direct-LLM baseline (Gemini-3.5-Flash) by over 24 points.
  • 91.66% micro-averaged Target-F1 and 98.24% precision on the real-world MegaVul dataset.
  • 96.85% Control-Flow IoU, indicating that the neural lifter is highly accurate at reconstructing the branching logic of the original source code.

Limitations and Future Work

Despite its success, SYMLIFT has several areas for improvement:

  • IR Uncertainty: The system's accuracy is entirely dependent on the LLM's ability to generate faithful IR. If the model "hallucinates" a missing check into the IR, the Datalog engine will miss the vulnerability.
  • Computational Cost: Generating IR via an LLM is significantly more resource-intensive than traditional parsing. The authors note that IR generation accounts for 87.5%–95.0% of the total analysis time.
  • Vulnerability Scope: The current rule library covers six major vulnerability families (e.g., Buffer Overflow, Null Pointer Dereference). Expanding this to cover concurrency bugs or complex logic errors remains future work.
  • Context Window: Very large functions can lead to truncated IR if they exceed the LLM's token limits, potentially causing false negatives.

Summary updated

Abstract

Missing project context can prevent build-dependent analyzers from constructing program relations required for vulnerability detection, while neural predictions alone do not establish auditable derivations. We present SymLift, a compile-free framework centered on Vulnerability-Oriented Neural Semantic Lifting for context-incomplete code fragments. A fine-tuned large language model reconstructs vulnerability-relevant control-flow, data-flow, memory, and resource relations in a constrained LLVM-like intermediate representation (IR), without reconstructing the full project context or directly predicting vulnerability labels. A deterministic parser validates the IR and maps its supported operations and relations into normalized evidence facts. Explicit Datalog rules derive findings with supporting facts and derivation traces, ensuring deterministic reasoning for fixed facts and rules. We evaluate SymLift on FormAI, Juliet, and MegaVul. Reducing complete Juliet programs to function-level fragments lowers Clang compilation success from 100% to 12.00%, whereas SymLift's analysis completion rate decreases by only 1.17 percentage points. After task-specific fine-tuning, the lifter achieves a control-flow intersection over union (IoU) of 96.85% on FormAI. SymLift-Qwen-7B achieves a Target-F1 of 94.41% on FormAI and, across six vulnerability families on MegaVul, a micro-averaged precision of 98.24% and a micro-averaged Target-F1 of 91.66%. These results support accurate and auditable detection in the evaluated context-incomplete settings, even with partial program relations.
BibTeX
@misc{chen2026symlift,
  author = {Xiarun Chen and Jiaxing Xu and Bozhi Wu and Chenhui Cui and Chunrong Fang and Weiping Wen and Tao Li and Rubing Huang and Tsong Yueh Chen},
  title = {{SymLift: Neural Semantic Lifting for Compile-Free Vulnerability Detection in Context-Incomplete Code Fragments}},
  year = {2026},
  eprint = {2610.34431},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.34431},
}
Figure