Strategie di progettazione dei prompt

Questa pagina illustra alcune strategie generali di progettazione dei prompt che puoi utilizzare durante la progettazione dei prompt. Sebbene non esista un modo giusto o sbagliato di progettare un prompt, esistono strategie comuni che puoi utilizzare per influenzare le risposte del modello. Test e valutazioni rigorosi sono fondamentali 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 le relazioni tra le unità linguistiche. Quando ricevono del testo (il prompt), i modelli linguistici possono prevedere ciò che probabilmente verrà dopo, come un sofisticato strumento di completamento automatico. Pertanto, quando progetti i prompt, considera i diversi fattori che possono influenzare ciò che viene previsto dal modello.

Fornisci istruzioni chiare e specifiche

Fornire al modello istruzioni su cosa fare è un modo efficace ed efficiente per personalizzare il comportamento del modello. Assicurati che le istruzioni fornite siano chiare e specifiche. Le istruzioni possono essere semplici, come un elenco di istruzioni passo passo, o complesse, come la mappatura dell'esperienza e della mentalità di un utente.

Definisci l'attività da eseguire

Descrivi nel dettaglio l'attività che vuoi che il modello esegua. L'attività può essere semplice come un elenco dettagliato di istruzioni o complessa come delineare l'esperienza e la mentalità di un utente. 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 relativi alla lettura del prompt o alla generazione di una risposta. Puoi dire al modello cosa fare e cosa non fare. Nell'esempio precedente, il riassunto è più breve del testo originale, ma forse è consigliabile che il riassunto sia più breve. In questo caso, puoi specificare un vincolo di durata del riepilogo nel prompt:

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 che la risposta venga formattata come tabella, elenco puntato, presentazione, parole chiave, frase o paragrafo. Il seguente prompt indica al modello di fornire elenchi puntati con le informazioni chiave nel 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 istruzioni su cosa fare.
  • Fai in modo che le istruzioni siano chiare e specifiche.
  • Specifica eventuali vincoli o requisiti di formattazione per l'output.

Includi esempi di few-shot

Nel prompt puoi includere esempi che mostrano al modello come funziona correttamente. Il modello tenta di identificare pattern e relazioni dagli esempi e li applica quando genera una risposta. I prompt che contengono alcuni esempi sono chiamati few-shot, mentre quelli che non forniscono esempi sono denominati richieste zero-shot. I prompt few-shot sono spesso utilizzati per regolare la formattazione, la formulazione, la definizione dell'ambito o la definizione di modelli generali delle risposte del modello. Utilizza esempi specifici e vari per aiutare il modello a restringere l'ambito e generare risultati più accurati.

Ti consigliamo di includere sempre pochi esempi nei prompt. I prompt senza esempi few-shot sono probabilmente meno efficaci perché mostrano al modello come applicare le istruzioni. In effetti, puoi rimuovere le istruzioni dal prompt se gli esempi sono sufficientemente chiari nel mostrare l'attività in corso.

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 nella richiesta esempi che danno la preferenza alle risposte concise.

Il seguente prompt fornisce due esempi che mostrano la preferenza per le spiegazioni più brevi. Nella risposta, puoi vedere che gli esempi hanno guidato il modello a scegliere la spiegazione più breve (Spiegazione2) rispetto a quella più lunga (Spiegazione1) come ha fatto 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 i risultati più desiderati. Modelli come PaLM e Gemini possono spesso individuare i pattern utilizzando alcuni esempi, anche se potrebbe essere necessario sperimentare il numero di esempi che portano ai risultati desiderati. Per i modelli più semplici come BERT, potrebbero essere necessari altri esempi. Allo stesso tempo, se includi troppi esempi, il modello potrebbe iniziare a superare la risposta agli esempi.

Utilizza gli esempi per mostrare pattern anziché anti-pattern

L'utilizzo di esempi per mostrare al modello un pattern da seguire è più efficace rispetto all'uso di 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 in tutti gli esempi

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

Riepilogo

  • Includere esempi di prompt di risposta nel prompt aiuta il modello a imparare come rispondere.
  • Fornisci al modello esempi di pattern da seguire, invece di esempi di pattern da evitare.
  • Prova a sperimentare con il numero di richieste da includere. A seconda del modello, un numero insufficiente di esempi è inefficace nel modificare il comportamento del modello. Troppi esempi causano l'overfit del modello.
  • Utilizza una formattazione coerente in tutti gli esempi

Aggiungi informazioni contestuali

Puoi includere nelle istruzioni e nelle informazioni dei prompt il modello ha bisogno di risolvere un problema, invece di presumere che il modello abbia tutte le informazioni richieste. Queste informazioni contestuali aiutano il modello a comprendere i vincoli e i dettagli di ciò che gli viene richiesto.

Nell'esempio seguente viene chiesto al modello di fornire indicazioni per la risoluzione dei problemi per 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 sembra informazioni generiche per la risoluzione dei problemi non specifiche per il router o lo stato delle spie LED.

Per personalizzare la risposta per un router specifico, puoi aggiungere alla guida alla risoluzione dei problemi del router come contesto a cui fare riferimento quando fornisci 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 una risposta.
  • Fornisci al modello istruzioni su come utilizzare le informazioni contestuali.

Aggiungi prefissi

Un prefisso è una parola o una frase che aggiungi ai contenuti del prompt e che può servire a diversi scopi, a seconda di dove lo inserisci:

  • Prefisso di input: aggiungere un prefisso alle parti degli indicatori di input semanticamente significative dell'input nel modello. Ad esempio, i prefissi "Inglese:" e "Francese:" indicano due lingue diverse.
  • Prefisso di output: anche se l'output viene generato dal modello, puoi aggiungere un prefisso per l'output nel prompt. Il prefisso di output fornisce al modello informazioni su cosa ci si aspetta come risposta. Ad esempio, il prefisso di output "JSON:" indica 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 dei contenuti di output.

Nell'esempio seguente, "Testo:" è il prefisso di input e "La risposta è:" è il prefisso di 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. Quando fornisci contenuti parziali, il modello può fornire il resto dei contenuti o ciò che pensa essere una continuazione di questi contenuti come risposta. Quando lo fai, se includi esempi o contesto, il modello può prendere in considerazione tali esempi o 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
}
```
  

Sebbene il modello abbia svolto le modalità richieste, scrivere le istruzioni in linguaggio naturale a volte può essere difficile e lascia molto all'interpretazione del modello. Ad esempio, il menu di un ristorante potrebbe contenere molte voci. Per ridurre le dimensioni della risposta JSON, probabilmente è necessario omettere gli articoli che non erano ordinati. In questo caso, puoi fornire un esempio e un prefisso di risposta e consentire al modello di completarlo:

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

Osserva come il termine "cheeseburger" è stato escluso dall'output perché non faceva parte dell'ordine.

Chiedere al modello di formattare la risposta

La strategia di completamento può anche essere utile per formattare la risposta. Nell'esempio seguente viene chiesto al modello di creare uno schema per 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 personalizzato. Per fare in modo che il modello restituisca un contorno in un formato specifico, puoi aggiungere del testo che rappresenti l'inizio della 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 a eventuali esempi o contesti disponibili nel prompt.
  • A volte il modello completa un input può essere più semplice che descrivere l'attività in un linguaggio naturale.
  • L'aggiunta di una risposta parziale a un prompt può guidare il modello a seguire un pattern o un formato desiderato.

Suddividi i prompt in componenti semplici

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

Istruzioni per la suddivisione

Anziché avere molte istruzioni in un unico prompt, creane uno per ogni istruzione. Puoi scegliere il prompt da elaborare in base all'input dell'utente.

Prompt della catena

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

Risposte aggregate

L'aggregazione consente di eseguire diverse attività parallele su parti diverse dei dati e di aggregare i risultati per produrre l'output finale. Ad esempio, puoi indicare al modello di eseguire un'operazione sulla prima parte dei dati, di eseguire un'altra operazione sugli altri dati e di aggregare i risultati.

Riepilogo

  • Suddividi le istruzioni complesse in una richiesta per ogni istruzione e decidi quale richiesta applicare in base all'input dell'utente.
  • Suddividi più passaggi sequenziali in prompt separati e collegali in modo che l'output sul prompt precedente diventi l'input del prompt seguente.
  • Suddividi le attività parallele e aggrega 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 genera una risposta. Il modello può generare risultati diversi a seconda dei valori parametro. Prova a utilizzare diversi valori parametro per ottenere i valori migliori per l'attività. I parametri disponibili per i vari modelli possono variare. 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 equivale a circa quattro caratteri. 100 token corrispondono a circa 60-80 parole.

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

Temperatura

La temperatura viene utilizzata per il campionamento durante la generazione delle risposte, che si verifica quando vengono applicati topP e topK. La temperatura controlla il grado di casualità nella selezione dei token. Le temperature più basse sono ideali per prompt che richiedono una risposta più deterministica e meno aperta o creativa, mentre le temperature più alte possono portare a risultati più diversificati o creativi. Una temperatura pari a 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 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 pari a 1 indica che il token successivo selezionato è il più probabile tra tutti i token nel vocabolario del modello (detta anche decodifica greedy), mentre un top-K pari a 3 indica che il token successivo viene selezionato tra i tre token più probabili utilizzando la temperatura.

Per ogni fase di selezione dei token, vengono campionati i token top-K con le probabilità più elevate. Quindi, i token vengono ulteriormente filtrati in base a top-P e il token finale viene selezionato utilizzando il campionamento con temperatura.

Specifica un valore più basso per risposte meno casuali e un valore più alto per risposte più 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. I token vengono selezionati dal più probabile (vedi top-K) al meno probabile finché la somma delle loro probabilità equivale al valore 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 selezionerà 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 risposte più casuali. Il valore predefinito di top-P è 0.95.

Strategie di iterazione dei prompt

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

Usa frasi diverse

L'utilizzo di parole o frasi diverse nei prompt spesso produce risposte diverse dal modello, anche se significano tutti la stessa cosa. Se non ottieni i risultati previsti dalla richiesta, 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?
  

Passare a un'attività analoga

Se non riesci a far sì che il modello segua le istruzioni per un'attività, prova a fornirgli le istruzioni per un'attività analoga che consente di ottenere 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 è rimasto nei limiti delle opzioni. Vuoi anche creare il modello affinché risponda solo con una delle opzioni, invece che con una frase completa. In questo caso, puoi riformulare le istruzioni come domanda a scelta multipla e chiedere al modello di scegliere un'opzione.

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

Modificare l'ordine dei contenuti del prompt

L'ordine dei contenuti nella richiesta a volte può influire sulla risposta. Prova a cambiare 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 attivano un filtro di sicurezza. Un esempio di risposta di riserva è "Non sono in grado di aiutarti, dato che 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 oggettive.
  • Presta attenzione ai problemi di matematica e logica.

Passaggi successivi