LLM4CodeRE: Generative AI for Code Decompilation Analysis and Reverse Engineering

Hamed Jelodar, Samita Bai, Tochukwu Emmanuel Nwankwo, Parisa Hamedi, Mohammad Meymani, Roozbeh Razavi-Far, Ali A. Ghorbani · 2026

Read LLM4CodeRE: Generative AI for Code Decompilation Analysis and Reverse Engineering by Hamed Jelodar, Samita Bai, Tochukwu Emmanuel Nwankwo, Parisa Hamedi, Mohammad Meymani, Roozbeh Razavi-Far, Ali A. Ghorbani (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-06095.txt.

Introduction

Jelodar and colleagues' 2026 paper presents LLM4CodeRE, a domain-tuned language-model setup for two-way code reverse engineering. It turns assembly into source and source into assembly in one model. Old methods lean on generic pretraining and adapt poorly to malware, a gap the setup targets. Two fine-tuning plans shape the model: a Multi-Adapter approach for task syntax and meaning, and a Seq2Seq Unified approach using task prefixes. Tests show it beats old decompilation tools and general-purpose code models with two-way generalization.

Catalog record

CREATORHamed Jelodar, Samita Bai, Tochukwu Emmanuel Nwankwo, Parisa Hamedi, Mohammad Meymani, Roozbeh Razavi-Far, Ali A. Ghorbani
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE25529
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2604.06095

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

LLM4CodeRE: Generative AI for Code Decompilation Analysis and Reverse Engineering * LLM4CodeRE: GenAI for RS Thanks: Identify applicable funding agency here. If none, delete this. Hamed Jelodar, Samita Bai, Tochukwu Emmanuel Nwankwo, Parisa Hamedi, Mohammad Meymani, Roozbeh Razavi-Far, Ali A. Ghorbani Abstract Code decompilation analysis is a fundamental yet challenging task in malware reverse engineering, particularly due to the pervasive use of sophisticated obfuscation techniques. Although recent large language models (LLMs) have shown promise in translating low-level representations into high-level source code, most existing approaches rely on generic code pretraining and lack adaptation to malicious software. We propose LLM4CodeRE , a domain-adaptive LLM framework for bidirectional code reverse engineering that supports both assembly-to-source decompilation and source-to-assembly translation within a unified model. To enable effective task adaptation, we introduce two complementary fine-tuning strategies: (i) a Multi-Adapter approach for task-specific syntactic and semantic alignment, and (ii) a Seq2Seq Unified approach using task-conditioned prefixes to enforce end-to-end generation constraints. Experimental results demonstrate that LLM4CodeRE outperforms existing decompilation tools and general-purpose code models, achieving robust bidirectional generalization. I Introduction Reverse engineering of portable executable (PE) files, including both benign software and malware, remains a fundamental challenge in cybersecurity. The rapid evolution of modern malware—characterized by pervasive obfuscation, packing, and polymorphism—has made automated code decompilation a critical yet largely unresolved problem. Reverse engineers must routinely translate low-level representations, such as assembly code or raw binaries, into high-level, human-readable source code in order to understand program semantics, uncover malicious intent, and develop effective defensive signatures. Despite the strong semantic modeling capabilities of transformer-based NLP models, reverse engineering pipelines still rely largely on traditional static and dynamic analysis techniques, which are labor-intensive, brittle under obfuscation, and difficult to scale. Even state-of-the-art decompilers struggle with stripped symbols, flattened control flow, and dynamic API resolution commonly used by malware [ 19 , 20 ] , motivating the need for domain-adaptive learning frameworks that directly model low-level code semantics. Generative AI models, particularly LLMs, have enabled promising advances in program translation and code understanding by treating code as natural language [ 3 , 8 , 21 ] . However, most LLM-based decompilation methods rely on generic code pretraining and treat malware as out-of-distribution, limiting their ability to capture malware-specific obfuscation and anti-analysis patterns and reducing reliability in cybersecurity settings [ 7 ] . In this work, we argue that effective GenAI-based reverse engineering and decompilation require domain-specific representation learning and parameter-efficient task adaptation explicitly tailored to both benign and malicious software. In fact, we introduce LLM4CodeRE, a domain-adaptive LLM framework for bidirectional code reverse engineering that supports both assembly-to-source decompilation and source-to-assembly translation within a unified model. By pretraining the backbone model on large-scale corpora of disassembled malware binaries and decompiled pseudo-code, we expose the model to obfuscation techniques, anti-debugging logic, and malware-specific API usage patterns that are characteristic of malicious programs. Inspired by recent advances in domain-adaptive pretraining for code models [ 11 ] , LLM4CodeRE extends this paradigm to the malware domain and, to the best of our knowledge, is the first framework to explicitly target malicious binaries for LLM-based decompilation. Moreover, we evaluate LLM4CodeRE on bidirectional code transformation tasks, including Assembly-to-Source (Asm→Src) and Source-to-Assembly (Src→Asm), using a unified evaluation protocol that measures three complementary dimensions: (i) semantic similarity, (ii) structural edit similarity, and (iii) re-executability of generated code in a sandboxed environment. Unlike prior work that focuses primarily on static similarity metrics [ 17 , 16 ] , our evaluation explicitly tests whether generated programs can be compiled and executed correctly, which is essential for real-world malware analysis and reverse engineering workflows. Our contributions can be summarized as follows: • To the best of our knowledge, the first malware-aware causal language modeling (CLM) pretraining framework for LLM-based decompilation is introduced, enabling domain-specific representation learning from real-world malicious binaries. • The first bidirectional reverse engineering framework is presented that supports both assembly-to-source decompilation and source-to-assembly translation, using a unified model capable of modeling both benign and malicious code behaviors. • Multi-Adapters(MA) and Seq2Seq(S2S) Unified prefixing are proposed as a hybrid strategy for task-specific adaptation in bidirectional malware code reverse engineering. • A unified evaluation framework is constructed to jointly measure semantic similarity, syntactic fidelity, and re-executability of generated code. • A unified evaluation framework is constructed to jointly measure semantic similarity. The model is available at: https://huggingface.co/JeloH/LLM4CodeRE-S2S-V1 II Related Work II-A Malware Decompilation and Reverse Engineering The analysis and decompilation of malware binaries has long been a central challenge in cybersecurity. Traditional approaches rely on static analysis techniques such as control-flow graph extraction, function call graph reconstruction, and API usage profiling [ 19 , 20 ] . Dynamic analysis frameworks execute suspicious binaries in sandboxed environments to observe runtime behavior and identify malicious patterns. While effective in controlled settings, these methods are often brittle under obfuscation, packing, and anti-analysis techniques, and they require substantial manual effort from expert analysts. As a result, they struggle to scale to the volume and diversity of modern malware [ 7 ] . II-B LLMs for Code Understanding and Generation Recent advances in large language models have substantially improved automated code understanding and generation. Models such as CodeBERT [ 3 ] and Qwen2.5-Coder [ 8 ] perform well on tasks including code summarization, translation, and synthesis, with instruction tuning further enhancing code reasoning [ 21 ] . However, most LLMs are pretrained on benign open-source code and are not explicitly adapted to the statistical and semantic characteristics of malicious software [ 11 ] . II-C LLMs for Decompilation and Low-Level Code Translation Recent work applies LLMs to decompilation and low-level code translation, including LLM4Decompile [ 17 ] , WADEC [ 16 ] , and ASMA-Tune [ 21 ] . While these approaches demonstrate the feasibility of LLM-based decompilation, they rely on generic or task-specific fine-tuning and do not perform domain-adaptive pretraining on malware corpora. II-D Parameter-Efficient Adaptation of LLMs To reduce the cost of fine-tuning large models, parameter-efficient adaptation methods such as adapters [ 5 ] , prefix-tuning [ 13 ] , and Low-Rank Adaptation (LoRA) [ 6 ] have been proposed. These techniques enable task adaptation by introducing lightweight modules or low-rank updates while keeping the backbone parameters frozen. Although widely used in natural language processing and code generation, these methods have not been systematically explored in the context of malware decompilation or evaluated for their impact on both semantic fidelity and executable correctness in low-level code translation tasks. II-E Summary and Positioning In contrast to prior work, this study integrates malware-aware CLM pretraining, LoRA-based parameter-efficient fine-tuning, and a unified comparison of Multi-Adapter and Seq2Seq Unified strategies within a single framework. Unlike existing LLM-based decompilers, the proposed approach explicitly targets malicious software as a first-class training domain and evaluates performance using a comprehensive protocol that includes semantic similarity, structural fidelity, and re-executability. This positioning distinguishes the framework from prior efforts that focus primarily on benign code, static similarity metrics, or single adaptation paradigms. Fig. 1: System pipeline of the proposed LLM4CodeRE framework. Malware binaries are disassembled and normalized into paired assembly and source representations. A backbone LLM is pretrained using a causal language modeling (CLM) objective on malware corpora. Task adaptation is performed using LoRA and task-specific adapters or Seq2Seq Unified prefix

Read the complete text