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 introduce Tree-like Self-Play (TSP), a framework that reframes secure code generation as a fine-grained sequential decision process. Unlike standard methods that blindly maximize likelihood, TSP constructs a decision tree where the model explores branching trajectories--generating both secure "golden paths" and vulnerable variants. By treating code generation as a self-play game, the model learns to strictly discriminate against its own localized errors. This provides a dense, on-policy learning signal that forces self-correction precisely at the critical decision nodes where vulnerabilities typically emerge. Our experiments demonstrate that TSP fundamentally enhances model reliability. In Python security benchmarks, TSP boosts CodeLlama-7B's pass rate (SPR@1) to 75.8%, significantly outperforming SFT (57.0%) and unstructured self-play baselines. Crucially, TSP induces robust out-of-distribution generalization: the model not only reduces vulnerabilities in unseen categories (CWEs) by 24.5% but also successfully transfers security principles learned from C/C++ to diverse languages, including Python, Go, and JavaScript. This suggests that TSP does not merely memorize patches, but internalizes abstract, language-agnostic security logic.
LLMs can Find Mathematical Reasoning Mistakes by Pedagogical Chain-of-Thought
Shanghai Business School(上海商学院);Learnable.AI Inc.(Learnable.AI公司);Centre for Frontier AI Research, A*STAR(前沿人工智能研究中心,A*STAR);Institute of High-Performance Computing, A*STAR(高性能计算研究所,A*STAR);The Hong Kong Polytechnic University(香港理工大学);Microsoft Research Asia(微软亚洲研究院)
Towards Secure Logging: Characterizing and Benchmarking Logging Code Security Issues with LLMs
York University(约克大学);The Hong Kong University of Science and Technology (Guangzhou)(香港科学与技术大学(广州));University of Waterloo(滑铁卢大学);University of Alberta(阿尔伯塔大学)
Pathway to Secure and Trustworthy ZSM for LLMs: Attacks, Defense, and Opportunities
School of Computing, Dublin City University(都柏林城市大学计算机学院);Institute of Business Administration, University of Sindh(信德大学工商管理学院);Munster Technological University(芒斯特理工大学);Centre Tecnològic de Telecomunicacions de Catalunya (CTTC)(加泰罗尼亚电信技术中心)
Nanyang Technological University(南洋理工大学);AI Singapore(新加坡人工智能研究院);Hangzhou Innovation Institute, Beihang University(北京航空航天大学杭州创新研究院);School of Computer Science and Technology, Anhui University(安徽大学计算机科学与技术学院);Qiyuan laboratory(启元实验室);IHPC, Agency for Science, Technology and Research, Singapore(新加坡科技研究局高性能计算研究院);CoAI Group, Tsinghua University(清华大学CoAI组);Institute of High Performance Computing, Agency for Science, Technology and Research (A*STAR), Singapore(新加坡科技研究局高性能计算研究院)
SecureFalcon: Are We There Yet in Automated Software Vulnerability Detection with LLMs?
Guelma University(盖勒马大学);Technology Innovation Institute(技术创新研究院);Khalifa University of Science and Technology(哈利法科技大学);University of Manchester(曼彻斯特大学)
CodeBC: A More Secure Large Language Model for Smart Contract Code Generation in Blockchain
State Key Laboratory of Complex & Critical Software Environment, Beihang University(复杂与关键软件环境国家重点实验室,北京航空航天大学);School of Artificial Intelligence, Beihang University(人工智能学院,北京航空航天大学);Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing(未来区块链与隐私计算北京先进创新中心);Beijing Academy of Blockchain and Edge Computing, BABEC(区块链与边缘计算北京研究院,BABEC)
The Illusion of Diminishing Returns: Measuring Long Horizon Execution in LLMs
University of Cambridge(剑桥大学);Institute for AI, University of Stuttgart(斯图加特大学人工智能研究所);Max Planck Institute for Intelligent Systems(智能系统马克斯·普朗克研究所);ELLIS Institute Tübingen(图宾根ELLIS研究所);University of Southampton(南安普顿大学);Tübingen AI Center(图宾根人工智能中心)
How Well Do Large Language Models Serve as End-to-End Secure Code Agents for Python?
School of Computer Science and Engineering, Beihang University(北京航空航天大学计算机科学与工程学院);State Key Laboratory of Software Development Environment(软件开发环境国家重点实验室);Zhongguancun Laboratory(中关村实验室);Tsinghua University(清华大学)
LLMs meet Federated Learning for Scalable and Secure IoT Management
School of Computer Science and Technology, Algoma University(计算机科学与技术学院,阿尔戈马大学);School of Electrical Engineering and Computer Science, University of Ottawa(电气工程与计算机科学学院,渥太华大学)