Finetune a perfect email generator in GPT-3 - take any input and generate a great email

David Shapiro · Beginner ·🧠 Large Language Models ·3y ago

Key Takeaways

This video demonstrates fine-tuning a GPT-3 model to generate perfect emails based on various input formats, including stories, bullet points, and conversations, using techniques such as prompt engineering and synthetic data generation.

Full Transcript

morning everybody David Shapiro here with another video today we are going to be synthesizing emails now I have seen dozens if not hundreds of people asking on the openai community and Reddit um how to synthesize emails and I want to do this for all kinds of emails right most for the most part people are like oh well there's copy Ai and and other things that it's like it's kind of kind of generic though um I had this idea for a while ago because um I work in technology and you know some technologists are grumpy some of us have bad days um I have gotten very good at writing diplomatic emails I have a whole bunch of rules in my head that I use for writing perfect emails um you know bottom line up front which is your subject line should have a statement of fact or a question or a problem right whoever is getting your email they should know exactly what you need as close as possible just from the subject line for instance um that sort of stuff so uh but then there's there's marketing copy there's emails to friends and family there's emails to whoever right um so there's a few things that that need to happen when you're writing an email um and also let me warn you this is going to be a long video I'll try and cut it down in post but no promises this could be a very long one um close this from my last video um yeah so the first thing that we need to do when we're generating uh emails is we need to have a bunch of different intents um and so what is an email intent it is um it is like who am I emailing to what am I talking about and so on and so what I'm going to do here is I'm just going to do a couple quick experiments to um actually let me make sure this is recording right okay yes um to to work on a prompt so the first thing is we're going to make a prompt to help us generate an email intent um uuid so what I'm going to do is I also what I've started doing is I just put a uuid um up front because that increases the internal entropy of the machine and you'll get better uh better Randomness um so let's see uh imagine um uh let's see a scenario let's see imagine um yeah we'll say a scenario where one person is writing an email to another um describe the scenario in a paragraph um so let's see here are some uh ideas to help uh format all right to help uh form the scenario okay so um we'll say inform the scenario and so then we'll then what I'll do here is I'll have a whole bunch of modifiers um and so this is a way to add even more entropy if you've watched my other videos you'll know that one thing that I do is I will have placeholders in the prompts and then I'll I'll rotate through those placeholders um and so then in this case let's say like um let's see email to boss um ask for raise something like that right um and then uh so that that's that's that and then we'll say scenario and then we'll just like let's say you're emailing your boss for raise you have been with the company for a year and feel you've contributed a lot um your boss responds and says that he will think about it okay so I didn't want it to I didn't want it to give the whole scenario um so I need to fix this prompt uh let's see imagine where uh where one person is writing an email to another um describe the scenario in a paragraph uh let's see actually describe describe the outgoing email so we need this is this is an exercise in being specific um describes the outgoing email in a paragraph okay and so then we'll change this to email um yeah I know that wasn't right okay so we do we do want we do want it to say a scenario you feel you're being underpaid and asked for a raise of 5 000 okay okay good it's getting it's getting some some good entropy writing this just a few times 500 per month good and then so here also when you're doing synthetic data I often turn the temperature up higher um yep cool okay so this is obviously getting a little bit repetitive there will be more entropy when I when we fill this out um but this is definitely good enough um so then we'll do a placeholder here so we'll do uh nope that's the uuid and then we'll do a placeholder here for modifier okay and then we'll delete this and so basically this is going to be this is not the helper bot one this is the perfect email generator so this will be prompt to form intents and so then what I'll do is um we will go to the script that I copied from uh previous one and we'll just modify this so this is a super simple script all it does is it loads a prompt um and then uh actually no this was this was a little bit different um so we're going to well first we can just clear all all this out because I don't think I need to reuse this but the rest of it I can reuse okay uh so then we need to have a list of modifiers up here so we'll say um modifiers equals and then we'll do um uh let's see so we have all kinds of intents we say um uh let's see um how did I how did I do it in this example email to boss ask for raise okay email to boss asked for raise um and then you know actually because I'm gonna have I'm gonna aim for 400 different things so I don't want to have like yeah there's gonna be some variants but like each one of these is only going to give me about five good good different things of variance because ideally it would invent these modifiers on its own let me think about this for a second I'm going to pause I'm going to pause the recording and think about how to how to how to fully offload the creative process because I want gpt3 to write these modifiers for me let me think about this for a second okay I think I figured it out um so what I'm going to do first actually is those intents I'm going to get gpt3 to generate a list of intents and what I'll do is I'll I'll give it just a list of types so what I did here was I just did a quick thing where I said imagine a list of any reasons to write an email and I gave it a couple of examples um and so then what I'll do is I'll do a modifier so I'll say like uh work related um and so then we'll I'll just uh clear that out ask boss for raise resign from job request time off ask for help with a project and then it switched to personal so this is one problem you see how it just kind of imagined like okay we're going to switch topics now I didn't want it to do that that is something that happens if you have the temperature too high so let's turn the temperature um ask boss for promotion resign from job there we go decline a meeting dang oh okay so this just generated like 50 or maybe 25 uh work related intents you know I might not even need to automate this part that's 40 right there almost 40. um okay get well soon um yeah I really like this uh yeah so that's that's 40 intense right there um so let me just I'll just leave that right there that's fine um let's then imagine a list of any reasons to write an email and then we'll say family related no don't give me friendship related I want family related actually we'll note that down for later friend related see it's being creative for me this is where gpt3 is really great at brainstorming let's just delete that we'll come back to you um work relate stop changing the topic gbt3 really doesn't want to talk about family only family related here let's add a space so one thing that I've noticed and I don't this might just be my imagination like some magical thinking I've noticed that if gpt3 doesn't put a space after a dash it tends to have stranger Behavior so let's add a space and then let's go back and see if that clears it up to apologize and then it just gives up let's get a new uuid uh generate version for uuid give me a new one and then we'll go here yeah it keeps wanting to change topics what if we do higher temperature and then I'll try lower temperature so tell a family member you love them that's great and then it just keeps giving up why you don't cooperate okay fine we'll just copy this over no don't save it we don't need to save that um and I will say uh friends related catching up favorite requests group project sending a funny meme 0.5 change this to friend related it keeps wanting to switch to like work related oops planning and social outing asking for advice yeah um yeah it came up with a whole lot of reasons for for work related emails here you know what I'll just condense all this onto um a single list so we're at like 66 intense um friends family work uh what else maybe maybe like um church and neighborhood um yeah that could be good uh let's see Church related because there's a lot of people that go to church um I know that I'll do that share a testimony to update Church on a mission trip that's great oh School related yes um School related communicate with teacher about an assignment stop it stop switching to personal and work and stuff give me I'm about to lose my cool with this thing it really doesn't want to talk about school um let's see um so this is assuming like to classmate um let's see to ask professor for a syllabus let's just see if we can prime the pump and get it to think there we go there we go ask student services for help much better much better um to inquire about graduation um my uh my girlfriend just graduated so this is this has been a topic of of uh of of uh conversation in our home okay so we got some school related stuff um Church School whoops that didn't copy it Ctrl C I know how to use computers I promise all right we're up to 106. um and I want 400 so if I go through each of these four times um I I could probably get four different variations of these um but actually yeah because so here's this is probably this is probably good enough because here's what I'm going to do what I'm going to do is I'm going to generate different kinds of inputs so rather like for some of these it's just going to be like write an email that says this but in other cases I'm going to use these to do um uh to do different things so like one one of the input formats is going to be just a list like just write this as bullet points right and so you feed the machine so what I'm going to do is I'm going to create uh training data where the input is just bullet points and then the output is a perfect email in another case I'm going to have where the input is a summary of of the email as a paragraph like write me an email that does this and the output is a full email and then in another case I'll have where the the input is a messy email right like one that's overly aggressive one that is um one that's got a lot of typos one that is just not clear right and then the output will be a perfect email and so by having those different input formats that's what I mean by this is going to be a universal email generator you give it anything and it'll write you a good email about it um so yes I think this is probably good so let's go ahead and do a little bit a little bit of cleanup I'll pause the video here you don't need to see me cleaning up this file um and then we'll be right back all right and we're back um did it it is recording okay so I cleaned it up and we have we now have a file it's 90 um in uh instances long um and it is called Baseline intense and so we've got um there's a bunch that are friend Family Church work related right all different kinds of things and so what we're going to do is I'm then going to use that prompt that I showed you just a minute ago where we'll have a scenario um so describe the outgoing email in a paragraph um and then we'll say like uh describe the outgoing email um here's some ideas um include relevant details so in this case we want like names and stuff such as names and times um so this will be this will be like one kind of like way to write an email and so we'll probably just generate like one one batch of these where it'll be like here's what here's here's what the email needs to achieve right so let's copy this up to whoops up to the playground all right and we can do we can get rid of this and so then let's turn this temperature back up to one and then we'll copy out one of these modifiers one of these Baseline intents um cancel a meeting uh no I don't want you to write the email imagine the scenario describe the email in a paragraph include relevant names um now I want you to write like uh just run it again one person is writing to you the and it's just parroting back what I asked no give me like imagine a scenario I wonder if we change this okay that's a little bit better detailed scenario hi name and that's yeah this is where uh this is where gbt3 often really falls down where sometimes it's just it's complete garbage um like if if you if you give this instruction to a human um you know it's like imagine a scenario let's see like yeah let's um invent the uh the names and background information um and then we'll say describe the scenario in a paragraph um let's see and then we'll shorten this intent cancel meeting all right let's see if that works and then it's just writing the email and it's writing an email okay I might need to switch to fuse shot on this um yeah this is not cooperating I'm going to pause this and do some do some experimentation because this is this is being frustrating okay I think I have a better I think I have a better prompt it says write a detailed paragraph describing a scenario where one person has to write an email to another imagine the scenario and tell it like a story so this I think fixed it write what happened and why does the email need to be sent right only about the sender intent cancel a meeting so I've run this a few times and it seems to be pretty pretty consistent it is 8 am the day of an important meeting and you're scheduled to attend with a client so telling a story this is great um you're feeling confident however when you arrive at the office your boss pulls you in her office and you need to stay on another important project so this is great this is this is a perfect story where you can imagine something like this might actually happen um there you go you have to wait you decide to write an email to find out why the meeting was canceled and rescheduled and then again you are scheduled to meet with your boss to okay so it is a little bit repetitive but we've also got 90 different intents that we can use what am I doing here we go um so let's just grab another random one to communicate with an academic advisor and detailed scenario so let's see I need to email my academic advisor for advice of what classes to take I'm not sure I'm feeling a bit lost oh this is great perfect um and because you can imagine if you're communicating with an email bot it might say like what is it that you're trying to do um so we're gonna we're gonna basically start with that brainstorm list of intents and we're going to expand them into stories um so I will go ahead and we will make a folder called stories and um we will we'll rename this file actually make sure it's saved synthesize intense yes um yes okay so we'll go ahead and close all that we'll I'll change this to synthesize stories so we'll basically use um and these background stories will be like one version of like like the input right so you're there's here's a story write the email right um so have stories and then we'll we'll also do these as lists but we're art will also start as like um uh let's see we'll just say uh lists um so we'll have stories we'll have lists and they'll all be based on these Baseline intents so we'll have lore uh stories lists uh what else did I say of Bad Emails um so we'll say we'll say messy emails um so lists stories messy emails um and those are ones that are like misspelled aggressive something like that so that'll basically be like rewrite the following email so that it's better um so actually we'll call this bullet points whoops go go back um bullet points um and then we'll have the stories so write me a story about it why this email needs to be written um and then I need a fourth and possibly a fifth category because I so typically um they say that 200 samples is the minimum however um I am finding that with some of these more complex um tasks you end up with a bad repetition um and so what I'm going to do is I'm going to hit one increase my sample count to 400 so double the sample count but I think I'm also going to add a stop token at the end of it because gpt3 does much better with with the stop tokens especially on these more open-ended things because without the stop token you're more likely to get the repetition um I'm gonna pause again and do a little bit of brainstorming because I need I need a fourth or fifth category one second okay figured it out um so first I've got four categories so I'm going to generate a list of bullet points so it's just like just here's a list of facts about the email here's uh conversations so the conversation is going to be between the person sending the email and the chat bot asking what kind of email do you want to send well it could be chatbot or it could be like an executive assistant um it'll be an executive assistant chatbot there you go messy emails so this is like I just hammered out an email and it's messy fix it for me and then the story so we're working on the stories first now I did a couple other things first I expanded the Baseline intents up to 100 because I want 400 samples so I was like I was at 90 I was like I just need 10 more so I added the uh the um uh neighborhood situation so like someone's dog is on the loose children running through backyards a package was delivered you know like typical stuff that you might see on a neighborhood list serve so we've got that um and then I updated uh the synthesized stories um thing so basically what I'm gonna do um oh here I can just show you real quick um so we'll do CD uh what was it um Universal that was a perfect email generator there we go um python synthesize stories and so here you go detailed scenario um or that's that's the end so this is the beginning of each one now let's add uh we'll do um we'll do slash n slash n and then a few enters sign slash n slash n not make it a little a little prettier okay so here's what we're getting like write a detailed paragraph describing a scenario where one person has to um email another imagine the scenario and tell it like a story what happened why does the email need to be sent write only about the sender intent a sidewalk is crack or needs to be shoveled detailed scenario so what we're going to do is I'm going to generate 100 stories about why these emails need to be sent um so that's what's just about to happen I've got this stuff commented out so you saw the process here um let's see oh and one thing that I need to show you is that in the playground I accidentally overwrote that perfect prompt and I was like and so I wanted to point out um I had forgotten about this until I was like I need this so there's this little handy dandy button so like you can re-run a prompt you can regenerate The Prompt but you can also look at your prompt history and it goes back 30 days so if you did something perfect and you don't remember what you wrote click on the little clock the rewind time button and it will save your life um okay so I'm going to generate some data we'll have 100 stories and then we'll come back and move on to the next step okay the first run is running so I just want to show you what the process looks like um I have it you know outputting to screen so it's like here's the here's the prompt and then here's the output um you've been dating your current partner for about a year and blah blah things are starting to get serious you're asking for advice these are some great stories by the way um so basically what I'm doing here is I'm generating a lot of synthetic data so here's the output we've got 20 so far out of 100 so here's an example it's your cousin's birthday and you want to send her a quick email to say happy birthday you drafted brief's message wish her a happy birthday and hit send um so that's you know that's a that's a that's a totally legit email but then let's sort by size so you're sitting at your desk working on a project for your boss you've been with the company for a few years now and you feel like you're you're due for a raise etc etc so this is like another great example as to why you might want to write an email so what I'm going to do once this is done and actually maybe I can I can I don't need to sit I will let this run in the background so once this is done I will uh how do I get back no don't do that there we go um so I'm going to take some of these stories and I'm going to say write a perfect email from them so let's just go ahead and start prompt engineering that um given the following scenario write the perfect email let's just see if that works all right um so we'll say scenario and then we'll say perfect email um Hi boss let's see I hope you're doing well I wanted to check with you about my email asking for a raise if I know you're busy so I don't want to bother you in person I just wanted to make sure you saw it and that you're considering it I really appreciate what you've done for me and I promise to continue great work if you give me a raise thanks for your time and I'll talk soon um okay so is that congruent with the story you hit send and then you wait okay you already asked for a raise perfect perfect um so yeah um it doesn't have a name that's fine we can I'm not as worried about like subject lines and senders and stuff although we can have subject lines because I did talk about how I have some rules for perfect subject lines so we will do that um I also realized that I didn't have any marketing copy examples um this should generalize well enough for marketing copy should um but now I feel guilty I probably should have that as an example um okay let's try a different scenario we're already up to 50 so it's halfway done um I need to read it write an email asking for time off so let's do this and let's see if the perfect email Hi boss I was hoping I could schedule MIDI I had it work recently I've been feeling my workload is excessive and I'm starting to feel overwhelmed I'd like to sit down with you and discuss how I'm feeling and see if there's anything that can be done to lighten my load a bit that's great okay it's basically just reiterating it but um it's just yeah that's fine so you can see how by having this iterative process it kind of gets better and better um yeah cool so I really like this uh just by saying like write the perfect email like it knows how to be polite um so we will we'll save this prompt um I'll go ahead and come over here and we'll do this add a second new line and we'll do okay scenario and then perfect email and then we'll save this as the um prompt uh let's see scenario to email not text okay so we'll use this to generate the output emails and so what I did was I'll have a folder where we'll have um we'll have the actually I'm going to need to think about how to how to do this because I've got the final emails right this is the final output um actually I know how I'll do it uh I'll show you in a little bit okay I'll pause again and do a little bit more work and then we'll come back basically what I'm going to do just so you know what to expect what I'm going to do is I'm going to start I'm going to use those Baseline intents to generate a few more of those um of those of these types of emails so like we've got the stories this is almost done and so then I'll do I'll basically convert those to bullet points and then I'll have the conversation and then I'll have just the messy versions of the email so instead of the perfect email it'll be like uh an email full of typos one that's overly aggressive and demanding one that doesn't have enough information and so then the perfect email generator will be able to take in if you just give it a list of bullet points it'll take that and run with it if you give it a story it'll take that and run with it if you give it a conversation like a conversation a transcribed conversation with an executive assistant or a chat log it can take that and run with it so that's what we're that's what we're aiming for okay the stories are done um and I'm working on the bullet points version so I think that you'll see some some utility in this um so I think I've got the prompt okay um so bullet points should include topics such as two from subject intention goals tone and so on so basically what I'm going to do is I'm going to train it to or create a data set that will be able to just say Okay given a list of you know a few things it will be able to to do this um and I think that like two from subject tone intentions this is great um intentions and goals uh this is probably all we need so then let's switch to um marketing email about a fun new product uh two potential customers subject intention and uh yep great um this should have more detail and so in the long run imagine you know your intentions you might change a bullet point to say something like um you know product description or whatever um but we can we can augment that later and see how well it handles it but remember um one of the things is that uh is that we also have stories right so we're training this model no one format has to be perfect um and we're training this model to do all kinds of different stuff um and we'll see how it goes so let me go ahead and copy this so we'll say we'll do um uh scenario um be creative as this is an imaginary scenario bullet points and we'll save this and we'll say prompt bullet points okay and then we'll go back to so we've got our Baseline intents that's not going to change oh one thing I did was because there were so many work related ones I went in and added like b2c stuff and vendor stuff um and B2B examples um because like okay so we get some marketing stuff in here too um all right so we're there prompt bullet points and then we do synthesize bullet points so we'll come in here and we'll just we'll basically just change this for to bullet points um and so for modifier to modifiers um so I'll actually change this to modifier uh because we're we're taking those Baseline intents um oh and then we need to add the uuid uuid get a little bit more entropy synthesize bullet points and so then we'll change this to the bullet points um that should be good bullet points yep that's where it should land python synthesize bullet points to announce new baby um oh snap I messed up stop stop stop halt so one so what I do often let me show you where I messed up um see how there's no no new lines um so I often remove new lines from from output so that it's all one paragraph but if you need a list you don't want that so we'll comment out this line that's what this does this compresses it all into one paragraph um and we will delete these and start over this is why you check your work as you go all right let's make sure this looks good to announce a new baby and we should get some legit bullet points okay cool um all family members and this is good so you see how it's giving different formats we you actually want messy data when you're fine-tuning gpd3 especially if you want it to be Universal you really really want it to have like different formats some of them you might not even have bullet points and what that does is it trains the model to be able to tolerate and interpret different kinds of input so this is going well I'm going to pause it again do a little bit more work on the back end and then we'll be back okay and we're back um I took a little while and I created there's four different types so I've got bullet points so here's an example of what I mean by bullet points so it's just like you give it kind of a kind of a stack of uh of um of items uh all different kinds uh so it's just you know relatively unstructured um so that's one type and then the next type is conversations so I synthesized a bunch of conversations where it's like a chat log and it's like um I need to request a work from home Arrangement is this permanent or do you need it just for a certain period of time I need it for a certain period of time I have a family emergency okay I can draft an email um no that's all thank you so you know just imagine like you have a a chat bot that'll help you write emails that's what this is for um I need to communicate with the housing office what do you need to save the housing office sometimes it cuts off that's fine um uh so there's bullet points there's conversations there's messy emails so I asked them to make really like rude emails um hi I'm struggling my classes wonder if I could talk to you to get some help from an academic advisor I'm really struggling starting to feel overwhelmed thanks so like there's nothing wrong with that it's just it could be better right it could be more diplomatic it could be more thorough more clear um let's see I need to talk to someone in student services so this is a lowercase it's you know written a little bit a little bit trashy um and then hey there Bible lover [Laughter] yeah so these are these are examples of emails that could be better and then finally the stories which is where we started and so um we've got you know hey you've been dating your current partner and things are starting to get serious so here's a story right which like um you might just kind of dictate this like here's my story write an email for me um so given these different formats um what I did so there was four steps to synthesize each of those and then there was four more steps to synthesize the perfect email so here is what the final ones look like and there's you can see down here there's 400 total samples let's pick a longer one so um here is an example of a bad email being Rewritten to be a good email so I can't stand working here anymore I've had it with the long hours of crappy pay and impossible demands management is always on our backs breathing down our necks we never get a break obviously like this is an email that someone might write especially if they're frustrated so it's like I'm quitting um so then you say okay perfect email let's rewrite this let's be more diplomatic I wanted to reach out and let you know that I've been feeling really overwhelmed at work lately I'm really not enjoying my job and I feel like I'm constantly stressed out I understand that there are demands that need to be met but I feel like I'm never given a break I've also been really unhappy with the hours and the pay I know that you're under a lot of pressure too but I feel like I'm constantly being micromanaged I know that you're just trying to do your job but it's really starting to wear on me I was really disappointed to hear that we're going to have to start working Saturdays I think I just made that up that's okay um I was really hoping to have that day off to spend with family etc etc um but I'm not sure if I can keep up with this pace can we talk about this I'd really appreciate if we can find a way to improve working situation I love the company I don't want to leave but I just can't keep going on like this thank you for your time so you can see like where it has Rewritten the email total rewrite Rewritten the email um so that that way we can take this as an input and then this will be the output and this is actually what the what the training data is going to look like so the final step that I haven't done yet I'll pause the video and do it again um or do it and then show you is to let's take these 400 different samples let's just grab another random one hey there co-worker um let's see this one didn't do a full rewrite then that's fine some of them some of them don't need much help um let's see oh here we go to colleagues from yourself upcoming changes at work to inform colleagues of upcoming changes to ensure that everyone is on the same page professional and informative hey everyone as we all know change is inevitable starting next week there will be some changes taking place at work I just want to let everyone know what to expect so we can all be on the same page firstly the awful office will be getting a makeover oh cool it made up it made up a situation which is exactly what I wanted to do we will be repainting the walls and getting new furniture the reception area will be undergoing some changes secondly there will be some changes in our daily routines the biggest change will be that we're now working from 9am to 5 p.m um yeah so that's fine and uh because we're going to be fine-tuning it on all these different I just noticed the name praise a cow because we're going to be fine-tuning it on all these different kinds of input the final model will actually be more robust and more capable than any of these individual samples and I'll show you what you mean after we're done so I'm going to go ahead and and do the fine tune job and then when we come back I will show you the final product all right the email generator is done so let's give it a try uh scroll down let's see fine tune David Shapiro Dolly email generator there it is so I wrote a couple of scenarios um this one was actually inspired by a Reddit post that was trending um so the story is my cousin Jenny embarrassed my son at her wedding um my son is trans afab and Jenny insisted on calling my son by his dead name because of this we decided to leave early I need to send an email to the family explaining why to my whole family for me my son and my wife we left uh subject why we left Jenny's wedding early intent explain why Jenny's Behavior was hurtful and unacceptable goal have the family understand our perspective and needs and repair damaged relationships tone diplomatic but firm so let's see what it does let's turn up the uh length a little bit 512. um so this was trained on 400 samples and there's four different types here we go um oh I forgot to add stops oh well um darn it that's fine um all right so dear family we are sorry we had to leave Jenny's uh wedding early but we felt that we had no other choice Jenny embarrassed our son by insisting on calling him by his dead name despite our clear communication that was not acceptable we understand that this was a misunderstanding on Jenny's part and that she did not mean to cause any harm however we feel that this behavior is completely unacceptable and there's no excuse for it we understand that it is not your fault and you did not know what was going on however we feel that you should have been made aware of what was going on we hope that you can understand our perspective and that we did what we felt was necessary to protect our son we would appreciate if you could respect our privacy at this time thank you okay that's not so bad um yeah I really regret that I forgot to put in a um a stop but that's okay um someone told me what is it if you do um there we go so we'll do that okay so if there's a double new line um actually that'll probably stop immediately let's try that yeah because it'll just stop there so if we do one new line there we go we were sorry we had to leave okay cool um so the stop could probably just be um if you start with one new line and and go there okay so then there was a second scenario which was a chat so this is a chat let me just show you what it says um user I need a B2B email a vendor trying to get in with a New Prospect okay what are you selling a mail opening service what are the special features are mail service is totally automatic it uses OCR and other other AI for automation um great what kind of value prop are you offering we save our customers hundreds of hours per year by automatically opening and replying to their letters and emails um assistant and is this a cold email or do you want them I already know them already it's cold email marketing so let's just jump in um hey there I'm a vendor trying to get with a New Prospect uh well it's supposed to write to the prospect um let's see so that's not exactly what I was looking for there we go that's a little bit better we provide a mail opening service that is completely automatic our services use OCR and other IAI for automation which saves our customers hundreds of hours per year if you're interested in learning more please feel to reach out to me my contact info is below thanks user vendor contact info um not the best but you know uh it's a start and again this only took a couple hours and um yeah so let's do uh let's see user code email marketing it should be really long and enticing um I need to provide examples a system okay hey do you have examples for me uh user no just make some stuff up all right so let's see what it says this time our services save our customer hundreds of hours per year that's time that you can spend on more important things okay that's not so bad um yeah so the fact that it can take that this fine-tuned model can take any kind of generic input and generate a decent email output just with a couple hours worth of work I think is pretty good um let's try another scenario um let's see I need to write an email to who am I writing to um let's say to my brother John um uh let's see uh this is about his house that um I'm helping him build um I am his general contractor uh the problem is that John is a tool um really what I mean is that he's demanding and has hounded off My foreman um John really needs to stop going to the job site to micro manage everything he's got no effing clue how to build a house and I've been doing this for 25 uh goddamn years so he needs to screw off um like uh his house is uh months behind schedule and over budget and he keeps blaming me but really it's mostly his fault for instance he uh he intercepted a delivery of materials and sent it back because he imagined that they were subpar uh um but in reality they were top-notch um okay yeah so let's see let's see how it handles this um oh whoops here let's just delete this uh perfect email I'm being part of it hi John I'm sorry to hear that you've been having some problems with the construction of your house okay it looks like we can just do add perfect as a stop because that seems to be like what it what it tries to do okay I want to assure you that we're doing everything we can to resolve the issues as quickly as possible I understand it can be frustrating to feel like you're not getting the support you need but please don't go to the job site without permission this is a safety issue for both you and the crew and it's not fair to them to have to stop what they're doing to deal with an unannounced visitor oh look at this this is perfect I understand that you're concerned about getting your house finished on schedule and within budget but please don't interfere with the work or blame the foreman he's doing the best he can under difficult circumstances and it's not his fault that you're behind schedule and over budget is there any specific issues you have with the construction please let me know and I'll do my best to resolve them thanks perfect okay I think this shows that I have a universal email generator it could use some improvement um but you know that's only 400 samples those samples can be improved we can add more uh more uh different you know types of emails to get a little bit better a little bit better output but I'd say that this is this is five stars well for let's say four and a half Stars it could do a little bit better but it's pretty darn good so thanks for watching like And subscribe and consider supporting me on patreon link is in the description

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 · 56 of 60

1 Raven MVP Demo 2021-04-02
Raven MVP Demo 2021-04-02
David Shapiro
2 Get Started with Raven AGI
Get Started with Raven AGI
David Shapiro
3 Coding Raven's Encyclopedia Service (v.1)
Coding Raven's Encyclopedia Service (v.1)
David Shapiro
4 Prototype AGI demo - Natural Language Cognitive Architecture "NLCA" running on GPT-3
Prototype AGI demo - Natural Language Cognitive Architecture "NLCA" running on GPT-3
David Shapiro
5 Raven Release 1 Deep Dive
Raven Release 1 Deep Dive
David Shapiro
6 Fine-tuning GPT-3 to generate questions about anything
Fine-tuning GPT-3 to generate questions about anything
David Shapiro
7 Fine-tuning GPT-3 for benevolent and trustworthy AGI
Fine-tuning GPT-3 for benevolent and trustworthy AGI
David Shapiro
8 Implementing Natural Language Cognitive Architecture with GPT-3 and the "nexus" concept
Implementing Natural Language Cognitive Architecture with GPT-3 and the "nexus" concept
David Shapiro
9 5 Tips and Misconceptions about Finetuning GPT-3
5 Tips and Misconceptions about Finetuning GPT-3
David Shapiro
10 How to create synthetic datasets with GPT-3
How to create synthetic datasets with GPT-3
David Shapiro
11 What is a heuristic imperative? What imperatives should we give AGI?
What is a heuristic imperative? What imperatives should we give AGI?
David Shapiro
12 Talking Philosophy with GPT-3
Talking Philosophy with GPT-3
David Shapiro
13 Talking Boundaries and Consent with GPT-3
Talking Boundaries and Consent with GPT-3
David Shapiro
14 Convergence and acceleration towards AGI (or Artificial Cognitive Entities)
Convergence and acceleration towards AGI (or Artificial Cognitive Entities)
David Shapiro
15 GPT-3 for Writing Dialog
GPT-3 for Writing Dialog
David Shapiro
16 Co-writing flash fiction with GPT-3
Co-writing flash fiction with GPT-3
David Shapiro
17 From zero to finetuned model in 1 hour with GPT-3. Generate a movie script from any premise!
From zero to finetuned model in 1 hour with GPT-3. Generate a movie script from any premise!
David Shapiro
18 GPT-3 Working Session: Finetune an information companion chatbot in 30 minutes (RESEARCH ONLY)
GPT-3 Working Session: Finetune an information companion chatbot in 30 minutes (RESEARCH ONLY)
David Shapiro
19 What is "toxic stoicism"? Talking philosophy with GPT-3
What is "toxic stoicism"? Talking philosophy with GPT-3
David Shapiro
20 Billion-dollar GPT-3 startup! Fix education with an expert tutor chatbot!
Billion-dollar GPT-3 startup! Fix education with an expert tutor chatbot!
David Shapiro
21 Finetune GPT-3 to write an entire coherent novel (part 1)
Finetune GPT-3 to write an entire coherent novel (part 1)
David Shapiro
22 Concepts in Neuroscience and Cognition - Deficits of GPT-3 and the path to AGI and ACE
Concepts in Neuroscience and Cognition - Deficits of GPT-3 and the path to AGI and ACE
David Shapiro
23 Finetuning GPT-3 to be a master tutor that can handle any topic and hostile students
Finetuning GPT-3 to be a master tutor that can handle any topic and hostile students
David Shapiro
24 Testing "Theory of Mind" in GPT-3 - making fully aligned ACOG (Artificial Cognitive Entities)
Testing "Theory of Mind" in GPT-3 - making fully aligned ACOG (Artificial Cognitive Entities)
David Shapiro
25 Finetune GPT-3 to write an entire coherent novel (part 2)
Finetune GPT-3 to write an entire coherent novel (part 2)
David Shapiro
26 Finetune multiple cognitive tasks with GPT-3 on medical texts (and reduce hallucination)
Finetune multiple cognitive tasks with GPT-3 on medical texts (and reduce hallucination)
David Shapiro
27 Finetune GPT-3 to write a novel - Part 3 (IT WORKS!!!) ...at least a little bit
Finetune GPT-3 to write a novel - Part 3 (IT WORKS!!!) ...at least a little bit
David Shapiro
28 How will we know when we've invented AGI? How will we know it is complete?
How will we know when we've invented AGI? How will we know it is complete?
David Shapiro
29 Finetuning a Creative Writing Coach in GPT-3 - Part 1
Finetuning a Creative Writing Coach in GPT-3 - Part 1
David Shapiro
30 Finetune GPT-3 to write a coherent novel - Part 4 (success! with minor bugs...)
Finetune GPT-3 to write a coherent novel - Part 4 (success! with minor bugs...)
David Shapiro
31 Recursively summarize text of any length with GPT-3
Recursively summarize text of any length with GPT-3
David Shapiro
32 Finetuning a Creative Writing Coach in GPT-3 - Part 2
Finetuning a Creative Writing Coach in GPT-3 - Part 2
David Shapiro
33 Increasingly Verbose Bot with GPT-3 - Expand any word or phrase into a whole paragraph
Increasingly Verbose Bot with GPT-3 - Expand any word or phrase into a whole paragraph
David Shapiro
34 Metaprompting with GPT-3 to dynamically generate arguments
Metaprompting with GPT-3 to dynamically generate arguments
David Shapiro
35 I'm taking a short break from research and YouTube
I'm taking a short break from research and YouTube
David Shapiro
36 Are LaMDA or GPT-3 sentient? No, but...
Are LaMDA or GPT-3 sentient? No, but...
David Shapiro
37 Can GPT-3 generate training data? Short answer? Yes! Here's why that's a legit methodology...
Can GPT-3 generate training data? Short answer? Yes! Here's why that's a legit methodology...
David Shapiro
38 DALLE2 Style Tags Tutorial - "Elven archer in a sunny forest" with different tags
DALLE2 Style Tags Tutorial - "Elven archer in a sunny forest" with different tags
David Shapiro
39 Many of you have asked for it: Join my new research Discord! Link in description
Many of you have asked for it: Join my new research Discord! Link in description
David Shapiro
40 Answer complex questions from an arbitrarily large set of documents with vector search and GPT-3
Answer complex questions from an arbitrarily large set of documents with vector search and GPT-3
David Shapiro
41 Fixing "goldfish memory" with GPT-3 and external sources of information in a chatbot - part 1
Fixing "goldfish memory" with GPT-3 and external sources of information in a chatbot - part 1
David Shapiro
42 Fixing "goldfish memory" with GPT-3 and external sources of information in a chatbot - part 2
Fixing "goldfish memory" with GPT-3 and external sources of information in a chatbot - part 2
David Shapiro
43 Python & GPT-3 for Absolute Beginners #1 - Setting up your environment
Python & GPT-3 for Absolute Beginners #1 - Setting up your environment
David Shapiro
44 Python & GPT-3 for Absolute Beginners #2 - Your first chatbot
Python & GPT-3 for Absolute Beginners #2 - Your first chatbot
David Shapiro
45 Python & GPT-3 for Absolute Beginners #3 - What the heck are embeddings?
Python & GPT-3 for Absolute Beginners #3 - What the heck are embeddings?
David Shapiro
46 Introducing the RAVEN MVP - a general purpose AI companion (with a live DEMO)
Introducing the RAVEN MVP - a general purpose AI companion (with a live DEMO)
David Shapiro
47 I needed SQLITE but for vectors so I wrote it myself. Now it's on PyPI - introducing VDBLITE
I needed SQLITE but for vectors so I wrote it myself. Now it's on PyPI - introducing VDBLITE
David Shapiro
48 Prompt Engineering 101: Autocomplete, Zero-shot, One-shot, and Few-shot prompting
Prompt Engineering 101: Autocomplete, Zero-shot, One-shot, and Few-shot prompting
David Shapiro
49 Prompt Engineering 101: Introduction to CODEX
Prompt Engineering 101: Introduction to CODEX
David Shapiro
50 Prompt Engineering 101: Summarizing, Extraction, and Rewriting
Prompt Engineering 101: Summarizing, Extraction, and Rewriting
David Shapiro
51 Summarize product reviews with GPT-3 fast and easy, get product insights and improvements fast!
Summarize product reviews with GPT-3 fast and easy, get product insights and improvements fast!
David Shapiro
52 Finetuning GPT-3 101: Synthesizing Training Data
Finetuning GPT-3 101: Synthesizing Training Data
David Shapiro
53 Finetuning GPT-3 101: Augmenting Training Data
Finetuning GPT-3 101: Augmenting Training Data
David Shapiro
54 Finetuning GPT-3 101: Using Your Finetuned Model
Finetuning GPT-3 101: Using Your Finetuned Model
David Shapiro
55 Modeling different viewpoints with GPT-3 for automatic debates
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
Finetune a perfect email generator in GPT-3 - take any input and generate a great email
David Shapiro
57 Research Update: Nexus microservice for Artificial Cognition + microservices architecture (MARAGI)
Research Update: Nexus microservice for Artificial Cognition + microservices architecture (MARAGI)
David Shapiro
58 Research Update: Microservices! Text-based simulation, Embeddings, and Nexus
Research Update: Microservices! Text-based simulation, Embeddings, and Nexus
David Shapiro
59 It's alive! The first 3 microservices are up and running!
It's alive! The first 3 microservices are up and running!
David Shapiro
60 What is a Microservice? What does it have to do with AGI?
What is a Microservice? What does it have to do with AGI?
David Shapiro

This video teaches how to fine-tune a GPT-3 model to generate perfect emails based on various input formats, using techniques such as prompt engineering and synthetic data generation. The model can be trained on different formats, including stories, bullet points, and conversations, to create a robust email generator.

Key Takeaways
  1. Use UUIDs to increase internal entropy of the machine
  2. Describe the scenario in a paragraph to help generate an email intent
  3. Use placeholders in prompts and rotate through them to add entropy
  4. Be specific when describing the outgoing email
  5. Turn up the temperature when generating synthetic data
  6. Create a list of intents using GPT-3
  7. Generate 40 work-related intents using GPT-3
  8. Add a space after a dash to improve GPT-3's behavior
💡 Fine-tuning a GPT-3 model on multiple input types can create a robust email generator that can handle different formats and inputs.

Related Reads

Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →