原典: Prompt engineering overview / 日本語版
一行要約
短い導線ページだが、主張は明確 — prompt engineering に入る前に成功基準と eval を持て、そしてすべての失敗が prompt engineering で解決すべきものではない。
要点
始める前の3つの前提
This guide assumes that you have:
- A clear definition of the success criteria for your use case
- Some ways to empirically test against those criteria
- A first draft prompt you want to improve
本ガイドは次を前提とする。1. ユースケースの成功基準が明確に定義されていること、2. その基準に対して経験的にテストする手段があること、3. 改善したい prompt の初稿があること。
If not, spend time establishing that first.
なければ、まずそれを固めることに時間を使え。
初稿がないなら、Claude Cookbook の metaprompt レシピで生成できる。
いつ prompt engineering をするのか
Not every success criteria or failing eval is best solved by prompt engineering. For example, you can sometimes improve latency and cost more easily by selecting a different model.
すべての成功基準や、失敗した eval が、prompt engineering で解決するのが最善とは限らない。たとえば別のモデルを選ぶほうが、レイテンシとコストを容易に改善できる場合がある。
技法はどこにあるか
All prompting techniques (from clarity and examples to XML structuring, role prompting, thinking, and prompt chaining) are covered in Prompting best practices. That’s the living reference; start there.
明確さと例示から、XML による構造化、役割の付与、thinking、prompt chaining に至るまで、すべてのプロンプト手法は Prompting best practices に載っている。あれが生きた参照であり、そこから始めよ。
モデルを問わない一般論が中心の記事は best-practices-for-prompt-engineering。
対話的に学ぶなら
- GitHub の prompt-eng-interactive-tutorial — 例が豊富なチュートリアル。Claude 3 世代向けに書かれているので、Prompting best practices と食い違うところは後者に従う(以前の取得の後に足された注記。間の控えが無いので、いつ足されたかは分からない)
- Google Sheets 版 — 対話的スプレッドシートとしての軽量版
そのまま使える具体例
作業の順序:
- 成功基準を定義する ——
develop-tests - 経験的にテストする手段を作る ——
develop-tests(eval) - prompt の初稿を用意する —— なければ metaprompt レシピ
- 技法を適用する ——
claude-prompting-best-practices(living reference。原典は「Claude の latest models に合わせた調整はここから」と書く)
「prompt engineering で解くべきか」の判断: レイテンシとコストは、prompt より先にモデルの選択で改善できないかを見る(原典が挙げる例はこれだけ)。
原典で言及されている関連文書
- claude-prompting-best-practices — living reference。技法の本体
- develop-tests — 成功基準と eval(これが前提条件)
- prompt-eng-interactive-tutorial
- best-practices-for-prompt-engineering