Enhancing Competitive-level Code Generation by Utilizing Natural Language Reasoning (2025)
Recent progress in large language models (LLMs) has shown strong performance in code generation. Models trained with long reasoning chains achieve promising results on complex competitive programming (CP) tasks. However, it remains unclear where the main bottlenecks in solving such problems lie. This dissertation studies these obstacles and explores how leveraging LLMs’ natural language reasoning abilities can improve code generation for CP. This proposal highlights three completed contributions: Explanation and Distilling: LLMs are e↵ective at explaining solution code(Li et al., 2023), and their ability to implement a verbal solution is stronger than solving a problem directly. Based on this, we developed a supervised finetuning method that distills LLM-generated explanations into chain-of-thought style problem-solving steps(Li and Mooney, 2024). Agent-Guided CodeTree Search: We introduced CodeTree(Li et al., 2025), an agent system for code generation that iteratively thinks, solves, reflects, refines, and verifies through an auto-expanded tree search until reaching the final solution. AlgoSimBench Benchmark: We built AlgoSimBench(Li and Mooney, 2025), a benchmark for evaluating LLMs’ ability to identify algorithmically similar problems. We found that using attempted solutions to match problems improves both end-to-end LLM selection and cosine similarity-based retrieval. Finally, we outline two directions for future work. Task-Aware Code Representation: Develop a zero-shot code embedding method that weighs tokens based on the task-specific prompt, focusing the representation on distinct aspects such as algorithm, functionality, and semantics. Retriever–LLM Training: Investigate why Retrieval-Augmented Generation (RAG) shows limited improvement in coding tasks, with two hypotheses: (a) retrievers fail to find useful context, and (b) LLMs struggle to use retrieved information effectively. To address this, we plan to jointly train retrievers and LLMs on context-dependent coding tasks.
View:
PDF
Citation:
Ph.D. Proposal.
Bibtex:

Jierui Li Ph.D. Student jierui [at] cs utexas edu