ANPL: Towards Natural Programming with Interactive Decomposition
Di Huang, Ziyuan Nan, Xing Hu, Pengwei Jin, Shaohui Peng, Yuanbo Wen, Rui Zhang, Zidong Du, Qi Guo, Yewen Pu, Yunji Chen
Abstract
Though LLMs are capable of generating plausible programs, it's challenging to interact with the LLMs further to revise the program, especially if the user's specific requirements are different from the initial proposal. In this paper, we introduce ANPL, an interactive programming system that ensures users can always refine the generated code towards their specific programmatic intents via structured decompositions. Borrowing the paradigm of sketching from program synthesis, an ANPL program consists of a set of input-outputs that it must satisfy, a sketch'' -- control/data flow expressed in precise code (e.g. Python), and holes'' -- sub-modules to be implemented by the LLM specified with natural language. The user revises an ANPL program by either modifying the sketch, changing the language used to describe the holes, or providing additional input-outputs to a particular hole, turning it into a sub-ANPL program that can be solved recursively. This workflow allows the users to offload programming burdens to the LLM as much as possible while retaining the ability to pinpoint and resolve bugs locally, without exposing the rest of the program to the LLM. We deploy ANPL on the Abstraction and Reasoning Corpus (ARC), a set of unique tasks that are challenging for state-of-the-art AI systems, showing it outperforms baseline programming systems that (a) without the ability to decompose tasks interactively and (b) without the guarantee that the modules can be correctly composed together. Additional evaluations on APPS, HumanEval, and real-world programming tasks have validated that the ANPL framework is applicable to multiple programming domains. We release the ANPL solutions to the ARC tasks as a dataset, providing insights into how humans decompose novel tasks programmatically. See our code at https://iprc-dip.github.io/ANPL/.
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.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 5b29f36b-75a8-4add-b335-a595fec5bca7Cited by top-tier papers7
- CoPrompt: Supporting Prompt Sharing and Referring in Collaborative Natural Language ProgrammingLi Feng, Ryan Yen, Yuzhe You, Mingming Fan et al.CHI 2024 · 28 citations
- CoLadder: Manipulating Code Generation via Multi-Level BlocksRyan Yen, Jiawen Stefanie Zhu, Sangho Suh, Haijun Xia et al.UIST 2024 · 22 citations
- Sharing State Between Prompts and ProgramsEllie Y. Cheng, Logan Weber, Tian Jin, Michael CarbinICLR 2026 · 3 citations
- Dependency Matters: Enhancing LLM Reasoning with Explicit Knowledge GroundingXiangyu Wen, Min Li, Junhua Huang, Jianyuan Zhong et al.NeurIPS 2025 · 2 citations
- Cut the Crap: An Economical Communication Pipeline for LLM-based Multi-Agent SystemsGuibin Zhang, Yanwei Yue, Zhixun Li, Sukwon Yun et al.ICLR 2025
Builds on16
- Toolformer: Language Models Can Teach Themselves to Use ToolsTimo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu et al.NeurIPS 2023 · 5,989 citations
- Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan et al.NeurIPS 2023 · 5,828 citations
- Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging FaceYongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li et al.NeurIPS 2023 · 1,778 citations
- Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
Related papers
- APPL: A Prompt Programming Language for Harmonious Integration of Programs and Large Language Model PromptsHonghua Dong, Qidong Su, Yubo Gao, Zhaoyu Li et al.ACL 2025
- Interactive and Expressive Code-Augmented Planning with Large Language ModelsAnthony Zhe Liu, Xinhe Wang, Jacob Sansom, Yao Fu et al.ACL 2025 · 4 citations
- Hypothesis Search: Inductive Reasoning with Language ModelsRuocheng Wang, Eric Zelikman, Gabriel Poesia, Yewen Pu et al.ICLR 2024 · 156 citations
- Parsel🦆: Algorithmic Reasoning with Language Models by Composing DecompositionsEric Zelikman, Qian Huang, Gabriel Poesia, Noah D. Goodman et al.NeurIPS 2023 · 90 citations
- CodeIt: Self-Improving Language Models with Prioritized Hindsight ReplayNatasha Butt, Blazej Manczak, Auke J. Wiggers, Corrado Rainone et al.ICML 2024 · 29 citations
