{"slug": "adversarial-code-obfuscation-for-defending-against-llm-based-analysis", "title": "Adversarial Code Obfuscation for Defending Against LLM-Based Analysis", "summary": "Researchers have developed Acoda, a genetic algorithm-based adversarial code obfuscation framework that defends against LLM-based code analysis by inducing LLMs to refuse or misinterpret code. On seven state-of-the-art LLMs including GPT-4o, DeepSeek, Qwen, Llama, and Gemma, Acoda achieves an attack success rate of up to 70% with strong cross-model transferability and minimal runtime overhead while preserving original code semantics.", "body_md": "# Computer Science > Software Engineering\n\n[Submitted on 10 Jun 2026]\n\n# Title:Acoda: Adversarial Code Obfuscation for Defending against LLM-based Analysis\n\n[View PDF](/pdf/2606.11755)\n\n[HTML (experimental)](https://arxiv.org/html/2606.11755v1)\n\nAbstract:With the widespread adoption of Large Language Models (LLMs) in software engineering (SE) tasks such as code understanding, debugging, and vulnerability detection, their powerful semantic reasoning ability has also introduced new security and privacy risks. LLMs can analyze, reconstruct, or even reverse-engineer source code logic, potentially leading to the leakage of intellectual property. To address this issue, we propose Acoda, a genetic algorithm-based adversarial code obfuscation framework that defends against LLM-based code analysis. Acoda leverages two key mechanisms of LLMs, namely safety alignment and token-based information processing, to design 8 semantics-preserving obfuscation methods. It iteratively optimizes obfuscation strategies through a genetic algorithm to generate adversarial samples that maximize defensive effectiveness. In addition, we propose a quantitative evaluation framework based on LLM responses, which combines an auxiliary LLM and four evaluation metrics to assess how target LLMs analyze obfuscated code comprehensively. Experimental results show that Acoda can effectively induce LLMs to refuse or misinterpret code analysis. On 7 state-of-the-art LLMs, including GPT-4o, DeepSeek, Qwen, Llama, and Gemma, Acoda achieves an attack success rate (ASR) of up to 70%, with strong cross-model transferability and minimal runtime overhead, while ensuring that the semantics of the original code remain unchanged. Overall, this study provides a new perspective for code protection and LLM security defense in the era of LLMs.\n\n### References & Citations\n\nLoading...\n\n# Bibliographic and Citation Tools\n\nBibliographic Explorer\n\n*(*[What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))\nConnected Papers\n\n*(*[What is Connected Papers?](https://www.connectedpapers.com/about))\nLitmaps\n\n*(*[What is Litmaps?](https://www.litmaps.co/))\nscite Smart Citations\n\n*(*[What are Smart Citations?](https://www.scite.ai/))# Code, Data and Media Associated with this Article\n\nalphaXiv\n\n*(*[What is alphaXiv?](https://alphaxiv.org/))\nCatalyzeX Code Finder for Papers\n\n*(*[What is CatalyzeX?](https://www.catalyzex.com))\nDagsHub\n\n*(*[What is DagsHub?](https://dagshub.com/))\nGotit.pub\n\n*(*[What is GotitPub?](http://gotit.pub/faq))\nHugging Face\n\n*(*[What is Huggingface?](https://huggingface.co/huggingface))\nScienceCast\n\n*(*[What is ScienceCast?](https://sciencecast.org/welcome))# Demos\n\n# Recommenders and Search Tools\n\nInfluence Flower\n\n*(*[What are Influence Flowers?](https://influencemap.cmlab.dev/))\nCORE Recommender\n\n*(*[What is CORE?](https://core.ac.uk/services/recommender))# arXivLabs: experimental projects with community collaborators\n\narXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.\n\nBoth individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.\n\nHave an idea for a project that will add value for arXiv's community? [ Learn more about arXivLabs](https://info.arxiv.org/labs/index.html).", "url": "https://wpnews.pro/news/adversarial-code-obfuscation-for-defending-against-llm-based-analysis", "canonical_source": "https://arxiv.org/abs/2606.11755", "published_at": "2026-07-30 13:40:54+00:00", "updated_at": "2026-07-30 13:52:26.312634+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-safety", "ai-research"], "entities": ["Acoda", "GPT-4o", "DeepSeek", "Qwen", "Llama", "Gemma"], "alternates": {"html": "https://wpnews.pro/news/adversarial-code-obfuscation-for-defending-against-llm-based-analysis", "markdown": "https://wpnews.pro/news/adversarial-code-obfuscation-for-defending-against-llm-based-analysis.md", "text": "https://wpnews.pro/news/adversarial-code-obfuscation-for-defending-against-llm-based-analysis.txt", "jsonld": "https://wpnews.pro/news/adversarial-code-obfuscation-for-defending-against-llm-based-analysis.jsonld"}}