Can Language Models Solve Olympiad Programming? (2404.10952v1)
Abstract: Computing olympiads contain some of the most challenging problems for humans, requiring complex algorithmic reasoning, puzzle solving, in addition to generating efficient code. However, it has been understudied as a domain to evaluate LLMs (LMs). In this paper, we introduce the USACO benchmark with 307 problems from the USA Computing Olympiad, along with high-quality unit tests, reference code, and official analyses for each problem. These resources enable us to construct and test a range of LM inference methods for competitive programming for the first time. We find GPT-4 only achieves a 8.7% pass@1 accuracy with zero-shot chain-of-thought prompting, and our best inference method improves it to 20.2% using a combination of self-reflection and retrieval over episodic knowledge. However, this is far from solving the benchmark. To better understand the remaining challenges, we design a novel human-in-the-loop study and surprisingly find that a small number of targeted hints enable GPT-4 to solve 13 out of 15 problems previously unsolvable by any model and method. Our benchmark, baseline methods, quantitative results, and qualitative analysis serve as an initial step toward LMs with grounded, creative, and algorithmic reasoning.
- Case-based reasoning: foundational issues, methodological variations, and system approaches. AI Commun., 7(1):39–59, mar 1994. ISSN 0921-7126.
- Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
- Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
- Teaching large language models to self-debug. arXiv preprint arXiv:2304.05128, 2023.
- Retrieval-augmented generation for large language models: A survey. arXiv preprint arXiv:2312.10997, 2023.
- Deepseek-coder: When the large language model meets programming–the rise of code intelligence. arXiv preprint arXiv:2401.14196, 2024.
- Measuring coding challenge competence with apps, 2021.
- Competition-level problems are effective llm evaluators. arXiv preprint arXiv:2312.02143, 2023.
- Livecodebench: Holistic and contamination free evaluation of large language models for code. arXiv preprint arXiv:2403.07974, 2024.
- Coderl: Mastering code generation through pretrained models and deep reinforcement learning. Advances in Neural Information Processing Systems, 35:21314–21328, 2022.
- Explaining competitive-level programming solutions using llms. arXiv preprint arXiv:2307.05337, 2023a.
- Taco: Topics in algorithmic code generation dataset. arXiv preprint arXiv:2312.14852, 2023b.
- Competition-level code generation with alphacode. Science, 378(6624):1092–1097, 2022.
- Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12:157–173, 2024.
- Mathdial: A dialogue tutoring dataset with rich pedagogical properties grounded in math reasoning problems. arXiv preprint arXiv:2305.14536, 2023.
- Self-refine: Iterative refinement with self-feedback. arXiv preprint arXiv:2303.17651, 2023.
- Gpt-4 technical report, 2023.
- Code llama: Open foundation models for code. arXiv preprint arXiv:2308.12950, 2023.
- Roger C. Schank. Dynamic Memory: A Theory of Reminding and Learning in Computers and People. Cambridge University Press, USA, 1983. ISBN 0521248582.
- Reflexion: an autonomous agent with dynamic memory and self-reflection. arXiv preprint arXiv:2303.11366, 2023.
- How to talk so ai will learn: Instructions, descriptions, and autonomy. Advances in neural information processing systems, 35:34762–34775, 2022.
- Cognitive architectures for language agents. arXiv preprint arXiv:2309.02427, 2023.
- Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305.16291, 2023.
- Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35:24824–24837, 2022.
- React: Synergizing reasoning and acting in language models. arXiv preprint arXiv:2210.03629, 2022.
- Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. arXiv preprint arXiv:1809.08887, 2018.
- Large language models meet nl2code: A survey. arXiv preprint arXiv:2212.09420, 2022.
- Parsel: A unified natural language framework for algorithmic reasoning. arXiv preprint arXiv:2212.10561, 2022.
- Language agent tree search unifies reasoning acting and planning in language models. arXiv preprint arXiv:2310.04406, 2023.
- Docprompting: Generating code by retrieving the docs. arXiv preprint arXiv:2207.05987, 2022.
- Quan Shi (26 papers)
- Michael Tang (14 papers)
- Karthik Narasimhan (82 papers)
- Shunyu Yao (72 papers)