OI-Assistant: A Retrieval Augmented System for Similar Problem Discovery and Interactive Learning in Competitive Programming
Competitive programming (CP) often requires quickly identifying relevant problems and solutions, yet current online judge (OJ) platforms offer only limited keyword or tag-based search.This makes it difficult for contestants and coaches to find past problems with smilar patterns or concepts, hindering efficient practice and problem-solving. We introduce OI-assistant, the first intelligent problem search and solution assistant based on Retrieval Augmented Generation (RAG) to bridge this gap. The proposed OI assistant provides insightful and similar problems based on our curated problem database, detailed and structured code explanation, and interactive code validation and follow-up chat. We first collected over 11,000 programming problems from Luogu, a widely-used Chinese platform. Then we use multiple embeddings and llm-based ranker to retrieve and rank semantically similar CP problems based on user queries or code snippets. An LLM generates contextaware responses, like related problem suggestions or solution summaries, enabling more accurate discovery than traditional keyword-based searches. Additionally, it validates these solutions by automatically generating test cases, validating code in real-time and providing educational improvement feedbacks. The proposed RAG-based search engine significantly improves the precision and recall of finding relevant problems, as evidenced by enhanced search results in our preliminary tests. When we introduced OI-Assistant to competitive programming students, their feedback was overwhelmingly positive. They rated the similar-problem recommendations highly and particularly appreciated the clear algorithm visualizations and real-time validation and improvement feedbacks. Overall, students found our platform significantly more helpful compared to traditional OJ systems or standalone ChatGPT. By simplifying the discovery of related practice problems and enhancing real-time interactive learning, OI-Assistant significantly improves the effectiveness of competitive programming training and opens up new possibilities for the community. Keywords: Competitive programming, Retrieval Augmented Generation, Large Language Model
Authors
- Ping Nie
- Xin Meng (ORCID: https://orcid.org/0000-0003-0343-5766)
- Yuchen Su (ORCID: https://orcid.org/0009-0007-5287-4163)
Institutions
- Peking University (CN)
Publication Details
- Journal
- OLYMPIADS IN INFORMATICS
- Published
- 2025-01-01
- DOI
- https://doi.org/10.15388/ioi.2025.09
- Citations
- 1
- Primary Topic
- Educational Games and Gamification
- Type
- article
- Field-Weighted Citation Impact
- 3.44