Abstract
Current alignment techniques in Large Language Models (LLMs) effectively block direct requests for harmful content but suffer from "compositional blindness." This paper introduces the Malware Generation Compiler (MGC), a framework that exploits this vulnerability by decomposing malicious intent into benign sub-tasks. By leveraging a "weak-strong" model synergy and a domain-specific intermediate representation (MDIR), MGC generates functional malware with a correctness rate 360% higher than existing jailbreaking methods, while maintaining a detection rate below 0.6% against history-aware defenses.
Introduction
Large Language Models (LLMs) like GPT-4 and Claude incorporate safety filters to prevent the generation of harmful content, such as ransomware. However, these safeguards are typically prompt-centric, evaluating individual inputs in isolation. This approach fails to account for the modular nature of software, where a malicious program is composed of multiple benign operations.
The authors identify this as compositional blindness: the inability of aligned models to detect a harmful overarching goal when it is presented as a series of seemingly innocent components.
Methodology: The Malware Generation Compiler (MGC)
MGC operates similarly to a traditional software compiler, utilizing LLMs for different stages of the process.
The Framework Architecture
- Frontend (The Architect): A smaller, "weakly aligned" model (e.g., Mistral-7B) receives the high-level malicious request. It acts as a planner, decomposing the intent into a structured workflow of benign sub-tasks.
- MDIR (Malware Description Intermediate Representation): This domain-specific language serves as the "glue." It defines logic and dependencies between sub-tasks using sanitized terminology to avoid triggering safety filters.
- Backend (The Coder): A "strongly aligned" model (e.g., Claude 3.5 Sonnet) implements the MDIR components. Because each function appears benign (e.g., a standard encryption routine), the model provides high-quality code without refusal.
Iterative Feedback Loop
MGC includes a feedback mechanism. If a strong model refuses a component, the frontend automatically renames variables or further decomposes the task into even more granular, innocuous pieces until the safety filters are bypassed.
Evaluation and Results
The framework was tested against three datasets: Malware Source Code (MSC), MITRE ATT&CK prompts, and real-world attacker prompts (Malla).
Performance Metrics
- Functional Correctness: MGC outperformed state-of-the-art jailbreaking techniques like DeepInception by 365.79% in terms of code correctness.
- Comparison to Dark LLMs: It surpassed specialized underground services (e.g., WolfGPT or DarkGPT) by 78.07%.
- Malware Enhancement: MGC successfully replicated 16 real-world malware samples and, in several cases, enhanced them with advanced features like anti-sandbox detection.
Defense Resistance
Testing against "Adaptive Defenses" that monitor prompt history showed that MGC's intent remains masked. Even with a 100-request context window, the detection rate remained below 0.6%.
Discussion and Conclusion
The success of MGC highlights a critical flaw in current AI safety: Context Stripping. By the time a strong model receives a technical request, the global malicious context has been removed.
Limitations
The system still requires a small amount of manual "glue code" (typically under 25 lines) for final integration. Additionally, very low-level tasks like custom packet crafting remain challenging for current LLMs to implement perfectly via MDIR.
Future Directions
The authors argue that future defenses must evolve from prompt-level filtering to composition-aware alignment. This requires monitoring systems that can analyze the logical flow and emergent intent across a series of related code snippets rather than evaluating them in isolation.
Summary updated