Build An Audio AI App Transcripts
Chapter: Feature 3: Summarize
Lecture: Prompt Engineering, Really

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Before we dive into actually using the Lemur LLM to get work done, I want to take a moment and talk to this cute little thing.
0:11 Say hi to it. Its name is Pepper. Now, Pepper is very smart, but you got to talk to Pepper in just the right way
0:20 to really get the maximum potential from it. Now, this is cute and all, but seriously, this idea of prompt engineering, it really matters.
0:30 I'm going to show you an example in a minute that will seem like two unrelated worlds for almost exactly the same question
0:38 based on the identical same inputs. It's going to blow your mind. So give me just a moment. I know you probably have used AI before.
0:48 You've talked to it before, but there are some techniques and some tricks and things you can do to really make the LLMs way better.
0:58 I'm going to talk about that just for a sec. Patrick, who were from Assembly AI, did this great video.
1:04 It's only 14 minutes long called Prompt Engineering 101. It comes with a Jupyter Notebook that lays out a bunch of the examples.
1:12 While I'm not included in the course, the link is right here on YouTube. I really encourage you to honestly pause the video
1:19 after I show you what you're about to see. Go to one more slide, one more graphic here. Then go watch this video and then come back and carry on
1:29 because Patrick has a bunch of great tips and techniques, and some of these techniques come from places like Anthropic.
1:36 Here's my example to help you fully rock the idea of prompt engineering and that it actually matters. So here's an example.
1:46 We're going to take a podcast. Now, before I show you the results of what we're going to get here,
1:53 this podcast comes from the Accessional Tech Podcast. It's a Mac, mostly Mac, enthusiast podcast. It's really long. It's like two hours or more.
2:03 Each episode is pretty fun. You can check it out if you wish. But here's the deal. There was an episode right when the Apple Watch was banned,
2:12 the week that it was banned, because they basically stole the techniques and broke the patent of another company called Massimo.
2:22 So most of this episode, at least an hour, probably more, was dedicated to are patents valuable, what's going to happen to the Apple Watch,
2:33 should they settle, should patents exist, all that kind of stuff, right? Right or wrong, agree, disagree, doesn't matter,
2:40 but that's what they spoke about, okay? So given that, I went to Lemur and I said, I need you to read the transcript and summarize it for me.
2:50 Your responses should be a TL DR summary of around five to eight sentences. And I gave it the entire transcript. Here's what I got back.
3:00 The man, the man tries to take an alternate route to the beach, but gets his vehicle stuck during a turn.
3:08 Despite using recovery gear like Max Trax and shoveling sand, he's unable to free the vehicle himself. The mayor,"" true story, ""the mayor drives by
3:18 and recognizes that the man needs assistance, toes the truck out. On the drive home, the man notices issues with the vehicle's suspension.
3:27 Later, he had to wash the wheels, et cetera, et cetera. And then you go similarly for the key moments. The man taking an alternate route,
3:33 he's unable to get unstuck. The mayor drives by on the drive home. It takes washing out the wheels and resetting the suspension
3:40 the next day to fix the problem and so on. Any mention of the Apple Watch? No. This was a story told at the beginning of the episode.
3:47 All right, and it was, I'm just thinking back, probably 10 minutes, 15 minutes top out of the two hours. The entire thing is about this, right?
3:56 No, it's not. Let's ask the same question of the same, literally the exact identical input, but we're gonna use a little higher end
4:06 bit of prompt engineering. First, we're gonna go to Lemur, if you wanna think of Pepper in our picture there, and put it in the right mindset,
4:17 put it in the right state of mind. So instead of just saying, I'm gonna ask you a question, say, ""Look, you are playing this role
4:26 and I want to talk to you about it from that perspective. You are an expert journalist. I need you to read the transcript and summarize it for me.
4:34 Use the style of a tech reporter from Ars Technica. That's the first part. The next part is to provide more context
4:41 about what this thing, this transcript thing is we're gonna need to summarize. This transcript comes from a podcast entitled Accidental Tech Podcast.
4:51 Obviously, this is generated out of the database 'cause we have that as we're clicking the button, right? And it focuses on,
4:58 here's the subtitle also out of the database, Three Nerds Discussing Tech, Apple Programming, and Loosely Related Topics. Matters.
5:07 The title of the episode is blank, whatever the title is. In this case, ""Episode 567, macOS Uranus.
5:15 It's not really germane to what we've been talking about so far, but that is the title. And then finally, ""Your response should be a TL DR summary
5:23 of around five to eight sentences. How different will this make the output? Identical input? Let's see. TL DR, the Accidental Tech Podcast crew
5:33 found themselves diving down an unexpected rabbit hole discussing an ongoing patent dispute between Apple and the Italian electronics firm Anthropic.
5:44 I think it got that wrong. With the firm, it's Massimo, and I think it's American. But besides that, perfect.
5:52 While John and Marco,"" those are two of the three hosts, had initially criticized so-called patent trolls, they walked back that characterization
6:01 of Anthropic, Massimo. They explored the merits of both companies' claims around patents and product development. The hosts analyzed this legal battle,
6:10 how this legal battle could impact innovation if certain patents were deemed valid or invalid. Both Apple and Massimo appeared committed
6:19 to seeing this through the courts, leading Marco to question whether the patent system is properly incentivizing progress.
6:25 In the end, the nerdy trio seemed unsure of who might come out on top, but they look forward to a resolution one way or another. Oh my gosh.
6:37 Are these the same things? How are these the same question and the same inputs and these answers? One is the man gets stuck,
6:45 and the other, it knows the guest's name, it knows the topic, it's got a sort of a chronology to this. The only thing that wasn't perfect was the name,
6:55 which you can see in the key moments, it actually does get right. So podcast host John, Marco, and guest, who was really a third host,
7:03 they got off track in a previous episode discussing the patent dispute between Apple and Italian electronics firm, Massimo.
7:10 I think it's also still American, but they clarified they were not directly calling Massimo a patent troll,
7:17 but complained about abusive patent practices. You can see down at the bottom, it says, Looking ahead, the host discussed rumors
7:25 of potential changes to Apple Watch's band attachment to improve design usability and other things about the capability of the phone.
7:35 And it's Apple, and it's really quite good. Both the key moments and the TLDR are good. And look at the difference. We kind of talked the LLM up,
7:50 like, ""Hey, you know what? You're an expert. You're an expert in blank, the whatever this podcast is about, you're an expert in that.
7:57 And you're a journalist, and I need you to help me. Okay? And then we give it more context of what the podcast is about,
8:05 based on the title and those things. I mean, I guess we could even give it show notes, although sometimes that would be really overdoing it
8:12 and might mislead it. I think this is a good balance. We just give it a little more background information. Look at the difference.
8:19 Again, the man tries an alternate route and the mayor gets him out. Well, too bad that vehicles get stuck.
8:27 Here's a great summary of a two and a half hour conversation. These are really different. So, hopefully you're feeling motivated
8:36 to take on prompt engineering and treat it a little more formally than let me just chat at a thing that sometimes responds well and sometimes doesn't.
8:45 So, go check out that video from Patrick. It's 14 minutes. It'll give you some real concrete ideas on how we can do this.
8:53 Hopefully you are feeling a little motivated and inspired to go build the second version, the really good version of that, into our X-Ray Podcast app.


Talk Python's Mastodon Michael Kennedy's Mastodon