プロンプトをバージョン管理して出力を評価する
プロンプトの変更を追跡し、レスポンスを評価します。
「プロンプトをバージョン管理して出力を評価する」はCoddyKit上の無料MLOps Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはMLOps Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 MLOps Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Prompts Are Code
A reworded prompt can change behavior overnight. So you treat each prompt as a versioned artifact, with history, review, and the ability to roll back. 📝
Store Prompts, Not Strings
Hard-coded strings scattered in code are impossible to track. Keep prompts in a registry or files so every change is visible and diffable.
prompts/summarize_ticket.v2.txt
prompts/summarize_ticket.v3.txtTag Each Version
Give every prompt a clear version id you can pin in code. Then you always know exactly which wording produced a given output.
PROMPT_VERSION = "summarize-v3"
template = load_prompt(PROMPT_VERSION)Build an Eval Dataset
Collect real inputs with the answers you want. This eval set is your yardstick for judging whether a prompt change actually helped.
cases = [
{"input": "ticket text...", "expected": "Refund requested"},
]Score Against References
For tasks with a known answer, compare output to the expected text. A simple metric like exact match or F1 gives you a fast pass-fail signal.
Use an LLM as Judge
For open-ended text, ask another model to grade the answer against a rubric. This LLM-as-judge pattern scales scoring beyond hand-written rules.
judge_prompt = "Rate 1-5 how well the summary captures the ticket:\n{output}"Watch the Judge Itself
Judges can be biased or inconsistent. You keep them honest by spot-checking scores against a few human ratings on the same cases.
Run Evals on Every Change
Before shipping a new prompt, run it across the whole eval set. You only promote it if the score holds or improves, never on a hunch.
old = run_eval("summarize-v2")
new = run_eval("summarize-v3")
assert new.score >= old.scoreTrack Regressions
A prompt that fixes one case can break another. Comparing per-case results catches these regressions before users ever see them.
Frameworks Help
Tools like promptfoo or OpenAI Evals run datasets, call models, and report scores for you. A framework turns ad-hoc testing into a repeatable suite.
Pin the Winner
Once a version wins on your evals, pin it in production and archive the rest. You now have a clear, auditable trail from prompt to result.
Quick Check
You need to score open-ended summaries with no single correct answer. What fits best?
Recap
You learned to version prompts, build an eval set, score with metrics or an LLM judge, and gate releases on results. No more guessing! 🎉
よくある質問
「プロンプトをバージョン管理して出力を評価する」レッスンは無料ですか?
はい。「プロンプトをバージョン管理して出力を評価する」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、MLOps Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 MLOps Academyコースには全4レッスンが含まれています。
「プロンプトをバージョン管理して出力を評価する」で何を学びますか?
プロンプトの変更を追跡し、レスポンスを評価します。 ブラウザで直接実行するハンズオンコードでMLOps Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
MLOps Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのMLOps Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「プロンプトをバージョン管理して出力を評価する」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このMLOps Academyレッスンでコードを書いて実行できますか?
はい。すべてのMLOps Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- LLMOpsと従来のMLOpsの違い
- プロンプトをバージョン管理して出力を評価する
- LLM呼び出しを追跡・監視する
- ガードレールとRAG評価