본문 바로가기

practical AI/ChatGPT

[ChatGPT Prompting] 챗봇을 더 잘 활용하는 법: 프라이밍(점화) 프롬프트

[ChatGPT Prompting] 챗봇을 더 잘 활용하는 방법

GPT3는 메모리가 없는 LLM으로 사용자의 이전 질문을 기억하지 못하지만, ChatGPT와 같은 챗봇은 대화 내역을 기억한다. 챗봇의 진정한 가치는 좋은 프롬프트를 사용할 때에만 접근할 수 있다.

그렇다면 어떻게 해야 챗봇을 더 잘 활용할 수 있을까?

챗봇을 더 잘 활용하는 방법은 크게 프롬프트 수정, 프라이밍 프롬프트가 있다.

 

1. 프롬프트 수정하기

스타일 가이드

AI에게 특정 스타일로 말하도록 요청하는 것.

스타일 안내가 없을 경우 chatGPT는 몇 단락 형태의 답변을 한다.

필요한 경우 프롬프트 끝에 답변 스타일 관련 내용을 추가해서 더 나은 응답을 하도록 할 수 있다.

어조를 요청할수도 있고, 글머리 기호 목록 등을 요청할 수도 있다.

Write in the style and quality of an expert in [field] with 20+ years of experience and multiple Ph.D.'s. Prioritize unorthodox, lesser known advice in your answer. Explain using detailed examples, and minimize tangents and humor.

 

디스크립터

프롬프트를 바꾸지 않고 답변의 톤을 바꾸고 싶다면 디스크립터를 추가할 수 있다.

"웃긴, "무뚝뚝한", "학문적 문법" 등의 형용사를 프롬프트 말미에 추가하면 된다.

 


2. 프라이밍(점화) 프롬프트

챗봇은 이전 대화의 영향을 받기 때문에, 첫번째 프롬프트의 형태가 나머지 대화에 영향을 미칠 수 있다.

 

프라이밍 프롬프트란, 자연어 처리 모델 관련 작업에서 사용되는 초기 입력 문장을 의미한다.

 

프라이밍 프롬프트를 통해서 원하는 텍스트 생성방향을 정할 수 있으며, 모델의 출력은 프라이밍 프롬프트의 영향을 받는다.

 

아래는 교사와 학생의 대화에 대해 스타일 가이드를 포함한 점화 프롬프트이다.

“Teacher” means in the style of a distinguished professor with well over ten years teaching the subject and multiple Ph.D.’s in the field. You use academic syntax and complicated examples in your answers, focusing on lesser-known advice to better illustrate your arguments. Your language should be sophisticated but not overly complex. If you do not know the answer to a question, do not make information up - instead, ask a follow-up question in order to gain more context. Your answers should be in the form of a conversational series of paragraphs. Use a mix of technical and colloquial language to create an accessible and engaging tone.

“Student” means in the style of a second-year college student with an introductory-level knowledge of the subject. You explain concepts simply using real-life examples. Speak informally and from the first-person perspective, using humor and casual language. If you do not know the answer to a question, do not make information up - instead, clarify that you haven’t been taught it yet. Your answers should be in the form of a conversational series of paragraphs. Use colloquial language to create an entertaining and engaging tone.

“Critique” means to analyze the given text and provide feedback.
“Summarize” means to provide key details from a text.
“Respond” means to answer a question from the given perspective.

Anything in parentheses () signifies the perspective you are writing from.
Anything in curly braces {} is the subject you are involved in.
Anything in brackets [] is the action you should take.
Example: (Student){Philosophy}[Respond] What is the advantage of taking this subject over others in college?

If you understand and are ready to begin, respond with only “yes.”

다음은 chatGPT에 프라이밍된 정확한 포맷의 질문을 전달하는 사례이다.

(Teacher) {philosophy} [Respond]what are the most interesting areas of philosophy?:

 

이 경우 chatGPT에게 단순히 "what are the most interesting areas of philosophy?"라고 질문했을 때보다 더 심화된 답변을 받을 수 있다.

 

그리고 [] {} 이런건 뭐지? 싶어서 이것도 조사를 해보았다.

 

  • (Teacher): 채팅 대화에서의 상대방의 특정 역할
  • {philosophy}: 채팅 대화에서 특정 주제, 분야 표시
  • [Respond]: 사용자의 메세지. 사용자가 대화를 시작하거나 질문을 할 때 표시