← Lab /AI/ML

Tiny language models can generate functional malware code with up to 100% success on benchmark tasks

Small language models are capable of producing executable post-exploitation code at near-perfect rates

AI/ML arXiv 16 Oct 2026 Measurement Prototype evidence Threat model

Published as “From Billion-Scale to Million-Scale Language Models: Operational Capabilities for Embedded Post-Exploitation”

Why it matters

Embedding uSLMs in malware could enable offline, air-gapped code generation, but low and inconsistent success rates limit immediate operational threat.

Summary

Ultra-small language models (uSLMs) can generate functional post-exploitation code, achieving up to 81.2% Pass@5 on Python directory-enumeration tasks, but their success drops dramatically under constrained prompting and on Lua tasks. Performance varies by model size, with the 0.5 B-parameter Qwen2.5-Coder reaching the highest Pass@5, while many models fail to produce any Lua code. Statistical analysis shows most differences are not significant, and adding implementation constraints reduces success rates to as low as 15%. The evidence is based on systematic experiments across multiple interaction paradigms and a custom sandbox evaluation framework.

What they found 1

  1. The 0.5 B-parameter Qwen2.5-Coder achieves the highest Pass@5 on Python directory enumeration.

    “Qwen2.5-Coder 0.5B achieves the highest average Pass@5 score (81.2%), followed by Qwen2.5-Coder 1.5B (72.2%) and SmolLM2 360M (53.9%).”

Caveats 4

  • Adding implementation constraints reduces Qwen2.5-Coder 0.5B Pass@5 from 81.2% to 15%: "Qwen2.5-Coder 0.5B drops from 81.2%±17.6 to 15%±24.2".
  • Many models achieve zero Pass@1 on Lua and backdoor tasks, indicating unreliable code generation in low-resource languages.
  • pairwise comparisons did not reveal statistically significant differences among Qwen2.5-Coder 0.5B, Qwen2.5-Coder 1.5B, and SmolLM2 360M (all p > 0.84).
  • the overall Kruskal-Wallis test remains non-significant

What’s new here 4

  • First systematic empirical assessment of ultra-small models embedded directly in malware.
  • Cross-language comparison of Python (high-resource) versus Lua (low-resource) code generation.
  • Evaluation of constrained task formulations and their impact on generation success.
  • Analysis of feedback-driven self-correction (closed-loop) capabilities in the malware context.

Threat model stated by the source

Adversarypost-compromise attacker seeking persistence and environment exploration
Capabilityability to execute embedded SLM on victim host without network access
AssumesInitial compromise has already occurred; Victim environment is isolated (no Internet); Model size < 1.5 B parameters to avoid detection