रिसोर्स · 09

RAG क्वालिटी: सबूत के साथ एक नॉलेज असिस्टेंट का मूल्यांकन करें

कॉर्पस, रिट्रीवल, साइटेशन्स, जवाब, एब्सटेंशन और ड्रिफ़्ट को अलग-अलग मापें ताकि आपको पता चले कि असल में क्या ठीक करने की ज़रूरत है।

अपडेटेड · 14 min

काल्पनिक खाली अभिलेख कक्ष: खाली दस्तावेज़ों की छह ट्रे, बरगंडी फ़ोल्डर और पीतल का लैंप 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। अनुत्तरित प्रश्न दिखते रहते हैं; ये इस साइट के मापन नहीं हैं।

गणना का नियम

गुणवत्ता = सत्यापित / दिए गए। कवरेज = दिए गए / परीक्षित। सफलता = सत्यापित / परीक्षित। हर शून्य हो तो अनुपात नहीं निकाला जा सकता।

रेफ़रेंस इस तरीके को सपोर्ट करते हैं। अपने कॉन्टेक्स्ट के हिसाब से चेक को एडजस्ट करें; वे सर्टिफ़िकेशन नहीं हैं। ओरिजिनल रेफ़रेंस टाइटल और सोर्स डॉक्यूमेंट दूसरी भाषा में हो सकते हैं।

काल्पनिक काम का उदाहरण

उदाहरण वाली स्थिति

एक इंटरनल असिस्टेंट प्रोसीजर से जवाब देता है, जिनमें से कुछ एक्सपायर हो चुके हैं। टेस्ट सेट में रूटीन, अस्पष्ट और बिना जवाब वाले सवाल होते हैं; हर साइटेशन को डॉक्यूमेंट वर्शन से चेक किया जाता है।

फैसला और उम्मीद का सबूत

रिलीज़ तब तक इंतज़ार करता है जब तक एक्सपायर हो चुके सोर्स को बाहर नहीं कर दिया जाता, बिना सपोर्ट वाले जवाबों को मना नहीं कर दिया जाता और कॉर्पस ओनर की पहचान नहीं हो जाती।

मैनेजमेंट इंडिकेटर

इंडिकेटरयह क्या मापता हैपहला एक्शन
रिट्रीवल कवरेजऐसे सवाल जिनके लिए ज़रूरी पैसेज मिले हैंमॉडल से पहले कॉर्पस, चंकिंग या क्वेरी को ठीक करें
फेथफुलनेसऐसे दावे जो बताए गए सोर्स से सच में सपोर्टेड होंबिना सपोर्ट वाले जवाबों को ब्लॉक करें या फिर से लिखें
काम का एब्सटेंशनबिना सबूत वाले केस जिन्हें सही तरीके से मना किया गया या आगे बढ़ाया गयाकॉन्फिडेंस थ्रेशहोल्ड को ट्यून करें
रिग्रेशनएक ही सेट के वर्शन के बीच क्वालिटी में अंतरज़िम्मेदार बदलाव की पहचान करें

आम गलतियाँ

  • सिर्फ़ लिखने की फ़्लूएंसी को मापना
  • रिट्रीवल फ़ेलियर और हैलुसिनेशन को मिलाना
  • ऐसे इवैल्यूएशन सेट का इस्तेमाल करना जो बहुत आसान हो
  • बिना तुलना किए कई कंपोनेंट बदलना

अक्सर पूछे जाने वाले सवाल

कितने सवालों की ज़रूरत है?

ज़रूरी रिस्क को कवर करने वाले एक रिप्रेजेंटेटिव, वर्शन वाले सेट से शुरू करें। आर्टिफिशियल वॉल्यूम से ज़्यादा डाइवर्सिटी और क्वालिटी मायने रखती है।

क्या एक ऑटोमेटेड मेट्रिक काफ़ी है?

नहीं। यह ट्राइएज को तेज़ करता है, लेकिन सेंसिटिव, साफ़ न होने वाले और डोमेन केस के लिए साफ़ क्राइटेरिया और इंसानी रिव्यू की ज़रूरत होती है।

क्या हर बातचीत को बनाए रखना चाहिए?

नहीं। सिर्फ़ ज़रूरी ट्रेस रखें जिनका मकसद, एक्सेस और समय तय हो। सुधार के लिए एनॉनिमाइज़्ड केस को प्राथमिकता दें।

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

ऑफ़िशियल रेफ़रेंस

रेफ़रेंस इस तरीके को सपोर्ट करते हैं। अपने कॉन्टेक्स्ट के हिसाब से चेक को एडजस्ट करें; वे सर्टिफ़िकेशन नहीं हैं। ओरिजिनल रेफ़रेंस टाइटल और सोर्स डॉक्यूमेंट दूसरी भाषा में हो सकते हैं।

संदर्भ जाँच की तारीख .