Skip to content
Search
paperJune 2026Unreviewed

Learn from Your Mistakes: Tree-like Self-Play for Secure Code LLMs

Wenqi Chen, Ziyan Zhang, Bing Wang, Lin Liu, Hengheng Zhang, Zhengsu Chen

Abstract

While Large Language Models (LLMs) excel in code generation, they remain prone to replicating subtle yet critical vulnerabilities endemic to their training data. Current alignment techniques, such as Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL), typically apply coarse-grained optimization at the sequence level. This approach often fails to address the localized nature of security flaws, where a single incorrect token choice can compromise an entire program. To bridge this gap, we

Categories

Cite

@misc{chen2026learn,
  title = {{Learn from Your Mistakes: Tree-like Self-Play for Secure Code LLMs}},
  author = {Wenqi Chen and Ziyan Zhang and Bing Wang and Lin Liu and Hengheng Zhang and Zhengsu Chen},
  year = {2026},
  month = jun,
  eprint = {2606.03489},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.03489}
}