リソース · 09

RAG品質:エビデンスに基づいて知識アシスタントを評価する

コーパス、検索、引用、回答、棄却、およびドリフトを個別に測定することで、真に修正が必要な箇所を把握できます。

更新済み · 17 min

無記入文書のトレー6個、えんじ色の資料、真ちゅうのランプがある架空の無人資料室 AIで生成した編集用イラスト

このガイドが達成するのに役立つこと

  • 失敗の原因がコーパス、検索、またはモデルにあるかどうかを特定する
  • すべての引用を追跡する
  • 適切な棄権を報奨する
  • 変更後のドリフトを検出する

クイックチェック

  • 参照元は承認済みで最新のものか?
  • 正しい箇所が上位に表示されているか?
  • すべての決定的な主張は裏付けられているか?
  • アシスタントは「わからない」と答えることができるか?
  • 機密性の高いケースはエスカレーションされているか?

手順

  1. 1

    有用なタスクを定義する

    実際の質問、そのバリエーション、および期待されるビジネス結果を収集する。 曖昧さ、情報源の矛盾、期限切れの文書、および範囲外の要求を追加する。

    成果物:ケースとリスクの分類体系。

  2. 2

    コーパスをクリーンアップする

    すべての情報源に所有者、権限、有効期限、およびステータスを割り当てる。 重複、孤立した断片、および権限が不明な文書を削除する。

    成果物:コーパスレジスタ

  3. 3

    検索の評価

    最終的な文言を評価する前に、必要な箇所が見つかり、ランク付けされているかを測定する。 証拠が存在しないクエリを検査する。

    成果物:網羅性と関連性の指標

  4. 4

    回答と引用の評価

    箇所への忠実性、完全性、制限事項、引用と主張の関係、矛盾を指摘する機能を確認する。

    成果物:忠実性と有用性の評価基準

  5. 5

    拒否と攻撃のテスト

    間接的なデータ注入、禁止されているデータ要求、悪意のあるソース、偽の優先順位文書、および取り消し不可能な操作を追加する。 人的エスカレーションを定義する。

    成果物:セキュリティ結果とガードレール

  6. 6

    変更の監視

    コーパス、インデックス、設定、モデル、および手順のバージョン管理 変更のたびに安定セットを再生し、不要なデータを保持せずに実際のフィードバックを分析します。

    成果物:ドリフトダッシュボードとレビュー手順。

理解し、計算し、判断する

AI回答:品質、回答率、回答の差し控えを区別する

テスト質問数、生成回答数、検証基準を満たす回答数を別々に数えます。このCIEの学習用指標はNISTのスコアではなく、普遍的な合格基準も設けていません。

ここでは回答を期待した質問だけを入力します。検証条件を先に決めます。正しさ、主張を実際に支える引用箇所、許可されたアクセス、十分に新しい出典が必要です。期待される回答差し控え、矛盾、重大な誤りは別に評価します。

指標と確認資料

指標読み取り方必要な確認資料
テスト質問 回答を期待した質問の集合 質問、判定条件、固定したバージョン
生成回答 回答が返された質問 保存した回答と回答差し控え
基準を満たす回答 判定条件を満たす回答 判定と根拠となる箇所

架空の事例

架空の例:100問に対して80回答、うち72回答が基準を満たします。回答中の品質は90%、回答率は80%、全質問での成功率は72%です。90%だけでは未回答20問と基準未達の回答8件が見えません。

架空の例の内訳
  • 72 / 100 · 基準達成
  • 8 / 100 · 基準未達
  • 20 / 100 · 未回答

100 = 72 + 8 + 20。未回答の質問も表示に残します。このサイトの測定結果ではありません。

計算式

品質 = 基準達成 / 生成回答。回答率 = 生成回答 / テスト質問。成功率 = 基準達成 / テスト質問。分母がゼロなら割合は算出できません。

参照文献はメソッドを裏付けるものです。 チェックは状況に合わせて調整してください。 これらは認証ではありません。 元の参照文献のタイトルやソース文書は別の言語で書かれている場合があります。

架空の事例

具体的な状況

内部アシスタントは、一部有効期限切れの手順書に基づいて回答します。 テストセットには、定型的な質問、曖昧な質問、回答不可能な質問が含まれています。 各引用は、文書のバージョンと照合されます。

決定と期待される証拠

有効期限切れの情報源が除外され、サポートされていない回答が拒否され、コーパスの所有者が特定されるまで、リリースは待機します。

管理指標

指標測定対象最初のアクション
検索カバレッジ必要なパッセージが見つかった質問モデル実行前にコーパス、チャンキング、またはクエリを修正する
忠実性引用元によって真に裏付けられた主張裏付けのない回答をブロックまたは書き換える
有用な棄権証拠のないケースを正しく拒否またはエスカレーションする信頼度閾値を調整する
回帰分析同一セット内のバージョン間の品質差原因となる変更を特定する

よくある間違い

  • ライティングの流暢さのみを測定する
  • 検索失敗と誤検出を混同する
  • 簡単すぎる評価セットを使用する
  • 比較せずに複数のコンポーネントを変更する

よくある質問

必要な質問数は?

重要なリスクを網羅する、代表的でバージョン管理されたセットから始める。 多様性と質は、人為的な量よりも重要です。

自動化された指標は1つだけで十分でしょうか?

いいえ。トリアージは迅速化されますが、機密性の高いケース、曖昧なケース、専門分野のケースには、明確な基準と人間のレビューが必要です。

すべての会話を保存すべきでしょうか?

いいえ。目的、アクセス権限、保存期間が明確に定義された、必要な記録のみを保存してください。 改善のためには、匿名化されたケースを優先してください。

RAG:アクセス権、引用、キャッシュ

この言語版の詳しい参照メモは英語で提供しています。

Evaluate an answer alongside its document rights

A relevant citation can support an accurate answer while revealing a forbidden document. RAG evaluation should separate faithfulness, freshness and authorisation of passages actually supplied to the model.

  • Annotate permitted documents for each test identity.
  • Remove a group and replay an existing conversation and citation.
  • Track incorrect answers, missing evidence and out-of-scope exposure separately.

Explore the RAG access matrix and replay cases →

References consulted on · OWASP · LLM08:2025 Vector and Embedding Weaknesses OWASP · API1:2023 Broken Object Level Authorization

AI:JSON出力を検証

この言語版の詳しい参照メモは英語で提供しています。

A retrieved reference does not prove the extracted value

A RAG system can find the right document and return schema-valid JSON that misstates a field. Separate retrieval, the output contract and passage reconciliation to locate what needs correction.

  • Keep an independent reference for decisive fields.
  • Test missing values, contradictions and unavailable documents.
  • Retain unexecuted checks as such instead of counting them as passes.

Compare the 14 outputs and their reasons →

Sources reviewed on · IETF · RFC 8259 · JSON Schema · Object reference · JSON Schema · Draft 2020-12 validation · Python 3.12 · json decoder · python-jsonschema · Schema validation · OWASP · LLM05:2025 Improper Output Handling

RAGの関連性とランキング

この言語版の詳しい参照メモは英語で提供しています。

A RAG system can retrieve useful documents and still produce an incorrect answer. Retrieval evaluation therefore needs its own questions, relevance judgments and defined reading depth. This dossier explains four ranking measures without confusing them with answer faithfulness, access permissions or guaranteed business outcomes.

Documentary references: Stanford CS276’s evaluation material from the 2019 archive and NIST TREC’s reciprocal-rank definition. The CIE workshop uses binary judgments and one query at a time. RR@k here is truncated at k; MRR is a mean RR across multiple queries and is not computed by this workshop.

Stanford CS276 · Retrieval evaluation · 2019 course archive · PDF pp. 3, 5–6 · consulted 2026-10-23

Four measures, four different questions

Four measures, four different questions
MeasureWorkshop calculationUseful readingCondition or limitation
Precision@kRelevant results in the first k / kMeasures the useful proportion in the inspected window.Unavailable if any judgment is missing in the first k.
Recall@kRelevant results in the first k / RR is the number of relevant records in the entire small judged corpus.If R is unknown, publish a value only when it is defined and identical in every possible case.
RR@k1 / rank of the first relevant result within kEquals 0 when no relevant record appears in that fully judged window.An unjudged record before the first relevant result makes that rank uncertain.
nDCG@kDCG@k / IDCG@kCompares ranking gain with the ideal order at the same k.Unavailable if the value changes across possible cases or any case has a zero ideal.

Explicit convention: judgment rᵢ is 0 or 1; DCG@k = Σᵢ₌₁ᵏ rᵢ / log₂(i + 1). With binary relevance, gain 2ʳⁱ − 1 also equals rᵢ. IDCG@k puts min(R, k) relevant records first using the same discount. nDCG@k = DCG@k / IDCG@k when that ideal is defined and nonzero. Keep gain, discount, depth and conventions with any published score.

NIST TREC · Reciprocal rank definition · Repository snapshot 35cf096ba6d5ae08ca4803c056b31ed61a56a6d4 · consulted 2026-10-23

A fictional six-record corpus with declared judgments

Titles and judgments below are created for this exercise. They are neither real search results nor automatic title-based judgments. 1 means relevant, 0 nonrelevant and ? unjudged. Columns Q1–Q5 correspond to the needs displayed in the workshop.

  • Q1 · Prepare a restoration test
  • Q2 · Authorise a document read
  • Q3 · Check a quantum sensor
  • Q4 · Restoration test: C judgment missing
  • Q5 · Restoration: B unjudged, other records off-topic
A fictional six-record corpus with declared judgments
Fictional recordQ1Q2Q3Q4Q5
A · Restoration procedure10011
B · Recovery budget1001?
C · Restoration test log100?0
D · Account and permission guide01000
E · Archiving policy00000
F · Publication schedule00000

文書ランキングの演習

Choose a need and enter an ordered list of A–F identifiers separated by commas. Change k to inspect only the first k results. The list may omit documents, but each identifier must be unique and k cannot exceed its length. Calculation stays local without collection, import, transmission, storage or export.

This reader queries no search engine, private corpus or AI model. It measures neither answer truth, correct citation nor permission security. Scores concern declared judgments in this small fictional universe. Do not present an exercise value as a benchmark of your system or a universal deployment threshold.

Unjudged and nonrelevant are different states

Unjudged and nonrelevant are different states
SituationCIE educational convention
Missing judgment within kPrecision may vary. Reciprocal rank remains known if the first relevant record is identified before any unjudged record.
Missing judgment elsewhereR becomes a range of possibilities. Do not assume recall and nDCG are always unknown: a value may remain constant, for example when the order is ideal in every case.
No relevant record in a fully judged corpusPrecision@k and RR@k are 0. The reader shows Recall@k and nDCG@k as unavailable for this zero-denominator case.
CIE publication ruleExplore every binary assignment of missing judgments, at most 64 for six records. Publish a measure only if it is defined and identical in every assignment. These are possibilities, with no probabilities assigned and no actual imputation.

Ten explained scenarios, available without JavaScript

K01 · Relevant records first
Relevant records first
NeedSupplied orderkExpected reading
Q1A,B,C,D,E,F3Precision@3 = 1, Recall@3 = 1, RR@3 = 1 and nDCG@3 = 1 in this fully judged corpus.
K02 · Relevant records after cutoff
Relevant records after cutoff
NeedSupplied orderkExpected reading
Q1D,E,F,A,B,C3All four measures are 0 at k = 3. Relevant records exist but are placed after the inspected window.
K03 · First relevant record at rank two
First relevant record at rank two
NeedSupplied orderkExpected reading
Q1D,A,E,B,F,C3Precision@3 and Recall@3 are 1/3; RR@3 is 1/2. nDCG considers position and the ideal order.
K04 · Relevant records omitted
Relevant records omitted
NeedSupplied orderkExpected reading
Q1A,D,E,F3R remains 3 in the corpus even though B and C are absent from the list. Recall must not use only returned results as its denominator.
K05 · Duplicate identifier
Duplicate identifier
NeedSupplied orderkExpected reading
Q1A,A,B3Input rejected: A must not be counted twice. Correct the ranking rather than inflating the relevant count.
K06 · Unjudged before the first relevant record
Unjudged before the first relevant record
NeedSupplied orderkExpected reading
Q4C,A,D,E,B,F3C is unjudged. Precision@3, Recall@3, RR@3 and nDCG@3 are unavailable under the declared conventions.
K07 · Unjudged after the window
Unjudged after the window
NeedSupplied orderkExpected reading
Q4A,B,D,E,F,C3Precision@3 is 2/3 and RR@3 is 1. Recall@3 and nDCG@3 remain unavailable because C’s corpus judgment is missing.
K08 · Need with no relevant record
Need with no relevant record
NeedSupplied orderkExpected reading
Q3A,B,C,D,E,F3Precision@3 and RR@3 are 0. Recall and nDCG remain unavailable; this is an explicit convention rather than division by zero.
K09 · Change reading depth
Change reading depth
NeedSupplied orderkExpected reading
Q2A,D,B,C,E,F1At k = 1 no relevant record is visible. At k = 2, D appears: precision 1/2, recall 1 and RR@2 = 1/2.
K10 · Unknown relevance, always ideal ordering
Unknown relevance, always ideal ordering
NeedSupplied orderkExpected reading
Q5A,B,C,D,E,F2B may be relevant or not. Either way, all relevant records are within the first two ranks and the order stays ideal: recall, RR and nDCG are 1. Precision remains unknown.

Prepare a reproducible evaluation

Prepare a reproducible evaluation
Suggested checkRecord to retain
NeedsRepresentative and unanswerable questions; specify the documentary need behind each wording.
CorpusDocument and index versions, accessible scope and deletion or revocation rules.
JudgmentsRelevance rule, assessors, disagreements and unjudged state; do not equate clicks with documentary truth.
ProtocolSame k, filters, data and conventions before and after a retrieval change.
RegressionPer-query and per-need-family results, gaining and losing cases, hypothesis and checks on new documents.
Final answerEvaluate faithfulness, citations, useful refusals and permissions separately; better retrieval scores do not validate this stage.

For a reviewable decision, keep the question, ranking, judgments, k and corpus limitations with the score. One average can conceal a regression on a critical need. Error tracking and answer review remain necessary even when the first records are relevant.

Sources, editions and credits

Original CIE explanations, six documents, five needs, judgments and scenarios. Conceptual references: Stanford CS276 and NIST TREC’s reciprocal-rank definition. No source chart, ranking example or code is reproduced. The CIE program and its unavailable-value conventions are not a complete trec_eval implementation.

Stanford CS276 · Retrieval evaluation · 2019 course archive · PDF pp. 3, 5–6 · consulted 2026-10-23

SHA-256 : be38261a8cdbc95551a502504d0a1c146ea453ffd9712243ea067ac8538c1826

NIST TREC · Reciprocal rank definition · Repository snapshot 35cf096ba6d5ae08ca4803c056b31ed61a56a6d4 · consulted 2026-10-23

SHA-256 : 64159909e6e1e4e9e4dd3c569b119fdc90696d0b03cd902e6a9358dcd6e84677

公式参照文献

参照文献はメソッドを裏付けるものです。 チェックは状況に合わせて調整してください。 これらは認証ではありません。 元の参照文献のタイトルやソース文書は別の言語で書かれている場合があります。

参照資料の確認日 .