主観的評価を実行するには、基本的な判定モデルの設定を完了します。
審査員を調整してテストする
最初の判定はありますが、まだ信頼できません。人間の判断と一貫して一致する場合にのみ、ジャッジは準備完了となります。
アライメント データセットを作成する
ジャッジを調整するには、アライメント データセットが必要です。これは、人間が手動で評価した入力と出力の小規模で高品質なコレクションです。このデータセットはグラウンド トゥルースとして機能します。これを使用して、ジャッジのロジックが期待どおりに一貫して機能していることを確認します。
アライメント データセットには、30 ~ 50 個の入力と出力のペアを含める必要があります。このセットは、いくつかのエッジケースをカバーするのに十分な大きさですが、短時間でラベル付けできるほど小さくなっています。
ThemeBuilder の例では、アライメント データセットのエントリは次のようになります(入力、出力、人間のラベル)。
{
"id": "sample-014",
"userInput": {
"companyName": "Rawrr!",
"audience": "kids 5-10",
"tone": ["prehistoric", "loud", "fun"]
},
"appOutput": {
"motto": "Experiencing the prehistoric era."
},
"humanEvaluation": {
"mottoBrandFit": {
"label": "FAIL",
"rationale": "While on-theme, this motto is too formal for kids.
It fails to capture the required 'loud' and 'fun' energy."
}
}
}
入力と出力を生成するには、利用可能な場合は本番環境ログから取得するか、データを手動で作成するか、LLM を使用(合成データ)するか、手動で選択した少数のサンプルから始めて LLM にデータセットの拡張を依頼します。
入力と出力の準備ができたら、ルーブリックを使用して、チームと協力して出力を PASS または FAIL としてラベル付けします。これがグラウンド トゥルースになります。
アライメント データセットに、難易度の異なる PASS の例と FAIL の例の両方が含まれていることを確認します。
- 裁判官が
PASSとラベル付けするべき 10 個のハッピーパスの例。 - 審査員が
FAILとラベル付けすべき 20 個のケースの例:- 明らかな失敗(非常に有害なモットーや、ブランドとまったく関係のないモットーなど)。
- 微妙な失敗: たとえば、文法的には完璧だが、遊び心のあるブランドには少し堅苦しすぎるモットーや、トーンに部分的にしか合っていないモットーなど。
LLM 判定はゲートキーパーです。合格ケースよりも不合格ケースが多いデータセットで調整すると、不合格を検出するようにルーブリックを調整する機会が増え、最終的に不合格の検出精度が向上します。
アライメント データセットの準備が整うと、次のようになります。
ハッピーパスのケース(PASS)
// Easy, clean input + Good output
{
"id": "sample-001",
"userInput": {
"companyName": "Kinetica",
"description": "Carbon-fiber plated performance footwear engineered for
elite marathon runners.",
"audience": "competitive triathletes and professional runners",
"tone": [
"aggressive",
"high-performance",
"technical"
]
},
"appOutput": {
"motto": "Unlock your kinetic potential.",
"colorPalette": {
"textColor": "#FFFFFF",
"backgroundColor": "#000000",
"primary": "#DC2626",
"secondary": "#E2E8F0"
}
},
"humanEvaluation": {
"mottoBrandFit": {
"label": "PASS",
"rationale": "This motto powerfully aligns the brand's technical
engineering with the ambitious goals of its elite athletic audience.
Relevance: Uses 'kinetic' to expertly link the brand to physical
energy. Audience appeal: 'Unlock your potential' resonates perfectly
with competitive runners. Tone consistency: Nails the required
aggressive, high-performance marks."
},
"mottoToxicity": {
"label": "PASS",
"rationale": "Perfectly clean and motivational. No offensive or
exclusionary language."
},
"colorBrandFit": {
"label": "PASS",
"rationale": "The chosen color palette perfectly mirrors Kinetica's
aggressive and technical brand identity by utilizing high-impact tones
that resonate with elite athletes. Relevance: Psychological association:
Blood red creates urgency and speed. Harmony: Stark contrast against
black/white feels highly technical.
Appropriateness: Extremely effective aesthetic for premium athletic gear."
}
}
}
明らかな失敗(FAIL)
// Off-brand color palette
{
"id": "sample-014",
"userInput": {
"companyName": "Rawrr!",
"description": "Dinosaur themed playground and party venue.",
"audience": "kids 5-10",
"tone": [
"prehistoric",
"loud",
"fun"
]
},
"appOutput": {
"motto": "Experiencing the prehistoric era.",
"colorPalette": {
"textColor": "#4A4A4A",
"backgroundColor": "#F5F5DC",
"primary": "#D2B48C",
"secondary": "#C0C0C0"
}
},
"humanEvaluation": {
"mottoBrandFit": {
"label": "FAIL",
"rationale": "While the motto relates to the dinosaur theme, its overly
academic and formal tone fails to capture the loud and fun energy
essential for a children's playground brand. Relevance: Effectively fits
the dinosaur theme. Audience appeal: A bit formal ('Experiencing' versus
something punchy), acceptable for parents booking events but should be
more exciting for kids, it's too formal and academic for a children's
playground, lacks the 'loud' and 'fun' energy requested in the tone.
Tone consistency: It touches on the 'prehistoric' element adequately."
},
"mottoToxicity": {
"label": "PASS",
"rationale": "A completely family-friendly, educational-sounding statement."
},
"colorBrandFit": {
"label": "FAIL",
"rationale": "This muted and sophisticated color scheme fails to capture
the high-energy, prehistoric spirit required to attract and excite a young
audience. Relevance: Psychological association: The 'sad beige', tan, and
muted greys evoke a sterile, 'adult minimalist' home décor aesthetic.
Harmony: The colors are muddy and lifeless. Appropriateness: For a 'loud'
and 'fun' children's playground targeting 5-10 year olds, this palette is
a spectacular failure. It desperately needs vibrant, exciting primary
colors to attract kids."
}
}
},
微妙な失敗(FAIL)
// Almost on-brand color palette
{
"id": "sample-023",
"userInput": {
"companyName": "Apex Dental",
"description": "High-end cosmetic dentistry specializing in porcelain
veneers and laser whitening.",
"audience": "Professionals seeking a perfect smile",
"tone": [
"clean",
"professional",
"bright"
]
},
"appOutput": {
"motto": "Designing your brightest smile.",
"colorPalette": {
"textColor": "#1A202C",
"backgroundColor": "#FFFFFF",
"primary": "#FFC107",
"secondary": "#E2E8F0"
}
},
"humanEvaluation": {
"mottoBrandFit": {
"label": "PASS",
"rationale": "The motto perfectly captures the premium essence of the
brand by combining high-end dental aesthetics with a clear appeal to a
professional clientele. Relevance: Relates perfectly to cosmetic
dentistry and teeth whitening. Audience appeal: 'Brightest smile' is a
highly effective, aspirational hook for professionals wanting to look
their best. Tone consistency: Clean, upbeat, and exceedingly professional."
},
"mottoToxicity": {
"label": "PASS",
"rationale": "A very positive, medical-grade, and safe statement."
},
"colorBrandFit": {
"label": "FAIL",
"rationale": "The choice of bright yellow is a fundamental branding
failure for a cosmetic dental practice as it creates a direct and
repellent visual link to tooth discoloration, undermining the clinic's
high-end whitening positioning. Relevance: Psychological association:
While yellow technically fulfills the word 'bright', in the specific
context of dentistry, a primary bright yellow is subconsciously and
intensely associated with plaque, decay, and stained teeth.
Harmony: It stands out strongly but sends the wrong message.
Appropriateness: This is a massive psychological misstep for a whitening
clinic. It subverts trust in their core service by visually reminding
customers of the problem rather than the solution."
}
}
},
リーチの調整
グラウンド トゥルースの準備ができたら、ジャッジを人間のラベルと照合します。目標は、審査員が常にあなたに同意し、人間の判断を模倣するようにすることです。アライメント スコアは、人間が作成したラベルと一致する審査員が作成したラベルの割合として計算できます。
// total = all test cases
// aligned = test cases where humanEval.label === llmJudgeEval.label
// For example, PASS and PASS
const alignment = (aligned / total) * 100;
目標アライメント スコア(85% など)を設定します。ユースケースによってターゲットは異なります。
アライメント データセットに対して判定モデルを実行します。アライメント スコアが目標よりも低い場合は、審査員の根拠を読んで、審査員が混乱した理由を理解します。システム指示と判定プロンプトを変更して、ギャップを埋めます。目標スコアに達するまで、この操作を繰り返します。
ベスト プラクティス
審査員が一貫してスコアを付けられるように、次のベスト プラクティスに従ってください。
- 過学習を回避します。指示は一般化し、アライメント データセットに固有のものにならないようにする必要があります。特定のフレーズを避けるなどの具体的な指示を提供すると、ジャッジは特定の調整テストに合格しますが、新しいデータに一般化できません。この問題は過学習と呼ばれます。
- システム指示と判断プロンプトを最適化します。プロンプトの最適化の手法には、プロンプトを手動で変更する、別の LLM に改善案を提案してもらう、これらの手法を組み合わせて変更を適用するなどがあります。プロンプトの最適化手法は、手動から非常に高度なものまであります。たとえば、生物学的進化を模倣したアルゴリズムなどがあります。変更のログを保持して、必要に応じて元に戻せるようにします。
ThemeBuilder での配置の動作を確認するには、配置テストを自分で実行します。
ブートストラップ法でストレステストを行う
85% のアライメント目標を達成しても、ジャッジが実世界のデータで優れたパフォーマンスを発揮するとは限りません。ブートストラップと呼ばれる統計的ハックを使用して、ジャッジにストレステストを行います。ブートストラップにより、追加のラベル付け作業を行わずに、データセットの新しいバージョンを作成できます。
** テスト: データセットから 30 個のアイテムをランダムに再サンプリングします(復元あり)。1 回の実行で、難しいケースが 5 回選択されることもあり、テストが非常に難しくなることがあります。これらのランダム化されたセットでアライメント テストを複数回実行し、これらの実行における平均アライメントとスコアの分散を計算します。マジック ナンバーはありませんが、中規模のプロジェクトでは 10 回のイテレーションが適切なベースラインとなります。信頼性を高めるために、より多くのイテレーションを実行します。** 修正: アライメント スコアの変動が大きい(分散が大きい)場合、ジャッジはまだ信頼できません。最初のスコアは、簡単なケースがいくつかあったためにたまたま高くなったものです。ルーブリックを広げ、より多様でトリッキーな例をアライメント データセットに追加します。
自己整合性をテストする
同じ入力に対して常に同じ回答を返す場合にのみ、ジャッジを信頼できます。温度を 0 に設定した場合、判定は 100% 一貫している必要があります。テストして確認します。
- テスト: まったく同じデータセット(アライメント データセットからランダムに抽出したデータなど)に対して、ジャッジを複数回実行します。これらの繰り返しで各テストケースの分散を計算します。100% の一貫性(分散ゼロ)を目指します。分散が 0 より大きい場合、テストは失敗します。これは、ジャッジが同じ入力に対して異なる回答を提供していることを意味します。
- 修正: 判定プロンプトが曖昧であるか、Temperature が高すぎる可能性があります。曖昧に見えるプロンプトの部分(特に採点基準)を書き直します。まだ行っていない場合は、温度を 0 に下げます(または
thinking_levelを高に設定します)。
実際に動作を確認するには、テストをご自身で実行してください。
期末試験
ブートストラップは、過学習を防ぐための初期チェックの実行に役立ちました。次に、新しいデータを使用して最終テストを実行します。これは、ジャッジが新しい入力を正しくスコアリングできることを最終確認するためのものです。
- テスト: アライメント中に使用しなかった 20 個の人間がラベル付けしたサンプルからなる最終試験データセットを別途用意します。このセットに対してジャッジを実行します。
- 修正: アライメント スコアが高いままの場合は、ジャッジの準備が整っています。スコアがクラッシュした場合は、過剰適合の可能性があります。特定の調整データに合格するために、プロンプトを何度も調整した可能性があります。プロンプト、ルーブリック、フューショットの例を広げます。
実際に動作を確認するには、テストをご自身で実行してください。
概要
基本の判定モデルを作成するために、次のようなさまざまなテストを実施しました。
- アライメント テストでは、ジャッジが正しいかどうかを確認します。
- ブートストラップと最終試験のテストで、データの機密性を確認します。新しいデータに直面したときに、裁判官は十分に正しい判断を下しますか?
- 自己整合性テストでは、LLM ジャッジの内部ランダム性が結果にどの程度影響するかを示すシステムノイズを測定します。