arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.12925cs.SEcs.AIcs.IR
收藏

CPRet:面向竞争性编程检索的数据集、基准与模型

CPRet: A Dataset, Benchmark, and Model for Retrieval in Competitive Programming

The Chinese University of Hong Kong(香港中文大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Tsinghua University(清华大学);Beihang University(北航);Shenzhen Loop Area Institute(深圳河套学院)

Han Deng, Yuan Meng, Shixiang Tang, Wanli Ouyang, Xinzhu Ma

AI总结:

针对竞争性编程中重复问题影响评估有效性的问题,提出相似问题检索任务,构建CPRet基准套件和两个专用检索器,并揭示高相似性问题会虚增模型通过率。

摘要:

竞争性编程基准被广泛用于编程竞赛和大语言模型评估等场景。然而,重复或高度相似问题的日益增多,不仅引发了对竞赛公平性的担忧,也引发了对竞争性编程作为模型评估基准有效性的质疑。在本文中,我们提出一个新问题——相似问题检索,以解决这一难题。由于缺乏数据和模型,解决该问题颇具挑战。为此,我们引入CPRet,一个面向竞争性编程的检索基准套件,涵盖四项检索任务:两项以代码为中心(即文本到代码、代码到代码)和两项新提出的以问题为中心的任务(即问题到重复、简化到完整),这些任务基于自动爬取的问题-解决方案数据和人工整理的标注构建而成。我们的贡献包括高质量的训练数据和按时间分隔的测试集,以确保可靠的评估。此外,我们基于该数据集进一步开发了两个任务专用检索器:CPRetriever-Code,采用新颖的Group-InfoNCE损失进行问题-代码对齐训练;以及CPRetriever-Prob,针对识别问题级相似性进行微调。两个模型均取得了强劲结果,并已开源供本地使用。最后,我们分析了LiveCodeBench,发现高相似性问题会虚增模型通过率并降低区分度,这凸显了未来基准中需采用相似性感知评估的必要性。

英文摘要:

Competitive programming benchmarks are widely used in scenarios such as programming contests and large language model assessments. However, the growing presence of duplicate or highly similar problems raises concerns not only about competition fairness, but also about the validity of competitive programming as a benchmark for model evaluation. In this paper, we propose a new problem, similar question retrieval, to tackle this issue. Due to the lack of both data and models, solving this problem is challenging. To this end, we introduce CPRet, a retrieval-oriented benchmark suite for competitive programming, covering four retrieval tasks: two code-centric (i.e., Text-to-Code, Code-to-Code) and two newly proposed problem-centric tasks (i.e., Problem-to-Duplicate, Simplified-to-Full) built from a combination of automatically crawled problem-solution data and manually curated annotations. Our contribution includes both high-quality training data and temporally separated test sets for reliable evaluation. Besides, we further develop two task-specialized retrievers based on this dataset: CPRetriever-Code, trained with a novel Group-InfoNCE loss for problem-code alignment, and CPRetriever-Prob, fine-tuned for identifying problem-level similarity. Both models achieve strong results and are open-sourced for local use. Finally, we analyze LiveCodeBench and find that high-similarity problems inflate model pass rates and reduce differentiation, underscoring the need for similarity-aware evaluation in future benchmarks. Github: https://github.com/coldchair/CPRet Online Demo: https://www.cpret.online/

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑