ChatPaper.aiChatPaper

DeepCodeSeek:面向上下文感知代碼生成的即時API檢索

DeepCodeSeek: Real-Time API Retrieval for Context-Aware Code Generation

September 30, 2025
作者: Esakkivel Esakkiraja, Denis Akhiyarov, Aditya Shanmugham, Chitra Ganapathy
cs.AI

摘要

現有的搜尋技術僅限於標準的RAG查詢-文件應用。本文提出了一種新穎的技術,擴展了程式碼與索引以預測所需的API,直接實現高品質、端到端的程式碼生成,適用於自動補全與代理式AI應用。我們針對當前程式碼到程式碼基準數據集中存在的API洩漏問題,引入了一個基於真實世界ServiceNow Script Includes的新數據集,該數據集捕捉了程式碼中API使用意圖不明確的挑戰。我們的評估指標顯示,該方法達到了87.86%的Top-40檢索準確率,確保了下游程式碼生成成功所需的關鍵API上下文。為了實現即時預測,我們開發了一個全面的後訓練管道,通過合成數據集生成、監督微調和強化學習來優化一個緊湊的0.6B重排序模型。這一方法使我們的緊湊重排序模型在保持2.5倍降低的延遲的同時,超越了更大的8B模型,有效解決了企業特定程式碼的細微差別,而無需承擔更大模型的計算開銷。
English
Current search techniques are limited to standard RAG query-document applications. In this paper, we propose a novel technique to expand the code and index for predicting the required APIs, directly enabling high-quality, end-to-end code generation for auto-completion and agentic AI applications. We address the problem of API leaks in current code-to-code benchmark datasets by introducing a new dataset built from real-world ServiceNow Script Includes that capture the challenge of unclear API usage intent in the code. Our evaluation metrics show that this method achieves 87.86% top-40 retrieval accuracy, allowing the critical context with APIs needed for successful downstream code generation. To enable real-time predictions, we develop a comprehensive post-training pipeline that optimizes a compact 0.6B reranker through synthetic dataset generation, supervised fine-tuning, and reinforcement learning. This approach enables our compact reranker to outperform a much larger 8B model while maintaining 2.5x reduced latency, effectively addressing the nuances of enterprise-specific code without the computational overhead of larger models.
PDF31October 1, 2025