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.

Thread ↓


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
 

Keep Current with Grant Slatton

Grant Slatton Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @GrantSlatton

Dec 8
GPT can use a web browser to answer questions.

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 ↓ ImageImageImage
The real HN pages showing those answers: ImageImage
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/
Read 10 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(