paper-with-me

Papers

RESCUE: Retrieval Augmented Secure Code Generation

2025-10-21 · Jiahao Shi, Tianyi Zhang arxiv

Despite recent advances, Large Language Models (LLMs) still generate vulnerable code. Retrieval-Augmented Generation (RAG) has the potential to enhance LLMs for secure code generation by incorporating external security knowledge. However, the conventional RAG design struggles with the noise of raw security-related documents, and existing retrieval methods overlook the significant security semantics implicitly embedded in task descriptions. To address these issues, we propose \textsc{Rescue}, a new RAG framework for secure code generation with two key innovations. First, we propose a hybrid knowledge base construction method that combines LLM-assisted cluster-then-summarize distillation with program slicing, producing both high-level security guidelines and concise, security-focused code examples. Second, we design a hierarchical multi-faceted retrieval that traverses the constructed knowledge base from top to bottom and integrates multiple security-critical facts at each hierarchical level, ensuring comprehensive and accurate retrieval. We evaluated \textsc{Rescue} on four benchmarks and compared it with five state-of-the-art secure code generation methods on six LLMs. The results demonstrate that \textsc{Rescue} improves the SecurePass@1 metric by an average of 4.8 points, establishing a new state-of-the-art performance for security. Furthermore, we performed in-depth analysis and ablation studies to rigorously validate the effectiveness of individual components in \textsc{Rescue}. Our code is available at https://github.com/steven1518/RESCUE.

📄 PDF Abstract BibTeX arXiv:2510.18204

Code (0)

등록된 구현이 없습니다.

Tasks

Code Generation

Similar Papers 제목 키워드 기반

TFHE-Coder: Evaluating LLM-agentic Fully Homomorphic Encryption Code Generation

2025-03-15 · Mayank Kumar, Jiaqi Xue, Mengxin Zheng, Qian Lou

Fully Homomorphic Encryption over the torus (TFHE) enables computation on encrypted data without decryption, making it a cornerstone of secure and confidential computing. Despite its potential in privacy preserving machi…

Code GenerationPrivacy PreservingRAGRetrieval-augmented Generation

Improving LLM-Assisted Secure Code Generation through Retrieval-Augmented-Generation and Multi-Tool Feedback

2026-01-01 · Vidyut Sriram, Sawan Pandita, Achintya Lakshmanan, Aneesh Shamraj 외 arxiv

Large Language Models (LLMs) can generate code but often introduce security vulnerabilities, logical inconsistencies, and compilation errors. Prior work demonstrates that LLMs benefit substantially from structured feedba…

Semantic RetrievalCode Generation

ScoreGate: Adaptive Chunk Selection for Retrieval-Augmented Generation via Dual-Score Statistical Fusion

2026-06-12 · Karamvir Singh, Arvind Jain arxiv

Fixed-cardinality retrieval injects a constant top-K chunks into the generator regardless of query complexity, causing over-retrieval for narrow queries and under-retrieval for compositional ones. We describe ScoreGate, …

A Decentralized Retrieval Augmented Generation System with Source Reliabilities Secured on Blockchain

2025-11-10 · Yining Lu, Wenyi Tang, Max Johnson, Taeho Jung 외 arxiv

Existing retrieval-augmented generation (RAG) systems typically use a centralized architecture, causing a high cost of data collection, integration, and management, as well as privacy concerns. There is a great need for …

ALoFTRAG: Automatic Local Fine Tuning for Retrieval Augmented Generation

2025-01-21 · Peter Devine

Retrieval Augmented Generation (RAG) systems have been shown to improve the accuracy of Large Language Model (LLM) outputs. However, these models can often achieve low accuracy when applied to new data domains. We introd…

Language ModelingLanguage ModellingLarge Language ModelRAG+2