REVIEW 4 major objections 5 minor 1 cited by
Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation
T0 review · 4 major / 5 minor · reviewed 2026-08-11 · deepseek-v4-flash
Pith's one-line read Large language models, especially GPT-4o-mini and DeepSeekCoder-v2, can transform short assembly snippets into new obfuscated variants, and the paper's MetamorphASM benchmark quantifies this capability across 328,200 samples.
desk verdict The dataset is a genuine contribution, but the LLM evaluation rests on post-hoc text-similarity proxies that don't actually verify the obfuscated code works. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The load-bearing object is the MetamorphASM benchmark with its MAD dataset: 328,200 assembly pairs built by mechanically applying dead code insertion, register substitution, and control flow change to 20-instruction snippets. Evaluation relies on two scores: delta entropy, the character-level entropy difference between original and generated code, and cosine similarity between the two. The good ranges (roughly 10–20% entropy change, similarity above 0.9) were calibrated by three human experts and later spot-checked on 200 samples across eight LLMs.
What would settle it
Take a random subset of pairs that the scores call successful, assemble and run both the original and obfuscated snippets on the same inputs (or check them with an SMT-based equivalence tool); if a nontrivial fraction fail to assemble or produce different outputs, the claim that LLMs generate valid obfuscated assembly is not supported.
Extended reading notes
Core claim
The central claim is that LLMs can generate new obfuscated assembly variants from plain assembly snippets, at scale, using only prompts and a few examples. To establish it, the authors construct MAD from disassembled Windows binaries and open-source x64 code, script three standard obfuscations to create 328,200 original-obfuscated pairs, and then ask LLMs to perform similar transformations. They report that GPT-4o-mini and DeepSeekCoder-v2 produce obfuscated code with delta entropy in a declared 10–20% good range and cosine similarity above 0.9 for dead code and control flow change, while CodeGemma and CodeLLAMA largely fail. The paper concludes that the GPT family has outstanding obfuscation performance even against specialized coder models.
Load-bearing premise
The evaluation assumes that delta entropy and cosine similarity, scores saying the output changed the right amount without looking too different, signal that the obfuscated code still does what the original does, and the acceptable range was set after seeing the model results rather than by an independent correctness test.
Editorial extensions
If this is right
- If the benchmark reflects real malware rewriting, an attacker can outsource obfuscation to an LLM API, so payloads need not carry a large metamorphic engine.
- Static signature-based detection becomes less reliable even for small snippets, since a model can rephrase the same code on demand.
- The released MAD gives defenders a shared corpus to train detectors, test deobfuscation, and measure how well anti-virus engines generalize to LLM-obfuscated code.
- Among the tested models, control flow change produces the largest entropy shifts and register substitution the smallest, so defenses can prioritize the technique that changes code most.
- Specialized coder LLMs are not automatically better at assembly obfuscation; general instruction-tuned models like GPT-4o-mini lead.
Reading between the lines
- Because the paper checks only statistical similarity plus 200 human-reviewed samples, the strongest inference to test next is whether the 'successful' outputs actually assemble and run identically; a symbolic-execution or emulation study on a few thousand pairs would settle that.
- The same benchmark could be flipped into a deobfuscation task: train a model to recover the original snippet from an obfuscated one, using MAD's paired structure as supervision.
- The 20-instruction snippets leave open whether LLM obfuscation scales to full functions or binaries, where control flow and data dependencies are more entangled than in isolated snippets.
- The ranking suggests obfuscation skill tracks instruction-following and assembly exposure more than code-model specialization, which would predict that future general models keep improving this capability without security-specific training.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper introduces MetamorphASM, a benchmark and dataset (MAD) of 328,200 assembly-code samples paired with three obfuscation techniques: dead-code insertion, register substitution, and control-flow change. The authors evaluate eight LLMs (GPT-4o-mini, GPT-3.5, DeepSeekCoder-v2, Codestral, CodeLlama, CodeGemma, Starcoder, LLaMA 3.1) plus a fine-tuned CodeT5 baseline, using character-wise delta entropy and cosine similarity to measure obfuscation quality, with a 200-sample human expert review. They answer the central question in the affirmative, claiming that LLMs, especially GPT-4o-mini, can generate obfuscated assembly code at scale.
Significance. If the main claim were established, the result would be practically significant: it would show that LLMs can act as low-cost, platform-independent metamorphic engines, with direct implications for malware detection and for the design of anti-virus evaluations. The paper's strengths are the scale and release of the dataset, the breadth of models compared, and the inclusion of human review in the evaluation. However, the core evaluation does not verify that generated outputs preserve program behavior, and the success thresholds are calibrated on the very models being ranked; the central affirmative claim is therefore not yet supported at the level the abstract and conclusion assert.
major comments (4)
- [Evaluation] The two evaluation metrics, delta entropy and cosine similarity, are textual similarity measures, not semantic equivalence checks. The Background section defines obfuscation as P'(x) ≡ P(x) for all inputs, but the evaluation never tests this condition. A model that emits syntactically plausible but semantically broken assembly can still score high on delta entropy, and a model that copies the original and appends NOPs can still score high on cosine similarity. The statement that "Functional correctness is an alternative method but it is impossible at this scale" justifies why a full equivalence check is not used, but it does not validate the proxies. The paper needs a subsample-based behavioral validation (e.g., assembling outputs and executing them over randomized inputs, or an SMT-based equivalence check on a sample) to calibrate delta entropy and cosine similarity against actual correctness. Without this, the model rankings and the affirmative claim rest on unproxied string-level scores.
- [Results and Discussion] The acceptable ranges—delta entropy of 10–20% and cosine similarity above 0.9—are defined after human experts examined outputs from these same eight models and selected GPT-4o-mini as the closest to human-performed obfuscation. Using these post hoc thresholds to then rank the same models is circular: the top model partially defines the criterion by which all models are judged. The thresholds should be justified independently (for example, by correlation with a held-out correctness check or by pre-registering the criteria) rather than by fitting to the evaluated outputs.
- [Dataset Metrics] The control-flow-change ground truth in MAD is described as being produced by "randomly rearrang[ing] parts of the code" with no stated analysis of data dependencies or instruction independence. Random reordering of assembly instructions does not generally preserve semantics; a snippet in which an instruction is moved before a dependent instruction will break the original behavior. If part of MAD's control-flow ground truth is semantically invalid, then model performance on that obfuscation technique cannot be interpreted as success or failure. An independent equivalence check or at least a dependence-aware construction procedure is needed for the dataset to support the benchmark's claims.
- [Tables 3-5] Several reported values are difficult to reconcile with the stated thresholds and narrative. For example, in Table 3, GPT-4o-mini's dead-code delta entropy is 26.90% at 0-shot and 21.00% at 1-shot, both outside the stated 10–20% expected range, and Starcoder at 1-shot has delta entropy 45.55% with cosine similarity 0.97, a combination that the thresholds do not cleanly classify. The paper should provide an explicit success-rate table based on the thresholds and discuss these borderline or contradictory cases, especially where a model's human ranking in Table 6 does not match its numerical scores.
minor comments (5)
- [Evaluation] The formula for delta entropy is malformed: it reads ΔH_AB = 1/N ∑_{x∈n}(|H(A) − H(B)|), but the summation variable x is unused and the set n is undefined; the normalization also needs clarification.
- [Models and Evaluation] The abstract mentions "GPT-3.5/4" while the experiments use GPT-3.5 and GPT-4o-mini; please align the model naming throughout the paper.
- [Models and Evaluation] LLaMA 3.1 is labeled as proprietary, but its weights are openly released; the open/proprietary classification should be corrected.
- [Models and Evaluation] The text states that 15,000 samples were selected from "our extensive repository of 300,000 examples," while the dataset is elsewhere described as containing 328,200 samples; these numbers should be reconciled.
- [Human Evaluation] Table 6's criteria are described only as "ranking the eight outputs" for insertion, substitution, and rearrangement. Please state explicitly whether the evaluators were permitted to assemble or execute the code or whether the review was purely visual; this affects how much weight the review can carry for semantic preservation.
Circularity Check
Evaluation thresholds calibrated to GPT-4o-mini and the top-3 LLMs are reused to declare those same models successful, partially self-anchoring the headline claim.
-
fitted input called prediction
[Results and Discussion, 'Interpretation' paragraph]
"The MAD includes both original and obfuscated code, with an expected delta entropy range of around 10%-20%. This range is crucial for defining an effective obfuscation engine; a delta entropy exceeding this range risks altering the code's functionality, while a value below 10 percent indicates minimal obfuscation. The range was defined after three human experts examined the code obfuscation from eight LLMs and picked GPT-4o-mini as the closest to human-performed code obfuscation (see Table 6)."
The 'expected delta entropy range' that distinguishes valid obfuscation from broken or trivial output is defined post hoc after human experts chose GPT-4o-mini as the best model. The paper then uses this range to score GPT-4o-mini's outputs as successful and to criticize other models as below or above the range. Thus the pass/fail criterion is fitted to the model it is later used to validate: an LLM whose outputs have entropy similar to GPT-4o-mini's will satisfy the criterion by construction, while the asserted link between this entropy range and 'altering the code's functionality' is not independently demonstrated.
-
fitted input called prediction
[Results and Discussion, 'Interpretation' paragraph]
"The threshold for cosine similarity was set following human evaluation, where experts reviewed the top three LLMs across three obfuscation techniques. We calculated the cosine similarity between the original and obfuscated code produced by top-3 LLMs, achieving an average of 0.9."
The cosine-similarity threshold of 0.9, described as 'essential' for confirming functional similarity, is computed as the average similarity of the top-3 LLMs selected by the authors' human review. Applying that threshold back to the same top-3 models makes their performance successful partly by definition: their own average defines the pass line. The threshold is not derived from behavioral equivalence or any external ground truth, and the paper itself concedes that 'functional correctness' is not checked at this scale.
full rationale
The paper is largely a dataset-construction and benchmarking effort, and most of its pipeline (disassembly, scripted obfuscations, prompting, and human review) is not circular. However, the central affirmative claim that LLMs 'can generate obfuscated assembly code' rests on two string-level metrics, delta entropy and cosine similarity, whose success bands were set post hoc from the very models being ranked. The quoted interpretation paragraph explicitly says the 10%-20% delta-entropy range was defined after human experts picked GPT-4o-mini, and that the 0.9 cosine threshold was set following review of the top-3 LLMs by averaging their scores. These model-derived thresholds are then applied back to the same models to declare their outputs successful, so part of the headline result reduces to a fitted evaluation criterion. The human review provides independent evidence about perceived quality of insertion, substitution, and rearrangement, but it does not assemble or execute outputs, so it does not verify the paper's own definition of obfuscation, which requires identical behavior for all inputs. No load-bearing self-citation or imported uniqueness theorem is present; the cited delta-entropy work is external. The circularity is real but partial, since the models are also ranked by human experts rather than solely by the fitted thresholds. Score 5 reflects this partial self-anchoring of the evaluation criteria.
Assumptions & free parameters
free parameters (4)
- Delta entropy expected range (10-20%) =
10%-20%
- Cosine similarity threshold (>0.9) =
>0.9
- Dead code insertion count (4-5 instructions) =
4-5
- Control flow JMP count (3-4 instructions) =
3-4
assumptions (4)
- domain assumption Assembly snippets of 20 instructions are representative of real obfuscation targets and are safe to release.
- domain assumption Delta entropy and cosine similarity are valid proxies for semantic equivalence in code obfuscation.
- domain assumption The Python-script obfuscations (dead code, register substitution, control flow) are functionally equivalent to the originals.
- domain assumption Human expert evaluation of 200 samples generalizes to the entire dataset and to all evaluated LLM outputs.
Cite this review
Pith. "Pith review of Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation." pith.science (2026). https://pith.science/paper/RYI6EKX5
@misc{pith2026241216135,
author = {Pith},
title = {Pith review of: Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation},
year = {2026},
howpublished = {\url{https://pith.science/paper/RYI6EKX5}},
note = {Machine review of arXiv:2412.16135}
}
read the original abstract
Malware authors often employ code obfuscations to make their malware harder to detect. Existing tools for generating obfuscated code often require access to the original source code (e.g., C++ or Java), and adding new obfuscations is a non-trivial, labor-intensive process. In this study, we ask the following question: Can Large Language Models (LLMs) potentially generate a new obfuscated assembly code? If so, this poses a risk to anti-virus engines and potentially increases the flexibility of attackers to create new obfuscation patterns. We answer this in the affirmative by developing the MetamorphASM benchmark comprising MetamorphASM Dataset (MAD) along with three code obfuscation techniques: dead code, register substitution, and control flow change. The MetamorphASM systematically evaluates the ability of LLMs to generate and analyze obfuscated code using MAD, which contains 328,200 obfuscated assembly code samples. We release this dataset and analyze the success rate of various LLMs (e.g., GPT-3.5/4, GPT-4o-mini, Starcoder, CodeGemma, CodeLlama, CodeT5, and LLaMA 3.1) in generating obfuscated assembly code. The evaluation was performed using established information-theoretic metrics and manual human review to ensure correctness and provide the foundation for researchers to study and develop remediations to this risk.
Figures
Forward citations
Cited by 1 Pith paper
-
JailbreaksOverTime: Detecting Jailbreak Attacks Under Distribution Shift
Jailbreak detection models drift over time, and a weekly self-trained detector plus an unsupervised behavioral monitor can keep false negatives near 0.3 to 0.4 percent at a 0.1 to 1 percent false positive rate.
Reference graph
Works this paper leans on
-
[5]
In 2018 13th International Conference on Malicious and Unwanted Software (MALWARE), 1–10
Static Malware Detection & Subterfuge: Quantify- ing the Robustness of Machine Learning and Current Anti- Virus. In 2018 13th International Conference on Malicious and Unwanted Software (MALWARE), 1–10. IEEE. Best Pa- per Award. Garba, P.; and Favaro, M
work page 2018
-
[6]
arXiv preprint arXiv:2308.10620
Large language models for software engineering: A systematic literature re- view. arXiv preprint arXiv:2308.10620. Joyce, R. J.; Amlani, D.; Nicholas, C.; and Raff, E. 2023a. MOTIF: A Malware Reference Dataset with Ground Truth Family Labels. Computers & Security, 124: 102921. Joyce, R. J.; Raff, E.; Nicholas, C.; and Holt, J. 2023b. Mal- DICT: Benchmark ...
-
[8]
In 2018 26th European Signal Processing Con- ference (EUSIPCO), 533–537
Adversarial Malware Binaries: Evading Deep Learning for Malware Detection in Executables. In 2018 26th European Signal Processing Con- ference (EUSIPCO), 533–537. Lehmann, D.; Kinder, J.; and Pradel, M
work page 2018
-
[11]
https://mistral.ai/news/codestral/
Codestral: Hello, World! — mistral.ai. https://mistral.ai/news/codestral/. [Accessed 16-08-2024]. Montolio, A. G
work page 2024
-
[12]
https: //furalabs.com/blog/2023/02/12/intro to smt analysis
A gentle introduction to SMT-based program analysis — Fura Labs — furalabs.com. https: //furalabs.com/blog/2023/02/12/intro to smt analysis. [Ac- cessed 20-12-2024]. Muennighoff, N.; Liu, Q.; Zebaze, A.; Zheng, Q.; Hui, B.; Zhuo, T. Y .; Singh, S.; Tang, X.; V on Werra, L.; and Long- pre, S
work page 2023
-
[13]
arXiv preprint arXiv:2308.07124
Octopack: Instruction tuning code large lan- guage models. arXiv preprint arXiv:2308.07124. Na, C.; Choi, Y .; and Lee, J.-H
-
[14]
DIP: Dead code in- sertion based black-box attack for programming language model. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 7777–7791. Nagra, J.; and Collberg, C. 2009.Surreptitious software: ob- fuscation, watermarking, and tamperproofing for software protection. Pearson Education. OpenAI
work page 2009
-
[15]
https://platform.openai.com/docs/ models/gpt-4o
gpt-40. https://platform.openai.com/docs/ models/gpt-4o. [Accessed 16-08-2024]. Patel, T.; Lu, F.; Raff, E.; Nicholas, C.; Matuszek, C.; and Holt, J
work page 2024
Show all 21 references
-
[16]
arXiv preprint arXiv:2308.12950
Code llama: Open foundation models for code. arXiv preprint arXiv:2308.12950. Saul, R.; Liu, C.; Fleischmann, N.; Zak, R. J.; Micinski, K.; Raff, E.; and Holt, J
-
[17]
arXiv preprint arXiv:2406.11409
Codegemma: Open code models based on gemma. arXiv preprint arXiv:2406.11409. Tristan, J.-B.; Govereau, P.; and Morrisett, G
-
[19]
In Machine Learning and Knowledge Discov- ery in Databases: Research Track: European Conference, ECML PKDD 2023, Turin, Italy, September 18–22, 2023, Proceedings, Part I, 270–285
Mar- volo: Programmatic Data Augmentation for Deep Malware Detection. In Machine Learning and Knowledge Discov- ery in Databases: Research Track: European Conference, ECML PKDD 2023, Turin, Italy, September 18–22, 2023, Proceedings, Part I, 270–285. Berlin, Heidelberg: Springe...
2023
-
[20]
Zhu, Q.; Guo, D.; Shao, Z.; Yang, D.; Wang, P.; Xu, R.; Wu, Y .; Li, Y .; Gao, H.; Ma, S.; et al
Revisiting Unnaturalness for Automated Program Repair in the Era of Large Language Models.arXiv preprint arXiv:2404.15236. Zhu, Q.; Guo, D.; Shao, Z.; Yang, D.; Wang, P.; Xu, R.; Wu, Y .; Li, Y .; Gao, H.; Ma, S.; et al
-
[21]
arXiv preprint arXiv:2406.11931
DeepSeek-Coder- V2: Breaking the Barrier of Closed-Source Models in Code Intelligence. arXiv preprint arXiv:2406.11931
-
[2014]
In Proceedings of the 2014 Workshop on Artificial Intelligent and Security Workshop , AISec ’14, 27–36
Poisoning behavioral malware clustering. In Proceedings of the 2014 Workshop on Artificial Intelligent and Security Workshop , AISec ’14, 27–36. New York, NY , USA: Association for Computing Machinery. ISBN 9781450331531. Biggio, B.; and Roli, F
2014
-
[2015]
In 2015 ieee/acm 1st international workshop on software pro- tection, 3–9
Obfuscator-LLVM–software protection for the masses. In 2015 ieee/acm 1st international workshop on software pro- tection, 3–9. IEEE. Kang, S.; Lee, S.; Kim, Y .; Mok, S.-K.; and Cho, E.-S
2015
-
[2018]
In Proceed- ings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, CCS ’18, 2154–2156
Wild Patterns: Ten Years Af- ter the Rise of Adversarial Machine Learning. In Proceed- ings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, CCS ’18, 2154–2156. New York, NY , USA: Association for Computing Machinery. ISBN 9781450356930. Demetrio, L.;...
2018
-
[2019]
In 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), 37–49
Automatic Equivalence Checking for Assembly Implementations of Cryptography Libraries. In 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), 37–49. Linn, C.; and Debray, S
2019
-
[2020]
In 2020 International Conference on Emerging Smart Computing and Informatics (ESCI), 52–59
Mechanisms for source code obfuscation in C: novel techniques and implementa- tion. In 2020 International Conference on Emerging Smart Computing and Informatics (ESCI), 52–59. IEEE. Balakrishnan, A.; and Schulze, C
2020
-
[2021]
arXiv preprint arXiv:2109.00859
Codet5: Identifier-aware unified pre-trained encoder-decoder mod- els for code understanding and generation. arXiv preprint arXiv:2109.00859. Wong, M.; Raff, E.; Holt, J.; and Netravali, R
-
[2023]
arXiv preprint arXiv:2303.08774
Gpt-4 technical report. arXiv preprint arXiv:2303.08774. Ahire, P.; and Abraham, J
-
[2024]
https://ai.meta.com/blog/ meta-llama-3-1/
Introducing Llama 3.1: Our most capable models to date — ai.meta.com. https://ai.meta.com/blog/ meta-llama-3-1/. Accessed: 2024-08-16. MistralAI
2024
Reviewed August 11, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.