SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.05286 · EMNLP · 2024

LLM4Decompile: Decompiling Binary Code with Large Language Models

Jing Li, Hanzhuo Tan, Qi Luo, Yuqun Zhang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 7 failures of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2403.05286.json · badge: /api/ran/2403.05286.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
albertan017/LLM4Decompile canonical (classifier label)
classifier basis: census
9 ran · 4 no recorded run
FunctionStatusWhere it lives
activate_neftune Ran
ran; our contract draft was wrong, not the code
albertan017/LLM4Decompile/train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py
code served (permissive licence) · get_code("5fcfb774c79b9b7d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleEmbedding(nn.Module):
    def __init__(self):
        super().__init__()
        self.embed_tokens = nn.Embedding(num_embeddings=10, embedding_dim=4)
    
    def get_input_embeddings(self):
        return self.embed_tokens
    
    def forward(self, input_ids):
        return self.embed_tokens(input_ids)

class ModelWrapper(nn.Module):
    def __init__(self):
        super().__init__()
        self.module = SimpleEmbedding()
    
    def unwrap(self):
        return self.module
    
    def get_input_embeddings(self):
        return self.module.get_input_embeddings()
    
    def forward(self, input_ids):
        return self.module(input_ids)

# Create a simple model
model = SimpleEmbedding()
model.train()

ARGS = {
    "model": model,
    "neftune_noise_alpha": 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_instruction_prompt Ran
ran; our contract draft was wrong, not the code
albertan017/LLM4Decompile/train/finetune.py
code served (permissive licence) · get_code("4fd02bfccdbf12b1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes an instruction string parameter
# Looking at the function body, it formats the instruction into a prompt template
# So we need to provide a sample assembly instruction string

instruction_sample = "mov eax, ebx\nadd eax, 1\nret"

ARGS = {
    "instruction": instruction_sample
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate_func Ran
ran, honoured the contract we drafted
albertan017/LLM4Decompile/evaluation/run_evaluation_llm4decompile.py
code served (permissive licence) · get_code("9a27b34db2c2024d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import subprocess
import os
import tempfile

# Minimal valid C code for testing
c_func_code = """
#include <stdio.h>

int add(int a, int b) {
    return a + b;
}
"""

c_test_code = """
#include <stdio.h>

int add(int a, int b);

int main() {
    int result = add(2, 3);
    printf("%d\\n", result);
    return 0;
}
"""

c_func_decompile_code = """
int add(int a, int b) {
    return a + b;
}
"""

ARGS = {
    'params': {
        'c_func': c_func_code,
        'c_test': c_test_code,
        'c_func_decompile': c_func_decompile_code
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_prompt_template Ran
ran; our contract draft was wrong, not the code
albertan017/LLM4Decompile/train/colossalai_llm4decompile/colossal_llama/utils/stream_chat_patch.py
code served (permissive licence) · get_code("fea66d04230199f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from copy import deepcopy
from typing import Any, Callable, Dict, List, Optional, Tuple

torch_imported = False
try:
    import torch
    torch_imported = True
except ImportError:
    pass

# Set seed if torch is available
if torch_imported:
    torch.manual_seed(0)

# Construct arguments for get_prompt_template

input_query = "What is the capital of France?"

history = [
    {'role': 'Human', 'message': 'Hello there'},
    {'role': 'Assistant', 'message': 'Hi! How can I help?'},
    {'role': 'Human', 'message': 'Tell me about Paris'}
]

roles = ['', 'Human', 'Assistant']

ARGS = {
    'input_query': input_query,
    'history': history,
    'roles': roles
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_json Ran
ran; our contract draft was wrong, not the code
albertan017/LLM4Decompile/train/colossalai_llm4decompile/colossal_llama/utils/ckpt_io.py
code served (permissive licence) · get_code("edd6dea17a852638")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import os
import tempfile
from pathlib import Path

# Create a temporary JSON file to load
temp_dir = tempfile.mkdtemp()
test_json_file = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": 42,
    "key3": [1, 2, 3],
    "key4": {"nested": "dict"}
}

with open(test_json_file, 'w', encoding='utf-8') as f:
    json.dump(test_data, f)

ARGS = {
    "file_path": test_json_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_tokenized_dataset Ran
ran; our contract draft was wrong, not the code
albertan017/LLM4Decompile/train/colossalai_llm4decompile/colossal_llama/dataset/loader.py
code served (permissive licence) · get_code("ef17eb15727ac3ea")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ConcatDataset. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
from pathlib import Path
from datasets import Dataset as HFDataset
import numpy as np

# Create temporary directories with mock tokenized datasets
temp_dir_1 = tempfile.mkdtemp()
temp_dir_2 = tempfile.mkdtemp()

# Create a simple dataset structure
def create_mock_dataset():
    data = {
        'input_ids': [[1, 2, 3, 4], [5, 6, 7, 8]],
        'labels': [[1, 2, 3, 4], [5, 6, 7, 8]],
        'sequence': ['hello world', 'foo bar']
    }
    return HFDataset.from_dict(data)

# Create train/validation/test splits in the first directory
train_ds = create_mock_dataset()
val_ds = create_mock_dataset()
test_ds = create_mock_dataset()

dataset_dict_1 = {
    'train': train_ds,
    'validation': val_ds,
    'test': test_ds
}

# Save the first dataset dict using HuggingFace datasets format
# We'll use a simple approach: store as arrow files
import json
from datasets import DatasetDict

ds_dict = DatasetDict({
    'train': train_ds,
    'validation': val_ds,
    'test': test_ds
})
ds_dict.save_to_disk(temp_dir_1)

# Create another dataset for testing multiple paths
ds_dict_2 = DatasetDict({
    'train': create_mock_dataset(),
    'validation': create_mock_dataset(),
    'test': create_mock_dataset()
})
ds_dict_2.save_to_disk(temp_dir_2)

ARGS = {
    'dataset_paths': [temp_dir_1, temp_dir_2],
    'mode': 'train'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ConcatDataset — a ConcatDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ConcatDataset output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
neftune_post_forward_hook Ran
ran on a synthesized input
albertan017/LLM4Decompile/train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py
code served (permissive licence) · get_code("c438348a5d3162c5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal embedding module that will be used as the 'module' parameter
embedding_module = nn.Embedding(num_embeddings=10, embedding_dim=4)
embedding_module.training = True
embedding_module.neftune_noise_alpha = 0.1

# Create input tensor - indices for the embedding layer
# Shape: (batch_size=2, seq_length=3)
input_tensor = torch.tensor([[1, 2, 3], [4, 5, 6]])

# Create output tensor - embeddings
# Shape: (batch_size=2, seq_length=3, embedding_dim=4)
output_tensor = torch.randn(2, 3, 4)

ARGS = {
    "module": embedding_module,
    "input": input_tensor,
    "output": output_tensor,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
preprocess Ran
ran; our contract draft was wrong, not the code
albertan017/LLM4Decompile/train/finetune.py
pointer only (licence: MIT); the stored copy get_code serves, from sail-sg/p-dos, is pointer only (licence: NONE) · get_code("51c01dd0d033f660")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sail-sg/p-dos, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

unwrap Ran
ran; our contract draft was wrong, not the code
albertan017/LLM4Decompile/train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py
code served (permissive licence) · get_code("17ffab2bd6e83923")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned SimpleModel. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a wrapped model (DataParallel-like wrapper with 'module' attribute)
class WrappedModel(nn.Module):
    def __init__(self, module):
        super().__init__()
        self.module = module
    
    def unwrap(self):
        return self.module
    
    def forward(self, x):
        return self.module(x)

# Test case 1: model with 'module' attribute that has unwrap() method
wrapped_model = WrappedModel(SimpleModel())

ARGS = {
    "model": wrapped_model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
decompile_pass_rate Not yet run
unverified (harvested, no recorded run)
albertan017/LLM4Decompile/evaluation/run_evaluation_llm4decompile.py
code served (permissive licence) · get_code("f9d7560dd23456b3")
How it ran

no invocation recorded.

decompile_pass_rate Not yet run
unverified (harvested, no recorded run)
albertan017/LLM4Decompile/evaluation/run_evaluation_llm4decompile_vllm.py
code served (permissive licence) · get_code("b830c89787dddfa0")
How it ran

no invocation recorded.

evaluate_func Not yet run
unverified (harvested, no recorded run)
albertan017/LLM4Decompile/evaluation/run_evaluation_llm4decompile_singleGPU.py
code served (permissive licence) · get_code("c00605edd20c1e97")
How it ran

no invocation recorded.

train_tokenize_function Not yet run
unverified (harvested, no recorded run)
albertan017/LLM4Decompile/train/finetune.py
code served (permissive licence) · get_code("1eb7810bff597f27")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
preprocess 23 other papers
12 dated earlier, 1 the same month, 8 later, 2 same year, order not determinable
2305.12870 (2023-05)
Lion: Adversarial Distillation of Proprietary Large Language Models
2306.17194 (2023-06)
On the Exploitability of Instruction Tuning
2308.07286 (2023-08)
The Devil is in the Errors: Leveraging Large Language Models for Fine-grained Machine Translation Evaluation
and 20 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Decompilation aims to convert binary code to high-level source code, but traditional tools like Ghidra often produce results that are difficult to read and execute. Motivated by the advancements in Large Language Models (LLMs), we propose LLM4Decompile, the first and largest open-source LLM series (1.3B to 33B) trained to decompile binary code. We optimize the LLM training process and introduce the LLM4Decompile-End models to decompile binary directly. The resulting models significantly outperform GPT-4o and Ghidra on the HumanEval and ExeBench benchmarks over 100% in terms of re-executability rate. Additionally, we improve the standard refinement approach to fine-tune the LLM4Decompile-Ref models, enabling them to effectively refine the decompiled code from Ghidra and achieve a further 16.2% improvement over the LLM4Decompile-End. LLM4Decompile 1 demonstrates the potential of LLMs to revolutionize binary code decompilation, delivering remarkable improvements in readability and executability while complementing conventional tools for optimal results.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2403.05286")
get_code_for_paper("2403.05286")
have("2403.05286")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2403.05286.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2403.05286.svg)](https://syntology.ai/paper/2403.05286)

Connect an agent — have() is free.