Fornire al modello istruzioni su cosa fare è un modo efficace ed efficiente per personalizzarne il comportamento. Fornisci istruzioni chiare, concise e dirette, fornendo il contesto necessario e delineando l'output desiderato. Le istruzioni possono essere semplici come un elenco di istruzioni passo passo o complesse come delineare l'esperienza e la mentalità di un utente.
Come scrivere istruzioni efficaci
Le istruzioni efficaci applicano i seguenti principi:
- Indica al modello cosa fare.
- Fornisci informazioni chiare e specifiche.
- Specifica eventuali vincoli o requisiti di formattazione per l'output.
Esempio
Ad esempio, supponiamo che tu possieda un ristorante che serve cheeseburger e che voglia utilizzare un modello per scoprire quali sono i prodotti più popolari. Vuoi che il modello formatti le trascrizioni degli ordini dei clienti in JSON per identificare rapidamente le voci di menu. Le seguenti tabelle mostrano le diverse risposte fornite dal modello quando vengono fornite istruzioni generiche e istruzioni specifiche che seguono i principi di istruzione:
Istruzioni generiche |
---|
Extract the transcript in JSON. Transcript: Speaker 1 (Customer): Hi, can I get a cheeseburger and large fries, please? Speaker 2 (Resturaunt employee): Coming right up! Anything else you'd like to add to your order? Speaker 1: Hmmm, maybe a small orange juice. And could I get the fries with ketchup on the side? Speaker 2: No problem, one cheeseburger, one large fries with ketchup on the side, and a small orange juice. That'll be $5.87. Drive through to the next window please. { "speakers": [ { "speaker": "Customer", "utterances": [ "Hi, can I get a cheeseburger and large fries, please?" ] }, { "speaker": "Restaurant Employee", "utterances": [ "Coming right up! Anything else you'd like to add to your order?" ] }, { "speaker": "Customer", "utterances": [ "Hmm, maybe a small orange juice. And could I get the fries with ketchup on the side?" ] }, { "speaker": "Restaurant Employee", "utterances": [ "No problem, one cheeseburger, one large fries with ketchup on the side, and a small orange juice. That'll be $5.87. Drive through to the next window please." ] } ] } |
Istruzioni specifiche |
---|
Extract the items from this transcript in JSON and separate drinks from food. Transcript: Speaker 1 (Customer): Hi, can I get a cheeseburger and large fries, please? Speaker 2 (Resturaunt employee): Coming right up! Anything else you'd like to add to your order? Speaker 1: Hmmm, maybe a small orange juice. And could I get the fries with ketchup on the side? Speaker 2: No problem, one cheeseburger, one large fries with ketchup on the side, and a small orange juice. That'll be $5.87. Drive through to the next window please. { "drinks": [ "orange juice" ], "food": [ "cheeseburger", "large fries" ] } |
Applicando i principi delle istruzioni, questo esempio è passato da una risposta che conteneva troppi dati a una che conteneva esattamente i dati richiesti per questo caso d'uso. Le istruzioni che utilizzano i principi di istruzione possono aiutarti a guidare il modello in modo che fornisca le risposte più utili per il tuo caso d'uso.
Passaggi successivi
- Esplora altri esempi di prompt nella Galleria prompt.