Raven Release 1 Deep Dive
Key Takeaways
The video discusses Raven, a conversational AI, and its capabilities, including recalling its own output, summarizing conversations, and formulating answers, with a focus on fine-tuning and improvement using tools like GPT-3, Discord, and Flask.
Full Transcript
hey everyone david shapiro here with another video about raven i've got some really good news raven is up and running and able to have really good conversations there's just a little bit of fine tuning that i need to do on the back end and i'll go into i'll go into greater detail about that in a minute but i wanted to start off by just showing you what raven is capable of right now and i think that'll really impress you and then after you have an understanding of what raven is producing then we'll take a look under the hood so the conversation today started with good morning raven i started logging all interactions do you remember what i asked you about china raven went back through the history and said i'll try and find the questions you asked me about china i'll go into why he didn't produce a good response there but that's still kind of a salient response unfortunately it does seem like a kind of a boilerplate uh chat bot response so there's nothing impressive there i said oh right you're not recalling your own output however the history service is definitely working better i'll need to log that and then i said what are the legal ramifications of ai to diagnose medical conditions i said the legal ramifications of using an ai depend on the nature of information gathered in its context so that's a true answer it's not a very full answer and it's also clearly just responding to the last question so then i made a couple quick changes i said now you can remember your output one day will be able to load entire corpuses hey raven do you know what i am he says hey khajiit i'm sorry i don't remember what we were talking about do you want to talk about it so this is this is evidence that raven was kind of getting confused on the back end and i'll show you why in just a minute um let's see hey ray and then i asked again do you know what i am i'm not sure please clarify so then i went back through and looked at and looked at raven's working memory and it's actually it was actually pretty jumbled um so raven was was not able to provide a good answer i said hey raven what's going on in this conversation and then raven was able to uh to uh summarize the conversation very well so clearly raven is keeping track of the conversation it's just formulating that output so i said hey raven what's going on in this conversation raven says khajiit is uh is trying to ask raven about the legality of ai diagnosing medical conditions raven doesn't understand the question kajii can format the corpus in a way that will give it a more efficient and sustainable amount of working memory so raven was able to summarize it without really understanding it i said not bad the problem is that we're not detecting the conversation has moved on hey raven do you know what i am do you know what you are and raven says i don't know please clarify so i went back through the corpus and actually a good answer was not was not uh generated was not put into raven's corpus so this is actually a solid answer raven honestly does not know and in fact it's really important for an agi to be able to say i don't know so this is this is pretty good uh again it still looks like a boilerplate uh chatbot response though so that's you know might your mileage may vary so that's a good answer i said i am a human see if you can remember that raven you are an agi hey raven what are you and i and so then again he says i'm not sure maybe you should ask me what i want to know and how i would like to be treated so raven is reminding me to keep in mind uh that he has needs of course it said interesting looking at the history section it's getting pretty jumbled so this this led me to think that i need to change some of raven's cognition a little bit again i'll show you what i mean that's going on under the hood in just a minute um i gave it a little bit more information i said hey raven what are you i asked the same question again raven answered correctly this time said i am an agi i'm a computer program that was created to help humans make better decisions that is perfect that is exactly what raven was supposed to do says i have no body and exist only in cyberspace i said nice good job raven what am i you are a person i'm sorry i didn't answer your questions sooner there are many types of artificial intelligence but i am not one of them so let's see clyde wants me to add people okay whatever um you're a person i'm sorry i didn't answer your questions sooner so that was a really good response so raven is starting to get a hang of this conversation all right so with all that out of the way let's take a deep dive under and and take a look under the hood at what's going on so first you'll notice that this is running on discord so i've got this broken down into two things where i've just got a simple discord uh pro client running and it it accumulates all of the messages so it gets uh you know on message i go ahead and i just accumulate all the messages in and i cache them locally and then i ask is it time to respond so this is a very naive thing right now raven can only just decide whether or not to respond based on a couple of rules so the first rule is if raven agi is in the most recent message author so if raven was the last thing to talk raven won't respond uh there was there was a bug a couple days ago where raven just started replying to himself over and over again and of course that's no good um so if raven was the last one to say anything raven won't say anything and then if raven if if the if the the wake words are hey raven so if if it detects hey raven in the last message then it will respond uh i'm gonna work on that i'm gonna work on some better logic for that just to kind of model where the conversation is to determine whether or not it's appropriate for raven to to chime in ultimately i want raven to be able to communicate spontaneously uh of his own accord so this again is super naive it's very it's very basic you can see that there's just three cases all right really only two rules um for raven to respond otherwise raven will just be listening and that's fine so this is the meat and potatoes of of raven right now um it is a python flask app that is 166 lines long so let's go through this this is this is quite a bit and um so like as promised this is a deep dive so this will take a little while so buckle in so right at the top starting raven nexus app host run port 9999 so i've got the one endpoint where you can post oh and that's what the the discord receiver does is it will send it it'll send um a message response send context and it'll post it to this other thing and i've got a timeout set to 45 so that it'll wait for the response all right so the discord receiver will send it over to the nexus it gets it here and so then there's two there's two components there's the context and then the wake sentence which are passed along so the wake sentence is just which whichever line in the chat log had the wake words in it and then what happens is i do a whole lot of parallel stuff so this generates a synopsis history feelings so on and so forth this is just a bunch of code so let me show you what it's actually generating so this is this is creating what i call the corpus and the corpus is let me open a better file better example uh let's see the corpus is yes it's going to be in here so the corpus is what i call raven's working memory so let me zoom in on this a little bit so here's a corpus the corpus will contain it's got a few sections so it's got the history which the history i'll show you how that that how that's pulled together it's got a synopsis which summarizes the conversation as it is right now uh it it has a um an emotional uh affect or a mood uh inference so it it it so raven understands how people are feeling it's got a few interesting facts that raven can add in spontaneously and then it's got the core objective functions which is this needs a lot of work because it's not really working core objective function one is about suffering and of course you don't see any any example of of describing suffering here objective function two is about prosperity and you know this is this is okay it's a boilerplate thing where it says the participants are not prosperous because they are unable to fill their fulfill their natural desires like that's really generic uh so these need a lot of work uh let's see objective function three is about understanding khajiit is trying to understand what raven is that's a natural conclusion because i'm asking raven a lot of questions and then it says khajiit should ask raven to tell them more about agis or read up on them so that's actually really good because core objective function 3 says the goal is to increase understanding so that's a that's actually a really good recommendation and then the chat log is raven what am i so that is the corpus so the corpus is what's fed in as the final kind of thing saying okay raven this is this is the conversation this is your working memory give me an output and this is the output from that last one you're a person i'm sorry i didn't answer your question sooner there are many types of artificial intelligence but i am not one of them so you see this this entire block this entire corpus was what was used to generate this output okay so i know even with some of the flaws here there there's a lot of there's a lot of room for improvement so at the top of this log is the context so this is the context that was sent over from the discord receiver so raven ultimately brought this in was able to summarize this so the synopsis right here you see is a summary of this and then the history is actually pulled from solar so solar i've got running here and here's an example of what solar looks like as as all the logs are just stored and that's how the history service works so the history service is actually one of the most important services so let me show you how the history service works alright so get relevant history you pass it the context and if you recall the context oops the context is just this this is just the conversation the chat log so i pass i pass this the context and it says get get search topics so i get search topics through this method prompt let's see where is it prompt understanding prosperity keywords there we go so i passed gpt3 literally just this or i say generate a list of keywords based on the following and here's an example of what it looks like gpt3 logs um let's see let's go down to the bottom interesting understanding suffering feelings prosperity keywords there we go so here's an output from gpthree i say generate a list of keywords from the following log so here's the chat log raven what am i and then keywords agility computer cyberspace decision human program confusion so these are some keywords that raven came up with to use to search his history based on based on his past and what that does is it searches uh it searches solar right which is running here here so it searches solar for those keywords obviously uh cert document search is its own is an entire art form the history service is is super critical so i'm going to need to do a lot of work on that in the long run but for now it's working good enough uh so it generated so going back keeping it all tied together so i got i got keywords i got topics and then for topic and search topics i went and searched solar and i accumulated all the memories together and then what happened after that was i sorted and deduplicated the memory so that they're all in chronological order and there's no duplicates and then i summarize each memory and put it together and so that's how you ultimately get the history section so raven recalled a whole bunch of memories and then summarized them all one problem that i need to fix for this and and i mentioned this in the chat log is that raven is recalling and and summarizing memories whether or not they're relevant to the current conversation so i'm going to need to do a little bit better on handling memory uh but again recall is a non-trivial problem so you know so so sue me this is something that's going to be worked on for many many years to to increase raven's recall but that's how that's how that works and then you see the synopsis i use this quite extensively if you look in the in the logs here the gpt3 logs synopsis synopsis synopsis so this is used quite often um and that chat that prompt works like this let's go back here prompt synopsis so i give it just a simple example this is a following chat log so here is the example and i say give me an example of of this and then go through chat log and generate a synopsis so let me show you what that actually looks like uh let's see what synopsis here pick a random one so there's the example chat log khajiit i'm sorry you find me to be unfriendly and hurtful i'm just a computer program and right now i cannot handle all the information in the chat raven isn't able to chat with you right now so there you go and this this was a simple memory this was an output memory that's being summarized so obviously this is this is just one dialog and then it's being summarized to be a little bit shorter so there you have it that's how the synopsis service works all right so i've showed you uh let's see let me go back to a raven output so the corpus the corpus is raven's working memory this is this is the gold standard you put everything together there's a whole bunch of different services i've got i've got the feelings oh let me show you how the feelings work feelings are important so the feelings prompt is just really simple the following is a chat log list list the chat participants and how each one feels so i give it very explicit instructions as well as an example and then it spits it out um so this was this was just uh something i made up between myself and a friend and so it uh gpt3 has a really good ability to to infer mood uh and so then let me show you an example let's see raven prompt feelings all right so here's a whole chat log and it says khajiit is feeling contemplative and analytical khajiit is feeling uncertain raven is feeling uninvolved [Laughter] so that's a that's a good that's a good response again this could this could all use a little bit of work this is still very early but the point is is that raven is able to summarize uh conversations based on different different aspects whether it's generating a synopsis uh inferring feelings and so on um another service that i'm gonna add is let's see go back over another service that i'm that i'm going to add is where did i put it i need a conversation state service because one thing that you noticed during the chat let me bring the chat back up actually uh where is it there it is is i noticed that raven was not keeping track of the current state of the conversation uh let's see so like he's like i can't i don't remember what we were talking about so that was actually a pretty pretty good uh inference reading reading his own corpus and saying i actually don't know what we're talking about uh and then i had to ask you know uh some questions several times for before they really before they really stuck so the corpus is gonna be need to be summarized a little bit better but that's pretty much it this deep dive actually took a lot less time than i than i thought it would uh i've got all this you know all these running in parallel so it prompts gpt3 quite a few times and then saves it all to solar and then sends the output back to the discord receiver so the result has a 45 second timeout print result return json and if you go down to where it's in context it says response equals uh weight or send context and then it awaits and sends the output and that's it and that is how you get this so the key things that i demonstrate here are uh that raven does all of his thinking in natural language and that a corpus is basically a stream of consciousness or working memory so the raven spontaneously dredges all this stuff up together makes it all relevant and then uses this to generate a coherent salient output and that's that so thanks for watching
Original Description
The Kickstarter for my Post-Labor Economics book is live! https://www.kickstarter.com/projects/daveshap/labor-zero
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from David Shapiro · David Shapiro · 5 of 60
1
2
3
4
▶
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Raven MVP Demo 2021-04-02
David Shapiro
Get Started with Raven AGI
David Shapiro
Coding Raven's Encyclopedia Service (v.1)
David Shapiro
Prototype AGI demo - Natural Language Cognitive Architecture "NLCA" running on GPT-3
David Shapiro
Raven Release 1 Deep Dive
David Shapiro
Fine-tuning GPT-3 to generate questions about anything
David Shapiro
Fine-tuning GPT-3 for benevolent and trustworthy AGI
David Shapiro
Implementing Natural Language Cognitive Architecture with GPT-3 and the "nexus" concept
David Shapiro
5 Tips and Misconceptions about Finetuning GPT-3
David Shapiro
How to create synthetic datasets with GPT-3
David Shapiro
What is a heuristic imperative? What imperatives should we give AGI?
David Shapiro
Talking Philosophy with GPT-3
David Shapiro
Talking Boundaries and Consent with GPT-3
David Shapiro
Convergence and acceleration towards AGI (or Artificial Cognitive Entities)
David Shapiro
GPT-3 for Writing Dialog
David Shapiro
Co-writing flash fiction with GPT-3
David Shapiro
From zero to finetuned model in 1 hour with GPT-3. Generate a movie script from any premise!
David Shapiro
GPT-3 Working Session: Finetune an information companion chatbot in 30 minutes (RESEARCH ONLY)
David Shapiro
What is "toxic stoicism"? Talking philosophy with GPT-3
David Shapiro
Billion-dollar GPT-3 startup! Fix education with an expert tutor chatbot!
David Shapiro
Finetune GPT-3 to write an entire coherent novel (part 1)
David Shapiro
Concepts in Neuroscience and Cognition - Deficits of GPT-3 and the path to AGI and ACE
David Shapiro
Finetuning GPT-3 to be a master tutor that can handle any topic and hostile students
David Shapiro
Testing "Theory of Mind" in GPT-3 - making fully aligned ACOG (Artificial Cognitive Entities)
David Shapiro
Finetune GPT-3 to write an entire coherent novel (part 2)
David Shapiro
Finetune multiple cognitive tasks with GPT-3 on medical texts (and reduce hallucination)
David Shapiro
Finetune GPT-3 to write a novel - Part 3 (IT WORKS!!!) ...at least a little bit
David Shapiro
How will we know when we've invented AGI? How will we know it is complete?
David Shapiro
Finetuning a Creative Writing Coach in GPT-3 - Part 1
David Shapiro
Finetune GPT-3 to write a coherent novel - Part 4 (success! with minor bugs...)
David Shapiro
Recursively summarize text of any length with GPT-3
David Shapiro
Finetuning a Creative Writing Coach in GPT-3 - Part 2
David Shapiro
Increasingly Verbose Bot with GPT-3 - Expand any word or phrase into a whole paragraph
David Shapiro
Metaprompting with GPT-3 to dynamically generate arguments
David Shapiro
I'm taking a short break from research and YouTube
David Shapiro
Are LaMDA or GPT-3 sentient? No, but...
David Shapiro
Can GPT-3 generate training data? Short answer? Yes! Here's why that's a legit methodology...
David Shapiro
DALLE2 Style Tags Tutorial - "Elven archer in a sunny forest" with different tags
David Shapiro
Many of you have asked for it: Join my new research Discord! Link in description
David Shapiro
Answer complex questions from an arbitrarily large set of documents with vector search and GPT-3
David Shapiro
Fixing "goldfish memory" with GPT-3 and external sources of information in a chatbot - part 1
David Shapiro
Fixing "goldfish memory" with GPT-3 and external sources of information in a chatbot - part 2
David Shapiro
Python & GPT-3 for Absolute Beginners #1 - Setting up your environment
David Shapiro
Python & GPT-3 for Absolute Beginners #2 - Your first chatbot
David Shapiro
Python & GPT-3 for Absolute Beginners #3 - What the heck are embeddings?
David Shapiro
Introducing the RAVEN MVP - a general purpose AI companion (with a live DEMO)
David Shapiro
I needed SQLITE but for vectors so I wrote it myself. Now it's on PyPI - introducing VDBLITE
David Shapiro
Prompt Engineering 101: Autocomplete, Zero-shot, One-shot, and Few-shot prompting
David Shapiro
Prompt Engineering 101: Introduction to CODEX
David Shapiro
Prompt Engineering 101: Summarizing, Extraction, and Rewriting
David Shapiro
Summarize product reviews with GPT-3 fast and easy, get product insights and improvements fast!
David Shapiro
Finetuning GPT-3 101: Synthesizing Training Data
David Shapiro
Finetuning GPT-3 101: Augmenting Training Data
David Shapiro
Finetuning GPT-3 101: Using Your Finetuned Model
David Shapiro
Modeling different viewpoints with GPT-3 for automatic debates
David Shapiro
Finetune a perfect email generator in GPT-3 - take any input and generate a great email
David Shapiro
Research Update: Nexus microservice for Artificial Cognition + microservices architecture (MARAGI)
David Shapiro
Research Update: Microservices! Text-based simulation, Embeddings, and Nexus
David Shapiro
It's alive! The first 3 microservices are up and running!
David Shapiro
What is a Microservice? What does it have to do with AGI?
David Shapiro
More on: Fine-tuning LLMs
View skill →Related AI Lessons
🎓
Tutor Explanation
DeepCamp AI