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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers5
- 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
- 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
- EvoSci: A Bio-Inspired Multi-Agent Framework for the Evolution of Scientific DiscoveryXiaoyu Xiong, Yuqi Ren, Deyi XiongACL 2026 · 1 citation
- TableLoRA: Low-rank Adaptation on Table Structure Understanding for Large Language ModelsXinyi He, Yihao Liu, Mengyu Zhou, Yeye He et al.ACL 2025
- HoarePrompt: Structural Reasoning About Program Correctness in Natural LanguageDimitrios Stamatios Bouras, Yihan Dai, Tairan Wang, Yingfei Xiong et al.ICSE 2026
Builds on9
- Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan et al.NeurIPS 2023 · 5,828 citations
- Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
- WizardCoder: Empowering Code Large Language Models with Evol-InstructZiyang Luo, Can Xu, Pu Zhao, Qingfeng Sun et al.ICLR 2024 · 945 citations
- 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
- 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
- DocCGen: Document-based Controlled Code GenerationSameer Pimparkhede, Mehant Kammakomati, Srikanth Tamilselvam, Prince Kumar et al.EMNLP 2024 · 4 citations
- TreeCoder: Systematic Exploration and Optimisation of Decoding and Constraints for LLM Code GenerationHenrijs Princis, Arindam Sharma, Cristina DavidPLDI 2026
- LEVER: Learning to Verify Language-to-Code Generation with ExecutionAnsong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov et al.ICML 2023 · 318 citations
- Language Models of Code are Few-Shot Commonsense LearnersAman Madaan, Shuyan Zhou, Uri Alon, Yiming Yang et al.EMNLP 2022 · 103 citations
- CodeTool: Enhancing Programmatic Tool Invocation of LLMs via Process SupervisionYifei Lu, Fanghua Ye, Jian Li, Qiang Gao et al.ACL 2025 · 8 citations
