Lune

NeurIPS2023Top-tier venue

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 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.

7 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

  • Cut the Crap: An Economical Communication Pipeline for LLM-based Multi-Agent Systems cites Reflexion: language agents with verbal reinforcement learning
  • Sharing State Between Prompts and Programs cites CoPrompt: Supporting Prompt Sharing and Referring in Collaborative Natural Language Programming
  • Dependency Matters: Enhancing LLM Reasoning with Explicit Knowledge Grounding cites Toolformer: Language Models Can Teach Themselves to Use Tools
  • Teaching Large Language Models to Self-Debug cites Self-Refine: Iterative Refinement with Self-Feedback
  • Reflexion: language agents with verbal reinforcement learning cites Self-Refine: Iterative Refinement with Self-Feedback
  • Reflexion: language agents with verbal reinforcement learning cites Teaching Large Language Models to Self-Debug
  • Reflexion: language agents with verbal reinforcement learning cites Toolformer: Language Models Can Teach Themselves to Use Tools
  • Reflexion: language agents with verbal reinforcement learning cites HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face
  • CoLadder: Manipulating Code Generation via Multi-Level Blocks cites CoPrompt: Supporting Prompt Sharing and Referring in Collaborative Natural Language Programming
  • HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face cites Toolformer: Language Models Can Teach Themselves to Use Tools
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. CoPrompt: Supporting Prompt Sharing and Referring in Collaborative Natural Language ProgrammingLi Feng, Ryan Yen, Yuzhe You, Mingming Fan et al.CHI 2024 · 28 citations
  2. CoLadder: Manipulating Code Generation via Multi-Level BlocksRyan Yen, Jiawen Stefanie Zhu, Sangho Suh, Haijun Xia et al.UIST 2024 · 22 citations
  3. Sharing State Between Prompts and ProgramsEllie Y. Cheng, Logan Weber, Tian Jin, Michael CarbinICLR 2026 · 3 citations
  4. Dependency Matters: Enhancing LLM Reasoning with Explicit Knowledge GroundingXiangyu Wen, Min Li, Junhua Huang, Jianyuan Zhong et al.NeurIPS 2025 · 2 citations
  5. 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 on17

  1. Toolformer: Language Models Can Teach Themselves to Use ToolsTimo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu et al.NeurIPS 2023 · 5,989 citations
  2. Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan et al.NeurIPS 2023 · 5,828 citations
  3. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
  4. 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
  5. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations

Related papers

  1. 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
  2. Interactive and Expressive Code-Augmented Planning with Large Language ModelsAnthony Zhe Liu, Xinhe Wang, Jacob Sansom, Yao Fu et al.ACL 2025 · 4 citations
  3. Hypothesis Search: Inductive Reasoning with Language ModelsRuocheng Wang, Eric Zelikman, Gabriel Poesia, Yewen Pu et al.ICLR 2024 · 156 citations
  4. Parsel🦆: Algorithmic Reasoning with Language Models by Composing DecompositionsEric Zelikman, Qian Huang, Gabriel Poesia, Noah D. Goodman et al.NeurIPS 2023 · 90 citations
  5. CodeIt: Self-Improving Language Models with Prioritized Hindsight ReplayNatasha Butt, Blazej Manczak, Auke J. Wiggers, Corrado Rainone et al.ICML 2024 · 29 citations
Dusk over the sea between two cliffs drawn in fine vertical lines