Strategie di progettazione dei prompt

Questa pagina presenta alcune strategie generali di progettazione dei prompt che puoi adottare quando la progettazione dei prompt. Sebbene non esista un modo giusto o sbagliato per progettare un prompt, esistono casi comuni strategie che puoi utilizzare per influenzare le risposte del modello. I test e le valutazioni rigorose rimangono di fondamentale importanza per ottimizzare le prestazioni del modello.

I modelli linguistici di grandi dimensioni (LLM) vengono addestrati su grandi quantità di dati di testo per apprendere i pattern e relazioni tra le unità di lingua. Quando ricevono del testo (il prompt), i modelli linguistici possono per prevedere ciò che probabilmente verrà dopo, come un sofisticato strumento di completamento automatico. Pertanto, quando progettando i prompt, considera i diversi fattori che possono influenzare ciò che un modello prevede a questo punto.

Fornisci istruzioni chiare e specifiche

Fornire al modello istruzioni su cosa fare è un modo efficace ed efficiente per personalizzarlo comportamento degli utenti. Assicurati che le istruzioni fornite siano chiare e specifiche. Le istruzioni possono essere semplice come un elenco di istruzioni passo passo o più complesso come mappare l'esperienza utente e la nostra mentalità.

Definisci l'attività da eseguire

Descrivi dettagliatamente l'attività che deve essere eseguita dal modello. L'attività può essere un'attività di istruzioni dettagliate o complesse, come creare l'esperienza e la mentalità di un utente. La Il seguente prompt indica al modello di riassumere un blocco di testo:

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.
  

Specifica eventuali vincoli

Specifica eventuali vincoli alla lettura del prompt o alla generazione di una risposta. Puoi indicare al modello cosa fare e cosa non fare. Dall'esempio precedente, il riassunto è più breve dell'originale di testo, ma forse è meglio che sia più breve. In questo caso, puoi specificare un vincolo al prompt sulla durata desiderata del riassunto:

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.
    

Definisci il formato della risposta

Puoi anche fornire istruzioni che specificano il formato della risposta. Ad esempio, puoi chiedere affinché la risposta venga formattata come tabella, elenco puntato, lift pitch, parole chiave, frase o paragrafo. Il seguente prompt indica al modello di fornire elenchi puntati delle informazioni chiave in il testo:

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.
  

Riepilogo

  • Fornisci ai modelli le istruzioni su cosa fare.
  • Fornisci istruzioni chiare e specifiche.
  • Specifica eventuali vincoli o requisiti di formattazione per l'output.

Includi esempi di few-shot

Puoi includere nel prompt degli esempi che mostrano al modello l'aspetto corretto. La il modello cerca di identificare pattern e relazioni dagli esempi e li applica quando generando una risposta. I prompt che contengono alcuni esempi sono chiamati prompt few-shot. mentre quelli che non forniscono esempi sono chiamati prompt zero-shot. I prompt few-shot sono spesso utilizzati per regolare la formattazione, la formulazione, la definizione dell'ambito o la definizione di pattern generali delle risposte del modello. Utilizza esempi specifici e diversificati per aiutare il modello a restringere il suo obiettivo e generare immagini più accurate che consentono di analizzare i dati e visualizzare i risultati.

Consigliamo di includere sempre esempi di few-shot nei prompt. Prompt senza few-shot gli esempi hanno probabilità di essere meno efficaci, perché mostrano al modello come applicare le istruzioni. Nel Infatti, puoi rimuovere le istruzioni dal prompt se gli esempi sono abbastanza chiari per mostrare l'attività a portata di mano.

Prompt zero-shot e few-shot

Il seguente prompt zero-shot chiede al modello di scegliere la spiegazione migliore.

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
  

Se il tuo caso d'uso richiede che il modello produca risposte concise, puoi includere esempi nella di prompt che preferiscono risposte concise.

Il seguente prompt fornisce due esempi che mostrano la preferenza per le spiegazioni più brevi. Nel la risposta, puoi vedere che gli esempi hanno guidato il modello a scegliere la spiegazione più breve (Spiegazione2) rispetto alla spiegazione più lunga (Spiegazione1) come in precedenza.

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
  

Trovare il numero ottimale di esempi

Puoi sperimentare il numero di esempi da fornire nel prompt per ottenere che consentono di analizzare i dati e visualizzare i risultati. Modelli come PaLM e Gemini spesso possono rilevare pattern usando alcuni esempi, anche se potresti dover sperimentare il numero di esempi che portano ai risultati desiderati. Per modelli più semplici come BERT, potrebbero essere necessari altri esempi. Allo stesso tempo, se includi troppi esempi, il modello potrebbe iniziare a overfitting la risposta agli esempi.

Usa esempi per mostrare pattern anziché anti-pattern

Usare gli esempi per mostrare al modello un pattern da seguire è più efficace che usare gli esempi per mostrare al modello un anti-pattern da evitare.

Sequenza negativa:

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

Pattern positivo:

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

Utilizza una formattazione coerente negli esempi

Assicurati che la struttura e la formattazione degli esempi di tipo few-shot siano le stesse per evitare risposte con formati indesiderati. Uno degli obiettivi principali dell'aggiunta di esempi few-shot nei prompt è quello di per mostrare al modello il formato della risposta. Pertanto, è essenziale garantire un formato coerente tutti gli esempi, prestando particolare attenzione a tag XML, spazi vuoti, a capo divisori.

Riepilogo

  • L'inclusione di esempi di risposta nel prompt consente al modello di imparare come rispondere.
  • Fornisci al modello esempi di pattern da seguire anziché esempi di pattern da seguire evitare.
  • Prova a numero di prompt da includere. A seconda del modello, non sono presenti esempi sufficienti inefficaci nel cambiamento del comportamento del modello. Troppi esempi causano l'overfitting del modello.
  • Utilizza una formattazione coerente negli esempi

Aggiungi informazioni contestuali

Puoi includere nel prompt le istruzioni e le informazioni necessarie al modello per risolvere anziché supporre che il modello abbia tutte le informazioni richieste. Questo contesto informazioni aiutano il modello a comprendere i vincoli e i dettagli di ciò che che possono fare.

Nell'esempio seguente viene chiesto al modello di fornire indicazioni per la risoluzione dei problemi relativi a un router:

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.
  

La risposta è simile a informazioni generiche per la risoluzione dei problemi che non sono specifiche per il router o lo stato delle spie LED.

Per personalizzare la risposta per il router specifico, puoi aggiungere al prompt del router guida alla risoluzione dei problemi come contesto a cui fare riferimento quando fornisce una risposta.

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.
  

Riepilogo

  • Includi informazioni (contesto) nel prompt che vuoi che il modello utilizzi quando genera un risposta.
  • Fornisci al modello istruzioni su come utilizzare le informazioni contestuali.

Aggiungi prefissi

Un prefisso è una parola o una frase che aggiungi al contenuto del prompt e che può servire a diversi scopi. a seconda di dove inserisci il prefisso:

  • Prefisso di input: aggiungi un prefisso ai segnali di input semanticamente significativo parti dell'input al modello. Ad esempio, i prefissi "Italiano:" e "Francese:" delimitare due lingue diverse.
  • Prefisso di output: anche se l'output è generato dal modello, puoi aggiungere un prefisso per l'output nel prompt. Il prefisso di output fornisce al modello informazioni previsto come risposta. Ad esempio, il prefisso di output "JSON:" segnala al modello che l'output deve essere in formato JSON.
  • Prefisso di esempio: nei prompt few-shot, l'aggiunta di prefissi agli esempi fornisce etichette che il modello può utilizzare durante la generazione dell'output, il che semplifica l'analisi dell'output contenuti.

Nel seguente esempio, "Text:" è il prefisso di input e "La risposta è:" è l'output .

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
  

Lascia che il modello completi l'input parziale

I modelli linguistici generativi funzionano come uno strumento di completamento automatico avanzato. Se fornisci un indirizzo contenuti, il modello può fornire il resto dei contenuti o ciò che ritiene sia una continuazione contenuti in risposta. Nel farlo, se includi esempi o contesto, il modello può prendere gli esempi o il contesto.

L'esempio seguente fornisce un prompt con un'istruzione e un input di entità:

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
}
```
  

Anche se il modello ha seguito le istruzioni, a volte scrivere le istruzioni in linguaggio naturale è difficile e questo può influire sull'interpretazione del modello. Ad esempio, il menu di un ristorante potrebbe contenere molti elementi. Per ridurre le dimensioni della risposta JSON, probabilmente vorrai omettere gli elementi che non sono stati ordinati. In questo caso, puoi fornire un esempio e un prefisso di risposta e lasciare che il modello completalo:

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
}
```
  

Come vedi, "cheeseburger" è stato escluso dall'output perché non faceva parte dell'ordine.

Chiedi al modello di formattare la sua risposta

La strategia di completamento può anche aiutare a formattare la risposta. L'esempio seguente richiede per creare lo schema di un saggio:

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.
  

Nel prompt non è stato specificato il formato della struttura e il modello ha scelto un formato per te. Per ottenere al modello per restituire una struttura in un formato specifico, puoi aggiungere un testo che rappresenti l'inizio la struttura e lasciare che il modello la completi in base al pattern che hai avviato.

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.
  

Riepilogo

  • Se fornisci al modello un input parziale, il modello completa l'input in base alle risposte esempi o contesto nel prompt.
  • A volte, fare in modo che il modello completi un input può essere più facile che descrivere l'attività in modo naturale lingua.
  • L'aggiunta di una risposta parziale a un prompt può portare il modello a seguire un pattern desiderato formato.

Suddividi i prompt in componenti semplici

Per i casi d'uso che richiedono prompt complessi, puoi aiutare il modello a gestire questa complessità suddividendoli in componenti più semplici.

Suddividi le istruzioni

Anziché avere molte istruzioni in un solo prompt, creane uno per istruzione. Puoi scegli quale prompt elaborare in base all'input dell'utente.

Catena di prompt

Per attività complesse che prevedono più passaggi sequenziali, imposta ogni passaggio come prompt e concatena i prompt insieme in sequenza. In questa catena sequenziale di prompt, l'output di un prompt la sequenza diventa l'input del prompt successivo. L'output dell'ultimo prompt della sequenza è il l'output finale.

Risposte aggregate

Per aggregazione si intende eseguire diverse attività parallele in parti diverse del e aggregarli per produrre l'output finale. Ad esempio, puoi dire al modello eseguire un'operazione sulla prima parte dei dati, eseguire un'altra operazione sul resto e aggreghiamo i risultati.

Riepilogo

  • Suddividi istruzioni complesse in un prompt per ogni istruzione e decidi quale prompt si applicano in base all'input dell'utente.
  • Suddividi più passaggi sequenziali in prompt separati e li concatena in modo che l'output sul prompt precedente diventa l'input del seguente prompt.
  • Suddividere le attività parallele e aggregare le risposte per produrre l'output finale.

Sperimenta con diversi valori parametro

Ogni chiamata inviata a un modello include valori parametro che controllano il modo in cui il modello viene generato una risposta. Il modello può generare risultati diversi a seconda dei valori parametro. Sperimenta con valori dei parametri diversi per ottenere i valori migliori per l'attività. I parametri disponibili per modelli diversi possono essere diversi. I parametri più comuni sono i seguenti:

  • Numero massimo di token di output
  • Temperatura
  • Top-K
  • Top-P

Numero massimo di token di output

Numero massimo di token che possono essere generati nella risposta. Un token è di circa quattro caratteri. 100 token corrispondono a circa 20 parole.

Specifica un valore più basso per risposte più brevi e un valore più alto per risposte più lunghe diverse.

Temperatura

La temperatura viene utilizzata per il campionamento durante la generazione della risposta, che si verifica quando vengono applicati i criteri topP e topK. Controlli della temperatura il grado di casualità nella selezione dei token. Le temperature più basse sono ideali per di prompt che richiedono una creatività o un approccio più deterministico e meno aperto di risposta, mentre le temperature più alte possono generare risposte più diversificate o creative che consentono di analizzare i dati e visualizzare i risultati. La temperatura di 0 è deterministica, il che significa che viene sempre selezionata la risposta con la probabilità più alta.

Per la maggior parte dei casi d'uso, prova a iniziare con una temperatura di 0.2. Se il modello restituisce una risposta troppo generica, troppo breve o fornisce una risposta di risposta di riserva, prova ad aumentare la temperatura.

Top-K

Top-K cambia il modo in cui il modello seleziona i token per l'output. Un top-K di 1 significa che il successivo token selezionato è il più probabile tra tutti nel vocabolario del modello (chiamato anche decodifica greedy), mentre una top-K di 3 significa che il token successivo viene selezionato tra i tre probabili token utilizzando la temperatura.

Per ogni passaggio di selezione dei token, vengono mostrati i token top-K con il vengono campionate. Quindi i token vengono ulteriormente filtrati in base a top-p con il token finale selezionato utilizzando il campionamento della temperatura.

Specifica un valore più basso per risposte meno casuali e un valore più alto per più risposte risposte casuali. Il valore predefinito di top-K è 40.

Top-P

Top-P cambia il modo in cui il modello seleziona i token per l'output. Token selezionati dal più probabile (vedi top-K) al meno probabile fino alla somma delle probabilità equivale al valore di top-p. Ad esempio, se i token A, B e C hanno una probabilità di 0,3, 0,2 e 0,1 e il valore di top-P è 0.5, il modello seleziona A o B come token successivo utilizzando la temperatura ed esclude C come candidato.

Specifica un valore più basso per risposte meno casuali e un valore più alto per più risposte risposte casuali. Il valore predefinito di top-P è 0.95.

Strategie di iterazione dei prompt

La progettazione del prompt è un processo iterativo che spesso richiede alcune iterazioni prima di ottenere la risposta desiderata in modo coerente. Questa sezione fornisce indicazioni su alcune cose che puoi provare quando l'iterazione dei tuoi prompt.

Usa una frase diversa

L'utilizzo di parole o frasi diverse nei prompt produce spesso risposte diverse rispetto al modello anche se significano tutti la stessa cosa. Se non ottieni i risultati previsti dalle tue , prova a riformularla.

Version 1:
How do I bake a pie?

Version 2:
Suggest a recipe for a pie.

Version 3:
What's a good pie recipe?
  

Passa a un'attività analoga

Se non riesci a far seguire al modello le istruzioni per un'attività, prova a fornirgli istruzioni un'attività analoga che ottiene lo stesso risultato.

Questo prompt indica al modello di classificare un libro utilizzando categorie predefinite.

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.
  

La risposta è corretta, ma il modello non è rientrato nei limiti delle opzioni. Inoltre vuoi modello in modo che risponda solo con una delle opzioni anziché in una frase completa. In questo caso, puoi riformulare le istruzioni come domanda a scelta multipla e chiedere al modello di scegliere .

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

Modifica l'ordine dei contenuti del prompt

A volte l'ordine dei contenuti della richiesta può influire sulla risposta. Prova a modificare l'ordine dei contenuti e vedere come questo influisce sulla risposta.

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

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

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

Risposte di riserva

Una risposta di riserva è una risposta restituita dal modello quando il prompt o la risposta attiva un filtro di sicurezza. Un esempio di risposta di riserva è "Non sono in grado di aiutarti, poiché Sono solo un modello linguistico".

Se il modello risponde con una risposta di riserva, prova ad aumentare la temperatura.

Cose da evitare

  • Evita di fare affidamento su modelli per generare informazioni fattuali.
  • Usa con attenzione i problemi di matematica e logica.

Passaggi successivi