AIOS Compiler: LLM as Interpreter for Natural Language Programming and Flow Programming of AI Agents (2405.06907v2)
Abstract: Since their inception, programming languages have trended towards greater readability and lower barriers for programmers. Following this trend, natural language can be a promising type of programming language that provides great flexibility and usability and helps towards the democracy of programming. However, the inherent vagueness, ambiguity, and verbosity of natural language pose significant challenges in developing an interpreter that can accurately understand the programming logic and execute instructions written in natural language. Fortunately, recent advancements in LLMs have demonstrated remarkable proficiency in interpreting complex natural language. Inspired by this, we develop a novel system for Code Representation and Execution (CoRE), which employs LLM as interpreter to interpret and execute natural language instructions. The proposed system unifies natural language programming, pseudo-code programming, and flow programming under the same representation for constructing language agents, while LLM serves as the interpreter to interpret and execute the agent programs. In this paper, we begin with defining the programming syntax that structures natural language instructions logically. During the execution, we incorporate external memory to minimize redundancy. Furthermore, we equip the designed interpreter with the capability to invoke external tools, compensating for the limitations of LLM in specialized domains or when accessing real-time information. This work is open-source at https://github.com/agiresearch/CoRE, https://github.com/agiresearch/OpenAGI, and https://github.com/agiresearch/AIOS.
- Do as i can, not as i say: Grounding language in robotic affordances. arXiv preprint arXiv:2204.01691 (2022).
- Graph of thoughts: Solving elaborate problems with large language models. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 38. 17682–17690.
- Improving language models by retrieving from trillions of tokens. In International conference on machine learning. PMLR, 2206–2240.
- Amy Bruckman and Elizabeth Edwards. 1999. Should we leverage natural-language knowledge? An analysis of user errors in a natural-language-style programming language. In Proceedings of the SIGCHI conference on Human Factors in Computing Systems. 207–214.
- Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Tasks. Transactions on Machine Learning Research (2023).
- Teaching large language models to self-debug. arXiv preprint arXiv:2304.05128 (2023).
- Scaling instruction-finetuned language models. Journal of Machine Learning Research 25, 70 (2024), 1–53.
- Structured programming. Academic Press Ltd.
- Program synthesis using natural language. In Proceedings of the 38th International Conference on Software Engineering. 345–356.
- Task and motion planning with large language models for object rearrangement. In 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2086–2092.
- Palm-e: An embodied multimodal language model. arXiv preprint arXiv:2303.03378 (2023).
- Michael D Ernst. 2017. Natural language is a programming language: Applying natural language processing to software development. In 2nd Summit on Advances in Programming Languages (SNAPL 2017). Schloss-Dagstuhl-Leibniz Zentrum für Informatik.
- OpenAGI: When LLM Meets Domain Experts. In Advances in Neural Information Processing Systems (NeurIPS) (2023).
- LLM as OS, Agents as Apps: Envisioning AIOS, Agents and the AIOS-Agent Ecosystem. arXiv e-prints (2023), arXiv–2312.
- Reasoning with language model is planning with world model. arXiv preprint arXiv:2305.14992 (2023).
- George E Heidorn. 1976. Automatic programming through natural language dialogue: A survey. IBM Journal of research and development 20, 4 (1976), 302–313.
- John L Hennessy and David A Patterson. 2011. Computer architecture: a quantitative approach. Elsevier.
- CLIPScore: A Reference-free Evaluation Metric for Image Captioning.
- Inner monologue: Embodied reasoning through planning with language models. arXiv preprint arXiv:2207.05608 (2022).
- Mixtral of experts. arXiv preprint arXiv:2401.04088 (2024).
- Gpt is becoming a turing machine: Here are some ways to program it. arXiv preprint arXiv:2303.14310 (2023).
- Demonstrate-Search-Predict: Composing Retrieval and Language Models for Knowledge-Intensive NLP. arXiv preprint arXiv:2212.14024 (2022).
- DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines. arXiv preprint arXiv:2310.03714 (2023).
- Large language models are zero-shot reasoners. Advances in neural information processing systems 35 (2022), 22199–22213.
- Retrieval-augmented generation for knowledge-intensive nlp tasks. Advances in Neural Information Processing Systems 33 (2020), 9459–9474.
- Jiwei Li and Eduard Hovy. 2015. The NLP engine: A universal turing machine for nlp. arXiv preprint arXiv:1503.00168 (2015).
- Formal-LLM: Integrating Formal Language and Natural Language for Controllable LLM-based Agents. arXiv:2402.00798 (2024).
- Taskmatrix. ai: Completing tasks by connecting foundation models with millions of apis. arXiv preprint arXiv:2303.16434 (2023).
- Llm+ p: Empowering large language models with optimal planning proficiency. arXiv preprint arXiv:2304.11477 (2023).
- Faithful chain-of-thought reasoning. arXiv preprint arXiv:2301.13379 (2023).
- Self-refine: Iterative refinement with self-feedback. Advances in Neural Information Processing Systems 36 (2024).
- AIOS: LLM Agent Operating System. arXiv (2024).
- NLP (natural language processing) for NLP (natural language programming). In Computational Linguistics and Intelligent Text Processing: 7th International Conference, CICLing 2006, Mexico City, Mexico, February 19-25, 2006. Proceedings 7. Springer, 319–330.
- Codegen: An open large language model for code with multi-turn program synthesis. arXiv preprint arXiv:2203.13474 (2022).
- Josh et al OpenAI. 2023. GPT-4 Technical Report. arXiv:2303.08774 [cs.CL]
- Training language models to follow instructions with human feedback. Advances in neural information processing systems 35 (2022), 27730–27744.
- Refiner: Reasoning feedback on intermediate representations. arXiv preprint arXiv:2304.01904 (2023).
- Synchromesh: Reliable code generation from pre-trained language models. arXiv preprint arXiv:2201.11227 (2022).
- Ronald E Prather. 1997. Regular expressions for program computations. The American mathematical monthly 104, 2 (1997), 120–130.
- Toolllm: Facilitating large language models to master 16000+ real-world apis. arXiv preprint arXiv:2307.16789 (2023).
- The programmer’s assistant: Conversational interaction with a large language model for software development. In Proceedings of the 28th International Conference on Intelligent User Interfaces. 491–514.
- Reflexion: an autonomous agent with dynamic memory and self-reflection. arXiv preprint arXiv:2303.11366 (2023).
- Progprompt: Generating situated robot task plans using large language models. In 2023 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 11523–11530.
- David Vadas and James R Curran. 2005. Programming with unrestricted natural language. In Proceedings of the Australasian Language Technology Workshop 2005. 191–199.
- Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171 (2022).
- Augmenting black-box llms with medical textbooks for clinical question answering. arXiv preprint arXiv:2309.02233 (2023).
- Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems 35 (2022), 24824–24837.
- Visual Transformers: Token-based Image Representation and Processing for Computer Vision. arXiv:2006.03677 [cs.CV]
- StateFlow: Enhancing LLM Task-Solving through State-Driven Workflows. arXiv preprint arXiv:2403.11322 (2024).
- Tree of thoughts: Deliberate problem solving with large language models. Advances in Neural Information Processing Systems 36 (2024).
- React: Synergizing reasoning and acting in language models. arXiv preprint arXiv:2210.03629 (2022).
- ReAct: Synergizing Reasoning and Acting in Language Models. In International Conference on Learning Representations (ICLR).
- BERTScore: Evaluating Text Generation with BERT.
- Shuyuan Xu (31 papers)
- Zelong Li (24 papers)
- Kai Mei (30 papers)
- Yongfeng Zhang (163 papers)