Fornisci istruzioni chiare e specifiche

Fornire al modello istruzioni su cosa fare è un modo efficace ed efficiente per personalizzarlo comportamento degli utenti. Fornisci istruzioni chiare, concise e dirette, fornendo il contesto necessario che delinea l'output desiderato. Le istruzioni possono essere semplici come un elenco di istruzioni passo passo o complessi come creare 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 aiutarti. scopri quali sono le portate più richieste. Vuoi che il modello formatti le trascrizioni gli ordini dei clienti in JSON per identificare rapidamente le voci del menu. Le seguenti tabelle dimostrare le diverse risposte fornite dal modello quando gli vengono fornite istruzioni generiche e specifiche istruzioni 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 (Restaurant 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 portano a una risposta con più campi JSON di quelli devi identificare le voci di menu che i clienti ordinano. Migliora le istruzioni rendendo più vincoli di output specifici, come illustrato 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 (Restaurant 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 di istruzione, questo esempio è passato da una risposta che conteneva molti dati a uno che conteneva esattamente i dati richiesti per questo caso d'uso. Istruzioni che utilizzano principi di istruzione possono aiutare il modello a fornire la risposta più utile per il tuo caso d'uso.

Passaggi successivi