Recursive LLM Prompts
Recursive LLM Prompts
I've been playing with the idea of an LLM prompt that causes the model to generate and return a new prompt. https://github.com/andyk/recursive_llm The idea I'm starting with is to implement recursion using English as the programming language and GPT as the runtime. It’s kind of like traditional recursion in code, but instead of having a function that calls itself with a different set of arguments, there is a prompt that returns itself with specific parts updated to reflect the new arguments. Here is a prompt for infinitely generating Fibonacci numbers: > You are a recursive function. Instead of being written in a programming language, you are written in English. You have variables FIB_INDEX = 2, MINUS_TWO = 0, MINUS_ONE = 1, CURR_VALUE = 1. Output this paragraph but with updated variables to compute the next step of the Fibbonaci sequence. Interestingly, I found that to get a base case to work I had to add quite a bit more text (i.e. the prompt I arrived at is more than twice as long https://raw.githubusercontent.com/andyk/recursive_llm/main/p... )
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
PrePrompt – rewrites vague prompts before they reach the LLM
Unfiltered LLM That Doesn't Reject Prompts
Serve LLM prompts via CDN (free and no account allowed)
Redis-LLM – Redis module integrates LLM with Redis
LitLLM the Spiciest LLM Wrapper
LLM Reasonsers
Resilient LLM
Hegelion – Force your LLM to argue with itself before answering
I Stopped Hoping My LLM Would Cooperate