Lune

EMNLP2024Top-tier venue

CoCoST: Automatic Complex Code Generation with Online Searching and Correctness Testing

Xinyi He, Jiaru Zou, Yun Lin, Mengyu Zhou, Shi Han, Zejian Yuan, Dongmei Zhang

Abstract

Large Language Models have revolutionized code generation ability by converting natural language descriptions into executable code. However, generating complex code within realworld scenarios remains challenging due to intricate structures, subtle bugs, understanding of advanced data types, and lack of supplementary contents. To address these challenges, we introduce the CoCoST framework, which enhances complex code generation by online searching for more information with planned queries and correctness testing for code refinement. Moreover, CoCoST serializes the complex inputs and outputs to improve comprehension and generates test cases to ensure the adaptability for real-world applications. CoCoST is validated through rigorous experiments on the DS-1000 and ClassEval datasets. Experimental results show that CoCoST substantially improves the quality of complex code generation, highlighting its potential to enhance the practicality of LLMs in generating complex code.

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.

5 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

  • TableLoRA: Low-rank Adaptation on Table Structure Understanding for Large Language Models cites DS-1000: A Natural and Reliable Benchmark for Data Science Code Generation
  • CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules cites Teaching Large Language Models to Self-Debug
  • CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules cites Reflexion: language agents with verbal reinforcement learning
  • CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules cites DS-1000: A Natural and Reliable Benchmark for Data Science Code Generation
  • Reflexion: language agents with verbal reinforcement learning cites Teaching Large Language Models to Self-Debug
  • ReasonFlux-PRM: Trajectory-Aware PRMs for Long Chain-of-Thought Reasoning in LLMs cites TaTToo: Tool-Grounded Thinking PRM for Test-Time Scaling in Tabular Reasoning
  • TaTToo: Tool-Grounded Thinking PRM for Test-Time Scaling in Tabular Reasoning cites ReasonFlux-PRM: Trajectory-Aware PRMs for Long Chain-of-Thought Reasoning in LLMs
  • WizardCoder: Empowering Code Large Language Models with Evol-Instruct cites DS-1000: A Natural and Reliable Benchmark for Data Science Code Generation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. ReasonFlux-PRM: Trajectory-Aware PRMs for Long Chain-of-Thought Reasoning in LLMsJiaru Zou, Ling Yang, Jingwen Gu, Jiahao Qiu et al.NeurIPS 2025 · 51 citations
  2. TaTToo: Tool-Grounded Thinking PRM for Test-Time Scaling in Tabular ReasoningJiaru Zou, Soumya Roy, Vinay Kumar Verma, Ziyi Wang et al.ICLR 2026 · 13 citations
  3. EvoSci: A Bio-Inspired Multi-Agent Framework for the Evolution of Scientific DiscoveryXiaoyu Xiong, Yuqi Ren, Deyi XiongACL 2026 · 1 citation
  4. TableLoRA: Low-rank Adaptation on Table Structure Understanding for Large Language ModelsXinyi He, Yihao Liu, Mengyu Zhou, Yeye He et al.ACL 2025
  5. HoarePrompt: Structural Reasoning About Program Correctness in Natural LanguageDimitrios Stamatios Bouras, Yihan Dai, Tairan Wang, Yingfei Xiong et al.ICSE 2026

Builds on10

  1. Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan et al.NeurIPS 2023 · 5,828 citations
  2. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
  3. WizardCoder: Empowering Code Large Language Models with Evol-InstructZiyang Luo, Can Xu, Pu Zhao, Qingfeng Sun et al.ICLR 2024 · 945 citations
  4. DS-1000: A Natural and Reliable Benchmark for Data Science Code GenerationYuhang Lai, Chengxi Li, Yiming Wang, Tianyi Zhang et al.ICML 2023 · 504 citations
  5. CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulesHung Le, Hailin Chen, Amrita Saha, Akash Gokul et al.ICLR 2024 · 73 citations

Related papers

  1. DocCGen: Document-based Controlled Code GenerationSameer Pimparkhede, Mehant Kammakomati, Srikanth Tamilselvam, Prince Kumar et al.EMNLP 2024 · 4 citations
  2. TreeCoder: Systematic Exploration and Optimisation of Decoding and Constraints for LLM Code GenerationHenrijs Princis, Arindam Sharma, Cristina DavidPLDI 2026
  3. Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler FeedbackZhangqian Bi, Yao Wan, Zheng Wang, Hongyu Zhang et al.ACL Findings 2024 · 18 citations
  4. LEVER: Learning to Verify Language-to-Code Generation with ExecutionAnsong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov et al.ICML 2023 · 318 citations
  5. Language Models of Code are Few-Shot Commonsense LearnersAman Madaan, Shuyan Zhou, Uri Alon, Yiming Yang et al.EMNLP 2022 · 103 citations
Dusk over the sea between two cliffs drawn in fine vertical lines