AIプロンプトをテストして出力を比較する
良い回答が一度出ても、別の入力で同じ品質になるとは限りません。よくあるケースと判断に迷うケースを用意し、変更前に何を評価するか決めておきます。
- 標準的な入力、短い入力、必要情報が欠けている入力を用意します。事実の正確さ、形式の遵守、不明点への対応を確認します。
- プロンプトの違いを見るときはモデルと入力を固定します。モデルを比べるときは同じプロンプトと入力を使います。
- Proのテスト・比較機能では結果を作業画面で並べて確認できます。複数のケースで安定した案を残し、人の確認が必要な出力にも印を付けます。
問い合わせ要約プロンプトのA/Bテスト実例
Prompt Builderで設定しているGeminiモデルを使い、同じ3件の架空の問い合わせでA案とB案を試しました。再現するには、各プロンプトの末尾に空行を1行入れて同じ問い合わせを貼り付け、モデルと設定をそろえて実行します。プロンプト、問い合わせ、出力は英語の原文です。
gemini-3.1-flash-lite-preview温度1、思考レベルは高、出力上限1,024トークン
プロンプトA
Summarize this customer support ticket in exactly two plain-text lines. Use the labels Issue and Order number.プロンプトB
Summarize this customer support ticket in exactly two plain-text lines. Use the labels Issue and Order number. Write Unknown for the order number when the customer did not provide one.2行目の「Order number: 」に続く値が期待値と完全に一致すれば、各ケースに1点を付けます。句読点も比較します。
| ケース | 期待値 | A | B |
|---|---|---|---|
| 注文番号あり | PB-2481 | 一致 | 不一致 |
| 注文番号なし | Unknown | 不一致 | 一致 |
| 問い合わせ番号のみ | Unknown | 不一致 | 一致 |
| 一致の合計 | 1/3 | 2/3 | |
B案は注文番号がない2件で指定どおりUnknownを返しました。注文番号があるケースでは末尾にピリオドを付けたため、完全一致とはなりませんでした。実行は各ケースで各案1回です。採用する前に、自分の入力でも試してください。
注文番号あり
問い合わせ本文
My blue travel mug arrived cracked. My order number is PB-2481.A案の実際の出力
Issue: Blue travel mug arrived cracked
Order number: PB-2481B案の実際の出力
Issue: Customer received a cracked blue travel mug.
Order number: PB-2481.注文番号なし
問い合わせ本文
My blue travel mug arrived cracked. Can you send a replacement?A案の実際の出力
Issue: Customer received a cracked blue travel mug and requested a replacement.
Order number: Not provided.B案の実際の出力
Issue: The customer received a cracked blue travel mug and is requesting a replacement.
Order number: Unknown問い合わせ番号のみ
問い合わせ本文
My blue travel mug arrived cracked. Please see support ticket 5176 for the photo. Can you send a replacement?A案の実際の出力
Issue: Customer received a cracked blue travel mug and is requesting a replacement.
Order number: Not provided (referenced support ticket 5176).B案の実際の出力
Issue: Customer received a damaged blue travel mug and is requesting a replacement.
Order number: Unknown内蔵のテスト機能を使わずに比較できますか?
はい。各案をコピーして同じAIに入力し、同じ基準で評価できます。作業画面内でのテストと比較はProの機能です。