Metrics Overview¶
This section explains how TempoEval evaluates a temporal RAG system.
System flow overview¶
┌─────────────────────────────────────┐
│ INPUT │
│ Query: "What happened in 2020?" │
│ Documents: [doc1, doc2, doc3, ...] │
└─────────────────┬───────────────────┘
│
┌───────────────────────────────────┼───────────────────────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ STEP 1: Extract │ │ STEP 1: Extract │ │ STEP 1: Extract │
│ QFT │ │ QFT │ │ QFT │
│ │ │ │ │ │
│ ExtractionMethod: │ │ ExtractionMethod: │ │ ExtractionMethod: │
│ REGEX │ │ HEIDELTIME │ │ LLM │
├─────────────────────┤ ├─────────────────────┤ ├─────────────────────┤
│ │ │ │ │ │
│ "What happened in │ │ "What happened in │ │ "What happened in │
│ 2020?" │ │ the pandemic?" │ │ the financial │
│ ↓ │ │ ↓ │ │ crisis?" │
│ Regex: \b20\d{2}\b │ │ HeidelTime tagger │ │ ↓ │
│ ↓ │ │ ↓ │ │ LLM: "Extract years"│
│ QFT = {2020} │ │ QFT = {2020,2021, │ │ ↓ │
│ │ │ 2022} │ │ QFT = {2008,2009} │
│ │ │ │ │ │
│ Speed: ⚡ FAST │ │ Speed: 🔵 MEDIUM │ │ Speed: 🔴 SLOW │
│ Cost: 💚 FREE │ │ Cost: 💚 FREE │ │ Cost: 💰 $$$ │
│ Accuracy: 🔵 MEDIUM │ │ Accuracy: 💚 HIGH │ │ Accuracy: 💚 HIGH │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
│ │ │
└───────────────────────────────────┼───────────────────────────────────┘
│
▼
┌────────────────────────────────┐
│ QFT = {2020} │
│ (Query Focus Time - years) │
└────────────────┬───────────────┘
│
┌───────────────────────────────────┴───────────────────────────────────┐
│ SAME 3 METHODS FOR EACH DOC │
▼ ▼
┌─────────────────────┐ ┌─────────────────────┐
│ STEP 2: Extract │ │ STEP 2: Extract │
│ DFT for doc1 │ │ DFT for docN │
├─────────────────────┤ ├─────────────────────┤
│ │ ... │ │
│ Doc1: "In 2020, │ │ DocN: "The 1990s │
│ COVID spread..." │ │ saw great..." │
│ ↓ │ │ ↓ │
│ REGEX/HEIDELTIME/LLM│ │ REGEX/HEIDELTIME/LLM│
│ ↓ │ │ ↓ │
│ DFT₁ = {2020,2021} │ │ DFTₙ = {1990-1999} │
└─────────────────────┘ └─────────────────────┘
│ │
└───────────────────────────────────┬───────────────────────────────────┘
│
▼
┌───────────────────────────────────────┐
│ DFTs = [DFT₁, DFT₂, ..., DFTₙ]│
│ [{2020,2021}, {2019}, {1990-1999}] │
└───────────────────┬───────────────────┘
│
│
┌───────────────────────────────────┼───────────────────────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ STEP 3: Compute │ │ STEP 3: Compute │ │ STEP 3: Compute │
│ METRIC │ │ METRIC │ │ METRIC │
│ │ │ │ │ │
│ _compute_focus_time│ │ _compute_llm │ │ _compute_gold │
├─────────────────────┤ ├─────────────────────┤ ├─────────────────────┤
│ │ │ │ │ │
│ Input: │ │ Input: │ │ Input: │
│ QFT = {2020} │ │ query = "..." │ │ retrieved_ids │
│ DFTs = [...] │ │ docs = [...] │ │ gold_ids │
│ │ │ │ │ │
│ Logic: │ │ Logic: │ │ Logic: │
│ QFT ∩ DFT > 0? │ │ LLM judges each │ │ retrieved ∩ gold │
│ │ │ doc relevance │ │ │
│ Example: │ │ Example: │ │ Example: │
│ {2020}∩{2020,2021}│ │ "Is doc1 about │ │ {doc1,doc2} ∩ │
│ = {2020} ✓ │ │ 2020?" → Yes │ │ {doc1,doc3} │
│ │ │ │ │ = {doc1} │
│ Output: 0.67 │ │ Output: 0.80 │ │ Output: 0.50 │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
Temporal query type classification¶
| Intent | Example query | Primary metric |
|---|---|---|
| specific_time | "When did X happen?" | Temporal Precision |
| duration | "How long did X last?" | Duration Accuracy |
| recency | "What are the recent advances in X?" | Temporal Diversity |
| change_over_time | "How has X changed since Y?" | Temporal Coverage |
| order | "What happened first?" | Event Ordering |
Implemented temporal_intent values:
- when, specific_time
- duration
- recency, ongoing_status
- change_over_time, trends_changes_and_cross_period
- order, before_after, timeline
- period_definition
- none