אסטרטגיות לעיצוב הנחיות

בדף הזה מפורטות כמה אסטרטגיות כלליות לעיצוב הנחיות שאפשר להשתמש בהן כשמתכננים הנחיות. אין דרך נכונה או לא נכונה לתכנן הנחיה, אבל יש אסטרטגיות נפוצות שאפשר להשתמש בהן כדי להשפיע על התשובות של המודל. בדיקות והערכה קפדניות הן קריטיות לצורך אופטימיזציה של ביצועי המודל.

מודלי שפה גדולים (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.
  

סיכום

  • נותנים למודלים הוראות שיסבירו מה לעשות.
  • נסחו את ההוראות בצורה ברורה וספציפית.
  • מציינים את האילוצים או את דרישות הפורמט של הפלט.

כלול מספר דוגמאות

בהנחיה תוכלו לכלול דוגמאות שמראות למודל איך לעשות את זה כמו שצריך. המודל מנסה לזהות דפוסים וקשרים מהדוגמאות, ולהחיל אותם כשיוצרים תשובה. הנחיות שמכילות כמה דוגמאות נקראות הנחיות עם כמה דוגמאות (few-shot), ואילו הנחיות שלא מספקות דוגמאות נקראות הנחיות בשיטת אפס. לעיתים קרובות משתמשים בהנחיות עם מספר קטן של צילומים כדי לווסת את העיצוב, הניסוח, ההיקף או התבנית הכללית של תשובות למודל. כדאי להשתמש בדוגמאות ספציפיות ומגוונות כדי לעזור למודל לצמצם את המיקוד וליצור תוצאות מדויקות יותר.

מומלץ לכלול תמיד מספר דוגמאות לדוגמה בהנחיות. פרומפטים בלי דוגמאות ספורות יהיו כנראה פחות יעילות, כי הן מראות למודל איך ליישם הוראות. למעשה, אפשר להסיר הוראות מההנחיה אם הדוגמאות ברורות מספיק להצגת המשימה.

הנחיות מאפס לעומת כמה דוגמאות

בהנחיה שמופיעה מאפס, המודל צריך לבחור את ההסבר הטוב ביותר.

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
  

אם בתרחיש לדוגמה שלכם נדרש שהמודל יכתוב תשובות תמציתיות, תוכלו לכלול בהנחיה דוגמאות שנותנות עדיפות לתשובות תמציתיות.

בהנחיה הבאה ריכזנו שתי דוגמאות שמבטאות העדפה להסברים הקצרים. בתשובה אתם יכולים לראות שהדוגמאות הנחו את המודל לבחור בהסבר הקצר יותר (הסבר2), בניגוד להסבר הארוך יותר (הסבר1) כמו קודם.

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 מילים.

אפשר לציין ערך נמוך יותר לתגובות קצרות יותר וערך גבוה יותר לתגובות ארוכות יותר.

טמפרטורה

הטמפרטורה משמשת לדגימה במהלך יצירת תגובות, שמתרחשת כאשר מפעילים את הדגימה topP ו-topK. הטמפרטורה קובעת את רמת הרנדומיזציה בבחירת האסימון. טמפרטורות נמוכות יותר מתאימות להנחיות שמחייבות תגובה דטרמיניסטית ופחות פתוחה או יצירתית, וטמפרטורות גבוהות יותר יכולות להוביל לתוצאות מגוונות או יצירתיות יותר. טמפרטורה של 0 היא דטרמיניסטית, כלומר התשובה בהסתברות הגבוהה ביותר נבחרת תמיד.

ברוב התרחישים לדוגמה, כדאי להתחיל בטמפרטורה של 0.2. אם התשובה שהמודל מחזיר תשובה כללית או קצרה מדי, או שהמודל נותן תגובה חלופית, כדאי לנסות להעלות את הטמפרטורה.

סדר K

ה-Top-K משנה את האופן שבו המודל בוחר אסימונים לפלט. המשמעות של K עליון של 1 היא שהאסימון הבא שנבחר הוא בעל ההסתברות הגבוהה ביותר מבין כל האסימונים באוצר המילים של המודל (נקרא גם פענוח חמדן), בעוד שהאסימון K של 3 פירושו שהאסימון הבא נבחר מבין שלושת האסימונים בעלי ההסתברות הגבוהה ביותר, באמצעות טמפרטורה.

בכל שלב של בחירת אסימונים, נדגמים אסימונים ב-K עם ההסתברויות הגבוהות ביותר. לאחר מכן, האסימונים מסוננים לפי מספר P, והאסימון הסופי נבחר באמצעות דגימת טמפרטורה.

מומלץ לציין ערך נמוך יותר לתגובות אקראיות פחות וערך גבוה יותר לתגובות אקראיות יותר. ערך ברירת המחדל של האות 'K' הוא 40.

מספר P

Top-P משנה את האופן שבו המודל בוחר אסימונים לפלט. האסימונים נבחרים מהגבוהה ביותר (מידע נוסף ב-K) להסתברות הנמוכה ביותר, עד שסכום ההסתברויות שלהם יהיה שווה לערך העליון של P. לדוגמה, אם לאסימונים A, B ו-C יש הסתברות של 0.3, 0.2 ו-0.1, והערך של הגורם העליון הוא 0.5, המודל יבחר את A או B כאסימון הבא באמצעות טמפרטורה ויחריג את C כמועמד.

מומלץ לציין ערך נמוך יותר לתגובות אקראיות פחות וערך גבוה יותר לתגובות אקראיות יותר. ערך ברירת המחדל של הפרמטר 'ראש הדף' הוא 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]

תגובות חלופיות

תגובת חלופית היא תגובה שמוחזרת על ידי המודל כשההנחיה או התגובה מפעילים מסנן בטיחות. דוגמה לתגובה חלופית היא "אין לי אפשרות לעזור בעניין הזה, כי אני רק מודל שפה".

אם המודל מגיב בתגובה חלופית, כדאי לנסות להעלות את הטמפרטורה.

דברים שיש להימנע מהם

  • אין להסתמך על מודלים כדי ליצור מידע עובדתי.
  • צריך להפעיל שיקול דעת במתמטיקה ובעיות לוגיות.

השלבים הבאים