ChatPaper.aiChatPaper

ExecRetrieval: 코드-임베딩 검색에서의 기능적 정확성 격차 측정

ExecRetrieval: Measuring the Functional-Correctness Gap in Code-Embedding Retrieval

September 1, 2026
저자: Aaryan Kapoor, Md Abdullah Al Hafiz Khan
cs.AI

초록

임베딩 기반 코드 검색은 코딩 에이전트와 검색 증강 코드 생성의 핵심 구성 요소로서, 어휘적으로 유사한 코드를 검색하는 것보다 올바른 코드를 검색하는 것이 더 중요하다. 기존 코드 검색 벤치마크는 질의의 정규 구현에 대해 통제된 실행 검증 단일 편집 변형을 검색 풀에 심지 않기 때문에, 임베딩이 근접 클론이지만 올바르지 않은 코드와 올바른 코드를 기능적으로 구별할 수 있는지에 대한 질문은 검색 환경에서 답이 없는 채로 남는다. 이를 해결하려면 검색 풀 자체에 관련 반사실적 예시, 즉 각 정규 구현과 거의 동일한 실행 검증 버그 변형을 포함하는 벤치마크가 필요하며, 그래야 검색기의 순위 정렬이 주제적 또는 동일성 중복이 아닌 기능적 구별 측면에서 직접 검증될 수 있다. 우리는 939개의 파이썬 작업으로 구성된 ExecRetrieval을 제안한다. 각 작업은 실행 검증된 정규 구현 하나와 최대 네 개의 실행 검증된 버그 방해 항목을 짝으로 가지며, 각 방해 항목은 단일 목표 편집을 수행하는 기계적 변이로 생성된다. 또한 23개의 밀집 임베딩 구성과 BM25를 프로바이더 고유 호출 방식으로 평가하고, 짝지은 맥니마 검정과 쿼리 수준 부트스트랩 신뢰 구간을 적용했다. 근접 클론 반사실적 예시가 검색 풀에 존재할 때, 최고 성능의 호스팅 시스템은 exec@10 = 1.00에 도달하지만 exec@1 = 0.331에 그친다. 상위 네 개 주요 시스템에서 순위 1 누락의 91.5~99.4%가 짝지은 버그 변형이었으며, 주요 시스템에서는 쿼리의 67~78%에서 정규 구현의 점수가 네 개의 짝지은 방해 항목 중 적어도 하나보다 낮았다. 전체 데이터셋, 실행 오라클, 임베딩 행렬, 환경 스냅샷, 그리고 쌍별 통계 검정은 부록 D의 URL에 공개되어 있다.
English
Embedding-based code retrieval is a core component of coding agents and retrieval-augmented code generation, where retrieving correct code matters more than retrieving lexically similar code. Existing code-retrieval benchmarks do not plant controlled, execution-verified single-edit variants of each query's canonical implementation in the search pool, leaving the question of whether embeddings can functionally discriminate correct from near-clone-but-incorrect code unanswered in a retrieval setting. Resolving this requires a benchmark whose search pool itself contains the relevant counterfactuals -- execution-verified buggy variants near-identical to each canonical -- so that a retriever's rank ordering can be directly tested for functional discrimination rather than topical or identity overlap. We introduce ExecRetrieval, 939 Python tasks each paired with one execution-verified canonical implementation and up to four execution-verified buggy distractors, each generated by a mechanical mutation making a single targeted edit, and evaluate 23 dense embedding configurations plus BM25 under provider-native invocation with paired McNemar tests and query-level bootstrap intervals. With near-clone counterfactuals in the pool, the top hosted system reaches exec@10 = 1.00 but only exec@1 = 0.331; rank-1 misses are paired buggy variants 91.5-99.4% of the time across the four leading systems, and the canonical scores below at least one of its four paired distractors in 67-78% of queries on the leading systems. The full dataset, execution oracle, embedding matrices, environment snapshot, and pairwise statistical tests are released at the URL in Appendix D.