Grant Slatton Profile picture
Dec 8 10 tweets 3 min read
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/
The first step is to send the user command into a simple classifier prompt that determines if it needs the internet. If it does, it rewrites the user's query into a search command for the next prompt. 2/
The next prompt involves embedding GPT3 in a mock REPL that is given the overall goal of fulfilling the command from the previous step. It does this by having the ability to use the REPL to fetch HTML from a URL, and apply an english query to it. 3/
This english query is applied to chunks of the HTML. You have to use chunks because most pages are larger than GPT3's context window. Extract all the results of this chunked processing and send it to a final aggregation prompt. 4/
Send this aggregated result back to the REPL from the previous step. At this point, the agent in the REPL can either choose to emit the result if the goal has been met, or keep working. Some REPLs need multiple steps, e.g. google -> find page -> look for result on that page 5/
This REPL output is then given back to the prompt that gets the output from the "Assistant". GPT3, choosing the Assistant's next response, will pull data from the now-available REPL output. Voila. 6/
Some notes:
Internal monologue is a key ingredient. It gives the agent opportunity to make explicit note of unexpected or interesting new data and adapt its strategy. It also helps with a narrative structure that prompts agent-like behavior. 7/
More notes:
Web pages get chunked because they are too big to fit in GPT's context window. It has to "look at" a sliding window through the page. This chunking and aggregation method is rudimentary and can be improved with semantic embeddings. For a future thread! /end

• • •

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!

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!

:(