Strategie di iterazione dei prompt

La progettazione dei prompt spesso richiede alcune iterazioni prima di ottenere in modo coerente la risposta desiderata. La tua strategia di progettazione dei prompt dovrebbe applicare le best practice per la progettazione dei prompt, con perfezionamenti incrementali. Puoi introdurre iterativamente alcune o tutte le best practice durante i test per ottenere prestazioni che soddisfino le tue esigenze del caso d'uso.

Inoltre, a volte l'ordine dei contenuti della richiesta può influire sulla risposta. Prova a modificare l'ordine dei contenuti e guarda come cambia la risposta. Ad esempio, per i prompt multimodali, prova ad aggiungere i file al prompt prima delle istruzioni.

Quando ricevi risposte dal modello, prendi nota degli aspetti che ti piacciono e non ti piacciono delle sue risposte e modifica i tuoi prompt per indirizzare il modello verso le risposte più in linea con i tuoi casi d'uso.

Esempi

In questo esempio, supponiamo che tu voglia che il modello scriva il testo pubblicitario per il tuo prodotto. Puoi iniziare definendo il seguente contenuto del prompt:

  • Obiettivo: creare un testo pubblicitario
  • Contesto:
    • Categorie: scarsità, esclusività
    • Descrizione del prodotto: "Chromecast è un dispositivo che consente agli utenti di trasmettere contenuti in modalità wireless da altri dispositivi per guardare i loro film, programmi TV, foto, siti web preferiti e altro ancora sulla loro TV. Chromecast è in grado di visualizzare contenuti da smartphone e tablet Android, iPhone e iPad, laptop Windows e Mac e Chromebook Pixel."
  • Vincoli: ogni risposta deve essere costituita al massimo da due frasi.

Sperimentare il modo in cui fornisci i contenuti al modello può aiutarti a garantire che la risposta del modello soddisfi al meglio le tue esigenze. Supponi di fornire al modello i contenuti del prompt esattamente come è scritto:

Prima iterazione
      Create ad copy.

      Categories: scarcity, exclusivity

      Product description: "Chromecast is a device that allows users to wirelessly cast their content from other devices, so they can watch their favorite movies, TV shows, photos, websites, and more on their TV. Chromecast can display content from Android smartphones and tablets, iPhones & iPads, Windows and Mac laptops, and the Chromebook Pixel."

      Constraints: Each response should be two sentences or less.
    
      Scarcity

      *  Time is running out to experience the future of entertainment! Get your Chromecast before they're gone.
      *  Limited quantities available! Don't miss your chance to own the streaming device everyone's talking about.

      Exclusivity

      *  Unlock a world of entertainment with Chromecast. Experience the freedom of streaming like never before.
      *  Upgrade your home entertainment with the exclusive Chromecast device. Join the elite group of cord-cutters who stream smarter.
    

Poi puoi provare a riformattare il prompt per vedere come cambia la risposta quando l'obiettivo, i vincoli e parte del contesto vengono combinati in un'unica frase:

Seconda iterazione
      Create scarcity and exclusivity-focused ad copy that is less than two sentences.

      Product description: "Chromecast is a device that allows users to wirelessly cast their content from other devices, so they can watch their favorite movies, TV shows, photos, websites, and more on their TV. Chromecast can display content from Android smartphones and tablets, iPhones & iPads, Windows and Mac laptops, and the Chromebook Pixel."
    
      Options for Scarcity & Exclusivity-Driven Chromecast Ads:

      Option 1 (Scarcity): "Limited quantities available! Get your Chromecast today before they're gone and unlock a world of on-demand entertainment."

      Option 2 (Exclusivity): "Experience entertainment like never before. Chromecast: the ultimate upgrade for your TV, available for a limited time."
    

Questa volta, la risposta del modello conteneva una sola opzione di copia per ogni categoria. Se ti rendi conto di aver bisogno di almeno due opzioni per ogni categoria e di non voler limitare la lunghezza della risposta, puoi modificare i vincoli e riprovare a eseguire il prompt:

Terza iterazione
      Create two ad-copies about scarcity and two ad-copies about exclusivity.

      Product description: "Chromecast is a device that allows users to wirelessly cast their content from other devices, so they can watch their favorite movies, TV shows, photos, websites, and more on their TV. Chromecast can display content from Android smartphones and tablets, iPhones & iPads, Windows and Mac laptops, and the Chromebook Pixel."
    
    Scarcity Ad Copies:
    Ad 1:

    Headline: Don't miss out! Chromecast is flying off the shelves!

    Body: Experience the magic of Chromecast before it's too late! Limited quantities are available, so grab yours now and start enjoying your favorite entertainment on the big screen. 

    Ad 2:

    Headline: Last chance! Chromecast is almost sold out.

    Body: Time is running out to get your hands on Chromecast. Upgrade your TV experience today and enjoy seamless streaming from all your devices. Don't wait, supplies are limited!


    Exclusivity Ad Copies:

    Ad 1:

    Headline: Unlock a world of entertainment with the exclusive Chromecast.

    Body: Join the elite group of Chromecast users and experience the future of television. Enjoy effortless streaming, endless entertainment options, and unparalleled convenience. Chromecast: It's not just TV, it's an experience.

    Ad 2:

    Headline: Elevate your home entertainment with the Chromecast advantage.

    Body: Go beyond ordinary TV with Chromecast. Seamlessly stream content from all your devices and enjoy a personalized entertainment experience like no other. Discover the exclusivity of Chromecast today. 
    

Nella terza iterazione, la risposta del modello conteneva entrambi i campi del titolo e del corpo del testo pubblicitario. Per questo esempio, supponiamo che questa risposta sia in linea con i tuoi requisiti del testo pubblicitario.

Ora che hai modificato il prompt in modo da ottenere una risposta in linea con i requisiti del testo pubblicitario, puoi aggiornarlo e testarlo per assicurarti che il modello produca risposte con formattazione simile in futuro:

Quarta iterazione
      Create two ad-copies about scarcity and two ad-copies about exclusivity.

      Include a headline and body for each ad copy.

      Product description: "Chromecast is a device that allows users to wirelessly cast their content from other devices, so they can watch their favorite movies, TV shows, photos, websites, and more on their TV. Chromecast can display content from Android smartphones and tablets, iPhones & iPads, Windows and Mac laptops, and the Chromebook Pixel."
    
    Scarcity Ads:

    Ad 1:

    Headline: Last Chance! Chromecast is Selling Out Fast
    Body: Get the Chromecast experience before it's gone! Limited quantities remain. Upgrade your TV time today!

    Ad 2:

    Headline: Don't Miss Out! Chromecast Stock is Running Low
    Body: Time is running out to grab your Chromecast. Enjoy seamless streaming on the big screen. Order now while supplies last!

    Exclusivity Ads:

    Ad 1:

    Headline: Unlock the Ultimate Viewing Experience with Chromecast
    Body: Join the elite group of Chromecast users and enjoy unparalleled streaming convenience. Elevate your entertainment today!

    Ad 2:

    Headline: Experience the Future of Entertainment: Get Your Chromecast
    Body: Be among the first to enjoy the cutting-edge technology of Chromecast. Stream anything, anytime, effortlessly.  Upgrade your home entertainment now!
    

Questa volta, la risposta del modello è molto simile all'iterazione precedente, anche con i vincoli aggiuntivi, il che significa che hai eseguito correttamente l'iterazione del prompt.

Come dimostrato nell'esempio, l'iterazione del prompt è parte integrante del processo di progettazione dei prompt e può aiutarti a guidare il modello affinché produca i migliori risultati per il tuo caso d'uso.

Passaggi successivi