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1 |
+
# Evaluation Framework V2 — Survey Reading List Benchmark
|
| 2 |
+
|
| 3 |
+
## Why the Old Eval Was Wrong
|
| 4 |
+
|
| 5 |
+
### The Problem
|
| 6 |
+
|
| 7 |
+
The V1/V2 evaluation tested: **"Can the model rank papers that were cited above papers that weren't?"**
|
| 8 |
+
|
| 9 |
+
Labels: `cited = 2, co-cited = 1, not cited = 0`
|
| 10 |
+
|
| 11 |
+
This produced inflated metrics (nDCG@10 = 0.919, MRR = 1.0) because:
|
| 12 |
+
|
| 13 |
+
1. **Easy negatives**: Random ANN results that happened not to be cited. Many of these are actually good recommendations.
|
| 14 |
+
2. **Binary signal**: All cited papers are equally "good" — no distinction between essential reading and passing mentions.
|
| 15 |
+
3. **Wrong task**: Predicting citations ≠ predicting what a user should read next.
|
| 16 |
+
4. **Model learned popularity**: The top feature (14,986 importance) is `candidate_num_cited_by`. The model is a citation counter.
|
| 17 |
+
|
| 18 |
+
### What This Means
|
| 19 |
+
|
| 20 |
+
The 0.919 nDCG@10 doesn't tell you "the model makes good recommendations." It tells you "highly-cited papers tend to be cited by other papers." That's trivially true and not useful.
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## The New Eval: Survey Reading List Benchmark
|
| 25 |
+
|
| 26 |
+
### The Insight
|
| 27 |
+
|
| 28 |
+
Survey papers are **expert-curated reading lists**. When a survey author includes 200 citations organized into sections, they're telling you:
|
| 29 |
+
- Which papers are essential background (Related Work)
|
| 30 |
+
- Which papers provided tools/methods (Methods)
|
| 31 |
+
- Which papers are just context (Introduction)
|
| 32 |
+
- Which papers they **chose NOT to include** (the hard negatives)
|
| 33 |
+
|
| 34 |
+
This is the closest approximation to "what should a researcher read?" without having real user data.
|
| 35 |
+
|
| 36 |
+
### Data Source
|
| 37 |
+
|
| 38 |
+
[ines-besrour/unarxive_2024](https://huggingface.co/datasets/ines-besrour/unarxive_2024) — 2.28M full-text arXiv papers with:
|
| 39 |
+
- Section-level structure (Introduction, Related Work, Methods, etc.)
|
| 40 |
+
- Citation spans annotated with position and reference ID
|
| 41 |
+
- Bibliography entries with DOIs, arXiv IDs, and raw text
|
| 42 |
+
- Paper metadata (categories, dates, authors)
|
| 43 |
+
|
| 44 |
+
### Label Scheme (5-tier)
|
| 45 |
+
|
| 46 |
+
| Label | Meaning | Source Signal |
|
| 47 |
+
|-------|---------|--------------|
|
| 48 |
+
| **4** | Essential reading | Cited ≥3 times or ≥2× in Related Work section |
|
| 49 |
+
| **3** | Relevant work | Cited in Related Work section |
|
| 50 |
+
| **2** | Tool/method | Cited in Methods or Experiments section |
|
| 51 |
+
| **1** | Background | Cited only in Introduction |
|
| 52 |
+
| **0** | Hard negative | Same arXiv category, cited by OTHER surveys, but NOT this one |
|
| 53 |
+
|
| 54 |
+
### Why Hard Negatives Matter
|
| 55 |
+
|
| 56 |
+
A "hard negative" is a paper that:
|
| 57 |
+
- Is in the same field (same arXiv category)
|
| 58 |
+
- Is good enough that OTHER survey authors in the field cited it
|
| 59 |
+
- Was NOT included by THIS survey's author
|
| 60 |
+
|
| 61 |
+
This represents an **expert exclusion decision**. The author was likely aware of this paper and chose to leave it out. This is a much harder signal than "random paper from Qdrant that happened not to be cited."
|
| 62 |
+
|
| 63 |
+
### Time Split
|
| 64 |
+
|
| 65 |
+
- **Train surveys**: Published before 2023 (for training better models)
|
| 66 |
+
- **Eval surveys**: Published 2023+ (for honest evaluation)
|
| 67 |
+
|
| 68 |
+
This prevents temporal leakage: eval surveys reference newer papers.
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
## Metrics
|
| 73 |
+
|
| 74 |
+
| Metric | What It Tests | Old Eval Equivalent |
|
| 75 |
+
|--------|--------------|---------------------|
|
| 76 |
+
| **nDCG@10** | Overall ranking quality with graded relevance | nDCG@10 (but harder) |
|
| 77 |
+
| **nDCG@20** | Ranking quality at deeper positions | nDCG@20 |
|
| 78 |
+
| **Recall@10 (tier≥3)** | How many important papers are in top-10? | HR@10 (but stricter) |
|
| 79 |
+
| **MRR (tier≥3)** | Where does the first important paper appear? | MRR |
|
| 80 |
+
| **MAP** | Average precision across all positions | — (new) |
|
| 81 |
+
| **Hard Negative AUC** | Can model separate cited from expert-excluded? | — (new, most honest) |
|
| 82 |
+
| **Essential nDCG@10** | Can model find the must-read papers? | — (new, most important) |
|
| 83 |
+
| **Relevant nDCG@10** | Can model find Related Work papers? | — (new) |
|
| 84 |
+
|
| 85 |
+
### Key Metric: Hard Negative AUC
|
| 86 |
+
|
| 87 |
+
This is the single most honest metric. It answers: **"If you give the model a paper that was cited by a survey expert and one that was excluded, can it tell which is which?"**
|
| 88 |
+
|
| 89 |
+
- **0.5** = random (model has no signal)
|
| 90 |
+
- **0.7** = decent (better than popularity)
|
| 91 |
+
- **0.8+** = strong (model understands relevance beyond citations)
|
| 92 |
+
- **1.0** = perfect
|
| 93 |
+
|
| 94 |
+
Your current model's hard_neg_auc will likely be 0.55-0.65 because it's essentially a citation counter.
|
| 95 |
+
|
| 96 |
+
---
|
| 97 |
+
|
| 98 |
+
## Expected Results
|
| 99 |
+
|
| 100 |
+
| Model | nDCG@10 | Hard Neg AUC | Essential nDCG@10 |
|
| 101 |
+
|-------|---------|--------------|-------------------|
|
| 102 |
+
| Random | ~0.30 | 0.50 | ~0.25 |
|
| 103 |
+
| Citation Count (popularity) | ~0.45 | ~0.60 | ~0.40 |
|
| 104 |
+
| LightGBM V2 (current) | ~0.50 | ~0.62 | ~0.45 |
|
| 105 |
+
| LightGBM V3 (reading-path labels) | ~0.65+ | ~0.75+ | ~0.60+ |
|
| 106 |
+
| Cross-encoder | ~0.70+ | ~0.80+ | ~0.65+ |
|
| 107 |
+
| Oracle (perfect) | 1.00 | 1.00 | 1.00 |
|
| 108 |
+
|
| 109 |
+
These are estimates. The actual numbers from running the eval will be the ground truth.
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## Pipeline
|
| 114 |
+
|
| 115 |
+
```
|
| 116 |
+
scripts/04_extract_survey_reading_lists.py
|
| 117 |
+
↓ (processes unarXive 2024, finds CS surveys, extracts section-annotated citations)
|
| 118 |
+
eval_v2/eval_survey_reading_lists.parquet + train_survey_reading_lists.parquet
|
| 119 |
+
↓ (used by evaluation script)
|
| 120 |
+
scripts/05_evaluate_on_surveys.py
|
| 121 |
+
↓ (runs models against eval data, reports metrics)
|
| 122 |
+
eval_v2/eval_results.json
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
## Files
|
| 126 |
+
|
| 127 |
+
| File | Location | Purpose |
|
| 128 |
+
|------|----------|---------|
|
| 129 |
+
| `scripts/04_extract_survey_reading_lists.py` | Model repo | Extract eval data from unarXive |
|
| 130 |
+
| `scripts/05_evaluate_on_surveys.py` | Model repo | Run evaluation |
|
| 131 |
+
| `eval_v2/eval_survey_reading_lists.parquet` | Dataset repo | Eval data (2023+ surveys) |
|
| 132 |
+
| `eval_v2/train_survey_reading_lists.parquet` | Dataset repo | Training data (pre-2023 surveys) |
|
| 133 |
+
| `eval_v2/eval_metadata.json` | Dataset repo | Stats and documentation |
|
| 134 |
+
| `EVAL_V2_DESIGN.md` | Model repo | This document |
|
| 135 |
+
|
| 136 |
+
## Running
|
| 137 |
+
|
| 138 |
+
```bash
|
| 139 |
+
# Step 1: Extract (run as HF job, needs ~50GB disk, 2-3hr CPU)
|
| 140 |
+
python scripts/04_extract_survey_reading_lists.py \
|
| 141 |
+
--max-surveys 1000 --min-citations 20 --push-to-hub
|
| 142 |
+
|
| 143 |
+
# Step 2: Evaluate (quick, <5min)
|
| 144 |
+
python scripts/05_evaluate_on_surveys.py \
|
| 145 |
+
--eval-file eval_v2_data/eval_survey_reading_lists.parquet \
|
| 146 |
+
--baselines-only
|
| 147 |
+
|
| 148 |
+
# Step 3: Evaluate your model (needs Qdrant + Turso)
|
| 149 |
+
python scripts/05_evaluate_on_surveys.py \
|
| 150 |
+
--eval-file eval_v2_data/eval_survey_reading_lists.parquet \
|
| 151 |
+
--model-file production_model/reranker_v2.txt \
|
| 152 |
+
--qdrant-url $QDRANT_URL --qdrant-api-key $QDRANT_API_KEY \
|
| 153 |
+
--turso-url $TURSO_URL --turso-token $TURSO_DB_TOKEN
|
| 154 |
+
```
|