跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 软件工程

arXiv:2603.01494 (cs)
[提交于 2026年3月2日]

标题:Inference-Time Safety For Code LLMs Via Retrieval-Augmented Revision

作者:Manisha Mukherjee, Vincent J. Hellendoorn
查看论文《Inference-Time Safety For Code LLMs Via Retrieval-Augmented Revision》的 PDF
查看中文 PDF 查看原文 PDF EasyResearch 阅读
摘要:Large Language Models (LLMs) are increasingly deployed for code generation in high-stakes software development, yet their limited transparency in security reasoning and brittleness to evolving vulnerability patterns raise critical trustworthiness concerns. Models trained on static datasets cannot readily adapt to newly discovered vulnerabilities or changing security standards without retraining, leading to the repeated generation of unsafe code. We present a principled approach to trustworthy code generation by design that operates as an inference-time safety mechanism. Our approach employs retrieval-augmented generation to surface relevant security risks in generated code and retrieve related security discussions from a curated Stack Overflow knowledge base, which are then used to guide an LLM during code revision. This design emphasizes three aspects relevant to trustworthiness: (1) interpretability, through transparent safety interventions grounded in expert community explanations; (2) robustness, by allowing adaptation to evolving security practices without model retraining; and (3) safety alignment, through real-time intervention before unsafe code reaches deployment. Across real-world and benchmark datasets, our approach improves the security of LLM-generated code compared to prompting alone, while introducing no new vulnerabilities as measured by static analysis. These results suggest that principled, retrieval-augmented inference-time interventions can serve as a complementary mechanism for improving the safety of LLM-based code generation, and highlight the ongoing value of community knowledge in supporting trustworthy AI deployment.
评论: Accepted at the ICLR 2026 Workshop on Principled Design for Trustworthy AI: Interpretability, Robustness, and Safety Across Modalities
主题: 软件工程 (cs.SE); 人工智能 (cs.AI); 密码学与安全 (cs.CR); 机器学习 (cs.LG)
引用方式: arXiv:2603.01494 [cs.SE]
  (或者 arXiv:2603.01494v1 [cs.SE] 对于此版本)
  https://doi.org/10.48550/arXiv.2603.01494

提交历史

来自:Manisha Mukherjee
[v1] 2026年3月2日 星期一 06:06:34 UTC
全文链接:

访问论文:

  • 查看中文 PDF
  • 查看原文 PDF
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.SE
< 上一篇   |   下一篇 >
最新 | 近期 | 2026-03
切换浏览方式为:
cs
cs.AI
cs.CR
cs.LG

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站