Fornisci istruzioni chiare e specifiche

Fornire al modello istruzioni su cosa fare è un modo efficace ed efficiente per personalizzare il comportamento del modello. Fornisci informazioni chiare, concise e dirette nelle istruzioni, 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:

  • Di' 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 al cheeseburger e voglia utilizzare un modello per scoprire quali sono i memu più popolari. Vuoi che il modello formatti le trascrizioni degli ordini dei clienti in formato JSON in modo da poter identificare rapidamente le voci del menu. Le seguenti tabelle mostrano le diverse risposte fornite dal modello quando vengono fornite istruzioni generiche e istruzioni specifiche che seguono i principi delle istruzioni:

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."
            ]
          }
        ]
      }
    
Nell'esempio, le istruzioni generiche generano una risposta con più campi JSON rispetto a quelli necessari per identificare le voci di menu che i clienti ordinano. Migliora le istruzioni creando vincoli di output più specifici, come mostrato nella seguente tabella:
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 delle istruzioni possono aiutarti a indirizzare il modello in modo che fornisca la risposta più utile per il tuo caso d'uso.

Passaggi successivi