GPT-4 App Tutorial: Uncovering AI Innovation Potential GPT-4实战应用教程:探索AI辅助创新的无限潜力

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right so I'm a super applied guy I kind of look at things and think okay how can I like to add this Lego add that Lego and clip them together and build something with it and right now you know if you look back in computer science history when you look at the kinds of things that were being done in 1970 right after Computing was invented the microprocessors were invented people were doing research like how do I sort a list of numbers and that was meaningful work and importantly it was work that's accessible to everybody because nobody knows what we can build with this new kind of oil this new kind of electricity this new kind of unit of computation we've created and anything was game and anybody could participate in that game to figure it out and I think one of the really exciting things about GPT right now is yes in and of itself it's amazing but then what could we do with it if we call it over and over again if we build it into our algorithms and start to build it into broader software so the world really is yours to figure out those fundamental questions about what could you do if you could script computation itself over and over again in the way that computers can do not just talk with it but build things atop it so we're a hosting company we host apps and these are just some of the things that we see I'm going to show you demos of this with code and try to explain some of the thought process but I wanted to give you a high level of overview of you've probably seen these on Twitter but kind of when it all sorts out to the top these are some of the things that we're seeing built and deployed with language models today companionship that's everything from I need a friend to I need a friend with a purpose I want a coach I want somebody to tell me go to the gym and do these exercises I want somebody to help me study a foreign language question answering this is a big one this is everything from your Newsroom having a slack bot that helps assist you does this article conform to the Style Guidelines of our Newsroom all the way through to and you need help on my homework or hey I have some questions that I want you to ask Wikipedia combine it with something else synthesize the answer and give it to me utility functions I would describe this as there's is a large set of things for which human beings can do them if only or computers could do them if only they had access to language computation language knowledge an example of this would be read every tweet on Twitter tell me the ones I should read that way I only get to read the ones that actually make sense to me and I don't have to skim through the rest creativity image generation text generation storytelling proposing other ways to do things and then these wild experiments and kind of baby AGI as people are calling them in which the AI itself decides what to do and is self-directed so I'll show you examples of many of these and what the code looks like and if I were you I would think about these as categories within which to both think about what you might build and then also seek out starter projects for how you might go about building them online all right so I'm just going to dive straight into demos and code for some of these because I know that's what's interesting to see as fellow Builders with a high level diagram for some of these as to how it works so approximately you can think of a companionship bot as a friend that has a purpose to you and there are many ways to build all of these things but one of the ways you can build this is simply to wrap GPT or a language model in an endpoint that additionally injects into the prompt some particular perspective or some particular goal that you want to use it really is that easy in a way but it's also very hard because you need to iterate and engineer The Prompt so that it consistently performs the way you want it to perform so a good example of this is something somebody built into hackathon yesterday and I just wanted to show you uh the project that they built it was a mandarin idiom coach and I'll show you what the code looked like first I'll show you the Demo First I think I already pulled it up here we go so the the buddy that this person wanted to create was a friend that if you gave it a particular problem you were having it would pick a Chinese idiom a four character Chung you that describe poetically like here's a a particular way you could say this and it would tell it to her so that the person who built this was studying Chinese and she wanted to learn more about it um so I might say something like I'm feeling very sad and it would think a little bit and if everything's up and running it will generate one of these four character phrases and it will respond to it uh with an example now I don't know if this is correct or not so if somebody can call me out if this is actually incorrect you please please call me out um and it will then finish up with something encouraging saying hey you can do it I know this is hard keep going so let me show you how they built this and I uh pulled up the code right here so this was the particular starter replit that folks were using in the hackathon yesterday and we we pulled things up into basically you have a wrapper around GPT and there's many things you could do but we're going to make it easy for you to do two things one of them is to inject some personality into the prompt and I'll explain what that prompt is in a second and then the second is ADD tools that might go out and do a particular thing search the web or generate an image or add something to a database or fetch something from a database so having done that now you have something more than GPT now you have GPT which we all know what it is and how we can interact with it but you've also added a particular lens through which it's talking to you and potentially some tools so this particular Chinese tutor all it took to build that was four lines so here's a question that I think is is frying the minds of everybody in the industry right now so is this something that we'll all do casually and nobody really knows well we just all say in the future to the llm hey for the next five minutes please talk like a teacher and maybe but also definitely in the meantime and maybe in the future it makes sense to wrap up these personalized endpoints so that when I'm talking to GPT I'm not just talking to GPT I have a whole Army of different buddies of different companions that I can talk to they're kind of human and kind of talk to me interactively but because I pre-loaded them with hey by the way you particular I want you to be a kind helpful Chinese teacher that responds to every situation by explaining the changu that fits it speak in English and explain the Chung in its meaning then provide a note of encouragement about learning language and so just adding something like that even if you're a non-programmer you can just type deploy and it'll pop it up to the web it'll take it over to a telegram bot that then you can even interact with hey I'm feeling too busy and interact with it over telegram over the web and this is the kind of thing that's now Within Reach for everybody from a CS 101 grad sorry I'm using the general purpose framing all the way through to Professionals in the industry that you can do just with a little bit of manipulation on top of sort of this raw unit of conversation and intelligence so companionship is is one of the first Common uh types of apps that we're seeing so a second kind of app that we're seeing and this blew up if for those of you who are on uh kind of Twitter followers this blew up I think the last few months is question answering and I want to unpack a couple of different ways this can work because I know many of you have probably already tried to build some of these kinds of apps there's a couple of different ways that it works the general framework is a user queries GPT and maybe it has general purpose knowledge maybe it doesn't have general purpose knowledge but what you want it to say back to you is something specific about an article you wrote or something specific about your course syllabus or something specific about a particular set of documents from the United Nations on a particular topic and so what you're really seeking is what we all hoped the customer service spot would be like we've all interacted with these customer service spots and we're kind of Smashing our heads on the keyboard as we do it but pretty soon we're going to start to see very high fidelity Bots that interact with us comfortably and this is approximately how to do it as an engineer so here's your game plan as an engineer step one take the documents that you want it to respond to step two cut them up now if you're an engineer this is going to Madden you you don't cut them up in a way that you would hope for example you could cut them up into clean sentences or clean paragraphs or or semantically coherent sections and that would be really nice honestly the way that most folks do it and this is a simplification that tends up tends to be just fine is you window you have a sliding window that goes over the document and you just pull out fragments of text having pulled out those fragments of text you turn them into something called an embedding Vector so an embedding Vector is a list of numbers that approximate some point of meaning so you've already all dealt with embedding vectors yourself in regular life and the reason you have and I know you have is because everybody's ordered food from Yelp before so when you order food from Yelp you look at what genre of restaurant is it is it in a pizza restaurant is it an Italian restaurant is it a Korean barbecue place you look at how many stars does it have one two three four five you look at where is it so all of these you can think of as points in space dimensions in space Korean barbecue restaurant four stars near my house it's a three three number vector that's all this is so this is a thousand number vector or a ten thousand number Vector different models produce different size vectors all it is is chunking pieces of text turning it into a vector that approximates meaning and then you put it in something called a vector database and a vector database is just a database that stores numbers but having that database now when I ask a question I can search the database and I can say hey the question was what does cs50 teach what pieces of text in the database have vectors similar to the question what does cs50 teach and there's all sorts of tricks and Empires being made on refinements of this General approach but at the end you the developer model it simply as thus and then when you have your query you embed it you find the document fragments and then you put them into a prompt and now we're just back to the personality the the companionship Bots now it's just a prompt and the prompt is you're an expert in answering questions please answer user provided question using Source documents results from the database that's it so after all of these Decades of engineering these customer service spots it turns out with a couple of lines of code you can fill this so let me show you I made one just before the class with the cs50 syllabus so we can pull that up and I can say I I added the PDF right here so I just I searched I don't know if I apologize I don't know if it's an accurate or recent syllabus I just searched the web for cs50 syllabus PDF I put the URL in here uh it loaded it into here this is just a like a hundred line piece of code deployed that will now let me talk to it and I can say what will cs50 teach me so under the hood now what's happening is exactly what that slide just showed you it takes that question what will cs50 teach me it turns it into a vector that Vector approximates without exactly representing the meaning of that question it looks into a vector database that steamship hosts of fragments from that PDF and then it pulls out a document and then passes it to a prompt that says hey you're an expert at answering questions someone has asked you what the cs50 teach please answer it using only the source documents and Source materials I've provided now those Source materials materials are dynamically loaded into the prompt it's just basic prompt engineering and I want to keep harping back onto that what's amazing about right now is Builders is that so many things just boil down to very creative Tactical rearrangement of prompts and then using those over and over again in an algorithm and putting that into software so the result and again it could be lying it could be making things up it could be hallucinating is cs50 will teach students how to think algorithmically and solve problems efficiently focusing on topics such as abstraction and then it Returns the source document from which it was found so this is another big category of which there are tons of potential applications because you can repeat for each context you know you can create arbitrarily many of these once it's software because once it's software you can just repeat it over and over again so for your dorm for your club for your slack for your telegram you can start to begin putting pieces of information in and then responding to it and it doesn't have to be documents you can also load it straight into the prompt I think I have it pulled up here and if I don't I'll just skip it oh here we go one other way you can do question answering because I I think it's healthy to always encourage the simplest possible approach to something you don't need to engineer this giant system it's great to have a database it's great to use embeddings it's great to use this big approach it's fancy at Scales you can do a lot of things but you can also get away with a lot by just pushing it all into a prompt and as a as an engineer I'm you know yes one of our teammates here always says like Engineers should aspire to be lazy and I couldn't agree more you as an engineer should want to set yourself up so that you can pursue the lazy path to something so here's how you might do the equivalent of a question answering system with a prompt alone let's say you have 30 friends and each friend is good at a particular thing or you can you know this isomorphic to many other problems you can simply just say hey I know certain things here's the things I know a user is going to ask me something how should we respond and then you load that into an agent that agent has access to GPT you can ship deploy it and now you've got a bot that you can connect to telegram you can connect to slack and that bot now it won't always give you the right answer because at a certain level we can't control the variance of the model underneath but it will tend to answer with respect to this list and and the degree to which it tends to is to a certain extent something that both industry is working on to just give everybody as a capacity but also you doing prompt engineering to tighten up the the error bars on it so I'll show you just a few more examples uh and then in about eight minutes I'll turn it over to questions because I'm sure you've got a lot about how to build things so just to give you a sense of of where we are all right this is one I don't have a demo for you but if you were to come to me and you were to say Ted I want a weekend Hustle Man what should I build holy moly there are a set of applications that I would describe as utility functions I don't like that name because it doesn't sound exciting and this is really exciting and it's it's low-hanging fruits that automate tasks that require basic language understanding so examples for this are generate a unit test I don't know how many of you have ever been writing tests and you're just like oh come on I can get through this I can get through this if you're a person who likes writing tests you're a lucky individual looking up the documentation for a function rewriting a function making something conform to your company guidelines doing a brand check all of these things are things that are kind of relatively context-free operations or scoped context operations on a piece of information that requires linguistic understanding and really you can think of them as something that is now available to you as a software Builder as a weekend project Builder as a startup Builder and you just have to build the interface around it and presented to other people in a context in which it's meaningful them for them to consume and so the space of this is extraordinary I mean it's the space of all human endeavor now with this new tool I think is the way to a way to think about it people often joke about how in when you're building a company when you're building a project you don't want to start with a hammer because you want you want to start with a problem instead and it's generally true but my God like we just got a really cool new hammer and to a certain extent I would encourage you to at least casually on the weekends run around and hit stuff with it and see what can happen from a Builders from a tinkerers from an experimentalists point of view and then the final creativity this is another huge mega app now I'm primarily live in the text world and so I'm going to talk about text-based things I think so far this is mostly uh been growing in the imagery world because we're such visual creatures and the the images you can generate are just staggering with AI certainly brings up a lot of questions too around IP and artistic style but the template for this if you're a builder that we're seeing in in the wild is approximately the following and the thing I want to point out is domain knowledge here this is really the purpose of this slide is to to touch on the importance of the domain knowledge so many people approximately find the creative process as follows come up with a big idea over generate possibilities edit down what you over generated repeat right like anybody who's been a writer knows when you write you write way too much and then you have to delete lots of it and then you revise and you write way too much and you have to delete lots of it this particular task is fantastic for AI one of the reasons it's fantastic for AI is because it allows the AI to be wrong you know you've pre-agreed you're going to delete lots of it and so if you pre-agree hey I'm just going to build you know generate five possibilities of the story I might tell five possibilities of the advertising headline five possibilities of what I might write what I might write my thesis on you pre-agreed it's okay if it's a little long because you are going to be the editor that steps in and and here's the thing that you really should bring to the table is don't think about this as a technical activity think about this as your opportunity not to put GPT in charge instead for you to grasp the steering wheel tighter I think at least in python or the language you're using to program because you have the domain knowledge to wield GPT in the generation of those so let me show you an example of what I mean by that so this is a a cool app that someone created for the writing Atlas project so writing Atlas is a set of short stories and you can think of it as Goodreads for short stories so you can go in here you can browse different stories and this was something somebody created where you can type in a story a description that you like and this is going to take about a minute to generate so I'm going to talk while it's generating and while while it's working what it's doing and I'll show you the code in a second is it's searching through the collection of stories for similar stories and here's what the domain knowledge part comes in then it uses GPT to look at what it was that you wanted and use knowledge of how an editor how a Bookseller thinks to generate a set of suggestions specifically through the lens of that perspective with the goal of writing that beautiful handwritten note that we sometimes see in a local bookstore tacked on underneath a book and so it doesn't just say hey you might like this here's a general purpose reason why you might like this but specifically here's why you might like this with respect to what you gave it it's either stalling out or it's taking a long time oh there we go so here's its suggestions and in particular these things these are things that only a human could know at least for now uh two humans specifically the human who said they wanted to read a story that's the text that came in and then the human who added domain knowledge to script a sequence of interactions with the language model so that you could provide very targeted reasoning over something that was informed by that domain knowledge so for these utility apps bring your bring your domain knowledge let me actually show you how this looks in code because I think it's it's useful to see how simple and accessible this is this is really a set of prompts so why might they like a particular location well here's the prompt that did that this is an open source project and and it has a bunch of examples and then it says well here's the one that we're interested in here's the audience here's a couple of examples of why might people like a particular thing in terms of audience it's just another prompt same for topic same for explanation and if you go down here and look at how it was done suggesting the story is what is this line 174 to line 203 it really is and again like over and over again I want to impress upon you this really is Within Reach it's really just what 20 odd lines of Step One search in the database for similar stories step two given that I have similar stories pull out the data step three with my domain knowledge in Python now run these prompts step four prepare that into an output so the thing we're scripting itself is some approximation of human cognition if you're willing to go there metaphorically we're not you know we're not sure I'm not going to weigh in on on where we are in the is open AI uh a life form argument all right uh one kind of really far out there thing and then I'll uh tie it up for questions because I know there's probably a lot and I also want to make sure you get a great pizza in your bellies and that is a baby AGI Auto GPT is what you might have heard them called on Twitter I think of them as multi-step planning bots so everything I showed you so far was approximately One-Shot interactions with GPT so this is the user says they want something and then either python mediates interactions with GPT or GPT itself does some things with the inflection of a personality that you've added from some prompt engineering really useful pretty easy to control if you want to go to production if you want to build a weekend project if you want to build a company that's a great way to do it right now this is wild and if you haven't seen this stuff on Twitter I would definitely recommend going to search for it this is what happens the simple way to put it is if you put GPT in a for Loop if you let GPT talk to itself and then tell itself what to do so it it's an emergent Behavior like and like all emergent behaviors it starts with a few simple steps the Conway's Game of Life many elements of reality turn out to be math equations that fit on a t-shirt but then when you play them forward in time they generate DNA they generate human life so this is approximately step one take a human objective step two your first task is to write yourself a list of steps and here's the critical part repeat now do the list of steps now you have to embody your agent with the ability to do things so it's really only limited to do what you give it the tools to do and what it has the skills to do so obviously this is still very much a set of experiments that are running right now and and but it's something that we'll see unfold over the coming years and this is the scenario in which python stops becoming so important because we've given it the ability to actually self-direct what it's doing and then it finally gives you a result and I want to give you an example still of just again impressing upon you how much of this is prompt engineering which is wild how little code this is let me show you what baby AGI looks like so here is a baby AGI that you can connect to Telegram and this is an agent that has two tools so I haven't explained to you what an agent is I haven't explained to you what tools are I'll give you a quick one sentence description an agent is just a word to mean GPT plus some bigger body in which it's living maybe that body has a personality maybe it has tools maybe it has python mediating its experience with other things tools are simply ways in which the agent can choose to do things like imagine if GPT could say order a pizza and instead of you seeing the text order a pizza that caused the pizza to be ordered that's a tool so these are two tools it has one tool is generated to-do list one tool is do a search on the web and then down here it has a a prompt saying hey your goal is to build a task list and then do that task list and then this is just placed into a harness that does it over and over again so after the next task kind of uncue the results of that task and and keep it going and so in doing that you get this kickstarted Loop where essentially you kick start it and then the agent is talking it to itself talking to itself so this unless I'm wrong I don't think this has yet reached production in terms of what we're seeing in the field of how people are deploying software but if you want to dive into sort of the wildest part of experimentation this is definitely one of the places you can start and it's really within reach all you have to do is download one of the starter projects for it and you can kind of see right in the prompting here's how you kick start that process of of iteration all right so I know that was super high level I hope it was useful uh it's I think from the field from the bottoms up what we're seeing and what people are building kind of the this high level categories of apps that people are making all of these apps are apps that are within reach to everybody which is really really exciting uh and there's I suggest Twitter is a great place to hang out and build things uh there's a lot of AI builders on Twitter publishing
Info
Channel: 盛少
Views: 112
Rating: undefined out of 5
Keywords: GPT-4, AI innovation, Practical AI, AI tutorial, Artificial Intelligence, AI assistants, GPT-4 applications, AI-driven creativity, Next-gen AI, Language models, AI for writing, AI for programming, AI in research, AI in marketing, Document QA systems, AI tools, Creative AI, AI for developers, AI-driven tasks, Autonomous agents, AI-assisted tasks, AI for content creation, AI in business, AI for problem-solving, AI chatbots, AI strategies, AI insights, AGI
Id: g9FzFnT56IQ
Channel Id: undefined
Length: 26min 11sec (1571 seconds)
Published: Mon May 08 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.