Lune

NeurIPS2023Top-tier venue

ALGO: Synthesizing Algorithmic Programs with Generated Oracle Verifiers

Kexun Zhang, Danqing Wang, Jingtao Xia, William Yang Wang, Lei Li

Abstract

Large language models (LLMs) excel at implementing code from functionality descriptions but struggle with algorithmic problems that require not only implementation but also identification of the suitable algorithm. Moreover, LLM-generated programs lack guaranteed correctness and require human verification. To address these challenges, we propose ALGO, a framework that synthesizes Algorithmic programs with LLM-Generated Oracles to guide the generation and verify their correctness. ALGO first generates a reference oracle by prompting an LLM to exhaustively enumerate all the combinations of relevant variables. This oracle is then utilized to guide an arbitrary search strategy in exploring the algorithm space and to verify the synthesized algorithms. Our study shows that the LLM-generated oracles are correct for 88% of the cases. With the oracles as verifiers, ALGO can be integrated with any existing code generation model in a model-agnostic manner to enhance its performance. Experiments show that when equipped with ALGO, we achieve an 8× better one-submission pass rate over the Codex model and a 2.6× better one-submission pass rate over CodeT, the current state-of-the-art model on CodeContests. We can also get 1.3× better pass rate over the ChatGPT Code Interpreter on unseen problems. The problem set we used for testing, the prompts we used, the verifier and solution programs, and the test cases generated by ALGO are available at https://github.com/zkx06111/ALGO .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

15 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • LLM-Assisted Code Cleaning For Training Accurate Code Generators cites Teaching Large Language Models to Self-Debug
  • Phenomenal Yet Puzzling: Testing Inductive Reasoning Capabilities of Language Models with Hypothesis Refinement cites Self-Refine: Iterative Refinement with Self-Feedback
  • Phenomenal Yet Puzzling: Testing Inductive Reasoning Capabilities of Language Models with Hypothesis Refinement cites Teaching Large Language Models to Self-Debug
  • Phenomenal Yet Puzzling: Testing Inductive Reasoning Capabilities of Language Models with Hypothesis Refinement cites LEVER: Learning to Verify Language-to-Code Generation with Execution
  • Self-Refine: Iterative Refinement with Self-Feedback cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • Teaching Large Language Models to Self-Debug cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • Teaching Large Language Models to Self-Debug cites Self-Refine: Iterative Refinement with Self-Feedback
  • Teaching Large Language Models to Self-Debug cites LEVER: Learning to Verify Language-to-Code Generation with Execution
  • rStar-Coder: Scaling Competitive Code Reasoning with a Large-Scale Verified Dataset cites ACECODER: Acing Coder RL via Automated Test-Case Synthesis
  • EffiLearner: Enhancing Efficiency of Generated Code via Self-Optimization cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • EffiLearner: Enhancing Efficiency of Generated Code via Self-Optimization cites Self-Refine: Iterative Refinement with Self-Feedback
  • EffiLearner: Enhancing Efficiency of Generated Code via Self-Optimization cites Teaching Large Language Models to Self-Debug
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers15

  1. Phenomenal Yet Puzzling: Testing Inductive Reasoning Capabilities of Language Models with Hypothesis RefinementLinlu Qiu, Liwei Jiang, Ximing Lu, Melanie Sclar et al.ICLR 2024 · 114 citations
  2. ACECODER: Acing Coder RL via Automated Test-Case SynthesisHuaye Zeng, Dongfu Jiang, Haozhe Wang, Ping Nie et al.ACL 2025 · 72 citations
  3. EffiLearner: Enhancing Efficiency of Generated Code via Self-OptimizationDong Huang, Jianbo Dai, Han Weng, Puzhen Wu et al.NeurIPS 2024 · 54 citations
  4. rStar-Coder: Scaling Competitive Code Reasoning with a Large-Scale Verified DatasetYifei Liu, Li Lyna Zhang, Yi Zhu, Bingcheng Dong et al.NeurIPS 2025 · 50 citations
  5. LLM-Assisted Code Cleaning For Training Accurate Code GeneratorsNaman Jain, Tianjun Zhang, Wei-Lin Chiang, Joseph E. Gonzalez et al.ICLR 2024 · 49 citations

Builds on12

  1. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
  2. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
  3. LEVER: Learning to Verify Language-to-Code Generation with ExecutionAnsong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov et al.ICML 2023 · 318 citations
  4. CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisErik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu et al.ICLR 2023 · 234 citations
  5. Large Language Models Can Self-ImproveJiaxin Huang, Shixiang Gu, Le Hou, Yuexin Wu et al.EMNLP 2023 · 184 citations

Related papers

  1. HARDTESTGEN: A High-Quality RL Verifier Generation Pipeline for LLM Algorithimic CodingZhongmou He, Yee Man Choi, Kexun Zhang, Ivan Bercovich et al.ICLR 2026
  2. Oracle-Guided Program Selection from Large Language ModelsZhiyu Fan, Haifeng Ruan, Sergey Mechtaev, Abhik RoychoudhuryISSTA 2024 · 4 citations
  3. CodeContests-O: Powering LLMs via Feedback-Driven Iterative Test Case GenerationJianfeng Cai, Jinhua Zhu, Ruopei Sun, Kangwen Zhao et al.ACL Findings 2026
  4. A Problem-Oriented Perspective and Anchor Verification for Code OptimizationTong Ye, Tengfei Ma, Xuhong Zhang, Hang Yu et al.ICLR 2026 · 3 citations
  5. AutoCode: LLMs as Problem Setters for Competitive ProgrammingShang Zhou, Zihan Zheng, Kaiyuan Liu, Zeyu Shen et al.ICLR 2026 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines