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脚本包含的新数据集,该数据集捕捉了代码中API使用意图不明确的挑战。评估指标显示,该方法在top-40检索准确率上达到了87.86%,为下游代码生成成功提供了关键的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