{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/llm4decompile-decompiling-binary-code-with","title":"LLM4Decompile: Decompiling Binary Code with Large Language Models","arxiv_id":"2403.05286","date":"2024-03-08","proceeding":null,"authors":["Hanzhuo Tan","Qi Luo","Jing Li","Yuqun Zhang"],"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 by 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 demonstrates the potential of LLMs to revolutionize binary code decompilation, delivering remarkable improvements in readability and executability while complementing conventional tools for optimal results. Our code, dataset, and models are released at https://github.com/albertan017/LLM4Decompile","url_abs":"https://arxiv.org/abs/2403.05286v3","url_pdf":"https://arxiv.org/pdf/2403.05286v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"llm4decompile-decompiling-binary-code-with","repo_url":"https://github.com/albertan017/LLM4Decompile","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"humaneval","task_name":"HumanEval"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-4","method_name":"GPT-4"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[{"slug":"decompile-ghidra-100k","name":"decompile-ghidra-100k","full_name":""}],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.05286","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.05286"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/albertan017/LLM4Decompile","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":9,"unverified":4},"by_repo_kind":{"official":{"samples":13,"ran":9,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"5fcfb774c79b9b7d","entry":"activate_neftune","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5fcfb774c79b9b7d"}},{"code_sha256_prefix":"4fd02bfccdbf12b1","entry":"build_instruction_prompt","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/finetune.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/finetune.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4fd02bfccdbf12b1"}},{"code_sha256_prefix":"9a27b34db2c2024d","entry":"evaluate_func","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"evaluation/run_evaluation_llm4decompile.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/evaluation/run_evaluation_llm4decompile.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9a27b34db2c2024d"}},{"code_sha256_prefix":"fea66d04230199f0","entry":"get_prompt_template","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/colossalai_llm4decompile/colossal_llama/utils/stream_chat_patch.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/colossalai_llm4decompile/colossal_llama/utils/stream_chat_patch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fea66d04230199f0"}},{"code_sha256_prefix":"edd6dea17a852638","entry":"load_json","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/colossalai_llm4decompile/colossal_llama/utils/ckpt_io.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/colossalai_llm4decompile/colossal_llama/utils/ckpt_io.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"edd6dea17a852638"}},{"code_sha256_prefix":"ef17eb15727ac3ea","entry":"load_tokenized_dataset","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/colossalai_llm4decompile/colossal_llama/dataset/loader.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/colossalai_llm4decompile/colossal_llama/dataset/loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ef17eb15727ac3ea"}},{"code_sha256_prefix":"c438348a5d3162c5","entry":"neftune_post_forward_hook","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c438348a5d3162c5"}},{"code_sha256_prefix":"51c01dd0d033f660","entry":"preprocess","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/finetune.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/finetune.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"51c01dd0d033f660"}},{"code_sha256_prefix":"17ffab2bd6e83923","entry":"unwrap","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/colossalai_llm4decompile/colossal_llama/utils/neftune_patch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"17ffab2bd6e83923"}},{"code_sha256_prefix":"f9d7560dd23456b3","entry":"decompile_pass_rate","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"evaluation/run_evaluation_llm4decompile.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/evaluation/run_evaluation_llm4decompile.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f9d7560dd23456b3"}},{"code_sha256_prefix":"b830c89787dddfa0","entry":"decompile_pass_rate","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"evaluation/run_evaluation_llm4decompile_vllm.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/evaluation/run_evaluation_llm4decompile_vllm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b830c89787dddfa0"}},{"code_sha256_prefix":"c00605edd20c1e97","entry":"evaluate_func","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"evaluation/run_evaluation_llm4decompile_singleGPU.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/evaluation/run_evaluation_llm4decompile_singleGPU.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c00605edd20c1e97"}},{"code_sha256_prefix":"1eb7810bff597f27","entry":"train_tokenize_function","repo":"albertan017/LLM4Decompile","repo_kind":"official","path":"train/finetune.py","file_url":"https://github.com/albertan017/LLM4Decompile/blob/HEAD/train/finetune.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1eb7810bff597f27"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}