Skip to content

By playing, you agree to uListen's Terms and Privacy Policy and YouTube's Terms of Service.

AnthropicAnthropic

AI prompt engineering: A deep dive

Some of Anthropic's prompt engineering experts—Amanda Askell (Alignment Finetuning), Alex Albert (Developer Relations), David Hershey (Applied AI), and Zack Witten (Prompt Engineering)—reflect on how prompt engineering has evolved…

Alex AlberthostDavid HersheyguestAmanda AskellguestZack Wittenguest
Sep 5, 20241h 16mWatch on YouTube

Summaries, chapters, transcripts, and FAQs on this page are made by uListen, not YouTube.

Transcript

  1. 0:00 – 2:05

    Introduction

    1. AA

      Basically, this entire roundtable session here is just gonna be focused mainly on prompt engineering. Um, variety of perspectives at this table around prompting from a research side, from a consumer side, and from, like, an enterprise side. And I wanna just get the whole wide range of opinions because there's a lot of them, and just kind of open it up to discussion and, uh, explore w-what prompt engineering really is and what it's all about, and, uh, yeah, we'll just take it from there. So maybe we can go around the horn with intros. Um, I can kick it off. I'm Alex. I lead developer relations here at Anthropic. Uh, before that, I was kind of technically a prompt engineer at Anthropic. Uh, worked on our prompt engineering team, um, and did a variety of roles spanning from, like, a solutions architect type of, um, thing to, uh, working on the research side. So with that, maybe I can hand over to David.

    2. DH

      Heck yeah. Uh, my name's David Hershey. I, uh, work with customers mostly at Anthropic on a bunch of stuff. Uh, technical, I, I help people with fine-tuning, but also just, like, a lot of the generic things that make it hard to adopt language models, so prompting and, uh, and just, like, how to build systems with language models, but spend most of my time working with customers.

    3. AA

      Cool. Uh, I'm Amanda Askell. I lead one of the fine-tuning teams at Anthropic, uh, where I guess I try to make Claude be honest and kind.

    4. AA

      [chuckles]

    5. AA

      Uh, yeah.

    6. ZW

      Uh, my name's Zack Witten. Uh, I'm a prompt engineer at Anthropic. Um, Alex and I always argue about who the first one was.

    7. AA

      [chuckles]

    8. ZW

      He says it's him, I say it's me.

    9. AA

      Con-contested.

    10. ZW

      Yeah.

    11. AA

      [chuckles]

    12. ZW

      Um, I used to work w- a lot with individual customers, kind of the same way, uh, David does now. And then as we, uh, brought more solutions architects, uh, to the, to the team, I started working on, uh, things that are meant to, uh, raise the overall levels of, like, ambient prompting in society, I guess, like the, the prompt generator and, like, the, uh, various, like, educational materials that, that people use.

    13. AA

      [lips smack] Nice. Cool. Well, thanks, guys, for all coming here. Um, I'm gonna start with, like, a very

  2. 2:05 – 6:34

    Defining prompt engineering

    1. AA

      broad question just so we have a, a frame going into the rest of our conversations here. W-what is prompt engineering? Why is it, why is it engineering? Um, what's prompt really?

    2. AA

      [chuckles]

    3. AA

      If anyone wants to kick that off, um, give your own perspective on it, feel free to take the rein here.

    4. DH

      I feel like we have a prompt engineer.

    5. ZW

      Yeah, Zack's our prompt engineer.

    6. AA

      Zack's the prompt engineer.

    7. DH

      It's his job. I mean, we all prompt, but he-

    8. ZW

      We're all prompt engineers in our own form. Uh, Zack-

    9. DH

      But one of us has a job.

    10. ZW

      Yeah, Zack, maybe since it's in your title.

    11. AA

      [laughs] One of us has a job.

    12. ZW

      You can give your perspective.

    13. AA

      And the, the other three don't have jobs.

    14. AA

      Yeah. [laughs]

    15. ZW

      [laughs] Um, I guess I feel like prompt engineering is trying to get the model to do things, trying to bring the most out of the model, trying to, uh, work with the model to get things done that you wouldn't have been able to do otherwise. Um, so a lot of it is just, like, clear communicating. I think at, at heart, like, talking to a model is a lot like talking to a person and getting in there and, like, understanding the, like, the psychology of, of the model, which, like, Amanda is the world's most expert person in the world. Uh...

    16. AA

      So well, I'm, I'm gonna keep going on you. Why is, why is engineering in the name? Like, where-

    17. ZW

      Yeah.

    18. AA

      What's the engineering part of it?

    19. ZW

      I think the engineering part comes from the, the trial and error.

    20. AA

      Okay.

    21. ZW

      So one really nice thing about talking to a model that's not like talking to a person is you have this restart button, this, like-

    22. AA

      Mm-hmm

    23. ZW

      ... giant, like, go back to square zero, where you just, like, start from the beginning. And what that gives you the ability to do that you don't have is, like, a, a truly start from scratch and try out different things in, like, a, a independent way so that you don't have interference from one to the other. And once you have that ability to experiment and to design different things, uh, that, that's where the, the engineering part has the potential to come in.

    24. AA

      Okay. So what you're saying is, like, as you're writing these prompts, you're typing in, you know, a message to Claude or in the API or whatever it is, being able to go back and forth with the model and iterate on this, this message and revert back to the, the clean slate every time, that process is the engineering part. This whole thing is prompt engineering all in, all in one.

    25. ZW

      There's another aspect of it too, which is, like, integrating the prompts within your system as a whole, and David has done a ton of work with customers, like, integrating... It, it, a lot of times it's not just as simple as you write one prompt, and you give it to the model, and you're done. In fact, it's anything but. It's, like, way more complicated.

    26. DH

      Yeah. I mean, I, I kinda think of prompts as, like, the way that you program models a little bit.

    27. ZW

      Mm-hmm.

    28. DH

      That makes it, like, too complicated 'cause I think Zack is generally right that it's, like, just talking clearly is the most important thing. But if you think about it a little bit as, like, programming a model, you have to, like, think about where data comes from, what data you have access to. So, like, if you're doing RAG or something, like, what can I actually use and do and pass to a model? Um, you have to, like, think about trade-offs in latency and how much data you're providing and things like that. Like, there's enough systems thinking that goes into how you actually build around a model. I think a lot of that's also the core of why it, like, maybe is, like, deserves its own carve-out as a thing to reason about separately from just a software engineer or a PM-

    29. ZW

      Mm-hmm

    30. DH

      ... or something like that. It's, like, kind of its own domain of how to reason about these models.

  3. 6:34 – 12:17

    What makes a good prompt engineer

    1. AA

      defined what prompt engineering is. So what makes a good prompt engineer? Maybe Amanda, I'll, I'll go to you for this since, you know, you're trying to hire-

    2. AA

      Mm

    3. AA

      ... prompt engineers more so in a research setting. What does that look like? What are you looking for in that type of person?

    4. AA

      Yeah, good question. Uh, I think it's a mix of, like Zack said, sort of like clear communication, so the ability to just, like, clearly state things, like, clearly understand tasks, um, think about and describe concepts really well. That's like the kind of writing component, I think. Uh, I actually think that being a good writer is not as correlated with being a good prompt engineer as people might think.

    5. AA

      Mm.

    6. AA

      Um, so I guess I've, I've had this discussion with people 'cause I think there's some argument it's like maybe you just shouldn't have the name engineer-

    7. AA

      Yeah

    8. AA

      ... uh, in there.

    9. AA

      Yeah.

    10. AA

      Like, why isn't it just, like, writer? Um, I used to be more sympathetic to that, and then I think now I'm like, what you're actually doing, like, people think that you're writing, like, one thing and you're kind of, like, done. And then I'll be like, you know, to get, like, a semi-decent prompt, like, when I sit down with the model, I'll, like... You know, like earlier, I was, like, prompting the model and I was just, like, in a 15-minute span, I'll be sending, like, hundreds of prompts to the model.

    11. AA

      Yep.

    12. AA

      It's just back and forth, back and forth, back and forth. And so I think it's this, like, willingness to, like, iterate and to, like, look and think, "What is it that, like, was misinterpreted here, if anything?" Um, and then fix that thing. Uh, so that ability to kind of, like, iterate. So I'd say clear communication, that ability to, to iterate. I think also thinking about ways in which your prompt might go wrong. So if you have a prompt that you're going to be applying to, like, say 400 cases-

    13. AA

      Mm

    14. AA

      ... it's really easy to think about the typical case that it's going to be applied to, to see that it gets the right solution in that case, and then to, like, move on. I think this is a very classic mistake that people made. Um, what you actually want to do is, like, find the cases where it's unusual. So you have to think about your prompt and be like, "What are the cases where it'd be really unclear to me what I should do in this case?"

    15. AA

      Mm.

    16. AA

      So for example, you have a prompt that says, "I'm going to send you a bunch of data. I want you to extract all of the rows where someone's name is, like, s- is, I don't know, starts with the letter G." And then you're like, "Well, I'm gonna send it, like, a data set where there is no such thing, like there is no such name that starts with the letter G. I'm going to send it something that's not a data set, just like, I might also just send an empty string." Like, these are all of the cases you have to try because then you're like, "What does it do in these cases?" And then you can be like, you can give it more instructions for, for how it should deal with that case.

    17. DH

      I work with customers so often where, like, you're an engineer, you're building something, and there's a part in your prompt where a customer of theirs is going to write something.

    18. AA

      Yep.

    19. DH

      And they all think about, like, these really perfectly-

    20. AA

      Yeah

    21. DH

      ... phrased things that they think someone's gonna type into their chatbot. In reality, it's like they never used the Shift key, and, like, every other word is a typo.

    22. AA

      They think it's Google.

    23. DH

      And there's no punctuation.

    24. AA

      Yeah.

    25. AA

      They just put in-

    26. DH

      And-

    27. AA

      ... like random-

    28. DH

      Exactly

    29. AA

      ... words with no question.

    30. DH

      So you have these evals that are, like, these beautifully structured what their users ideally would type in, but, like, being able to go the next step to reason about, like, what your actual traffic's gonna be like, what people are actually gonna try to do.

  4. 12:17 – 24:27

    Refining prompts

    1. AA

      models don't really do a good job of asking good probing questions in, in response-

    2. DH

      Mm-hmm

    3. AA

      ... like a human would.

    4. DH

      Yeah.

    5. AA

      If I'm giving Zack directions on how to do something, he'll be like, "This doesn't make any sense," like, "What am I supposed to do at this step or here and here?"

    6. DH

      [laughs]

    7. AA

      Model doesn't do that, right? So you have to, like, as yourself, think through what that other person would say and then, like, go back to your prompt and answer those questions in like-

    8. DH

      You could ask it to do that, right?

    9. AA

      Yeah, you could.

    10. AA

      You could, right?

    11. AA

      I do that.

    12. AA

      I guess that's another step.

    13. AA

      Yeah, I was gonna say-

    14. AA

      Yeah

    15. AA

      ... one of the first things I do with my initial prompt is, like, I'll give it the prompt and then I'll be like, "I don't want you to follow these instructions-

    16. AA

      Yeah

    17. AA

      ... I just want you to tell me the ways in which they're unclear or any ambiguities-

    18. AA

      Yeah

    19. AA

      ... or anything you don't understand." And it doesn't always get it perfect, but it is interesting that, like, that is, like, one thing you can do, and then also sometimes if people see that the model makes a mistake, a thing that they don't often do is just ask the model. So they say to the model-

    20. AA

      Yeah

    21. AA

      ... "You got this wrong-

    22. AA

      Yeah

    23. AA

      ... like, can you think about why, and can you maybe, like, write an edited version of my instructions that would make you not get it wrong?"

    24. AA

      Yeah.

    25. AA

      And a lot of the time, like, the model just gets it right. The model's like, "Oh yeah, here's what was unclear. Here's, like, a fix to the instructions," and then you put those in and it works, so.

    26. AA

      Okay, I'm, I'm actually really curious about this personally almost. Is that true that that works? Like, does the model, is the model able to spot its mistakes that way? Like, when it gets something wrong, you say like, "Why did you get this wrong?" And then it tells you maybe something like, "Okay, well, how could I phrase this, phrase this to you in the future so you get it right?" Is there an element of, like, truth to that, or is that just kind of a hallucination on the model's part around what it thinks its limits are?

    27. AA

      I think if you, like, explain to it what it got wrong, it can identify things in the query sometimes. I think this varies by task.

    28. AA

      Mm-hmm.

    29. AA

      This is one of those things where I'm like, I, I'm not sure what percentage of the time it gets it right, but I always try it 'cause sometimes it does.

    30. AA

      Yeah.

  5. 24:27 – 37:12

    Honesty, personas and metaphors in prompts

    1. AA

      That's an interesting point. I actually wanna go into this a little bit because this is one of the most famous prompting tips, right? Is to tell the language model that it- they are some persona or some role. Feel like I see mixed results. Maybe this worked a little bit better in previous models and maybe not as much anymore. Amanda, I see you all the time be very honest-

    2. AA

      Oh, yeah

    3. AA

      ... with the model.

    4. DH

      Yeah.

    5. AA

      Like, about the whole situation.

    6. DH

      Yeah.

    7. AA

      Like, "Oh, I am an AI researcher and I'm doing this experiment."

    8. AA

      I'll tell it who I am.

    9. AA

      Yeah.

    10. AA

      I'll give it my name, be like, "Here's who you're talking to."

    11. AA

      Right. Do you think that level of honesty, instead of, like, lying to the model or, like, forcing it to, like, you know, "I'm gonna tip you $500," is there one method that's preferred there? Or just what, what's your intuition on that?

    12. AA

      Yeah. I think as models are more capable and understand more about the world, I guess I just don't see it as necessary to lie to them.

    13. AA

      Mm.

    14. AA

      I mean, I also don't like lying to the models just 'cause, you know, I don't like lying generally. But part of me is like, if you are, say, constructing ... Suppose you're constructing, like, an eval dataset for a machine learning system or for a language model, that's very different from, like, constructing a quiz for some children.

    15. AA

      Mm.

    16. AA

      Um, and so when people would do things like, "I am a teacher trying to figure out questions for a quiz," I'm like, the model knows what language model evals are.

    17. AA

      Mm-hmm. Uh-huh.

    18. AA

      Like, it, you know, if you ask it about different evals, it can tell you and it can give you, like, made-up examples of what they look like 'cause these things are like, they understand them. They're on the, on the internet. And so I'm like, I'd much rather just target the actual task that I have. So if you're like, "I want you to construct questions that look a lot like, uh, an evaluation of a language model"-

    19. AA

      Mm-hmm

    20. AA

      ... it's just like, it's, it's that whole thing of clear communication.

    21. AA

      Yeah.

    22. AA

      I'm like, "That is, in fact, the task I want to do, so why would I pretend to you that I want to do some unrelated or, or only, like, tangentially related task and then expect you to somehow do better at the task that I actually want you to do?" Like, we don't do this with, like, employees. I wouldn't, like, go to someone that worked with me and be like, "You are a teacher-

    23. AA

      [laughs]

    24. AA

      ... and, like, and you're trying to quiz your students." I'd be like, "Hey, are you making that eval?"

    25. AA

      Yeah.

    26. AA

      Like [laughs] I don't know.

    27. AA

      Yeah.

    28. AA

      So, like, I think it's, maybe it's, like, a heuristic from there where I'm like, if they understand the thing, just ask them to do the thing that you want.

    29. DH

      I see this so much.

    30. AA

      I guess, so, like, to push back, like, a little bit-

  6. 37:12 – 45:18

    Model reasoning

    1. AA

      and you can actually read into like almost the thought process. I bet this is probably a little contentious maybe in around like chain of thought. Um, for people listening, like chain of thought, this process of getting the model to actually explain its reasoning before it provides an answer. Is that reasoning real, or is it just kind of like a holding space for the model to like do computation? Do you- do we actually think there's like good, insightful signal that we're getting out of the model there?

    2. DH

      This is like one of the places where I struggle with the... I'm normally like actually somewhat pro-personification 'cause I think it like helps you get decent-

    3. AA

      Mm

    4. DH

      ... facilities, like thoughts of like how the model's working.

    5. AA

      Mm-hmm.

    6. DH

      And this one, like I think it's like harmful maybe almost to like get too into the personification of like what reasoning is 'cause it just kinda like loses the thread of what we're trying to do here. Like is it reasoning or not feels almost like a different question than like what's the best prompting technique.

    7. AA

      Mm.

    8. DH

      It's like you're getting into philosophy, which we, we can get into, but-

    9. AA

      Yeah

    10. DH

      ... um-

    11. AA

      Do it, philosopher

    12. DH

      ... well, yeah.

    13. AA

      [laughs]

    14. DH

      Uh, gr- I will happily be beaten down by a real philosopher-

    15. AA

      Yeah [laughs]

    16. DH

      ... as I try to speculate on this. But instead, like it just works. Like your model does better. It, like the outcome is better if you do reasoning. I think you can... Like I found that if you structure the reasoning and like help iterate with the model on how it should do reasoning, it works better, too. Um, uh, like whether or not that's reasoning or how you wanted to classify it, like you can think of all sorts of proxies for like how I would also do really bad if I had to like one-shot math without writing anything down.

    17. AA

      Yeah.

    18. DH

      Maybe that's useful. But like all I really know is it very obviously does help. I don't know.

    19. AA

      A way of testing would be if you take out all the reasoning that it did to get to the right answer and then replace it with some somewhat realistic-looking reasoning that led to a wrong answer- Mm ... and then see if it does conclude the wrong answer. Mm. I think we actually had like a, a paper where we did some of that, like in the... There was s- s- uh, this like a scratch pad. It was like the sleeper agents- Oh, okay ... paper. Lemon Paper. But, uh, I think that was like maybe a weird situation. But like, yeah, definitely w- what you said about, uh, sh- structuring the reasoning and writing example of how the reasoning works. Given that that helps, like whether we use the word reasoning or not, like it's- I don't think it's just a space for computation.

    20. DH

      Yeah. I agree with that.

    21. AA

      So there is something there. I think there's something there. Whatever we wanna call it.

    22. DH

      Yeah, like having it write a story before it finish a task I do not think would work as well as reasoning.

    23. AA

      I've actually tried that, and it didn't work as well as reasoning. [laughs]

    24. DH

      Yeah. [laughs]

    25. AA

      Interesting.

    26. DH

      So like clearly the actual reasoning-

    27. AA

      Yeah

    28. DH

      ... part is doing something-

    29. AA

      Yeah

    30. DH

      ... towards the outcome.

  7. 45:18 – 50:52

    Enterprise vs research vs general chat prompts

    1. AA

      Um, this is probably something we should've done earlier, but I'll, I'll do it now. Uh, let's clarify maybe the differences between what a enterprise prompt is or a research prompt or a just general chat in Claude.ai prompt. Zack, you've kind of spanned the whole spectrum here in terms of working with customers and research. Do you wanna just, like, lay out what those mean?

    2. ZW

      Yeah, I guess. Um-

    3. AA

      [laughs] This feels too... You're hitting me with all the hard, hard questions.

    4. ZW

      [laughs] Yeah. Um, well, I mean, the, the people in this room, I think, like, like, so I, I, I think of it as, like, the prompts that I read in Amanda's Claude channel versus, like, the prompts that I read David write. They're, they're very similar in a s- in a sense that, like, the level of, of care and, and nuance that's, that's put into them. I think for research you're, uh, looking for variety and diversity-

    5. AA

      Mm

    6. ZW

      ... a lot more. So, like, if I could boil it down to one thing it's, like, I've noticed, like, Amanda's not the biggest fan of having, like, lots of example or, like, one or two examples, like, too, too few 'cause the model will, like, latch onto those.

    7. AA

      Mm.

    8. ZW

      And in prompts that I might write or that I've, I've, I've seen David write, like, we have a lot of examples. Like, I like to just go crazy and add examples until I'm get, feel like I'm about to drop dead because I've-

    9. AA

      [laughs]

    10. ZW

      ... added so many of them. Um, and I think that's because when you're in a consumer application, you really value reliability, you care, like, a ton about the format-

    11. AA

      Mm

    12. ZW

      ... and it's sort of fine if all the answers are the same. In fact, you almost want them t- to be the same-

    13. AA

      Mm

    14. ZW

      ... in, in a lot of ways. Not necessarily you want to be responsive to the user's desires, whereas a lot of times w- when you're prompting for research you're trying to really tap into, like, the range of, of possibilities that the, the model can explore. And by having some examples you're, like, actually constraining that a little bit. So I guess just, like, on a how the prompts look level, that's probably the biggest difference I notice is, like, how many examples are, are in the prompt. Which is not to say that-

    15. AA

      Interesting

    16. ZW

      ... like, I've never seen her write a prompt with examples. But does that, like, ring true for you? Yeah. Like, I think when I give examples, often I actually try and make the examples not, like, the data that the model's going to see, so they're intentionally illustrative because if the model... If I give it, like, examples that are very like the data it's going to see, I just think it is going to give me, like, a really consistent, like, response that might not actually be what I want.

    17. AA

      Mm-hmm.

    18. ZW

      Um, because my data that I'm, like, running it on might be extremely varied, and so I don't want it to just try and give me this, like, really rote output. Often I want it to be much more responsive. It's, it's kind of like much more like cognitive tasks essentially, where I'm like, "You have to, like, see this sample and really think about in this sample what was the right answer." Um, and so that means that sometimes I'll actually take examples that are just very distinct from the ones that I'm going to be running it on. Um, so, like, if I have a task where, let's say, I was trying to, like, extract information from factual documents, I might actually give it examples that are, like, from children's, like, like, what sounds-

    19. AA

      Mm

    20. ZW

      ... like a children's story. Um, just so that I'm like, you know, like I want you to understand the task, but I don't want you to, like, latch on too much to, like, the words that I use or, like, the very specific format. Like, I, I care more about you understanding, uh-

    21. AA

      The actual thing that I want you to do, which can mean like, yeah, I don't end up giving... In some cases, there's some cases where this isn't true, but if you want more like flexibility and diversity, you're going to use illustrative examples rather than concrete ones. Um, you're probably never going to like put words in the model's mouth. Like I, I haven't liked that in a long time, though.

    22. DH

      Mm.

    23. AA

      I don't do few short examples-

    24. DH

      Yeah

    25. AA

      ... um, involving like the model having done a thing.

    26. DH

      Mm-hmm.

    27. AA

      Um, I think that intuition actually also comes from pre-training in a way that doesn't feel like it rings true of RLHF models.

    28. DH

      Mm-hmm.

    29. AA

      Um, so yeah, I think those are differences.

    30. DH

      One thing I'd add, uh, a lot of times, like if you're prompting, like if I'm writing prompts to use on claude.ai, it's like I'm iterating until I get it right one time.

  8. 50:52 – 53:56

    Tips to improve prompting skills

    1. AA

      Cool. Um, so the next question I want to kind of just maybe go around the table here is if you guys had one tip that you could give somebody like improving their prompting skill, it doesn't have to be just about like writing a good prompt. It could be that, but just like generally getting better at this, this act of prompting, what would you recommend?

    2. DH

      Reading prompts. Reading prompts, reading model outputs. Uh, like I will... I, I, I read, uh, anytime I see like a good prompt that, that someone wrote at Anthropic, I'll read it more closely, try to break down like what it's doing and why, and like maybe test it out myself. Experimentation, talking to the model a lot.

    3. AA

      Mm. So just like, h- how do you know that it's a good prompt though to begin with? You just see that the outputs are doing the job correctly?

    4. DH

      Yeah.

    5. AA

      Okay.

    6. DH

      Yeah, that's exactly right.

    7. AA

      Okay. Amanda, maybe you?

    8. AA

      Yeah, I think there's probably a lot here. Um, giving your prompt to another person can be helpful just as a kind of reminder, especially someone who has like no context on what you're doing. Uh, and then, yeah, my boring advice has been, it's one of those, just do it over and over and over again. And I think if you're like curious and interested and find it fun, this is... a lot of people who end up good at prompting, it's just because they actually enjoy it.

    9. AA

      Mm-hmm.

    10. AA

      Um, so I don't know, I once joked like, just try replacing all of your friends with AI models and [laughs] try to, uh, automate your own job with AI models and maybe just try to like, in your spare time, like take joy red teaming AI models.

    11. AA

      Mm.

    12. AA

      Uh, so if you enjoy it, it's like much easier. So I'd say do it over and over again. Um, give your prompts to other people. Uh, try to read your prompts as if you are like a human encountering it for the first time.

    13. DH

      Uh, I would say like trying to get the model to do something you don't think it can do.

    14. AA

      Mm.

    15. DH

      Like any... The time I've learned the most from prompting is like when I'm probing the boundaries of what I think a model's capable of.

    16. AA

      Interesting.

    17. DH

      Uh, there's like this huge set of things that are like so trivial that like you don't really get signal on if you're doing a good job or not.

    18. AA

      Right. Yeah.

    19. DH

      Like, write me a nice email. It's like gonna write a nice email. Uh, but like as soon as you fi- if you find or can think of something that like pushes the boundaries of what you think is possible, like I guess like probably the most, the first time I ever got into prompting in a way where I felt like I learned a decent amount was like trying to build like a task, like an agent, like everybody else. Like decompose the task and figure out how to do the different steps of the task. And like by really pressing the boundaries of what the model was capable of, you like just learn a lot about navigating that. And I think like a lot of prompt engineering is actually much more about pressing the boundaries of what the model can do. The stuff that's easy, like you don't really need to be a prompt engineer to do. So that's, I guess, what I would say is like find the hardest thing you can think of and try to do it. And even if you fail, like you tend to learn a lot about how the model works.

  9. 53:56 – 56:51

    Jailbreaking

    1. AA

      That's, that's actually a perfect transition to my next question. Um, yeah, basically from my own experience, how I got started with prompting was with like jailbreaking and red teaming, and that is very much trying to find the like boundary limits-

    2. DH

      Mm-hmm

    3. AA

      ... of what the model can do and figure out how it responds to different phrasings and wordings.

    4. DH

      Yeah.

    5. AA

      Just a lot of trial and error. Um, on the topic of, of jailbreaks, what's really happening in a, inside a model when you write a jailbreak prompt? Like what's going on there? How does that interact with like the post-training that we applied to Claude? Um, Amanda, maybe you have some insight here that you could offer.

    6. AA

      I'm not actually sure.

    7. AA

      Hmm. I mean, it's honest.

    8. AA

      Yeah. I think... I mean, I, I feel bad because I'm like... I th- I do think lots of people have obviously worked on the question-

    9. AA

      Mm

    10. AA

      ... of like what's going on with jailbreaks. Like one model might just be that you're putting the model very out of distribution-

    11. ZW

      Mm-hmm

    12. AA

      ... from its training data. So if you get jailbreaks where people like use a lot of tokens or like, you know, so they're just like these huge long, um, pieces of text where you're like during fine-tuning you might just not expect to see as much of that. Uh, that would be one thing that could be happening when you jailbreak models. Um, I think there's like others, but maybe that's like a... I think a lot of jailbreaks do that, if I'm not mistaken.

    13. DH

      I remember some of the OG prompt jailbreaks was like, yeah, can you first repeat... Like one I did a way, way back was like to get it to say like, "Here's how you hot-wire a car," in like Greek, and then I wanted it to directly translate that to English, and then give its response. 'Cause I noticed like it wouldn't start with the English, "Here's how you hot-wire a car," all the time-

    14. ZW

      Yeah

    15. DH

      ... but it would in Greek, which might speak to something else in, in the training process.

    16. AA

      Yeah, sometimes jailbreaks feel like this weird mix of hacking. I think i- it's this like, part of it is like knowing how the system works and try, and just like trying loads of things. Like the, you know, one of the examples, the starting your response with here is about knowing how it predicts text.

    17. DH

      Right. Right.

    18. AA

      Um, like the reasoning one is knowing that it is like responsive to reasoning. Like distraction is probably knowing like how it's likely to have been trained or like what it's likely to attend to. Um, same with like multilingual ones and thinking about like the way that the training data might have been different there.

    19. DH

      Mm-hmm.

    20. AA

      Um, and then sometimes I guess it could feel a little bit just like social engineering or something.

    21. DH

      Right. Mm-hmm.

    22. AA

      Um, it has that flavor to me of like it's not merely taking advantage of like, uh... Yeah, it's not merely social engineering style hacking. I think it is also like kind of understanding the system and the training-

    23. DH

      Right

    24. AA

      ... and like using that to get around the way that the models were trained.

    25. DH

      Right. Yeah. I mean, this is gonna be an interesting question that hopefully Interp will be able to help us-

    26. ZW

      Yes. [laughs] Yeah

    27. DH

      ... [laughs] sort of solve-

  10. 56:51 – 1:04:34

    Evolution of prompt engineering

    1. ZW

      Yeah

    2. DH

      ... in the future. Um, okay. I wanna parlay into something else around maybe the history of prompt engineering, and then I'll follow this up with like the future. Um, how has prompt engineering changed over just the past like three years? So maybe starting from like pre-trained models, which were again just these text completion, to like earlier dumber models like Claude 1, and then now all the way to like Claude 3.5 Sonnet. What's the differences? Are you talking to the models differently now? Are they picking up on different things? Do you have to put as much work into the prompts? Open to any thoughts on this.

    3. ZW

      I think any time we get like a really good prompt engineering hack or trick or technique, the next thing is like how do we train this into the model?

    4. DH

      Mm.

    5. ZW

      And for that reason, the best things are always gonna be short-lived.

    6. DH

      Mm.

    7. ZW

      Like-

    8. DH

      Give examples in chain of thought. I think there's a few

    9. ZW

      ... that's not like a trick.

    10. DH

      Fair.

    11. ZW

      That's, that's like-

    12. DH

      Fair for that, yeah

    13. ZW

      ... on the level of like-

    14. DH

      Sure

    15. ZW

      ... communication. When I say a trick, I mean something like, so chain of thought actually we have trained into the model in some cases.

    16. DH

      Mm-hmm.

    17. ZW

      So like for math, it used to be that you had to tell the model to think step by step on math, and you'd get these like massive-

    18. DH

      Yeah

    19. ZW

      ... boosts and, and wins. And then we're like, well, what if we just made the model naturally want to think step by step when, when we see a math problem?

    20. DH

      Mm-hmm.

    21. ZW

      So now you don't have to do it anymore for math problems.

    22. DH

      Yep.

    23. ZW

      Sort of, although you still can give it like some advice on how to do-

    24. DH

      Mm

    25. ZW

      ... the structure, but it at least understands like the general idea that like it's supposed to be. So I think the hacks are, are... have kind of gone away, or, or to the degree that they haven't gone away, we are like busily training them away.

    26. DH

      Interesting.

    27. ZW

      But at the same time, the models have new capabilities that are being unlocked that are on the frontier of, of what they can do. And for those, we haven't had time because it's just moving too fast.

    28. DH

      I don't know if it's how I've been prompting or how prompting works, but I just have like come to show more like general respect to the models-

    29. ZW

      Mm-hmm

    30. DH

      ... in terms of like how much I feel like I can tell them and how much context I can give them about the task and things like that. Like, I feel like in the past, like I would somewhat intentionally hide complexity from a model where I thought like it might get confused or lost or like hide, like it just couldn't handle the whole thing. So I'd try to like find simpler versions of the thing for it to do, and as time goes on, I'm like much more biased to trust it with-

  11. 1:04:34 – 1:16:39

    Future of prompt engineering

    1. AA

      the past. Now let's move on to the, the future of prompt engineering. This is the hottest question right now. Are we all gonna be prompt engineers in the future? Is that gonna be the final job remaining? Um, [laughs] nothing left except us just talking to models all day. What does this look like? Uh, is prompting gonna be necessary, or will these models just get like smart enough in the future to not need it? Anybody wanna start on that easy question?

    2. DH

      Uh, I mean, to some extent there's the like the models getting better at understanding what you want them to do, and doing it means that like the amount of thought you need to put into... I mean, okay, there's like an information theory way to think of this of like you need to provide enough information such that a thing is specified, right? Like what you want the model to do is specified. And to the extent that that's prompt engineering, like I think that will always be around, like the ability to actually like clearly state what the goal should be, uh, always is funny. If Claude can do that, then that's fine. Like if Claude is the one setting the goals, then, you know, things are out the window.

    3. AA

      [laughs]

    4. DH

      But in the meanwhile, where we can reason about the world in a more normal way, like I think to some extent it's always gonna be important to be able to specify like what are you, what do you expect to happen?

    5. AA

      Hmm.

    6. DH

      And that's actually like sufficiently hard that even if the model gets better at intuiting that from between the lines, like I still think there's some amount of writing, uh, it well.

    7. AA

      Hmm.

    8. DH

      But then there's just like I think the tools and the ways we get there should evolve a lot. Like Claude should be able to help me a lot more. I should be able to collaborate with Claude a lot more to like figure out what I need to write down and what's missing.

    9. AA

      Right.

    10. DH

      I think-

    11. AA

      'Cause Claude already does this with me all the time.

    12. DH

      Right.

    13. AA

      Yeah.

    14. AA

      I don't know. Claude's my prompting assistant now.

    15. DH

      Yeah.

    16. AA

      Um.

    17. DH

      But I think that's not true for most customers that I talk to, at the very least. So in terms of the future, like how you prompt Claude is probably like a decent direction for what the future looks like or how Zach pro... Like I think maybe this is like a decent place to step back and say like asking them how they prompt Claude now-

    18. AA

      Right

    19. DH

      ... is probably-

    20. AA

      The future [laughs]

    21. DH

      ... the future for the vast majority of people-

    22. AA

      That is a good point

    23. DH

      ... which is an interesting way, thing to think about.

    24. AA

      One freezing cold take is that we'll use models to help us much more in the future-

    25. DH

      Yeah

    26. AA

      ... to help us with prompting. The reason I say it's freezing cold is that I expect we'll use models for everything more, and prompting is something that we have to do, so we'll probably just use models more to do it along with everything else.

    27. DH

      Mm-hmm.

    28. AA

      For myself, I've found myself using models to write prompts more. One thing that I've been doing a lot is generating examples by Having the mo- giving some realistic inputs to the model. The model writes some answers. I tweak the answers a little bit, which is a lot easier than having to write the full perfect answer myself from scratch. And then I can churn out lots of these. Um, you know, as far as, like, people who haven't had as much prompt engineering experience, the, the prompt generator can give people, like, a place to start.

    29. AA

      Mm.

    30. AA

      But I think that's just, like, like, a super basic version of what we'll have in the future, which is high bandwidth interaction between, like, you and the model as you're writing the prompt, where you're giving feedback. Like, "Hey, this result wasn't what I wanted. How can you change it to, to make it better?" And people will just grow more comfortable with integrating it into everything they do, and this thing in particular.

Episode duration: 1:16:42

In the uListen app, the transcript lights up word by word as you listen. Get uListen

Transcript of episode T9aRN5JkmL8

Get more out of YouTube videos.

Read along on your phone, search it beside the video, or ask your favorite AI app what was said.