Neuro-Symbolic Execution: The Feasibility of an Inductive Approach to Symbolic Execution

Shiqi Shen, Soundarya Ramesh, Shweta Shinde, Abhik Roychoudhury, Prateek SaxenaarXiv 2018

Abstract

Symbolic execution is a powerful technique for program analysis. However, it has many limitations in practical applicability: the path explosion problem encumbers scalability, the need for language-specific implementation, the inability to handle complex dependencies, and the limited expressiveness of theories supported by underlying satisfiability checkers. Often, relationships between variables of interest are not expressible directly as purely symbolic constraints. To this end, we present a new approach -- neuro-symbolic execution -- which learns an approximation of the relationship as a neural net. It features a constraint solver that can solve mixed constraints, involving both symbolic expressions and neural network representation. To do so, we envision such constraint solving as procedure combining SMT solving and gradient-based optimization. We demonstrate the utility of neuro-symbolic execution in constructing exploits for buffer overflows. We report success on 13/14 programs which have difficult constraints, known to require specialized extensions to symbolic execution. In addition, our technique solves 100% of the given neuro-symbolic constraints in 73 programs from standard verification and invariant synthesis benchmarks.

Introduction

Symbolic execution (SE) is a cornerstone of software security, particularly for automated bug discovery. However, it frequently encounters three major obstacles: the Modeling Gap, where SE requires precise logical models of all libraries and languages; Solver Limits, where SMT solvers struggle with non-linear arithmetic or complex strings; and Path Explosion, the combinatorial growth of execution paths in complex loops.

NeuEx addresses these by treating "hard" program segments as black boxes, learning their behavior inductively through observation, and integrating this knowledge into a symbolic framework.

Methodology

NeuEx bridges deductive logic and inductive learning by approximating complex code using neural networks. When a symbolic execution runtime encounters code that is difficult to model symbolically, it executes it with various inputs to train a Multi-Layer Perceptron (MLP). This creates Neural Constraints.

The NeuEx architecture combining symbolic execution with neural constraint learning.

The core innovation is NeuSolv, a hybrid solver that treats constraint satisfaction as an optimization problem. Logical constraints are translated into differentiable loss functions. For example, a symbolic inequality like $a < b$ is transformed into a loss $L = \max(a - b + \alpha, 0)$. By minimizing the total loss using gradient descent, NeuEx can efficiently search for satisfying inputs that trigger a target state, such as a vulnerability.

Translation of symbolic constraints into differentiable loss functions for gradient-based optimization.

Evaluation and Results

NeuEx was evaluated on two benchmarks: a Buffer Overflow Benchmark consisting of 14 real-world programs (e.g., BIND, Sendmail) and Verification Benchmarks (HOLA/NLA) containing 73 programs for testing loop invariants.

  • Exploit Generation: NeuEx successfully generated exploits for 13 out of 14 vulnerable programs, outperforming specialized tools like LESE in speed (under 2 hours vs. over 5 hours).
  • Constraint Solving: In verification benchmarks, NeuEx solved 100% of the neuro-symbolic constraints, typically within one to three search restarts.
  • Learning Efficacy: Neural models achieved over 80% accuracy for most loops, proving that even simple approximations can effectively guide gradient-based solvers toward valid inputs.

Discussion and Limitations

While powerful, the neuro-symbolic approach has limitations. Neural networks treat values as continuous, making them less effective for discrete logic (like "magic byte" checks) or integer overflows, which require manual symbolic rules to handle wrap-around behavior. Additionally, gradient-based solvers can occasionally get stuck in local minima (saddle points). Future work may explore Recurrent Neural Networks (RNNs) for sequential data and more sophisticated loss function translations.

Summary updated

BibTeX
@misc{shen2018neuro,
  author = {Shiqi Shen and Soundarya Ramesh and Shweta Shinde and Abhik Roychoudhury and Prateek Saxena},
  title = {{Neuro-Symbolic Execution: The Feasibility of an Inductive Approach to Symbolic Execution}},
  year = {2018},
  eprint = {1807.00575},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.00575},
}
Figure