상세 컨텐츠

본문 제목

Knowledge Generation Prompting

프롬프트 공학

by 달의 언어 2023. 4. 2. 09:03

본문

Knowledge Generation Prompting

<출처> Generated Knowledge Prompting for Commonsense Reasoning,

 

  • Knowledge Generation Prompting은 상식 추론을 위한 새로운 방법입니다
  • Knowledge Generation Prompting은 두 개의 언어 모델을 사용합니다. 하나는 질문과 관련된 지식 문장을 생성하고, 다른 하나는 각 지식 문장을 사용하여 예측을 합니다.
  • Knowledge Generation Prompting은 Few-Shot-CoT 패러다임을 사용하여 지식 문장을 생성하는 prompt를 작성합니다. 이 prompt는 질문과 예시 답변을 입력으로 받고, 질문에 도움이 되는 지식 문장을 출력으로 내놓습니다.
  • Knowledge Generation Prompting은 생성된 지식 문장들과 함께 질문을 두 번째 언어 모델에 입력합니다. 그리고 가장 높은 확신도를 가진 예측을 최종 답변으로 선택합니다

Knowledge Generation Prompting은 상식 추론 작업에서 기존의 언어 모델과 미세 조정된 언어 모델의 성능을 향상시킬 수 있습니다.

Knowledge Generation Prompting의 구체적인 예시는 다음과 같습니다.

  • 예시 1: Knowledgeable Dialogue Generation: 작업에서는 대화 상황에 맞는 지식이 있는 응답을 생성하는 것입니다. 예를 들어, 다음과 같은 대화 상황이 있습니다.
A: I'm going to watch a movie tonight. Do you have any recommendations?
B: What kind of movies do you like?
A: I like sci-fi movies with a twist.

이 때, Knowledge Generation Prompting은 다음과 같은 prompt를 사용하여 지식 문장을 생성합니다.

Q: I like sci-fi movies with a twist.
A: You might like The Matrix.

Knowledge:
- The Matrix is a sci-fi movie that was released in 1999.
- The Matrix has a twist that reveals the true nature of reality.
- The Matrix is the first film in a trilogy that also includes The Matrix Reloaded and The Matrix Revolutions.

그리고 생성된 지식 문장들과 함께 질문을 두 번째 언어 모델에 입력하여 응답을 생성합니다. 예를 들어, 다음과 같은 응답이 가능합니다.

B: You might like The Matrix. It's a sci-fi movie that has a twist that reveals the true nature of reality. It's also the first film in a trilogy that you can binge-watch if you enjoy it.
  • 예시 2: Commonsense Reasoning: 이 작업에서는 상식적인 질문에 답하는 것입니다. 예를 들어, 다음과 같은 질문이 있습니다.
Q: Why do people put ice cubes in drinks?
A: To make them cold.

이 때, Knowledge Generation Prompting은 다음과 같은 prompt를 사용하여 지식 문장을 생성합니다.

Q: Why do people put ice cubes in drinks?
A: To make them cold.

Knowledge:
- Ice cubes are frozen water that have a lower temperature than liquid water.
- When ice cubes are put in drinks, they transfer some of their thermal energy to the drinks and melt into water.
- As a result, the drinks become colder and more refreshing.

그리고 생성된 지식 문장들과 함께 질문을 두 번째 언어 모델에 입력하여 답변을 선택합니다. 예를 들어, 다음과 같은 답변들 중 하나를 선택할 수 있습니다.

A1: To make them cold by transferring thermal energy from ice cubes to drinks. (Correct)
A2: To make them sweet by adding sugar from ice cubes to drinks. (Incorrect)
A3: To make them fizzy by creating bubbles from ice cubes to drinks. (Incorrect)

Knowledge Generation Prompting과 다른 방법들과의 차이점은 다음과 같습니다.

Knowledge Generation Prompting은 외부 지식을 사용하지 않고 언어 모델로부터 지식을 생성합니다. 이는 외부 지식의 품질, 신뢰성, 일관성 등의 문제를 피할 수 있습니다. 또한 미세 조정 없이 few-shot prompting을 사용하여 지식 문장을 생성합니다. 이는 미세 조정에 필요한 데이터와 컴퓨팅 자원을 절약할 수 있습니다. 그리고, 생성된 지식 문장들을 추가 입력으로 제공하여 질문에 답합니다. 이는 언어 모델이 상황에 맞는 지식을 활용할 수 있도록 돕습니다.

 

midjourney, prompt: cherry blossom, first love

 

 

 

관련글 더보기

댓글 영역