Recursive LLM prompts
a year ago
- #recursion
- #LLM
- #AI
- Implementing recursion using English and an LLM (e.g., GPT-3.5) as the runtime.
- Recursive prompts contain state and update it to approach an end goal (base case).
- Example of an infinitely recursive Fibonacci prompt without a base case.
- Automation via a Python function that calls the OpenAI API recursively.
- Two types of recursion: recursive prompts and recursive Python functions.
- Inspiration from goal-conditioned Reinforcement Learning and General Problem Solver (GPS).
- LLMs use memorized rules (algebraic and atomic) for problem-solving, similar to human cognition.
- Challenges with LLMs generating incorrect facts and potential solutions (e.g., fact-checking, Wikipedia lookups).
- Connections to ACT-R and ReAct (Reasoning + Action) paradigms.
- Exploration of non-tail recursion and stack management within prompts.
- Example of a non-tail recursive prompt for computing factorial(11).
- Instructions for running the recursive prompts using OpenAI Playground or Python scripts.