arXiv:2610.27871cs.SEOct 2026

Manuscript Offprint

arXiv:2610.27871

A Neuro-Symbolic Reasoning Engine for Compilation-Free Patch Presence Testing

Siyuan Li, Jiayi Zhou, Zhiyuan Xia, Weijie Wang, Yaowen Zheng, Weiran Tang, Hong Li, Hongsong Zhu, Shanqing Guo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Siyuan Li, Jiayi Zhou, Zhiyuan Xia, Weijie Wang, Yaowen Zheng, Weiran Tang, Hong Li, Hongsong Zhu, Shanqing Guo

Abstract—Code reuse in modern software ecosystems facilitates the spread of 1-day vulnerabilities, posing significant security risks. Determining if patches are present is crucial, but traditional methods suffer from limited usability and accuracy, often depending on a fragile compilation process. In our prior work, we introduced Lares, the first compilation-free framework for patch presence testing that combines large language models (LLMs) with SMT solvers. However, Lares treats the LLM and the SMT solver as two separate, parallel decision channels: the symbolic channel (Z3) succeeded in only 20% of code cases, and the remaining cases fell back to the neural channel (the LLM) for the final decision. Letting the LLM act as the final arbiter turns verification into an informal, non-deterministic process that is prone to hallucination errors, while the two channels never reinforce each other. To overcome these limitations, we propose SYLARES, which reformulates compilation-free patch presence testing as neuro-symbolic reasoning. Instead of letting the LLM emit a final verdict, SYLARES uses the LLM as a neural feature extractor that perceives heterogeneous source code and decompiled pseudocode and produces specification-compliant SMT-LIB inputs, and delegates the final, deterministic judgment to the symbolic Z3 solver. This neural-perceives, symbolic-decides coupling is realized by a Code2SMT reasoning engine that combines deterministic syntactic parsing with LLM-driven code normalization and symbol alignment, so that every case is reduced to a formal equivalence query rather than an opaque LLM guess. Our evaluation shows that SYLARES improves accuracy by 10% and the F1 score by 6% compared to Lares. Notably, by routing the neural output into the symbolic reasoner, its formal verification coverage reached 100%, with the Z3 solver processing all test cases, whereas Lares succeeded in only 20% of cases. Compared to other state-of-the-art methods, SYLARES achieves a 15% improvement in F1 score. These findings indicate the significant potential of neuro-symbolic reasoning in the domain of code verification.

Index Terms—Patch Presence Testing, Binary Analysis, Neuro-Symbolic Reasoning

I. INTRODUCTION

S OFTWARE development is not a purely repetitive activity. To speed up implementation, developers frequently incorporate third-party libraries, creating a complex software supply

Figure

Fig. 1. The Background.

chain ecosystem [1]. This practice, however, can propagate vulnerabilities and increase security risk. According to the Synopsys report [2], 96% of evaluated projects used at least one third-party library, 89% of codebases contained open-source components that had not been updated for over two years, and some for more than four years. Delayed updates and patching amplify the impact of 1-day vulnerabilities.

Several approaches [1], [3]–[8] have been proposed for detecting 1-day vulnerabilities. As shown in Figure 1, these methods, which fall into syntactic-based and semantic-based categories, typically perform function-level or library-level matching using binary similarity techniques. However, they face significant limitations in real-world scenarios. We summarize these limitations into three main points: First, they rely on a compilation process that is difficult to automate and often fails, reducing usability (P1). Second, they struggle to accurately locate patch-related code fragments, which reduces detection accuracy (P2). Third, their accuracy degrades significantly across different compilation environments, such as varied optimization options or architectures (P3).

In previous work, we introduced Lares [9], a novel framework designed to address these challenges. Lares was the first to leverage Large Language Models (LLMs) for patch presence testing, eliminating the need for compilation by extracting features directly from source code and patches (for P1). It employed an LLM to locate patch-related code slices in decompiled pseudocode, ensuring a consistent comparison granularity (for P2), and its features were architecture-independent (for P3). Lares combined formal methods with LLM-driven analysis to detect if a patch was present.

This work was supported by National Key Research and Development Program of China (Grant No.2022YFB3103904)). (Corresponding authors: Hong Li, Siyuan Li)

Siyuan Li, Jiayi Zhou, Zhiyuan Xia and Shanqing Guo is with the School of Cyber Science and Technology, Shandong University, Qingdao 266237, China. (e-mail: siyuan@sdu.edu.cn, 294030000@qq.com, 3325894735@qq.com, guoshanqing@sdu.edu.cn)

Despite its innovations, Lares is fundamentally limited by how it organizes the LLM and the SMT solver: it treats them as two separate, parallel decision channels rather than as one coupled reasoning process. The symbolic channel (Z3) and

Weijie Wang, Yaowen Zheng, Weiran Tang, Hong Li, and Hongsong Zhu are with the Institute of Information Engineering, Chinese Academy of Sciences, Beijing 100085, China, and also with the School of Cyber Security, University of Chinese Academy of Sciences, Beijing 100049, China. (e-mail: {wangweijie, zhengyaowen, tangweiran, lihong, zhuhongsong}@iie.ac.cn) the neural channel (the LLM) each attempt to reach a verdict independently, and the system simply falls back from one to the other. This decoupled design causes two critical challenges. First, the symbolic channel struggles with complex control flows and data structures, exhibiting limited applicability, and succeeds in only 20% of code cases, significantly reducing judgment's reliability (Challenge 1, C1). Second, whenever the symbolic channel fails, the neural channel must issue the final verdict; this LLM-as-final-arbiter judgment is an informal, non-deterministic verification process that is highly susceptible to hallucination, leading to erroneous conclusions (Challenge 2, C2). Because the two channels never reinforce each other, Lares produced a high rate of false positives, undermining its effectiveness in practice.

To overcome these challenges, we propose SYLARES, which reformulates compilation-free patch presence testing as neuro-symbolic reasoning: instead of letting the LLM and the solver compete as parallel channels, SYLARES couples them so that the neural component perceives and the symbolic component decides. The key idea is to use the LLM as a feature extractor rather than the final discriminator, and to delegate the final, deterministic judgment to the symbolic Z3 solver. Concretely, the patch enhancement module first expands patch semantics by adding context-related statements to the patch code with a few statements, and the patch localization module leverages an LLM to identify pseudocode slices corresponding to patch code slices within the target function's pseudocode. These localized and enhanced code slices then serve as the input for the Code2SMT reasoning engine, which realizes the neuro-symbolic coupling in three stages. Its Extractor utilizes an FSM-based parser for rapid lexical analysis, decomposing the code into fundamental logical units, and employs an LLM-based parser as a robust fallback for syntactically complex expressions. Its Normalizer then uses the LLM's code analysis and translation capabilities not to judge, but to translate these heterogeneous units into a specification-compliant SMT-LIB representation and to align symbols across source code and pseudocode. Finally, the symbolic Verifier feeds this normalized representation into the Z3 solver, which makes the final deterministic decision. By turning the LLM's flexible perception into well-formed symbolic inputs, SYLARES broadens the applicability of the SMT solver (for C1) and eliminates the need for an LLM-based final judgment, thereby mitigating its associated hallucinations (for C2).

We thoroughly analyze the issues introduced by the compilation process in existing methods and demonstrate how SYLARES naturally avoids them. Our evaluation demonstrates that SYLARES significantly enhances the accuracy and reliability of patch presence testing. Compared to Lares, our system improves accuracy by 10% and the F1 score by 6%. Our experiments show that routing the LLM's neural output into the symbolic reasoner effectively resolves the critical failure point of Lares, where the SMT solver previously succeeded in only 20% of cases (addressing C1). A key point is the expanded capability of the SMT solver, which achieved 100% formal verification coverage by processing all test cases. As a direct result, delegating the final decision to the symbolic reasoner significantly reduces the false positives caused by the LLM hallucinations inherent in Lares's LLM-based judgment (addressing C2). Furthermore, when compared against other methods, SYLARES achieves a 20% improvement in precision and a 15% improvement in F1 score across a diverse range of architectures and compilation options.

We summarize our main contributions below:

• We propose SYLARES, the first compilation-free, neuro-symbolic approach for patch presence testing, which eliminates substantial manual work and achieves large-scale automated detection.

• We identify that coupling, rather than merely combining, the neural and symbolic components is the key to reliable verification, and we design and implement a Code2SMT reasoning engine in which the LLM serves as a neural feature extractor that produces specification-compliant SMT-LIB inputs and the Z3 solver serves as the deterministic decision maker, achieving a 100% formal verification rate.

• We implement SYLARES with 3,500 lines of Python code and integrate it with several source and binary analysis tools, while also validating its performance using advanced LLMs. The code and dataset are available at https://github.com/Siyuan-Li201/SyLares

• We conduct an extensive evaluation of SYLARES, and the results show that SYLARES outperforms state-of-the-art approaches in terms of both accuracy and recall overall across a range of architectures and compilation options.

References (45)