arXiv:2510.12948cs.SEcs.AI2025-10中稿 · Context Collection…被引 1

用关键词搜索替代昂贵的语义搜索,实现轻量级代码上下文检索。

SpareCodeSearch: Searching for Code Context When You Have No Spare GPU

  • 用关键词搜索替代语义搜索,降低计算资源需求。
  • 在Kotlin和Python上分别取得0.748和0.725的chRF得分。
  • 适合无闲置GPU的IDE代码补全等轻量级场景。

检索增强生成(RAG)框架通过引入检索模块来提升代码语言模型(CLMs)的表现,但现有方法依赖语义搜索,需大量计算资源进行训练与部署,难以应用于如IDE内AI代码补全等轻量级场景。本文提出一种无需额外GPU资源的解决方案:仅使用关键词搜索即可在大型代码库中有效检索相关代码上下文。该方法在代码上下文竞赛基准上的表现验证了其有效性,在Kotlin和Python赛道上分别获得0.748和0.725的chRF得分。

原文摘要 · Abstract (English)

Retrieval-Augmented Generation (RAG) frameworks aim to enhance Code Language Models (CLMs) by including another module for retrieving relevant context to construct the input prompt. However, these retrieval modules commonly use semantic search, requiring substantial computational resources for training and hosting these embedded models, making them infeasible to integrate into lightweight applications such as in-IDE AI-based code completion. In this solution paper, we prove that using keyword-search is sufficient to retrieve relevant and useful code context inside large codebases, without the need for extensive GPU resources. The usefulness of code contexts found by our solution is demonstrated through their completion results on the Code Context Competition's benchmark, reaching 0.748 and 0.725 chRF scores on Kotlin and Python tracks, respectively.

代码检索轻量化关键词搜索IDE工具

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。