GPT can iteratively write, debug, and test programs to accomplish arbitrary goals.
Pictured: GPT reading snippets of HTML from HN and building a headline scraper in Python, overcoming bugs by simply reading the errors and self-judgments and hypothesizing to itself.
As shown in my previous post, GPT can be embedded in a REPL to accomplish goals in an agent-based fashion by using command line tools. Today's post shows it is capable of creating novel command line tools, such as a web scraper.
1/
As mentioned in the comments of that thread, the next major thing to add is long term memory. What tools exist? What are their inputs in outputs? Which tools are relevant to the problem at hand?
All these sorts of questions can be answered by memory embeddings.
2/
Embeddings take a sentence and embed it in a vector space where similar sentences are nearby. The sentence "a tool that scrapes HN headlines" will be nearby the sentence "headline_scraper.py outputs a list of headlines from HN".
3/
Upon getting a new problem, enumerate a list of memories you wish you had, embed those in the vector space, and query for real memories you actually have. Use that knowledge to solve the problem. After solving the problem, write down any new knowledge gained. Repeat.
4/
If you don't have the tools readily available to solve the problem, make a statement for the tool you wished you had, and then use the method shown in this thread to create a new tool. If the tool is too hard to make, break the problem into smaller steps and try again.
5/
This method does involve arbitrary `exec` of AI-generated Python code, so is a huge security risk. Run in a sandboxed VM. Not only for the small risk that you accidentally create Skynet, but for the much more real risk that a webpage you download has a prompt injection.
/thread
• • •
Missing some Tweet in this thread? You can try to
force a refresh
When embedded in a REPL environment and prompted to strategize and monologue, agent-like behavior emerges. The agent can solve multi-step problems that involve going to pages, following links, reading the next page, etc.
Thread ↓
The real HN pages showing those answers:
Explanation of the system described in the diagram:
The process here involves several different prompts pipelined together in a recursive fashion to result in agent-like behavior. 1/