Memberikan petunjuk kepada model tentang apa yang harus dilakukan adalah cara yang efektif dan efisien untuk menyesuaikan perilaku model. Berikan petunjuk yang jelas, ringkas, dan langsung, serta berikan konteks yang diperlukan dan jelaskan output yang diinginkan. Petunjuk dapat berupa daftar petunjuk langkah demi langkah yang sederhana atau kompleks seperti memetakan pengalaman dan pola pikir pengguna.
Cara menulis petunjuk yang efektif
Petunjuk yang efektif menerapkan prinsip-prinsip berikut:
- Beri tahu model apa yang harus dilakukan.
- Gunakan kata-kata yang jelas dan spesifik.
- Tentukan batasan atau persyaratan pemformatan untuk output.
Contoh
Misalnya, Anda memiliki restoran cheeseburger dan ingin menggunakan model untuk membantu Anda mempelajari item menu mana yang paling populer. Anda ingin model memformat transkrip pesanan pelanggan dalam format JSON sehingga Anda dapat dengan cepat mengidentifikasi item menu. Tabel berikut menunjukkan berbagai respons yang diberikan model saat diberi petunjuk umum dan petunjuk spesifik yang mengikuti prinsip petunjuk:
| Petunjuk umum |
|---|
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."
]
}
]
}
|
| Petunjuk spesifik |
|---|
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"
]
}
|
Dengan menerapkan prinsip petunjuk, contoh ini berubah dari respons yang berisi terlalu banyak data menjadi respons yang berisi data yang diperlukan untuk kasus penggunaan ini. Petunjuk yang menggunakan prinsip petunjuk dapat membantu Anda memandu model untuk memberikan respons yang paling bermanfaat untuk kasus penggunaan Anda.