Abstract
NeuroDeX is a novel framework designed to decompile Deep Neural Network (DNN) executables back into high-level, reusable models such as PyTorch. By integrating the semantic reasoning capabilities of Large Language Models (LLMs) with dynamic analysis, NeuroDeX addresses critical challenges in modern AI deployment, including complex operator fusion, cross-architecture support (x86 and ARM), and the recovery of quantized models. Our evaluation across 96 executables demonstrates high operator recognition accuracy (up to 99.22%) and significant efficiency gains over existing state-of-the-art tools, highlighting substantial intellectual property risks in edge AI.
Introduction
As deep learning models migrate to the "edge" (mobile and IoT devices), they are typically compiled into binary executables using tools like TVM or GLOW. This transformation converts readable model code into machine instructions, often perceived by developers as a layer of security for intellectual property. However, existing decompilers suffer from three major blind spots: optimization sensitivity (e.g., operator fusion), architectural rigidity (limited hardware support), and the "quantization gap," where 8-bit integer models cannot be easily mapped back to functional high-level code. NeuroDeX bridges these gaps by focusing on the mathematical intent (semantics) of the code rather than its optimized syntax.
Methods
NeuroDeX introduces a multi-stage pipeline for operator recovery and model reconstruction, leveraging both static and dynamic analysis techniques.
Operator Recovery and Recognition
- Operator Function Extraction: The framework utilizes the Ghidra decompiler to extract disassembled code and parameter dimensions from the binary.
- LLM-Powered Recognition: Instead of rigid pattern matching, NeuroDeX prompts an LLM (e.g., GPT-4o) to analyze the semantics of the decompiled code. This allows the system to identify mathematical operations even when the code is mangled by compiler optimizations.
- Dynamic Attribute Recovery: To determine specific parameters like stride or padding, NeuroDeX executes the binary with trivial inputs. It uses "constraint enumeration" to monitor memory and find parameters that satisfy the observed outputs.
Handling Quantization
For quantized models, NeuroDeX employs a "scale train" approach. Rather than attempting a direct weight dump, it freezes the recovered integer weights and trains only the scaling factors (multiples) using a small dataset. This restores the model's floating-point functionality without requiring the original training data.
Experimental Evaluation
The authors evaluated NeuroDeX using 96 DNN executables across 12 popular architectures (including ShuffleNet, MobileNetv2, and ResNet) compiled with various versions of TVM and GLOW. Testing was conducted on both x86 and AArch64 (ARM) platforms.
Key Results
- High Accuracy: NeuroDeX achieved operator type recognition accuracy of 99.22% for TVM and 97.62% for GLOW. Attribute recovery (stride, padding) was nearly 100% accurate.
- Quantization Success: Recovered quantized models achieved an average top-1 accuracy of 72% and top-5 accuracy of 86%, proving they are functionally similar to the originals.
- Efficiency: By avoiding resource-intensive symbolic execution, NeuroDeX outperformed previous state-of-the-art tools (like BTD) by 2.7x to 12.7x in analysis time.
Discussion and Future Work
NeuroDeX demonstrates that while compilers change how code looks, they cannot change what it does. LLMs act as effective translators between machine logic and mathematical operators. However, limitations remain: the current study focuses on Computer Vision (CV) models, and more complex Natural Language Processing (NLP) architectures like Transformers present additional reconstruction challenges. Furthermore, while standard compilers do not currently use heavy obfuscation, future developments in binary protection could hinder LLM-based semantic recognition. Future work will explore these more complex model types and potential countermeasures against decompilation.
Summary updated