跳到主要导航 跳到搜索 跳到主要内容

Beyond the Surface: A Solution-Aware Retrieval Model for Competition-level Code Generation

  • Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing
  • Beihang University

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

In competitive programming task, problem statements are often embedded within elaborate narrative backgrounds, requiring deep understanding of the underlying solutions to successfully complete the tasks. Current code generation models primarily focus on token-level semantic modeling, highly susceptible to distractions from irrelevant narrative statements. Inspired by RAG, retrieving reference code with similar solutions may help enhance model performance on difficult problems. However, existing retrieval models also emphasize surface-level semantic similarity, neglecting the deeper solution-level logical similarities that are critical in competitive programming. Therefore, designing ranking models capable of accurately identifying and retrieving problems and corresponding codes remains an urgent research problem in competitive code generation. In this paper, we propose SolveRank, a solution-aware ranking model empowered by synthetic data for competitive programming tasks. Specifically, we leverage the DeepSeekR1 model to generate logically equivalent but differently phrased new problems, verified by GPT-4o for solution consistency. Then, we train SolveRank with these as positive samples and BM25/random-retrieved problems as negatives. During inference, SolveRank retrieves relevant problems and corresponding code from the corpus to assist a downstream code generator. Experiments on the xCodeEval dataset demonstrate that SolveRank outperforms SOTA ranking methods in precision and recall metrics, and boosts code generation performance for difficult problems.

源语言英语
主期刊名EMNLP 2025 - 2025 Conference on Empirical Methods in Natural Language Processing, Findings of EMNLP 2025
编辑Christos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, Violet Peng
出版商Association for Computational Linguistics (ACL)
5237-5246
页数10
ISBN(电子版)9798891763357
DOI
出版状态已出版 - 2025
活动30th Conference on Empirical Methods in Natural Language Processing, EMNLP 2025 - Suzhou, 中国
期限: 4 11月 20259 11月 2025

出版系列

姓名EMNLP 2025 - 2025 Conference on Empirical Methods in Natural Language Processing, Findings of EMNLP 2025

会议

会议30th Conference on Empirical Methods in Natural Language Processing, EMNLP 2025
国家/地区中国
Suzhou
时期4/11/259/11/25

学术指纹

探究 'Beyond the Surface: A Solution-Aware Retrieval Model for Competition-level Code Generation' 的科研主题。它们共同构成独一无二的学术指纹。

引用此