프롬프트 설계 전략

이 페이지에서는 프롬프트를 설계할 때 사용할 수 있는 일반적인 프롬프트 설계 전략 몇 가지를 소개합니다. 프롬프트를 설계하는 데 있어 옳거나 그른 방법은 없지만 모델 응답에 영향을 미치는 데 사용할 수 있는 일반적인 전략이 있습니다. 모델 성능 최적화를 위해서는 여전히 엄격한 테스트와 평가가 중요합니다.

대규모 언어 모델(LLM)은 언어 단위 간의 패턴과 관계를 배우기 위해 방대한 양의 텍스트 데이터에 대해 학습합니다. 일부 텍스트(프롬프트)가 제공되면 언어 모델은 정교한 자동 완성 도구와 같이 다음에 나올 내용을 예측할 수 있습니다. 따라서 프롬프트를 설계할 때 모델이 다음에 올 내용을 예측할 때 영향을 미칠 수 있는 다양한 요소를 고려하십시오.

명확하고 구체적인 요청 사항 제공

수행할 작업에 대한 요청 사항을 모델에 제공하는 것이 모델 동작을 효과적이고 효율적으로 맞춤설정하는 방법입니다. 제공하는 지침이 명확하고 구체적인지 확인합니다. 단계별 요청 사항 목록처럼 간단한 요청 사항이 있는 반면 사용자의 경험과 사고방식을 매핑하는 것만큼 복잡한 요청 사항도 있습니다.

수행할 태스크 정의

모델로 수행하려는 태스크를 자세히 설명합니다. 단계별 요청 사항 목록만큼 간단한 태스크가 있는 반면 사용자의 경험과 사고방식을 매핑하는 것만큼 복잡한 태스크도 있습니다. 다음 프롬프트는 모델에 텍스트 블록을 요약하도록 지시합니다.

Summarize this text.
Text: A quantum computer exploits quantum mechanical phenomena to perform calculations exponentially
faster than any modern traditional computer. At very tiny scales, physical matter acts as both
particles and as waves, and quantum computing uses specialized hardware to leverage this behavior.
The operating principles of quantum devices is beyond the scope of classical physics. When deployed
at scale, quantum computers could be used in a wide variety of applications such as: in
cybersecurity to break existing encryption methods while helping researchers create new ones, in
meteorology to develop better weather forecasting etc. However, the current state of the art quantum
computers are still largely experimental and impractical.
  
Quantum computers utilize quantum mechanical phenomena to perform computations significantly faster
than traditional computers. By exploiting the particle-wave duality of matter at tiny scales,
quantum computers leverage specialized hardware to solve problems beyond classical physics.
Potential applications include breaking encryption, developing better weather forecasting, and more.
However, current quantum computers are still largely experimental and impractical.
  

제약조건 지정

프롬프트 읽기 또는 응답 생성에 대한 제약조건을 지정합니다. 모델에게 해야 할 일과 하지 말아야 할 일을 지시할 수 있습니다. 이전 예시의 요약은 원본 텍스트보다 짧지만 요약을 더 짧게 줄이고 싶을 수 있습니다. 이 경우 프롬프트에서 요약의 길이에 대한 제약조건을 지정할 수 있습니다.

Summarize this text in two sentences.
Text: A quantum computer exploits quantum mechanical phenomena to perform calculations exponentially
faster than any modern traditional computer. At very tiny scales, physical matter acts as both
particles and as waves, and quantum computing uses specialized hardware to leverage this behavior.
The operating principles of quantum devices is beyond the scope of classical physics. When deployed
at scale, quantum computers could be used in a wide variety of applications such as: in
cybersecurity to break existing encryption methods while helping researchers create new ones, in
meteorology to develop better weather forecasting etc. However, the current state of the art quantum
computers are still largely experimental and impractical.
    

Quantum computers use quantum mechanical phenomena to perform calculations much faster than
traditional computers. They have the potential to revolutionize various fields, but current quantum
computers are still experimental and impractical.
    

응답 형식 정의

또한 응답 형식을 지정하는 요청 사항을 제공할 수 있습니다. 예를 들어 응답 형식을 표, 글머리기호 목록, 엘리베이터 피치, 키워드, 문장 또는 단락 형식으로 요청할 수 있습니다. 다음 프롬프트는 텍스트에서 주요 정보의 글머리 기호를 제공하도록 모델에 지시합니다.

Summarize this text as bullets points of key information.
Text: A quantum computer exploits quantum mechanical phenomena to perform calculations exponentially
faster than any modern traditional computer. At very tiny scales, physical matter acts as both
particles and as waves, and quantum computing uses specialized hardware to leverage this behavior.
The operating principles of quantum devices is beyond the scope of classical physics. When deployed
at scale, quantum computers could be used in a wide variety of applications such as: in
cybersecurity to break existing encryption methods while helping researchers create new ones, in
meteorology to develop better weather forecasting etc. However, the current state of the art quantum
computers are still largely experimental and impractical.
  
- Quantum computers leverage quantum mechanical phenomena for exponentially faster calculations than
  traditional computers.
- Quantum devices utilize specialized hardware to exploit tiny-scale matter behavior as both
  particles and waves.
- Their operating principles transcend classical physics.
- Potential applications include cybersecurity, weather forecasting, and more.
- Current quantum computers are largely experimental and impractical.
  

요약

  • 모델에게 수행할 작업에 대한 안내를 제공합니다.
  • 요청 사항을 명확하고 구체적으로 작성합니다.
  • 출력에 대한 제약조건 또는 형식 요구사항을 지정합니다.

퓨샷 예시 포함

프롬프트에 올바른 예시 모델을 보여주는 예시를 포함할 수 있습니다. 모델은 예시의 패턴과 관계를 식별한 후 응답을 생성할 때 이를 적용합니다. 몇 가지 예시가 포함된 프롬프트를 퓨샷 프롬프트라고 하며, 예시를 제공하지 않는 프롬프트를 제로샷 프롬프트라고 합니다. 퓨샷 프롬프트는 모델 응답의 형식 지정, 문구, 범위 지정 또는 일반적인 패턴을 규제하는 데 자주 사용됩니다. 모델이 초점을 좁히고 더 정확한 결과를 생성할 수 있도록 구체적이고 다양한 예시를 사용합니다.

프롬프트에는 항상 퓨샷 예시를 포함하는 것이 좋습니다. 퓨샷 예시는 모델에 요청 사항을 적용하는 방법을 알려주므로 퓨샷 예시가 없는 프롬프트는 효과적이지 않을 수 있습니다. 실제로 태스크를 보여주는 예시가 충분히 명확하다면 프롬프트에서 요청 사항을 삭제해도 됩니다.

제로샷 또는 퓨샷 프롬프트

다음 제로샷 프롬프트는 모델에 가장 적합한 설명을 선택하라고 요청합니다.

Please choose the best explanation to the question:

Question: How is snow formed?
Explanation1: Snow is formed when water vapor in the air freezes into ice crystals in the
atmosphere, which can combine and grow into snowflakes as they fall through the atmosphere and
accumulate on the ground.
Explanation2: Water vapor freezes into ice crystals forming snow.
Answer:
  
Explanation1
  

모델이 간결한 응답을 생성해야 하는 사용 사례의 경우 간결한 응답을 선호할 수 있도록 프롬프트에 예시를 포함할 수 있습니다.

다음 프롬프트는 간략한 설명을 선호하는 두 가지 예시를 제공합니다. 응답에서 모델은 이전과 마찬가지로 더 긴 설명(Explanation1)이 아닌 더 짧은 설명 (Explanation2)을 선택하도록 모델에 예시를 통해 안내가 제공된 것을 볼 수 있습니다.

Please choose the best explanation to the question:

Question: Why is sky blue?
Explanation1: The sky appears blue because of Rayleigh scattering, which causes shorter blue
wavelengths of light to be scattered more easily than longer red wavelengths, making the sky look
blue.
Explanation2: Due to Rayleigh scattering effect.
Answer: Explanation2

Question: What is the cause of earthquakes?
Explanation1: Sudden release of energy in the Earth's crust.
Explanation2: Earthquakes happen when tectonic plates suddenly slip or break apart, causing a
release of energy that creates seismic waves that can shake the ground and cause damage.
Answer: Explanation1

Question: How is snow formed?
Explanation1: Snow is formed when water vapor in the air freezes into ice crystals in the
atmosphere, which can combine and grow into snowflakes as they fall through the atmosphere and
accumulate on the ground.
Explanation2: Water vapor freezes into ice crystals forming snow.
Answer:
  
Explanation2
  

최적의 예시 수 찾기

프롬프트에서 가장 원하는 결과를 제공할 예시 수를 실험해볼 수 있습니다. PaLM 및 Gemini과 같은 모델은 종종 몇 가지 예시를 사용하여 패턴을 선택하지만, 원하는 결과를 얻기 위한 예시 수에 대해 실험해야 할 수 있습니다. BERT와 같은 더 간단한 모델의 경우 더 많은 예시가 필요할 수 있습니다. 하지만 너무 많은 예시를 포함하면 모델이 예시에 대한 응답에 과적합하게 될 수 있습니다.

예시를 사용하여 피해야 할 패턴이 아닌 패턴 표시

예시를 사용하여 모델을 따라야 할 패턴을 보여주는 것이 예시를 사용하여 모델에 피해야 할 반대 패턴을 보여주는 것보다 더 효과적입니다.

부정적인 패턴:

Don't end haikus with a question:
Haiku are fun
A short and simple poem
Don't you enjoy them?
  

긍정적인 패턴:

Always end haikus with an assertion:
Haiku are fun
A short and simple poem
A joy to write
  

여러 예시에 일관된 형식을 사용합니다.

원치 않는 형식의 응답을 방지하기 위해 퓨샷 예시의 구조와 형식이 동일해야 합니다. 프롬프트에 퓨샷 예시를 추가하는 기본 목표 중 하나는 모델에 응답 형식을 보여주는 것입니다. 따라서 모든 예시에서 일관된 형식을 보장하는 것이 중요합니다. 특히 XML 태그, 공백, 줄바꿈, 예시 분할기에 주의해야 합니다.

요약

  • 프롬프트에 프롬프트-응답 예시를 포함하면 모델이 응답하는 방법을 배울 수 있습니다.
  • 피해야 할 패턴의 예시 대신 따를 패턴의 모델에 대한 예시를 제공하세요.
  • 포함할 프롬프트 수를 실험해 보세요. 모델에 따라 모델 동작을 변경하는 데 효과적이지 않은 예시가 너무 적습니다. 예시가 너무 많으면 모델이 과적합하게 됩니다.
  • 여러 예시에 일관된 형식을 사용합니다.

컨텍스트 정보 추가

모델에 필요한 모든 정보가 있다고 가정하는 대신 모델이 문제를 해결하는 데 필요한 프롬프트 안내와 정보를 포함할 수 있습니다. 이 컨텍스트 정보는 모델이 요청된 작업의 제약조건과 세부정보를 이해하는 데 도움이 됩니다.

다음 예시에서는 모델에 라우터에 대한 문제 해결 안내를 제공하도록 요청합니다.

What should I do to fix my disconnected wifi? The light on my Google Wifi router is yellow and
blinking slowly.
  
1. **Check the Cables:**
- Make sure that all cables are securely connected to your Google Wifi router and modem.
- Try replacing the cables with new ones to ensure they are not faulty.


2. **Reboot the Router:**
- Unplug your Google Wifi router and modem from the power outlet.
- Wait for at least 30 seconds.
- Plug the modem and router back in and wait for them to start up.


3. **Factory Reset the Router:**
- Resetting the router will restore it to its default settings.
- Find the small reset button on the back of the router.
- Press and hold the reset button with a paper clip or similar object for 10 seconds.
- Release the button and wait for the router to restart.


4. **Check Your Internet Connection:**
- Use a wired connection to connect a device directly to your modem.
- If the internet works, the issue may be with your router.
- If the internet still doesn't work, contact your Internet Service Provider (ISP).


5. **Update Router's Firmware:**
- Check if there is a firmware update available for your Google Wifi router.
- Download and install the latest firmware update from the Google Wifi app.


6. **Interference and Obstacles:**
- Make sure the router is not near electronic devices that can cause interference, like microwaves or cordless phones.
- Remove any obstacles between the router and your devices, such as furniture or thick walls.


7. **Change Wi-Fi Channel:**
- In the Google Wifi app, go to Settings > Network & General > Advanced Networking.
- Try changing the Wi-Fi channel to a less congested one.


8. **Contact Google Support:**
- If you've tried the above steps and the issue persists, contact Google support for further assistance.
  

이 응답은 라우터 또는 LED 표시기 표시등의 상태와 관련이 없는 일반적인 문제 해결 정보처럼 보입니다.

특정 라우터의 응답을 맞춤설정하려면 응답을 제공할 때 참조할 컨텍스트로 라우터의 문제 해결 가이드를 프롬프트에 추가할 수 있습니다.

Answer the question using the text below. Respond with only the text provided.
Question: What should I do to fix my disconnected wifi? The light on my Google Wifi router is yellow and blinking slowly.

Text:
Color: Slowly pulsing yellow
What it means: There is a network error.
What to do:
Check that the Ethernet cable is connected to both your router and your modem and both devices are turned on. You might need to unplug and plug in each device again.

Color: Fast blinking yellow
What it means: You are holding down the reset button and are factory resetting this device.
What to do:
If you keep holding down the reset button, after about 12 seconds, the light will turn solid yellow. Once it is solid yellow, let go of the factory reset button.

Color: Solid yellow
What it means: Router is factory resetting.
What to do:
This can take up to 10 minutes. When it's done, the device will reset itself and start pulsing white, letting you know it's ready for setup.

Color: Solid red
What it means: Something is wrong.
What to do:
Critical failure. Factory reset the router. If the light stays red, contact Wifi customer support.
  
Check that the Ethernet cable is connected to both your router and your modem and both devices are turned on. You might need to unplug and plug in each device again.
  

요약

  • 모델에서 응답을 생성할 때 사용할 정보(컨텍스트)를 프롬프트에 포함합니다.
  • 컨텍스트 정보 사용 방법에 대한 요청 사항을 모델에 제공합니다.

프리픽스 추가

프리픽스는 프리픽스를 배치하는 위치에 따라 여러 용도로 사용할 수 있는 프롬프트 콘텐츠에 추가하는 단어 또는 구문입니다.

  • 입력 프리픽스: 모델에 대한 입력에서 의미론적으로 의미 있는 부분에 입력 프리픽스를 추가합니다. 예를 들어 '영어:' 및 '프랑스어' 프리픽스는 두 가지 언어를 구분합니다.
  • 출력 프리픽스: 모델에서 출력을 생성하더라도 프롬프트에서 출력에 대한 프리픽스를 추가할 수 있습니다. 출력 프리픽스는 예상되는 응답에 대한 모델 정보를 제공합니다. 예를 들어 출력 프리픽스 'JSON:'은 출력이 JSON 형식이어야 함을 모델에 알립니다.
  • 프리픽스 예시: 퓨샷 프롬프트에서 예시에 프리픽스를 추가하면 모델이 출력을 생성할 때 사용할 수 있는 라벨을 제공하여 출력 콘텐츠를 더 쉽게 파싱할 수 있습니다.

다음 예시에서 'Text:'는 입력 프리픽스이고 'The answer is'는 출력 프리픽스입니다.

Classify the text as one of the following categories.
- large
- small
Text: Rhino
The answer is: large
Text: Mouse
The answer is: small
Text: Snail
The answer is: small
Text: Elephant
The answer is:
  
large
  

모델에서 부분 입력을 완료하도록 허용

생성형 언어 모델은 고급 자동 완성 도구처럼 작동합니다. 부분 콘텐츠를 제공하면 모델은 나머지 콘텐츠나 해당 콘텐츠의 연속이라고 생각하는 것을 응답으로 제공할 수 있습니다. 이 경우 예시 또는 컨텍스트를 포함하면 모델이 이러한 예시 또는 컨텍스트를 고려할 수 있습니다.

다음 예시에서는 안내 및 항목 입력과 함께 프롬프트를 제공합니다.

For the given order, return a JSON object that has the fields cheeseburger, hamburger, fries, or
drink, with the value being the quantity.

Order: A burger and a drink.
  
```
{
"cheeseburger": 0,
"hamburger": 1,
"fries": 0,
"drink": 1
}
```
  

모델이 예측한 대로 작동하지만 자연어로 안내를 작성하는 것이 어려울 수 있으며 모델의 해석에 많은 영향을 미칩니다. 예를 들어 레스토랑 메뉴에는 많은 항목이 포함되어 있을 수 있습니다. JSON 응답의 크기를 줄이기 위해 정렬되지 않은 항목을 생략하고 싶을 수 있습니다. 이 경우 예시 및 응답 프리픽스를 제공하여 모델이 이를 완료하게 할 수 있습니다.

Valid fields are cheeseburger, hamburger, fries, and drink.
Order: Give me a cheeseburger and fries
Output:
```
{
  "cheeseburger": 1,
  "fries": 1
}
```
Order: I want two burgers, a drink, and fries.
Output:
  
```
{
"hamburger": 2,
"drink": 1,
"fries": 1
}
```
  

'치즈버거'가 주문의 일부가 아니었기 때문에 출력에서 어떻게 제외되었는지 확인하세요.

모델에 응답 형식을 지정하라는 프롬프트 표시

완료 전략은 응답의 형식을 지정하는 데 도움이 될 수도 있습니다. 다음 예시에서는 모델에 에세이 개요를 만들라는 프롬프트를 표시합니다.

Create an outline for an essay about hummingbirds.
  
I. Introduction
A. Hook: Begin with an intriguing fact or description of hummingbirds.
B. Provide some background information on hummingbirds.
1. Mention their small size and long, thin beaks.
2. Highlight their unique ability to hover and fly backward.

II. Body
A. Anatomy and Physiology
1. Elaborate on their tiny size, making comparisons to other animals.
2. Describe their wings and how they enable hovering and swift flight.
3. Discuss their metabolism and energy requirements, emphasizing their caloric needs.

B. Feeding Habits and Diet
1. Explain their primary food source, nectar, and how they extract it from flowers.
2. Describe their ability to feed from a wide variety of flowers.
3. Mention their consumption of insects and the nutritional value they provide.

C. Migration Patterns
1. Discuss the incredible long-distance migrations of some hummingbird species.
2. Explain the phenomenon of seasonal migration and the environmental factors driving it.
3. Describe the routes taken by different species during migration.

D. Conservation and Threats
1. Highlight the importance of hummingbirds in ecosystems as pollinators.
2. Discuss the challenges and threats they face, such as habitat loss, nectar scarcity, and climate change.
3. Mention conservation efforts and ways to support hummingbird populations.

III. Conclusion
A. Summarize the main points covered in the essay.
B. Reinforce the importance of hummingbirds and their ecological role.
C. Provide a final thought or call to action to protect these fascinating creatures.
  

프롬프트에 개요의 형식이 지정되지 않았고 모델이 자동으로 형식을 선택했습니다. 모델이 특정 형식으로 개요를 반환하기 위해서는 개요의 시작을 나타내는 텍스트를 추가하고, 시작한 패턴에 따라 모델이 이를 완료하도록 할 수 있습니다.

Create an outline for an essay about hummingbirds.
I. Introduction
   *
  
I. Introduction
* Capture the reader's attention with an interesting anecdote or fact about hummingbirds.
* Provide a brief background on hummingbirds, including their unique characteristics.
* State the main points that will be covered in the essay.

II. The Unique Characteristics of Hummingbirds
* Discuss the hummingbird's exceptionally rapid wing-beat, allowing them to hover and fly backward.
* Highlight their tiny size, making them the smallest birds in the world.
* Describe their long, slender beaks and tongues, allowing them to reach deep into flowers to extract nectar.
* Explain their iridescent plumage, which creates brilliant and vibrant colors.

III. Hummingbird Migration and Distribution
* Discuss the extensive migration patterns of hummingbirds, covering vast distances across continents.
* Describe the different habitats where hummingbirds can be found, including tropical rainforests, deserts, and urban areas.
* Explain the seasonal changes that influence hummingbird migration and habitat selection.

IV. Hummingbird Diet and Feeding Habits
* Focus on the hummingbird's primary food source, which is nectar from flowers.
* Describe their ability to consume insects, spiders, and other small invertebrates for protein.
* Explain how hummingbirds use their long, slender tongues to extract nectar from flowers.
* Discuss the importance of flowering plants in providing sustenance for hummingbirds.

V. Reproduction and Nesting Behavior
* Describe the mating rituals and courtship behavior of hummingbirds.
* Explain the process of nest-building, including the materials used and the unique characteristics of hummingbird nests.
* Discuss the role of the female hummingbird in laying and incubating eggs.
* Describe the development of hummingbird chicks and the role of both parents in providing care.

VI. Threats to Hummingbirds and Conservation Efforts
* Highlight habitat loss, climate change, and deforestation as significant threats to hummingbird populations.
* Describe the role of habitat conservation initiatives in protecting hummingbird habitats.
* Explain the importance of creating hummingbird-friendly gardens and landscapes.
* Discuss the efforts of organizations and individuals working to conserve hummingbird populations.

VII. Conclusion
* Summarize the main points covered in the essay, emphasizing the unique characteristics, migration patterns, diet, reproduction, and conservation of hummingbirds.
* Provide a closing statement that leaves a lasting impression on the reader and reinforces the significance of these fascinating creatures.
  

요약

  • 모델에 부분 입력을 제공하면 모델은 프롬프트에서 사용 가능한 예시 또는 컨텍스트를 기반으로 해당 입력을 완료합니다.
  • 모델이 입력을 완료하도록 하는 것이 자연어로 작업을 설명하는 것보다 더 쉬울 수 있습니다.
  • 프롬프트에 부분 응답을 추가하면 모델이 원하는 패턴이나 형식을 따르도록 유도할 수 있습니다.

프롬프트를 간단한 구성요소로 세분화

복잡한 프롬프트가 필요한 사용 사례의 경우 항목을 더 간단한 구성요소로 나누면 모델이 이러한 복잡성을 관리하도록 도울 수 있습니다.

요청 사항 세분화

하나의 프롬프트에 여러 요청 사항을 포함하는 대신 요청 사항당 하나의 프롬프트를 만듭니다. 사용자의 입력에 따라 처리할 프롬프트를 선택할 수 있습니다.

프롬프트 연결

여러 순차적 단계가 포함된 복잡한 태스크의 경우 각 단계를 프롬프트로 만들고 프롬프트를 순서대로 연결합니다. 이 순차적인 프롬프트 체인에서 시퀀스의 한 프롬프트의 출력이 다음 프롬프트의 입력이 됩니다. 시퀀스에서 마지막 프롬프트의 출력이 최종 출력입니다.

응답 집계

집계에서는 데이터의 서로 다른 부분에서 서로 다른 병렬 태스크를 수행하고 결과를 집계하여 최종 출력을 생성합니다. 예를 들어 데이터의 첫 번째 부분에 대해 하나의 작업을 수행하고 나머지 데이터에서 다른 작업을 수행한 후 결과를 집계하도록 모델에 지시할 수 있습니다.

요약

  • 복잡한 여러 요청 사항을 각 요청 사항에 대한 프롬프트로 분류하고 사용자 입력에 따라 적용할 프롬프트를 결정합니다.
  • 여러 순차적 단계를 개별 프롬프트로 분할하고 앞의 프롬프트의 출력이 다음 프롬프트의 입력이 되도록 연결합니다.
  • 병렬 태스크를 분류하고 응답을 집계하여 최종 출력을 생성합니다.

다양한 매개변수 값 실험

모델에 보낸 각 셀에는 모델의 응답 생성 방식을 제어하는 매개변수 값이 포함되어 있습니다. 모델은 서로 다른 매개변수 값에 대해 서로 다른 결과를 생성할 수 있습니다. 이 작업에서는 최상의 값을 얻을 수 있도록 다양한 매개변수 값으로 실험해 봅니다. 모델별로 사용 가능한 매개변수가 다를 수 있습니다. 가장 일반적인 매개변수는 다음과 같습니다.

  • 최대 출력 토큰
  • 강도
  • 최상위 K
  • 최상위 P

최대 출력 토큰

응답에서 생성될 수 있는 토큰의 최대 개수입니다. 토큰은 약 4자(영문 기준)입니다. 100개의 토큰은 약 60~80개의 단어에 해당합니다.

응답이 짧을수록 낮은 값을 지정하고 응답이 길면 높은 값을 지정합니다.

강도

강도는 응답 생성 중 샘플링에 사용되며 topPtopK가 적용될 때 발생합니다. 강도는 토큰 선택의 무작위성 수준을 제어합니다. 강도가 낮을수록 보다 결정적이고 덜 개방적인 또는 창의적인 응답이 필요한 프롬프트에 적합하고, 강도가 높을수록 다양하거나 창의적인 결과로 이어질 수 있습니다. 0의 강도는 결정적입니다. 즉, 가능성이 가장 높은 응답이 항상 선택됩니다.

대부분의 사용 사례에서는 강도 0.2로 시작해 보세요. 모델이 너무 일반적이거나, 너무 짧은 응답을 반환하거나 모델이 대체 응답을 제공할 경우에는 강도를 늘려보세요.

최상위 K

최상위 K는 모델이 출력용 토큰을 선택하는 방식을 변경합니다. Top-K가 1이면 선택된 토큰이 모델의 어휘에 포함된 모든 토큰 중에서 가장 확률이 높다는 의미입니다(그리디 디코딩이라고도 함). 반면에 Top-K가 3이면 온도(temperature)를 사용하여 가장 확률이 높은 3개 토큰 중에서 다음 토큰이 선택된다는 의미입니다.

각 토큰 선택 단계에서 확률이 가장 높은 Top-K 토큰이 샘플링됩니다. 그런 다음 Top-P를 기준으로 토큰을 추가로 필터링하고 온도(temperature) 샘플링을 사용하여 최종 토큰을 선택합니다.

임의성이 낮은 응답에 낮은 값을 지정하고 임의성이 높은 응답에 높은 값을 지정합니다. 기본 최상위 K는 40입니다.

최상위 P

최상위 P는 모델이 출력용 토큰을 선택하는 방식을 변경합니다. 토큰은 확률의 합이 Top-P 값과 같아질 때까지 확률이 가장 높은 것부터(Top-K 참조) 가장 낮은 것까지 선택됩니다. 예를 들어 토큰 A, B, C의 확률이 0.3, 0.2, 0.1이고 Top-P 값이 0.5이면 모델이 온도(temperature)를 사용해서 다음 토큰으로 A 또는 B를 선택하고 C는 후보에서 제외합니다.

임의성이 낮은 응답에 낮은 값을 지정하고 임의성이 높은 응답에 높은 값을 지정합니다. 기본 최상위 P는 0.95입니다.

프롬프트 반복 전략

프롬프트 설계는 원하는 응답을 일관성 있게 받기 위해 종종 몇 번의 반복 작업이 필요한 반복 프로세스입니다. 이 섹션에서는 프롬프트에서 반복할 때 시도할 수 있는 몇 가지 사항에 대한 안내를 제공합니다.

다른 문구 사용

프롬프트에서 다른 단어나 문구를 사용하면 의미가 동일하더라도 모델마다 다른 응답이 출력되는 경우가 많습니다. 예상한 결과를 얻지 못했다면 다른 문구를 사용해 보세요.

Version 1:
How do I bake a pie?

Version 2:
Suggest a recipe for a pie.

Version 3:
What's a good pie recipe?
  

유사한 태스크로 전환

모델이 태스크 안내를 따르게 할 수 없으면 동일한 결과를 얻는 유사한 태스크에 대한 안내를 제공해보세요.

이 프롬프트는 사전 정의된 카테고리를 사용하여 도서를 분류하도록 모델에 지시합니다.

Which category does The Odyssey belong to:
thriller
sci-fi
mythology
biography
  
The answer: mythology

Explanations:

The Odyssey is an epic poem in ancient Greek literature. It is one of two major ancient Greek epic
poems attributed to Homer. The Odyssey is an epic poem that tells the story of Odysseus, a Greek
hero who fought in the Trojan War and then spent ten years trying to return home to Ithaca. The
Odyssey is a work of mythology.
  

응답은 올바르지만 모델이 옵션의 경계 내에 있지 않았습니다. 또한 전체 문장 대신 옵션 중 하나에만 응답하도록 모델을 만들 수 있습니다. 이 경우 안내를 객관식 질문으로 변경하고 모델이 옵션을 선택하도록 요청할 수 있습니다.

Multiple choice problem: Which of the following options describes the book The Odyssey?
Options:
- thriller
- sci-fi
- mythology
- biography
  
The answer is: mythology
  

프롬프트 콘텐츠 순서 변경

프롬프트에서 콘텐츠 순서는 응답에 영향을 줄 수 있습니다. 콘텐츠 순서를 변경하여 응답에 미치는 영향을 확인하세요.

Version 1:
[examples]
[context]
[input]

Version 2:
[input]
[examples]
[context]

Version 3:
[examples]
[input]
[context]

대체 응답

대체 응답은 프롬프트 또는 응답이 안전 필터를 트리거할 때 모델에서 반환하는 응답입니다. 대체 응답의 예로는 '저는 언어 모델일 뿐이기 때문에 지원할 수 없습니다.'가 있습니다.

모델이 대체 응답을 제공할 경우에는 강도를 높여보세요.

피해야 할 사항

  • 사실에 기반한 정보를 생성하기 위해 모델에 의존하지 마세요.
  • 수학 및 논리 문제에 주의해서 사용하세요.

다음 단계