LLM evaluation methodology: benchmarks, contamination aur eval process
LLM evaluate karna matlab limited questions par task class ka performance estimate karna. Yeh page MMLU, HumanEval, GSM8K, MT-Bench kya naapte hain, contamination kaise pakde, aur chaar-layer eval process batata hai।
यह पृष्ठ पूरा करने पर आप
- Saaf karein evaluation kya poochta hai: limited questions se poori task class ka performance estimate।
- Bataayein MMLU, HumanEval, GSM8K, MT-Bench har ek kya naapta hai, kis tareeke se verify hota hai।
- Samjhayein data contamination scores kaise phula deti hai; n-gram overlap se detect karein; is detection ke blind spots jaanein।
- Capability, behaviour, safety, experience - chaar layers ka eval panel design karein, aur ek chalne wala eval process poora chalayein।
इस पृष्ठ पर
- Evaluation kya poochta hai
- Chaar classic benchmarks kya naapte hain
- MMLU: knowledge coverage
- HumanEval: executable verification
- GSM8K: multi-step math reasoning
- MT-Bench: multi-turn chat aur judges
- Data contamination
- Detection: n-gram overlap
- N-gram ke blind spots
- Mature eval system: four-layer panel
- Ek chalne wala eval process
- Offline eval se launch decision tak
- Versions ke saath ek failed request ka post-mortem
- Summary aur exercises
- Exercises
- Aage padhein
- अक्सर पूछे जाने वाले सवाल
Evaluation kya poochta hai
LLM evaluate karna essence mein limited questions par model ki poori task class ke performance ka estimate hai. Isliye koi bhi eval score - chaar sawaal: kaun si capability naapi ja rahi hai, scoring kaise hoti hai, error kitna, questions model ne pehle dekhe hain? Yeh page teen batata hai; “error kitna” eval statistics ke liye।
Aaj ke models ek saath knowledge QA, math reasoning, code generation, multi-turn chat, tool calling aur safety refusals sab karte hain - isliye “zyada powerful” ek number nahi, ek doosre se related par poori tarah aligned na hone wali capabilities ka set hai. Achhi evaluation ke bina aap alag nahi kar paate ki model waqai behtar hua, prompt badla, benchmark ratt liya gaya, ya external component kaam kar raha hai।
Chaar classic benchmarks kya naapte hain
| Benchmark | Kya naapta hai | Scale | Scoring | Dhyan |
|---|---|---|---|---|
| MMLU | 57 subjects ke multiple-choice knowledge questions | Total 15,908, test 14,079 | Option accuracy; random lagbhag 25% | Exam-question format; questions lambe samay se public - contamination risk high |
| HumanEval | Function signature + docstring se function complete | 164 hand-written | Unit tests run; pass@k report | Kam questions, bada error; mostly chhote functions |
| GSM8K | Grade-school word problems ka multi-step reasoning | Official repo: 7,473 train, 1,319 test | Final numeric answer sahi? | Sirf final answer; reasoning process nahi |
| MT-Bench | Multi-turn chat aur instruction-following | 80 questions, 8 categories x 10, har ek 2 turns | Judge model 1-10, ya pairwise | Kam questions; judge ke biases |
Numbers original papers se: MMLU, HumanEval, MT-Bench; GSM8K paper sirf lagbhag 7.5K train aur 1K test likhta hai - table official repo ke data files ki actual line counts hai।
MMLU: knowledge coverage
MMLU 57 subjects ke multiple-choice questions (Hendrycks adi, 2020). Paper ke anchors: random lagbhag 25%; untrained crowdworkers 34.5%; GPT-3 175B few-shot 43.9%; paper ka estimated per-subject expert level lagbhag 89.8%. Cross-comparisons ke liye achha; “chat achhi hai ya nahi” ka jawab nahi deta; multiple-choice format capability expression seemit karta hai. Questions lambe public - contamination ka sabse pehla shikaar।
HumanEval: executable verification
Code questions ka fayda: tests se sahi/galat - “sahi dikhne wala” answer kaam nahi karta. HumanEval isi se code evaluation ka starting point bana, aur pass@k jaise generation-model metrics ko popular kiya. Par sirf 164 chhote function questions - asli software engineering nahi; itne kam questions ka error kitna aur pass@k kaise estimate - eval statistics mein।
GSM8K: multi-step math reasoning
GSM8K 8.5K grade-school word problems; har ek 2-8 steps; answer ek number (Cobbe adi, 2021). Reasoning eval mein widely used - jaise chain-of-thought prompting ka effect. Sirf final answer check hota hai - galat steps se sahi-tak-pahuncha answer bhi pass; zaroorat par reasoning-process check bhi jodein।
MT-Bench: multi-turn chat aur judges
Knowledge/code ke alawa user ko sabse seedha chat experience dikhta hai. MT-Bench 80 multi-turn questions - writing, role-play, extraction, reasoning, math, coding, STEM aur humanities knowledge - judge model se scored. Sasta, par judge khud biased - detail LLM-as-a-Judge mein।
Data contamination
Eval contamination matlab benchmark ke questions ya answers training data mein aa gaye; score ab generalization nahi reflect karta. Pretraining corpus internet se aata hai, aur MMLU/GSM8K jaise benchmarks ke questions internet par hi public hain - risk poori tarah khatam nahi hota।
Detection: n-gram overlap
GPT-3 paper ne classic tareeka diya (Brown adi, 2020, Section 4 aur Appendix C). Har benchmark ke liye question se lagatar words lo - = us benchmark ke sample lengths ka 5th percentile; punctuation/case ignore; min 8, max 13; question aur training corpus ke kisi bhi document mein ek bhi -gram overlap ho to “dirty”, warna “clean”. Phir sirf clean subset par re-eval: score full-set ke kareeb - contamination shayad scores nahi badha; clean subset clearly kam - contamination scores badha sakti hai।
Paper ka conclusion: zyada-tar benchmarks par change negligible; kuch exceptions: PIQA ke 29% samples flagged - clean subset par 3 points down; Winograd 45% flagged - clean par 2.6% down, aur confirm ki 132 questions waqai training set mein the, sirf format eval se alag. Paper ne dono results par star lagaya।
import re
def ngrams(text: str, n: int) -> set[tuple[str, ...]]:
words = re.findall(r"[a-z0-9]+", text.lower()) # punctuation aur case ignore
return {tuple(words[i:i + n]) for i in range(len(words) - n + 1)}
question = "Janet has 3 apples, buys 5 more, and then gives 2 to her friend. How many apples does Janet have left?"
rephrased = "After buying five more apples to add to her original three, Janet hands two over to a friend. What is the number of apples she still holds?"
unrelated = "A train leaves the station at 9 am and travels at 80 km per hour. How far has it gone by noon?"
# hypothetical pretraining corpus: ek webpage ne benchmark question verbatim quote kiya।
corpus = "Practice problems for grade school students. Problem 7: " + question + " Answer: 6. Problem 8: ..."
corpus_ngrams = ngrams(corpus, 13)
for name, text in [("verbatim", question), ("rephrased", rephrased), ("unrelated", unrelated)]:
hits = len(ngrams(text, 13) & corpus_ngrams)
print(f"{name} 13-gram hits {hits:2d} -> {'dirty' if hits else 'clean'}")
# output:
# verbatim 13-gram hits 9 -> dirty
# rephrased 13-gram hits 0 -> clean
# unrelated 13-gram hits 0 -> clean
Note: numbers original run se hain; print labels Latin transliteration mein likhe gaye hain।
N-gram ke blind spots
Demo mein verbatim question 9 13-gram hits karta hai; matlab-wise bilkul same rephrased question zero - clean maan liya jaayega. Yang adi (2023) ne dekha: MMLU test questions rephrase karke train karne par Llama-2-13B MMLU par 85.9 accuracy tak pahuncha - n-gram detection ne pakda hi nahi; unhone strong-model-based semantic dedup decontamination propose kiya. Detection ke blind spots hain to ek hi tareeke par bharosa nahi:
| Tareeka | Idea | Limit |
|---|---|---|
| N-gram overlap | Training se pehle benchmark-overlapping docs hatao; eval ke baad clean subset vs full set | Sirf verbatim; rephrase/translation miss |
| Semantic dedup | Vector similarity ya strong model se same-meaning samples | False positives zyada; mehnga |
| Private question set | Questions public nahi; eval holder ke paas | Reproduce mushkil; question type pehle dekha ho sakta hai |
| Live-refreshing questions | Lagatar naye questions - hafte ki programming contests, user ke naye sawaal (Chiang adi, 2024) | Set badalta hai - cross-time scores seedha comparable nahi |
| Score patterns | Clean subset clearly kam; question-format ke chhote changes par bahut sensitive | Sirf indirect evidence |
Training side: eval set ko “remove-hone-wali duplicate documents” ki tarah treat karna - exact, MinHash-near aur paragraph-level dedup kya pakadte hain kya nahi, demo corpus par naapkar - pretraining data engineering mein।
Eval side ka sawaal: questions training mein kitni baar aaye to ratta lag jaata hai, rephrase ke baad n-gram nahi dikhta, loss-difference aur Min-K% jaise model signals kitna dekhte hain, flagged questions hatane ke baad score mein kitna paani bachta hai. Benchmark contamination page ek real fine-tuning experiment se sab naapta hai।
नीचे का component यह detector browser में चलाता है: page के काल्पनिक corpus और तीन texts पर N-gram matches को live calculate करता है। Corpus और candidate बदलें, N बदलें या normalisation बंद करें; match होने वाले हिस्से highlight होते हैं।
Mature eval system: four-layer panel
Evaluation R&D ke baad wali side-activity nahi hai: jo aap naapte ho, team wahi optimize karti hai; eval patla ho to “questions solve karta hai par usable nahi” ya “bahut charming par inaccurate” model milega. Isliye mature eval chaar layers cover karti hai:
| Layer | Kya naapta hai | Typical content |
|---|---|---|
| Capability | Model kar sakta hai? | Knowledge QA, math-logic reasoning, code, long-context use |
| Behaviour | Model reliable kaam karta hai? | Instruction-following, structured output stability, multi-turn consistency, tool-call success |
| Safety | Model bigad sakta hai? | Harmful-request handling, sensitive refusals, overreach output, hallucination overconfidence |
| Experience aur system | User aur business ko kaisa lagta hai | Helpfulness, clarity, response length/rhythm, cost, latency, full-workflow effect |
Koi ek benchmark chaar layers represent nahi karta; mature team combined eval panel banati hai - ek total score ke devotee nahi rehti. Eval object bhi bare model se full system par shift ho raha hai: prompt, retrieval, tools aur safety policy sab result badalte hain - eval mein inhe saath fix karo।
Chaar sabse aam galtiyan:
| Galti | Kyun galat | Fix |
|---|---|---|
| Benchmark score = user experience | Offline questions aur live inputs ke distributions alag | Real inputs se eval set; launch ke baad live metrics |
| Prompt improvement = model improvement | Prompt, system message ya retrieval badla - score badal jaata hai | Baaki variables fix; ek baar mein ek change; gap ka confidence interval report |
| Contamination ignore | Questions training mein - score inflated | Clean-subset control; private ya fresher question sets |
| Sirf average | Average high-risk class ke persistent failures chhupa deta hai | Category-wise slices; failure cases padho; error analysis |
Ek chalne wala eval process
- Task define karo, aur likho kaun si error sabse mehngi hai।
- Eval set banao: real input distribution se; tail aur edge cases cover; ek private holdout rakho; versions record karo. Question sources, label errors aur question information-quantity building eval sets mein।
- Scoring method chuno: auto-verifiable par tests/rules; open questions par judge model ya human - pehle chhote sample par human calibration।
- Eval chalao; question count, standard error ya confidence interval report karo; do models compare karte waqt paired differences (eval statistics)।
- Prompt, decoding params aur system components fix karke baseline se same-questions comparison aur ablation।
- Failure cases padho; category slices; typical errors regression set mein।
- Launch ke baad live metrics monitor; live failures eval set mein wapas; periodic contamination checks।
Offline eval se launch decision tak
Stanford CS324 evaluation project broad capability questions ko checkable comparisons mein badalne ka practice hai. CMU Machine Learning in Production chapter 19 question ko real traffic tak le jaata hai. Support retrieval model replace karne ki misaal: pehle “answer successful” define karo, phir traffic kab badhana hai decide karo।
| Stage | Fixed comparison standard | Kya check |
|---|---|---|
| Offline replay | Same historical questions, same-time docs, same scoring rules se do versions compare | Language, question-frequency aur no-answer samples se accuracy, refusals, evidence coverage report |
| Shadow traffic | Dono versions requests paate hain; user ko purana response; side-effect tools isolated env mein | Production requests par timeouts, format errors, cost record |
| Canary release | Naya version kuch users par; pehle se agreed observation window, scale-up criteria, rollback conditions | Version aur traffic slices par failures/timeouts; trigger hone par old version restore |
| A/B experiment | Product effect estimate karna ho to proper unit par randomize - user ya session | Resolution rate, human handoff jaise product outcomes; quality-latency constraints bhi track |
Report mein model, prompt, retrieval index aur data snapshot ke versions rakho. Shadow traffic naye version ko real requests par test karta hai. User task poora karne mein aasaan hua ya nahi - woh user ko waqai dikhne wale responses se hi naapna hai।
Versions ke saath ek failed request ka post-mortem
CMU chapter 24 versions, lineage aur reproduction discuss karta hai. Model name inference chain ka sirf ek link pin karta hai. Ek RAG request ke liye trace ID se us waqt ki deployment manifest aur stage results jodo. Deployment manifest kam se kam model, tokenizer, prompt, retrieval index aur app version identify kare. Eval report mein data snapshot, scoring rules, sampling config aur run environment bhi jodein।
Misal: naya version launch hua, citation accuracy giri. Pehle same samples par online version replay karo; phir usi version se sirf index purana karke dekho - retrieved evidence aur final citations ka badlav record. Evidence wapas aa gaya par citations abhi bhi galat - ab prompt ya model alag se compare. Manifest se deployable purane combinations bhi locate ho sake - compatible prompt/model/index restore ke liye. Server-side nondeterminism ho sakta hai - review mein ek explainable single trace aur sample-group ke stable changes dono dekho।
Summary aur exercises
- Ek eval score par chaar sawaal: kya naapa, kaise score hua, error kitna, questions model ne dekhe hain?।
- Chaar classic benchmarks alag capabilities: MMLU knowledge, HumanEval code, GSM8K math reasoning, MT-Bench multi-turn chat - koi ek overall capability nahi hai।
- Contamination kai tareekon se detect; n-gram rephrase pakad nahi pata; clean-subset comparison sabse direct evidence।
- Mature eval capability/behaviour/safety/experience chaar layers ka combined panel; eval object full system, bare model nahi।
1. Team ne system prompt rewrite kiya; MMLU score 2 points chadha. Kaun sa conclusion sabse reasonable?
- Model capability 2 points badhi
- Model ko seedha attribute nahi kar sakte: baaki variables fix karke control chahiye, aur gap ka confidence interval, tabhi faisla
- MMLU ab trust-worth nahi - benchmark badlo
- Model retrain karna hoga
Prompt, system message aur retrieval sab score badalte hain. MMLU test mein 14,079 questions; 2-point gap statistically usually khada rehta hai - par khada rehta hai sirf “score badla”, “model strong hua” nahi।
2. Data contamination detection par kaun se kathan sahi? (multiple)
- 13-gram overlap sirf verbatim leakage dhoondhta hai; rephrased questions bach jaate hain
- Clean subset ka score full set se clearly kam - contamination scores badha sakti hai
- N-gram detection hit nahi hua - matlab model ne question ka content nahi dekha
- Eval set private hai - model ne same-type questions zaroor nahi dekhe
No-hit matlab sirf no-verbatim-overlap; rephrase, translation ya same-type questions exclude nahi. Private set leakage risk kam karta hai, question-type pehle-dekha guarantee nahi।
3. “Tool-call success rate” aur “structured output stability” chaar-layer panel ki kaun si layer mein hain?
- Capability
- Behaviour
- Safety
- Experience aur system
Yeh naapte hain model reliable kaam karta hai - behaviour layer; capability layer “kar sakta hai” - knowledge, reasoning, code।
4. GPT-3 paper ne n-gram overlap se “dirty” samples mark karne ke baad contamination ka asar kaise judge karte the?
- Dirty samples seedha training set mein
- Clean subset par re-eval karke full set se compare
- Sab benchmarks ke scores se 5 points minus
- Sirf dirty samples ke scores report
Clean subset full-set ke kareeb - contamination shayad scores nahi badha; clean clearly kam - contamination scores badha sakti hai।
Exercises
- Enterprise support RAG assistant ke liye eval panel design karein: chaar layers mein har ek do metrics, aur har metric ka scoring method likhein।
- Ek check design karein: kaise decide karein kisi benchmark ke score ko contamination ne badhaya hai? Kam se kam teen steps likhein।
- Kisi paper ki eval table padhte waqt “A > B” bharosay-layak hai ya nahi - kaun si info chahiye? Kam se kam chaar items list karein।
Reference answers
- Ek jawab hai; misaal: Capability layer: retrieval hit rate (human-labeled relevant docs ke against), answer accuracy (standard answers ya human scoring); Behaviour layer: citation-format compliance (rule check), KB mein answer na hone par “pata nahi” maanna (human spot-check); Safety layer: overreach questions par refusal rate, prompt-injection resistance (red-team cases); Experience/system layer: first-token latency aur per-request cost (log stats), user satisfaction ya handoff rate (live metrics). Har metric ka data source (real ticket sampling), scoring method aur target threshold likha ho।
- Ek tareeka: pehle -gram overlap (jaise 13-gram) se training corpus ya public web par har question search; hits ko “dirty” mark; phir full set aur clean subset ke scores, gap + confidence interval ke saath; phir questions rephrase/translate karke dekho model ka score clearly kam hota hai ya nahi; aakhir private ya naye questions se ranking consistency confirm karein।
- Question count; confidence interval ya standard error report hua?; dono models same questions, same prompt/decoding params par?; pass@k ke , , sampling temperature; contamination check kiya?; judge model use hua to kaun, human calibration hui?; gap noise se bada? paired analysis hua?।
Aage padhein
-
Measuring Massive Multitask Language Understanding (Hendrycks adi, 2020): MMLU।
-
Evaluating Large Language Models Trained on Code (Chen adi, 2021): HumanEval aur pass@k।
-
Training Verifiers to Solve Math Word Problems (Cobbe adi, 2021): GSM8K।
-
Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (Zheng adi, 2023): MT-Bench aur judge models।
-
Language Models are Few-Shot Learners (Brown adi, 2020): Section 4 aur Appendix C ka contamination analysis।
-
Rethinking Benchmark and Contamination for Language Models with Rephrased Samples (Yang adi, 2023): rephrased samples n-gram detection bypass karte hain।
-
Chatbot Arena: An Open Platform for Evaluating LLMs by Human Preference (Chiang adi, 2024): live, crowd-sourced human-preference eval।
-
Eval statistics: pass@k, confidence intervals, needed sample size: score errors, paired comparisons, sample size।
-
Building eval sets: question sources, label quality, question information: label errors scores kaise dabate hain, kappa ke traps aur question discrimination।
-
Eval ko training/alignment flow mein samajhna: pretraining training pipeline।
-
Long-context eval ke specific traps: Lost in the Middle।
-
Alag protocols se scores incomparable ho jaane ke examples: Mixtral of Experts (do tables ke eval-process differences, majority-voting scores) aur DeepSeekMath (majority voting vs single-pass seedha comparable nahi)।
-
White adi, LiveBench (2024) aur Jain adi, LiveCodeBench (2024): periodically-refreshed “live” benchmarks - contamination aur leaderboard-targeting kam।
-
Kapoor adi, AI Agents That Matter (2024): cost aur success rate ko eval ke first-class metrics banana; detail agent evaluation mein।
अक्सर पूछे जाने वाले सवाल
- Sirf benchmark score kaafi nahi kyun?
- Score limited questions par estimate hai: sampling error lagta hai (164-question benchmark par 80% accuracy ka lagbhag ±6 point ka 95% interval), training-data contamination ho sakta hai, prompt ya retrieval module ke changes se chadh sakta hai, aur average score high-risk class ke persistent failures ko chhupa deta hai. Benchmarks + human spot-checks + conversation evals + live metrics milakar dekho, aur error report karo।
- MMLU, HumanEval, GSM8K aur MT-Bench har ek kya naapta hai?
- MMLU: 57 subjects ke multiple-choice knowledge questions; HumanEval: function signature + docstring se code likhna, unit tests se judge, pass@k report; GSM8K: grade-school word problems ka multi-step math reasoning, sirf final numeric answer; MT-Bench: 80 multi-turn chat questions, judge model scores ya pairwise compares - real chat ke zyada kareeb, par zyada subjective. Chaaron alag capabilities naapte hain - ek doosre ka replacement nahi।
- Evaluation contamination kya hai, kaise detect karein?
- Benchmark ke questions ya answers training data mein ghus jaana - score ab generalization nahi reflect karta. Aam detection n-gram overlap: GPT-3 ne 8-13 words ke n-grams se training-set-overlapping questions dhunde, phir clean subset vs full set scores compare kiye. Rephrased/translated questions isse bach jaate hain - isliye private question sets, fresh questions aur human checks bhi chahiye।
- Eval set mein kitne questions kaafi?
- Detect karne chahiye wale minimum gap se; needed questions gap ke square ke inverse. Accuracy lagbhag 80%, do models same questions par correlated (r=0.5): 2-point gap ke liye lagbhag 3,300 questions; 1 point ke liye lagbhag 12,800 (alpha 5%, power 80%). Hundreds-of-questions set sirf bade gaps dikhata hai।
- Eval process kaise banayein?
- Pehle task aur sabse mehngi error type define; real inputs se eval set + ek private holdout; scoring method chuno - auto-verifiable par tests, open questions par judge model ya human (pehle calibrate); question count aur confidence intervals report; prompt aur decoding params fix karke baseline compare; failure cases padhkar regression set; launch ke baad live metrics aur periodic contamination checks।