English
Related papers

Related papers: PurpCode: Reasoning for Safer Code Generation

200 papers

While code large language models have demonstrated remarkable progress in code generation, the generated code often exhibits poor runtime efficiency, limiting its practical application in performance-sensitive scenarios. To address this…

Software Engineering · Computer Science 2025-08-29 Yunlong Feng , Yang Xu , Xiao Xu , Binyuan Hui , Junyang Lin

AI-generated content has evolved from monolithic models to modular workflows, particularly on platforms like ComfyUI, enabling customization in creative pipelines. However, crafting effective workflows requires great expertise to…

Computation and Language · Computer Science 2025-06-12 Zhenran Xu , Yiyu Wang , Xue Yang , Longyue Wang , Weihua Luo , Kaifu Zhang , Baotian Hu , Min Zhang

Code reasoning refers to the task of predicting the output of a program given its source code and specific inputs. It can measure the reasoning capability of large language models (LLMs) and also benefit downstream tasks such as code…

Machine Learning · Computer Science 2026-05-19 Zhanyue Qin , Jia Feng , Yibo Lyu , Yun Peng , Dianbo Sui , Cuiyun Gao , Qing Liao

Large reasoning models (LRMs) "think" by generating structured chain-of-thought (CoT) before producing a final answer, yet they still lack the ability to reason critically about safety alignment and are easily biased when a flawed premise…

Code generation aims to automatically generate code snippets of specific programming language according to natural language descriptions. The continuous advancements in deep learning, particularly pre-trained models, have empowered the code…

Software Engineering · Computer Science 2025-01-24 Zezhou Yang , Sirong Chen , Cuiyun Gao , Zhenhao Li , Xing Hu , Kui Liu , Xin Xia

Pre-trained Generative Language models (e.g. PLBART, CodeT5, SPT-Code) for source code yielded strong results on several tasks in the past few years, including code generation and translation. These models have adopted varying pre-training…

Programming Languages · Computer Science 2022-07-07 Saikat Chakraborty , Toufique Ahmed , Yangruibo Ding , Premkumar Devanbu , Baishakhi Ray

The pre-training paradigm plays a key role in the success of Large Language Models (LLMs), which have been recognized as one of the most significant advancements of AI recently. Building on these breakthroughs, code LLMs with advanced…

Software Engineering · Computer Science 2025-04-22 Yuheng Huang , Lei Ma , Keizaburo Nishikino , Takumi Akazaki

Recent advances in diffusion models have notably enhanced text-to-image (T2I) generation quality, but they also raise the risk of generating unsafe content. Traditional safety methods like text blacklisting or harmful content classification…

Computer Vision and Pattern Recognition · Computer Science 2025-12-30 Zongsheng Cao , Yangfan He , Anran Liu , Jun Xie , Feng Chen , Zepeng Wang

Code generation models have shown significant potential for programming tasks. However, existing training methods like supervised fine-tuning face key limitations: they do not effectively teach models to prioritize correct over incorrect…

Software Engineering · Computer Science 2025-06-04 Kechi Zhang , Ge Li , Yihong Dong , Jingjing Xu , Jun Zhang , Jing Su , Yongfei Liu , Zhi Jin

Recent progress in ML and LLMs has improved vulnerability detection, and recent datasets have reduced label noise and unrelated code changes. However, most existing approaches still operate at the function level, where models are asked to…

Cryptography and Security · Computer Science 2026-02-09 Yikun Li , Ting Zhang , Jieke Shi , Chengran Yang , Junda He , Xin Zhou , Jinfeng Jiang , Huihui Huang , Wen Bin Leow , Yide Yin , Eng Lieh Ouh , Lwin Khin Shar , David Lo

Effective code generation requires both model capability and a problem representation that carefully structures how models reason and plan. Existing approaches augment reasoning steps or inject specific structure into how models think, but…

Computation and Language · Computer Science 2026-04-17 Geonhui Jang , Dongyoon Han , YoungJoon Yoo

Recent advancements in natural language processing \cite{gpt2} \cite{BERT} have led to near-human performance in multiple natural language tasks. In this paper, we seek to understand whether similar techniques can be applied to a highly…

Computation and Language · Computer Science 2021-02-23 Luis Perez , Lizi Ottens , Sudharshan Viswanathan

We argue that when it comes to producing secure code with AI, the prevailing "fighting fire with fire" approach -- using probabilistic AI-based checkers or attackers to secure probabilistically generated code -- fails to address the long…

Cryptography and Security · Computer Science 2026-02-10 Benjamin Livshits

Large Reasoning Models (LRMs) have significantly improved problem-solving through explicit Chain-of-Thought (CoT) reasoning. However, this capability creates a Safety-Helpfulness Paradox: the reasoning process itself can be misused to…

Artificial Intelligence · Computer Science 2026-01-27 Xin Gao , Shaohan Yu , Zerui Chen , Yueming Lyu , Weichen Yu , Guanghao Li , Jiyao Liu , Jianxiong Gao , Jian Liang , Ziwei Liu , Chenyang Si

We witness an increasing usage of AI-assistants even for routine (classroom) programming tasks. However, the code generated on basis of a so called "prompt" by the programmer does not always meet accepted security standards. On the one…

Software Engineering · Computer Science 2024-08-15 Stefan Goetz , Andreas Schaad

Large language models write production code, and yet they routinely introduce well-known vulnerabilities. We show that this is not a knowledge deficit: the same models that generate insecure code, correctly identify and explain the…

Cryptography and Security · Computer Science 2026-04-21 Gustavo Sandoval , Brendan Dolan-Gavitt , Siddharth Garg

Building robust and general reasoning ability is a central goal in the development of large language models (LLMs). Recent efforts increasingly turn to code as a rich training source, given its inherent logical structure and diverse…

Machine Learning · Computer Science 2025-10-29 Nuo Chen , Zehua Li , Keqin Bao , Junyang Lin , Dayiheng Liu

Few-shot learning with large-scale, pre-trained language models is a powerful way to answer questions about code, e.g., how to complete a given code example, or even generate code snippets from scratch. The success of these models raises…

Software Engineering · Computer Science 2022-06-14 Patrick Bareiß , Beatriz Souza , Marcelo d'Amorim , Michael Pradel

Prompting techniques such as chain-of-thought have established themselves as a popular vehicle for improving the outputs of large language models (LLMs). For code generation, however, their exact mechanics and efficacy are under-explored.…

Computation and Language · Computer Science 2025-04-09 Kunhao Zheng , Juliette Decugis , Jonas Gehring , Taco Cohen , Benjamin Negrevergne , Gabriel Synnaeve

Machine unlearning algorithms are increasingly important as legal concerns arise around the provenance of training data, but verifying the success of unlearning is often difficult. Provable guarantees for unlearning are often limited to…

Machine Learning · Computer Science 2025-04-22 Stanley Wei , Sadhika Malladi , Sanjeev Arora , Amartya Sanyal