TL;DR
REBENCH is a new, standardized benchmark designed to fairly evaluate Large Language Models (LLMs) on binary reverse engineering tasks, specifically variable/function name recovery and type inference. By utilizing a byte-level knowledge base to preserve ground truth without simplifying real-world stripped binary constraints, REBENCH exposes the significant gaps and brittle generalization capabilities of current state-of-the-art models.
What Problem Does This Paper Address?
Applying LLMs to computer security tasks like reverse engineering has exploded in popularity. However, evaluating how well these models actually perform has been a chaotic wild west. Existing studies rely on completely different datasets, distinct preprocessing pipelines, and inconsistent evaluation metrics. For example, one tool might report an F1 score of 0.715 on its own dataset, but drop to 0.05 when evaluated by an independent team.
Furthermore, many prior evaluations simplified the problem by using binaries compiled with debug symbols to generate decompiled code. In the real world, reverse engineers deal with stripped binaries. Without debug symbols, decompilers "flatten" complex data structures into raw size allocations or independent stack variables. This creates a massive structural mismatch between source-code ground truth and what an LLM actually sees, leading to artificial shortcuts or unfair evaluations.
Methods
REBENCH introduces a procedural, "fair-by-construction" pipeline to normalize datasets into a universal format:
- Knowledge-Base (KB) Driven Ground Truth: Instead of relying on fragile source-to-binary text matching, the authors build a KB by decompiling binaries with debug symbols and mapping every variable's name and type down to its exact byte-level stack offset and memory footprint.
- Universal Input Normalization: Stripped binaries are passed through a decompiler, and all identifiable symbols are replaced with uniform placeholders (e.g.,
VAR1,TYPE1,FUNC1). The model's task is to fill in these blanks. The prompt structure used to guide the LLMs through this inference task is illustrated below:
- Rigorous Filtering: To prevent data leakage, the framework computes code similarity across both assembly and decompiled code to eliminate duplicate functions. It also filters out trivial functions (fewer than 10 lines) and external library wrappers.
- Dual Evaluation Metrics: Type inference is evaluated strictly via exact matching due to rigid C semantics. Name recovery uses a semantic similarity metric powered by CodeWordNet, ensuring models aren't unfairly penalized for outputting synonyms (e.g.,
meminstead ofmemory).
Datasets
REBENCH consolidates a massive superset of datasets used in prior reverse engineering research. It covers four major processor architectures (x64, x86, ARM 32-bit, MIPS 32-bit) and four compiler optimization levels (O0 to O3).
The scale of the dataset before and after the filtering pipeline is detailed below:
On the x64 architecture alone, the dataset contains nearly 30 million lines of filtered, decompiled code.
Key Insights and Ideas
- Optimization is a Double-Edged Sword: For decompiled code, higher compiler optimization (O1–O3) severely degrades LLM performance because optimizations like inlining and register allocation strip away structural semantic cues. However, for assembly code, higher optimization actually improves function name recovery because it regularizes and shortens instruction sequences into canonical patterns.
- Decompiler Lock-in: Models fine-tuned on Ghidra-decompiled code fail to generalize when tested on IDA Pro outputs. LLMs are highly sensitive to the specific syntactic style, naming conventions, and control-flow representations of the underlying decompiler.
- Data Quality > Model Size: Scaling up model size within the same family (e.g., CodeLlama 7B to 34B) yielded diminishing returns. The quality and domain-specificity of the pre-training data proved to be a much more decisive factor than raw parameter count.
- Formatting Fragility: Even after fine-tuning, LLMs frequently fail to follow strict output formatting constraints without heavy post-processing, often hallucinating chain-of-thought reasoning or repeating the same variable name for distinct placeholders.
Key Results
The authors evaluated seven mainstream code LLMs (including CodeLlama, Llama2, WizardCoder, Qwen2.5, Qwen3, and DeepSeek-R1-Qwen).
- Overall Performance: Across the board, reverse engineering remains incredibly difficult for LLMs, with most models scoring below a 0.1 F1 score on complex tasks.
- Type Inference vs. Name Recovery: Type inference is universally disastrous for all models due to the strictness of exact matching and the complexity of data flows. Name recovery fares slightly better, with newer models like Qwen2.5 and Qwen3 outperforming older architectures.
- Architecture Weakness: All evaluated LLMs heavily struggled with the MIPS architecture, likely due to its underrepresentation in open-source training data.
An example of how a model can succeed at high-level function naming but fail at granular variable and type recovery is shown here:
Limitations and Future Work
While REBENCH provides a solid foundation, it currently relies heavily on the decompiler's interpretation of the binary, meaning decompiler errors (like omitted type annotations or introduced artifacts) can propagate into the benchmark.
The authors plan to expand REBENCH to include "decompiler-agnostic" formats and integrate additional security-critical tasks such as memory corruption detection, control-flow integrity (CFI) analysis, and binary similarity diffing.
Summary updated