FidelityGPT: Correcting Decompilation Distortions with Retrieval Augmented Generation
On the map: Retrieval-augmented generation → RAG for code
Abstract (arXiv)
Decompilation converts machine code into human-readable form, enabling analysis and debugging without source code. However, fidelity issues often degrade the readability and semantic accuracy of decompiled output. Existing methods, such as variable renaming or structural simplification, provide partial improvements but lack robust detection and correction, particularly for complex closed-source binaries. We present FidelityGPT, a framework that enhances decompiled code accuracy and readability by systematically detecting and correcting semantic distortions. FidelityGPT introduces distortion-aware prompt templates tailored to closed-source settings and integrates Retrieval-Augmented Generation (RAG) with a dynamic semantic intensity algorithm to locate distorted lines and retrieve semantically similar code from a database. A variable dependency algorithm further mitigates long-context limitations by analyzing redundant variables and integrating their dependencies into the prompt context. Evaluated on 620 function pairs from a binary similarity benchmark, FidelityGPT achieved an average detection accuracy of 89% and a precision of 83%. Compared to the state-of-the-art DeGPT (Fix Rate 83%, Corrected Fix Rate 37%), FidelityGPT attained 94% FR and 64% CFR, demonstrating significant gains in accuracy and readability. These results highlight its potential to advance LLM-based decompilation and reverse engineering.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 19 of its 53 references that are in the map. First posted on arXiv 22 Oct 2025.
Builds on
19 of 53 references.
Closest ancestors · 1
Same direction, newest first
Other references · 18
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
- 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 450
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2021Do Prompt-Based Models Really Understand the Meaning of their Prompts?cited by 324
- 2024The Power of Noise: Redefining Retrieval for RAG Systemscited by 275
- 2023RAGTruth: A Hallucination Corpus for Developing Trustworthy Retrieval-Augmented Language Modelscited by 272
- 2024The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG)cited by 159
- 2024DRAGIN: Dynamic Retrieval Augmented Generation based on the Information Needs of Large Language Modelscited by 63
- 2024HITS: High-coverage LLM-based Unit Test Generation via Method Slicingcited by 37
- 2023A study on Prompt Design, Advantages and Limitations of ChatGPT for Deep Learning Program Repaircited by 26
- 2019An Observational Investigation of Reverse Engineers' Processescited by 20
- 2024LongHeads: Multi-Head Attention is Secretly a Long Context Processorcited by 16
6 more
- 2024DomainRAG: A Chinese Benchmark for Evaluating Domain-specific Retrieval-Augmented Generationcited by 16
- 2023CP-BCS: Binary Code Summarization Guided by Control Flow Graph and Pseudo Codecited by 11
- 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysiscited by 8
- 2021Variable Name Recovery in Decompiled Binary Code using Constrained Masked Language Modelingcited by 7
- 2022Automatically Mitigating Vulnerabilities in Binary Programs via Partially Recompilable Decompilationcited by 4
- 2024VulCatch: Enhancing Binary Vulnerability Detection through CodeT5 Decompilation and KAN Advanced Feature Extractioncited by 2
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2024Self-Constructed Context Decompilation with Fined-grained Alignment Enhancement
- 2026Fidelity Probes for Specification--Code Alignment
- 2025Practical Code RAG at Scale: Task-Aware Retrieval Design Choices under Compute Budgets
- 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair
- 2025Correctness Forensics for Batch Speculative Decoding: Diagnosing the Ragged Tensor Problem
- 2026Beyond "What to Retrieve": Uncertainty in Retrieval-Augmented Code Generation
- 2025ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generation
- 2026Practical Source Code Recovery from Binary Functions Using Anchor-Based Retrieval and LLM Reasoning