Neural Semantic Recovery for Stripped Binaries

You are reading version 1 of this direction, frozen 2026-10-04. The latest version is version 2.

Version 1 of 2198 papers231 conceptsfrozen 2026-10-04

When a programmer writes code, they use variable names, function labels, and comments to encode their intent. However, the compilation process is fundamentally lossy. To optimize for execution speed and file size, compilers discard this human-centric metadata, leaving behind "stripped" binaries. For a reverse engineer, this creates a "semantic gap": they are left with functional machine code but no context regarding the original logic or purpose.

Recent research has shifted from treating reverse engineering as a manual search for patterns to a machine learning problem of semantic recovery. By using Large Language Models (LLMs) and graph-based architectures, researchers are now able to "hallucinate" the missing metadata, restoring readability to code that was once considered a black box.

The Semantic Gap in Decompilation

Traditional decompilers like IDA Pro or Ghidra attempt to translate binary instructions back into high-level languages like C. While they are often successful at preserving functional correctness, they fail at readability. As noted in A Neural-based Program Decompiler by Cheng Fu, the resulting "spaghetti code" is technically accurate for a machine but nearly impossible for a human to audit.

The core challenge is that the mapping from source to binary is many-to-one. Multiple high-level constructs can result in the same assembly patterns, and optimizations like constant folding or function inlining further obscure the original structure. Omer Katz in Towards Neural Decompilation highlights that these irreversible optimizations create a fundamental ceiling for perfect source reconstruction using rule-based tools.

From Classification to Generative Inference

Early attempts to recover function names treated the problem as a classification task, where a model would pick a name from a fixed vocabulary. This approach struggled with the "out-of-vocabulary" problem—it couldn't predict a name it hadn't seen during training.

The field has moved toward an autoregressive generation paradigm. Liang Jiang and colleagues developed SYMGEN in Beyond Classification: Inferring Function Names in Stripped Binaries via Domain Adapted LLMs, which uses domain-adapted LLMs to generate names. This allows the model to synthesize semantically appropriate names even for unique or obfuscated functions. Similarly, GENNM uses "Symbol Preference Optimization" to ensure that the generated names align with common developer naming conventions, significantly outperforming rigid classification models.

Learning the Language of Code

To recover names, models must understand the "naturalness" of code—the idea that even stripped code contains statistical patterns that hint at its purpose.

  1. Contextual Embeddings: Pratyay Banerjee introduced VarBERT in Variable Name Recovery in Decompiled Binary Code using Constrained Masked Language Modeling. By using a Transformer architecture, VarBERT learns to fill in the "blanks" left by decompilers (like v1 or sub_401000) by looking at how those variables are used across the entire function.
  2. Structural Representations: Because code is inherently non-linear, some researchers argue that text-based Transformers aren't enough. Aram Galstyan and Shushan Arakelyan proposed Bin2vec in Towards Learning Representations of Binary Executable Files for Security Tasks, which uses Graph Convolutional Networks (GCNs) to capture the control flow and data flow of a program, allowing the model to "see" the structural intent behind the machine code.
  3. Cross-Modal Retrieval: Sometimes the goal isn't to rename everything, but to find a specific needle in a haystack. Lingyun Ying developed BinSeek, a framework that allows analysts to search for binary functions using natural language queries (e.g., "AES encryption loop"), bridging the gap between human concepts and binary reality.

Refining and Verifying the Output

Generating a name or a snippet of code is only half the battle; the output must also be functionally correct and readable. Wai Kin Wong and Shuai Wang addressed this in Refining Decompiled C Code with Large Language Models by introducing DecGPT. This framework uses an iterative process: the LLM suggests a fix, a static analysis tool checks for syntax errors, and a dynamic tool (like AddressSanitizer) verifies that the code still runs correctly.

This hybrid approach—combining the creative "intuition" of LLMs with the rigorous "verification" of traditional compilers—represents the current state-of-the-art. As shown in Self-Constructed Context Decompilation with Fined-grained Alignment Enhancement by Yunlong Feng, using a model's own successful outputs as examples (in-context learning) can push the re-executability of decompiled code to over 50%, a massive leap from the "broken" outputs of previous generations.

By treating binary code as a language with its own grammar and idioms, these neural recovery techniques are effectively reversing the "irreversible" loss of compilation, turning anonymous machine instructions back into human-understandable software.

Papers in this version

Showing 60 of 198 papers.

History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 145 papers
  2. Version 1 · 2026-10-04 · 198 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_semantic_information_loss_40b825ab,
  title = {semantic information loss},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/semantic-information-loss/rdr_40b825abae5f4668960e85717b6cbf6c},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-21},
}

This exact version (version 1, frozen text):

@misc{lacuna_neural_semantic_recovery_for_stripped_bi_40b825ab_v1,
  title = {Neural Semantic Recovery for Stripped Binaries},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/neural-semantic-recovery-for-stripped-binaries/rdr_40b825abae5f4668960e85717b6cbf6c/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-21},
}