You’re Using ChatGPT Wrong!
ChatGPT 사용자의 99%보다 앞서가는 방법은 다음과 같습니다.
Here’s How to Be Ahead of 99% of ChatGPT Users
프롬프트 엔지니어링을 학습하여 ChatGPT를 마스터하세요.
Master ChatGPT by learning prompt engineering.
![](https://blog.kakaocdn.net/dn/MwPM3/btr5sgDaDK6/82cIhOx7OgpH8dNL4lQt3K/img.jpg)
Image licensed from Shutterstock
우리들 대부분은 ChatGPT를 잘못 사용하고 있습니다.
우리는 프롬프트에 예제를 포함하지 않습니다.
역할 을 통해 ChatGPT 동작을 제어할 수 있다는 사실을 무시합니다.
일부 정보를 제공하는 대신 ChatGPT가 추측하게 만듭니다.
Most of us use ChatGPT wrong.
We don’t include examples in our prompts.
We ignore that we can control ChatGPT’s behavior with roles.
We let ChatGPT guess stuff instead of providing it with some information.
작업을 한 번 완료하는 데는 도움이 될 수 있지만 항상 그렇지는 않은 표준 프롬프트를 주로 사용하기 때문에 이런 일이 발생합니다.
더 나은 결과를 얻으려면 #고품질프롬프트 만드는 방법을 배워야 합니다.
#프롬프트엔지니어링 을 배워야 합니다!
그리고 이 가이드에서는 프롬프트 엔지니어링에 사용되는 4가지 기술을 배웁니다.
This happens because we mostly use standard prompts that might help us get the job done once, but not all the time.
We need to learn how to create high-quality prompts to get better results. We need to learn prompt engineering! And, in this guide, we’ll learn 4 techniques used in prompt engineering.
읽기 싫으시면 아래 제 영상을 보시면 됩니다.
If you don’t feel like reading, you can watch my video below.
몇 가지 샷 표준 프롬프트
Few Shot Standard Prompts
몇 가지 샷 표준 프롬프트는 이전에 본 표준 프롬프트이지만 그 안에 작업의 예가 있습니다.
Few shot standard prompts are the standard prompts we’ve seen before, but with examples of the task in them.
왜 예입니까?
음, 원하는 결과를 얻을 가능성을 높이려면 프롬프트가 해결하려는 작업의 예를 추가해야 합니다.
Why examples? Well, If you want to increase your chances to get the desired result, you have to add examples of the task that the prompt is trying to solve.
몇가지 샷 표준 프롬프트는 작업 설명, 예제 및 프롬프트로 구성됩니다.
이 경우 프롬프트는 모델이 누락된 텍스트를 생성하여 완료해야 하는 새 예제의 시작입니다.
Few-shot standard prompts consist of a task description, examples, and the prompt. In this case, the prompt is the beginning of a new example that the model should complete by generating the missing text.
다음은 몇 가지 샷 표준 프롬프트의 구성 요소입니다.
Here are the components of few shot standard prompts.
![](https://blog.kakaocdn.net/dn/uM7E7/btr5qtb0TKF/A6Vfoc95ZmvnKXFFpPyOs1/img.png)
Image by author
"I want to fly from Orlando to Boston"
이제 다른 프롬프트를 만들어 보겠습니다.
"I want to fly from Orlando to Boston"이라는 텍스트에서 공항 코드를 추출하고 싶다고 가정해 보겠습니다.
"I want to fly from Orlando to Boston"
Now let’s create another prompt. Say we want to extract airport codes from the text “I want to fly from Orlando to Boston”
다음은 대부분이 사용하는 표준 프롬프트입니다.
Here’s the standard prompt that most would use.
이 텍스트 “I want to fly from Orlando to Boston”에서 공항 코드를 추출합니다.Extract the airport codes from this text: “I want to fly from Orlando to Boston”
이렇게 하면 작업이 완료될 수 있지만 때로는 충분하지 않을 수 있습니다.
이러한 경우 몇 가지 샷 표준 프롬프트를 사용해야 합니다.
This might get the job done, but sometimes it might not be enough. In such cases, you have to use few shot standard prompts.
아래 텍스트에서 공항 코드를 추출합니다:
Extract the airport codes from this text:
텍스트: "로스앤젤레스에서 마이애미로 가는 비행기를 타고 싶어요."
공항 코드: LAX, MIA
Text: “I want to fly from Los Angeles to Miami.”
Airport codes: LAX, MIA
텍스트: "내슈빌에서 캔자스시티로 가는 비행기를 타고 싶어요."
공항 코드: BNA, MCI
Text: “I want to fly from Nashville to Kansas City.”
Airport codes: BNA, MCI
텍스트: "올랜도에서 보스턴으로 가는 비행기를 타고 싶어요"
공항 코드:
Text: “I want to fly from Orlando to Boston”
Airport codes:
ChatGPT에서 이전 프롬프트를 시도하면 예제에서 지정한 형식(MCO, BOS)으로 공항 코드를 얻게 됩니다.
If we try the previous prompt on ChatGPT, we’re going to get the airport code in the format we specified in the example (MCO, BOS)
이전 연구에서는 예제의 실제 답변이 중요하지 않지만 labelspace 가 중요하다는 사실을 알아냈습니다.
labelspace 는 주어진 작업에 대해 가능한 모든 레이블입니다.
labelspace 에서 임의의 레이블을 제공하여 프롬프트 결과를 개선할 수도 있습니다.
Keep in mind that previous research found that the actual answers in the examples are not important, but the labelspace is. A labelspace is all the possible labels for a given task. You could improve the results of your prompts by even providing random labels from the labelspace.
예제에서 임의의 공항 코드를 입력하여 이를 테스트해 보겠습니다.
Let’s test this by typing random airport codes in our example.
이 텍스트에서 공항 코드를 추출합니다:
Extract the airport codes from this text:
텍스트: "로스앤젤레스에서 마이애미로 가는 비행기를 타고 싶어요."
공항 코드: DEN, OAK
Text: “I want to fly from Los Angeles to Miami.”
Airport codes: DEN, OAK
텍스트: "내슈빌에서 캔자스시티로 가는 비행기를 타고 싶어요."
공항 코드: DAL, IDA
Text: “I want to fly from Nashville to Kansas City.”
Airport codes: DAL, IDA
텍스트: "올랜도에서 보스턴으로 가는 비행기를 타고 싶어요"
공항 코드:
Text: “I want to fly from Orlando to Boston”
Airport codes:
ChatGPT에서 이전 프롬프트를 시도한 경우, 여전히 올바른 공항 코드 MCO 및 BOS를 받게 됩니다.
If you tried the previous prompt on ChatGPT, you’ll still get the right airport codes MCO and BOS.
예제가 올바른지 여부에 관계없이 labelspace에서 임의의 레이블을 포함하십시오.
이렇게 하면 결과를 개선하고 프롬프트에 대한 답변 형식을 지정하는 방법을 모델에 지시하는 데 도움이 됩니다.
Whether your examples are correct or not, include random labels from the labelspace. This will help you improve results and instruct the model on how to format the answer to the prompt.
역할 프롬프트 Role Prompting
때때로 ChatGPT의 기본 동작은 원하는 것을 얻기에 충분하지 않습니다.
이때 ChatGPT의 역할을 설정해야 합니다.
면접을 위해 연습하고 싶다고 가정해 보겠습니다.
ChatGPT에 "채용 관리자 역할"을 지시하고 프롬프트에 세부 정보를 추가하면 모든 직책에 대한 면접을 시뮬레이션할 수 있습니다.
Sometimes the default behavior of ChatGPT isn’t enough to get what you want. This is when you need to set a role for ChatGPT.
Say you want to practice for a job interview. By telling ChatGPT to “act as hiring manager” and adding more details to the prompt, you’ll be able to simulate a job interview for any position.
![](https://blog.kakaocdn.net/dn/dcUutn/btr5pyEzPg7/Xfjq84YHYv4hrNIyaNXRy0/img.png)
Image by author
보시다시피, ChatGPT는 직장을 위해 저를 인터뷰하는 것처럼 행동합니다.
마찬가지로 ChatGPT를 스페인어와 같은 외국어를 연습하는 언어 튜터로, 원하는 영화를 분석하는 영화 평론가로 전환할 수 있습니다.
As you can see, ChatGPT behaves like he’s interviewing me for a job position.
Just like that, you can turn ChatGPT into a language tutor to practice a foreign language like Spanish or a movie critic to analyze any movie you want.
"...로 행동 Act as a … ” 라는 단어로 프롬프트를 시작한 다음 가능한 한 많은 세부 정보를 추가하기만 하면 됩니다.
영감이 필요한 경우, ChatGPT가 스탠드업 코미디언, 의사 등처럼 작동하도록 프롬프트를 찾을 수 있는 이 저장소를 확인하십시오.
You only need to start your prompt with the words “Act as a … ” and then add as many details as possible. If you need some inspiration, check this repository where you’ll find prompts to make ChatGPT behave like a stand-up comedian, doctor, and more.
프롬프트에 개성을 더하고 지식을 생성하세요
Add personality to your prompts and generate knowledge
이메일, 블로그, 이야기, 기사 등을 위한 텍스트를 생성할 때 이 2가지 프롬프트 접근방식이 좋습니다.
첫째, "프롬프트에 개성을 더하다"는 것은 스타일과 설명자를 추가하는 것을 의미합니다.
스타일을 추가하면 텍스트가 특정 어조, 형식, 작가의 영역 등을 얻는 데 도움이 될 수 있습니다.
These two prompting approaches are good when it comes to generating text for emails, blogs, stories, articles, etc.
First, by “adding personality to our prompts” I mean adding a style and descriptors. Adding a style can help our text get a specific tone, formality, domain of the writer, and more.
10년 이상 경험을 가진 [분야] 전문가 스타일로 [주제]를 작성합니다.
Write [topic] in the style of an expert in [field] with 10+ years of experience.
출력을 더욱 사용자 정의하기 위해 디스크립터를 추가할 수 있습니다.
설명자는 단순히 프롬프트를 조정하기 위해 추가할 수 있는 형용사입니다.
To customize the output even further we can add descriptors. A descriptor is simply an adjective that you can add to tweak your prompt.
AI가 인간을 대체하는 방법에 대한 500개의 블로그 게시물을 작성하고 싶다고 가정해 보겠습니다.
"AI가 인간을 대체하는 방법에 대한 500개의 블로그 게시물 작성"이라는 단어로 표준 프롬프트를 만들면 아마도 매우 일반적 게시물을 받게 될 것입니다.
Say you want to write a 500-blog post on how AI will replace humans. If you create a standard prompt with the words “write a 500-blog post on how AI will replace humans,” you’d probably get a very generic post.
하지만 영감을 주는, 냉소적인, 흥미로운, 재미있는 등의 형용사를 추가하면 출력이 크게 달라집니다.
However, if you add the adjectives such as inspiring, sarcastic, intriguing, and entertaining, the output will significantly change.
이전 프롬프트에 설명자를 추가해 보겠습니다.
Let’s add descriptors to our previous prompt.
AI가 인간을 대체하지 못하는 이유에 대한 재치 있는 500개 블로그 게시물을 작성하세요. 10년 이상의 경력을 가진 인공 지능 전문가의 스타일로 작성하십시오.
재미있는 예를 들어 설명해 보세요
Write a witty 500-blog post on why AI will not replace humans. Write in the style of an expert in artificial intelligence with 10+ years of experience. Explain using funny examples
우리 예에서 AI 전문가 스타일과 witty, funny와 같은 형용사는 ChatGPT에서 생성된 텍스트에 다른 터치를 추가하고 있습니다.
이것의 부작용은 AI 감지기가 텍스트를 감지하기 어렵다는 것입니다(이 기사에서는 AI 감지기를 속이는 다른 방법을 보여줍니다).
In our example, the style of an expert in AI and adjectives such as witty and funny are adding a different touch to the text generated by ChatGPT. A side effect of this is that our text will be hard to detect by AI detectors (in this article, I show other ways to fool AI detectors).
마지막으로 생성된 지식 접근방식을 사용하여 블로그 게시물을 개선할 수 있습니다.
이것은 최종 응답을 생성하기 전에 주제에 대한 잠재적으로 유용한 정보를 생성하는 것으로 구성됩니다.
Finally, we can use the generated knowledge approach to improve the blog post. This consists in generating potentially useful information about a topic before generating a final response.
예를 들어 이전 프롬프트로 게시물을 생성하기 전에 먼저 지식을 생성한 다음 게시물을 작성할 수 있습니다.
For example, before generating the post with the previous prompt we could first generate knowledge and only then write the post.
"AI는 인간을 대체하지 않을 것"에 대한 5가지 사실 생성하시오
Generate 5 facts about “AI will not replace humans”
5가지 사실이 있으면 이 정보를 다른 프롬프트에 입력하여 더 나은 게시물을 작성할 수 있습니다.
Once we have the 5 facts we can feed this information to the other prompt to write a better post.
# Fact 1
# Fact 2
# Fact 3
# Fact 4
# Fact 5
위의 사실을 사용하여 AI가 인간을 대체하지 못하는 이유에 대한 재치 있는 500개의 블로그 게시물을 작성하십시오.
10년 이상의 경력을 가진 인공 지능 전문가의 스타일로 작성하십시오.
재미있는 예를 들어 설명해 보세요
Use the above facts to write a witty 500-blog post on why AI will not replace humans. Write in the style of an expert in artificial intelligence with 10+ years of experience. Explain using funny examples
Chain of Thought Prompting
표준 프롬팅과 달리 일련의 사고 프롬프팅에서는 모델이 문제에 대한 최종 답변을 제공하기 전에 중간 추론 단계를 생성하도록 유도됩니다.
즉, 모델은 문제에 대한 답을 직접 제공하는 대신 추론을 설명합니다.
Unlike standard prompting, in chain of thought prompting, the model is induced to produce intermediate reasoning steps before giving the final answer to a problem. In other words, the model will explain its reasoning instead of directly giving the answer to a problem.
추론이 중요한 이유는 무엇입니까? 추론에 대한 설명은 종종 더 정확한 결과로 이어집니다.
Why is reasoning important? The explanation of reasoning often leads to more accurate results.
일련의 사고 프롬프팅을 사용하려면 동일한 예에서 추론이 설명되는 몇 가지 예를 제공해야 합니다.
To use chain of thought prompting, we have to provide few-shot examples where the reasoning is explained in the same example.
이런 식으로 프롬프트에 답할 때 추론 프로세스도 표시됩니다.
In this way, the reasoning process will also be shown when answering the prompt.
다음은 표준과 일련의 사고 프롬프팅을 비교한 것입니다.
Here’s a comparison between standard and chain of thought prompting.
![](https://blog.kakaocdn.net/dn/GcXOL/btr5pyYUXg7/jZMh3pPW969LkX6iiC3sQK/img.png)
Source: Google Research
보시다시피, 모델이 이 수학 문제를 풀기 위한 추론을 설명하도록 유도되었다는 사실이 일련의 사고 프롬프팅에서 더 정확한 결과를 가져왔습니다.
일련의 사고 유도는 산술, 상식 및 상징적 추론 작업의 결과를 개선하는 데 효과적이라는 점에 유의하십시오.
As we can see, the fact that the model was induced to explain its reasoning to solve this math problem led to more accurate results in chain of thought prompting.
Note that chain of thought prompting is effective in improving results on arithmetic, commonsense, and symbolic reasoning tasks.
인공 코너의 무료 ChatGPT 치트 시트
Artificial Corner’s Free ChatGPT Cheat Sheet
독자들에게 무료 치트 시트를 제공하고 있습니다. 20,000명 이상의 뉴스레터에 가입하고 무료 ChatGPT 치트 시트를 받으세요.
이런 이야기를 읽는 것을 좋아하고 작가로서 저를 지원하고 싶다면 미디엄 회원이 되기 위해 가입하는 것을 고려해보세요. 월 5달러로 수천 개의 Python 가이드 및 데이터 과학 기사에 무제한으로 액세스할 수 있습니다. 내 링크를 사용하여 가입하면 추가 비용 없이 소정의 커미션을 받을 수 있습니다.
We’re offering a free cheat sheet to our readers. Join our newsletter with 20K+ people and get our free ChatGPT cheat sheet.
If you enjoy reading stories like these and want to support me as a writer, consider signing up to become a Medium member. It’s $5 a month, giving you unlimited access to thousands of Python guides and Data science articles. If you sign up using my link, I’ll earn a small commission with no extra cost to you.
건강전문 몰
댓글