SecCoder: Towards Generalizable and Robust Secure Code Generation
Not on the map. Why?
Abstract (arXiv)
After large models (LMs) have gained widespread acceptance in code-related tasks, their superior generative capacity has greatly promoted the application of the code LM. Nevertheless, the security of the generated code has raised attention to its potential damage. Existing secure code generation methods have limited generalizability to unseen test cases and poor robustness against the attacked model, leading to safety failures in code generation. In this paper, we propose a generalizable and robust secure code generation method SecCoder by using in-context learning (ICL) and the safe demonstration. The dense retriever is also used to select the most helpful demonstration to maximize the improvement of the generated code's security. Experimental results show the superior generalizability of the proposed model SecCoder compared to the current secure code generation method, achieving a significant security improvement of an average of 7.20% on unseen test cases. The results also show the better robustness of SecCoder compared to the current attacked code LM, achieving a significant security improvement of an average of 7.74%. Our analysis indicates that SecCoder enhances the security of LMs in generating code, and it is more generalizable and robust.
Key facts. Cited by 14 papers in the map (data through 14 Oct 2026). First posted on arXiv 2 Oct 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 8; 2026: 6.
14 papers.
Sort:
By area:
- 2025PurpCode: Reasoning for Safer Code Generationcited by 18
- 2025Training Language Models to Generate Quality Code with Program Analysis Feedbackcited by 12
- 2025Rethinking the Evaluation of Secure Code Generationcited by 10
- 2025Teaching an Old LLM Secure Coding: Localized Preference Optimization on Distilled Preferencescited by 10
- 2025RESCUE: Retrieval Augmented Secure Code Generationcited by 7
- 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrievalcited by 6
- 2025The Future of Generative AI in Software Engineering: A Vision from Industry and Academia in the European GENIUS Projectcited by 4
- 2026How Secure is Secure Code Generation? Adversarial Prompts Put LLM Defenses to the Testcited by 4
- 2026DeepGuard: Secure Code Generation via Multi-Layer Semantic Aggregationcited by 2
- 2026SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalizationcited by 1
- 2025Position: Intelligent Coding Systems Should Write Programs with Justificationscited by 0
- 2026Security-by-Design for LLM-Based Code Generation: Leveraging Internal Representations for Concept-Driven Steering Mechanismscited by 0
- 2026MACGen: Toward Functionally Correct and Secure Code Generation via Multi-Agent Collaboration26 Aug 2026
- 2026SoK: AI Secure Code Generation: Progress, Pitfalls, and Paths Forward23 Jun 2026
- 2026DeepGuard: Secure Code Generation via Multi-Layer Semantic Aggregation10 Apr 2026
- 2026SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalization4 Apr 2026
- 2026Security-by-Design for LLM-Based Code Generation: Leveraging Internal Representations for Concept-Driven Steering Mechanisms11 Mar 2026
- 2026How Secure is Secure Code Generation? Adversarial Prompts Put LLM Defenses to the Test11 Jan 2026
- 2025The Future of Generative AI in Software Engineering: A Vision from Industry and Academia in the European GENIUS Project3 Nov 2025
- 2025RESCUE: Retrieval Augmented Secure Code Generation21 Oct 2025
- 2025Position: Intelligent Coding Systems Should Write Programs with Justifications8 Aug 2025
- 2025PurpCode: Reasoning for Safer Code Generation25 Jul 2025
- 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrieval31 May 2025
- 2025Teaching an Old LLM Secure Coding: Localized Preference Optimization on Distilled Preferences31 May 2025
2 more
- 2025RESCUE: Retrieval Augmented Secure Code Generationcited by 7
- 2025RESCUE: Retrieval Augmented Secure Code Generation21 Oct 2025
- 2025Training Language Models to Generate Quality Code with Program Analysis Feedbackcited by 12
- 2025Rethinking the Evaluation of Secure Code Generationcited by 10
- 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrievalcited by 6
- 2025The Future of Generative AI in Software Engineering: A Vision from Industry and Academia in the European GENIUS Projectcited by 4
- 2026DeepGuard: Secure Code Generation via Multi-Layer Semantic Aggregationcited by 2
- 2025Position: Intelligent Coding Systems Should Write Programs with Justificationscited by 0
- 2026Security-by-Design for LLM-Based Code Generation: Leveraging Internal Representations for Concept-Driven Steering Mechanismscited by 0
- 2026DeepGuard: Secure Code Generation via Multi-Layer Semantic Aggregation10 Apr 2026
- 2026Security-by-Design for LLM-Based Code Generation: Leveraging Internal Representations for Concept-Driven Steering Mechanisms11 Mar 2026
- 2025The Future of Generative AI in Software Engineering: A Vision from Industry and Academia in the European GENIUS Project3 Nov 2025
- 2025Position: Intelligent Coding Systems Should Write Programs with Justifications8 Aug 2025
- 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrieval31 May 2025
- 2025Training Language Models to Generate Quality Code with Program Analysis Feedback28 May 2025
- 2025Rethinking the Evaluation of Secure Code Generation18 Mar 2025