원문

번역

Welcome to this course on ChatGPT Prompt Engineering for Developers. I'm thrilled to have with me Isa Fulford to teach this along with me. She is a member of the technical staff of OpenAI and had built the popular ChatGPT Retrieval plugin and a large part of her work has been teaching people how to use LLM or Large Language Model technology in products. She's also contributed to the OpenAI Cookbook that teaches people prompting. So thrilled to have you with me. And I'm thrilled to be here and share some prompting best practices with you all. So, there's been a lot of material on the internet for prompting with articles like 30 prompts everyone has to know.

개발자를 위한 ChatGPT Prompt Engineering 과정에 오신 것을 환영합니다. 나와 함께 이것을 가르칠 Isa Fulford와 함께하게 되어 기쁩니다. 그녀는 OpenAI의 기술 직원이며 인기 있는 ChatGPT Retrieval 플러그인을 구축했으며 작업의 대부분은 제품에서 LLM 또는 대규모 언어 모델 기술을 사용하는 방법을 사람들에게 가르치는 것입니다. 그녀는 또한 사람들에게 프롬프트를 가르치는 OpenAI Cookbook에 기여했습니다. 당신이 나와 함께 있어서 정말 기쁩니다. 그리고 저는 이 자리에 참석하여 몇 가지 유용한 모범 사례를 여러분 모두와 공유하게 되어 기쁩니다. 그래서 인터넷에는 모두가 알아야 할 30가지 프롬프트와 같은 기사로 프롬프트에 대한 많은 자료가 있습니다.

A lot of that has been focused on the chatGPT web user interface, which many people are using to do specific and often one-off tasks. But, I think the power of LLMs, large language models, as a developer tool, that is using API calls to LLMs to quickly build software applications, I think that is still very underappreciated.  In fact, my team at AI Fund, which is a sister company to DeepLearning.ai, has been working with many startups on applying these technologies to many different applications, and it's been exciting to see what LLM APIs can enable developers to very quickly build.

그 중 많은 부분이 chatGPT 웹 사용자 인터페이스에 초점을 맞추었습니다. 많은 사람들이 특정 작업과 종종 일회성 작업을 수행하는 데 사용하고 있습니다. 그러나 LLM에 대한 API 호출을 사용하여 소프트웨어 애플리케이션을 신속하게 구축하는 개발자 도구로서의 LLM, 대규모 언어 모델의 힘은 여전히 과소 평가되고 있다고 생각합니다. 사실, DeepLearning.ai의 자매 회사인 AI Fund의 제 팀은 이러한 기술을 다양한 애플리케이션에 적용하기 위해 많은 신생 기업과 협력해 왔으며, LLM API를 통해 개발자가 매우 빠르게 구축할 수 있는 것을 보는 것은 흥미로웠습니다. .

So, in this course, we'll share with you some of the possibilities for what you can do, as well as best practices for how you can do them. There's a lot of material to cover. First, you'll learn some prompting best practices for software development, then we'll cover some common use cases, summarizing, inferring, transforming, expanding, and then you'll build a chatbot using an LLM. We hope that this will spark your imagination about new applications that you can build. So in the development of large language models or LLMs, there have been broadly two types of LLMs, which I'm going to refer to as base LLMs and instruction-tuned LLMs. So, base LLM has been trained to predict the next word based on text training data, often trained on a large amount of data from the internet and other sources to figure out what's the next most likely word to follow.

따라서 이 과정에서는 수행할 수 있는 몇 가지 가능성과 수행 방법에 대한 모범 사례를 공유합니다. 가릴 자료가 많습니다. 먼저 소프트웨어 개발을 위한 몇 가지 프롬프트 모범 사례를 배운 다음 몇 가지 일반적인 사용 사례, 요약, 추론, 변환, 확장을 다룬 다음 LLM을 사용하여 챗봇을 구축합니다. 이것이 구축할 수 있는 새로운 애플리케이션에 대한 상상력을 자극하기를 바랍니다. 따라서 대규모 언어 모델 또는 LLM의 개발에는 크게 두 가지 유형의 LLM이 있으며, 이를 기본 LLM명령 조정 LLM이라고 합니다. 따라서 기본 LLM은 텍스트 훈련 데이터를 기반으로 다음 단어를 예측하도록 훈련되었으며, 종종 인터넷 및 기타 소스의 많은 양의 데이터에 대해 훈련되어 다음에 따라올 가능성이 가장 높은 단어가 무엇인지 알아냅니다.

So, for example, if you were to prompt us once upon a time there was a unicorn, it may complete this, that is it may predict the next several words are that live in a magical forest with all unicorn friends. But if you were to prompt us with what is the capital of France, then based on what articles on the internet might have, it's quite possible that the base LLM will complete this with what is France's largest city, what is France's population and so on, because articles on the internet could quite plausibly be lists of quiz questions about the country of France.

예를 들어, 옛날 옛적에 유니콘이 있었다는 메시지를 표시하면 이를 완료할 수 있습니다. 즉, 모든 유니콘 친구들과 함께 마법의 숲에 사는 다음 몇 단어를 예측할 수 있습니다. 그러나 프랑스의 수도가 어디인지 묻는 메시지가 표시되면 인터넷에 있는 기사에 따라 기본 LLM이 프랑스에서 가장 큰 도시, 프랑스 인구 등으로 완료할 가능성이 큽니다. , 왜냐하면 인터넷의 기사는 프랑스 국가에 대한 퀴즈 질문 목록일 가능성이 매우 높기 때문입니다.

In contrast, an instruction-tuned LLM, which is where a lot of momentum of LLM research and practice has been going, an instruction-tuned LLM has been trained to follow instructions. So, if you were to ask it what is the capital of France, it's much more likely to output something like, the capital of France is Paris. So the way that instruction-tuned LLMs are typically trained is you start off with a base LLM that's been trained on a huge amount of text data and further train it, further fine-tune it with inputs and outputs that are instructions and good attempts to follow those instructions, and then often further refine using a technique called RLHF, reinforcement learning from human feedback, to make the system better able to be helpful and follow instructions.

대조적으로, LLM 연구 및 실습의 많은 모멘텀이 진행되고 있는 명령 조정 LLM은 명령을 따르도록 훈련되었습니다. 따라서 프랑스의 수도가 어디인지 묻는다면 프랑스의 수도는 파리라고 출력할 가능성이 훨씬 더 높습니다. 따라서 명령 조정 LLM이 일반적으로 훈련되는 방식은 막대한 양의 텍스트 데이터에 대해 훈련된 기본 LLM으로 시작하여 추가로 훈련하고 명령인 입력 및 출력으로 미세 조정하고 다음을 수행하는 좋은 시도입니다. 이러한 지침을 따른 다음 종종 RLHF라는 기술, 사람의 피드백을 통한 강화 학습을 사용하여 더욱 개선하여 시스템이 더 유용하고 지침을 따를 수 있도록 합니다.

Because instruction-tuned LLMs have been trained to be helpful, honest, and harmless, so for example, they are less likely to output problematic text such as toxic outputs compared to base LLM, a lot of the practical usage scenarios have been shifting toward instruction-tuned LLMs. Some of the best practices you find on the internet may be more suited for a base LLM, but for most practical applications today, we would recommend most people instead focus on instruction-tuned LLMs which are easier to use and also, because of the work of OpenAI and other LLM companies becoming safer and more aligned.   So, this course will focus on best practices for instruction-tuned LLMs, which is what we recommend you use for most of your applications.\

명령 조정 LLM은 도움이 되고 정직하며 무해하도록 훈련되었기 때문에 예를 들어 기본 LLM에 비해 유해한 출력 문제가 있는 텍스트를 출력할 가능성이 낮기 때문에 많은 실제 사용 시나리오가 명령 조정 LLM 으로 이동하고 있습니다. 인터넷에서 찾은 모범 사례 중 일부는 기본 LLM에 더 적합할 수 있지만 오늘날 대부분의 실용적인 응용 프로그램의 경우 대부분의 사람들이 사용하기 쉽고 또한 작업으로 인해 명령 조정 LLM에 집중하는 것이 좋습니다. OpenAI 및 기타 LLM 회사가 더 안전해지고 정렬됩니다. 따라서 이 과정에서는 대부분의 응용 프로그램에 사용하도록 권장하는 지침 조정 LLM의 모범 사례에 중점을 둘 것입니다.

Before moving on, I just want to acknowledge the team from OpenAI and DeepLearning.ai that had contributed to the materials that Isa and I will be presenting. I'm very grateful to Andrew Mayne, Joe Palermo, Boris Power, Ted Sanders, and Lillian Weng from OpenAI that were very involved with us brainstorming materials, vetting the materials to put together the curriculum for this short course, and I'm also grateful on the DeepLearning side for the work of Geoff Lodwig, Eddy Shyu and Tommy Nelson. So, when you use an instruction-tuned LLM, think of giving instructions to another person, say someone that's smart but doesn't know the specifics of your task. So, when an LLM doesn't work, sometimes it's because the instructions weren't clear enough. For example, if you were to say, please write me something about Alan Turing. 

계속 진행하기 전에 Isa와 제가 발표할 자료에 기여한 OpenAI 및 DeepLearning.ai 팀에 감사를 표하고 싶습니다. 브레인스토밍 자료와 이 짧은 과정의 커리큘럼을 구성하기 위해 자료를 검토하는 데 매우 관여한 OpenAI의 Andrew Mayne, Joe Palermo, Boris Power, Ted Sanders 및 Lillian Weng에게 매우 감사합니다. Geoff Lodwig, Eddy Shyu 및 Tommy Nelson의 작업에 대해 DeepLearning 측에 감사드립니다. 따라서 지침 조정 LLM을 사용할 때 다른 사람에게 지침을 제공하는 것을 생각하십시오. 똑똑하지만 작업의 세부 사항을 모르는 사람이라고 말하십시오. 따라서 LLM이 작동하지 않는 경우 지침이 충분히 명확하지 않았기 때문일 수 있습니다. 예를 들어 앨런 튜링에 대한 글을 써주세요.

Well, in addition to that, it can be helpful to be clear about whether you want the text to focus on his scientific work or his personal life or his role in history or something else. And if you specify what you want the tone of the text to be, should it take on the tone like a professional journalist would write. Or is it more of a casual note that you dash off to a friend? That helps the LLM generate what you want. And of course, if you picture yourself asking, say, a fresh college graduate to carry out this task for you, if you can even specify what snippets of text, they should read in advance to write this text about Alan Turing, then that even better sets up that fresh college grad for success to carry out this task for you. So, in the next video, you see examples of how to be clear and specific, which is an important principle of prompting LLMs. And you also learn from Isa a second principle of prompting that is giving the LLM time to think. So with that, let's go on to the next video.

글쎄요, 그 외에도 텍스트가 그의 과학적 작업, 개인 생활 또는 역사에서의 역할 또는 다른 것에 초점을 맞추고 싶은지 명확하게 하는 것이 도움이 될 수 있습니다. 그리고 원하는 텍스트의 어조를 지정하면 전문 저널리스트가 쓰는 것과 같은 어조를 취해야 합니다. 아니면 친구에게 달려가는 캐주얼 메모에 가깝습니까? 이는 LLM이 원하는 것을 생성하는 데 도움이 됩니다. 그리고 물론, 예를 들어 신입 대학 졸업생에게 이 작업을 수행하도록 요청하는 자신을 상상한다면, 텍스트의 일부를 지정할 수 있다면 Alan Turing에 대한 이 텍스트를 작성하기 위해 미리 읽어야 합니다. 이 작업을 성공적으로 수행할 수 있도록 신입 대학 졸업생을 더 잘 설정하십시오. 그래서 다음 비디오에서는 LLM을 유도하는 중요한 원칙인 명확하고 구체적인 방법에 대한 예를 볼 수 있습니다. 또한 LLM에게 생각할 시간을 주는 두 번째 프롬프트 원칙을 Isa로부터 배웁니다. 그럼 다음 영상으로 넘어가겠습니다.


Key point


  • 기본 LLM은 인터넷에서 수집한 데이터 기반이나 Instruction-tuned LLM은 RLHF 기반으로 강화학습이 되어 있으므로 일반적인 시나리오에 더 유용한 결과를 보여줍니다.
  • RAG 관련해서는 다음을 참고합니다. Retrieval의 효과 - Retrieval..


  • 레이블 없음