longembed-eval
LongEmbed: Extending Embedding Models for Long Context Retrieval — Zhu et al. (2024) (arXiv:2404.12096, 2024)
What this evaluates
Evaluates embedding models' ability to retrieve relevant information from long contexts (up to 32k tokens) and compares the effectiveness of various context window extension strategies. It also probes the extrapolation capabilities of Absolute Positional Encoding (APE) versus Rotary Positional Encoding (RoPE) in retrieval tasks.
Datasets
Metrics
accuracy (%) (primary) — range: percent
- Percentage of correctly retrieved or answered instances per subset, averaged across all six subsets (Passkey, Needle, NarrativeQA, QMSum, SummScreenFD, 2WikiMultihopQA).
Input / output format
Input: A query paired with a long context document (ranging from 512 to 32,768 tokens) containing the target information or answer.
Output: Dense embedding vectors for the query and the context document, used for cosine similarity-based retrieval.
Scoring recipe
def compute_longembed_score(predictions, golds):
subset_scores = []
for subset in ['Passkey', 'Needle', 'NarrativeQA', 'QMSum', 'SummScreenFD', '2WikiMultihopQA']:
correct = sum(1 for pred, gold in zip(predictions[subset], golds[subset]) if pred == gold)
subset_scores.append(correct / len(golds[subset]) * 100)
return sum(subset_scores) / len(subset_scores)
Common pitfalls
- Models trained on data overlapping with the LongEmbed test set (e.g., M2*) must be excluded to avoid data contamination.
- Plug-and-play extension methods (e.g., PI, GP, PCW) should not be confused with full model fine-tuning; only position embeddings are typically modified or frozen during extension.
- Comparing APE and RoPE models requires controlling for identical training data and procedures, otherwise performance gaps may stem from pretraining differences rather than positional encoding.
Evidence (verbatim from paper)
Table 2 demonstrates the performance of existing embedding models on our LongEmbed benchmark. ... Table 3: Results (%) of context window extension methods on E5-RoPEBase and E5-Mistral. For datasets, P, N, NQA, QMS, SFD, WQA is short for Passkey, Needle, NarrativeQA, QMSum, SummScreenFD, 2WikiMultihopQA.
Citation
@misc{zhu2024longembed,
title={LongEmbed: Extending Embedding Models for Long Context Retrieval},
author={Zhu et al. (2024)},
year={2024},
note={arXiv:2404.12096}
}
1---2name: longembed-eval3description: Evaluates embedding models' ability to retrieve relevant information from long contexts (up to 32k tokens) and compares the effectiveness of various context window extension strategies. It also probes the extrapolation capabilities of Absolute Positional Encoding (APE) versus Rotary Positional Encoding (RoPE) in retrieval tasks. Use when the user wants to benchmark on LongEmbed, or asks about evaluating this task. Reports accuracy (%).4---56# longembed-eval78> LongEmbed: Extending Embedding Models for Long Context Retrieval — Zhu et al. (2024) (arXiv:2404.12096, 2024)910## What this evaluates1112Evaluates embedding models' ability to retrieve relevant information from long contexts (up to 32k tokens) and compares the effectiveness of various context window extension strategies. It also probes the extrapolation capabilities of Absolute Positional Encoding (APE) versus Rotary Positional Encoding (RoPE) in retrieval tasks.1314## Datasets1516- **LongEmbed** — total ?; splits: Passkey (-1), Needle (-1), NarrativeQA (-1), QMSum (-1), SummScreenFD (-1), 2WikiMultihopQA (-1); repo https://github.com/dwzhu-pku/LongEmbed1718## Metrics1920- `accuracy (%)` **(primary)** — range: percent21 - Percentage of correctly retrieved or answered instances per subset, averaged across all six subsets (Passkey, Needle, NarrativeQA, QMSum, SummScreenFD, 2WikiMultihopQA).2223## Input / output format2425**Input**: A query paired with a long context document (ranging from 512 to 32,768 tokens) containing the target information or answer.2627**Output**: Dense embedding vectors for the query and the context document, used for cosine similarity-based retrieval.2829## Scoring recipe3031```python32def compute_longembed_score(predictions, golds):33 subset_scores = []34 for subset in ['Passkey', 'Needle', 'NarrativeQA', 'QMSum', 'SummScreenFD', '2WikiMultihopQA']:35 correct = sum(1 for pred, gold in zip(predictions[subset], golds[subset]) if pred == gold)36 subset_scores.append(correct / len(golds[subset]) * 100)37 return sum(subset_scores) / len(subset_scores)38```3940## Common pitfalls4142- Models trained on data overlapping with the LongEmbed test set (e.g., M2*) must be excluded to avoid data contamination.43- Plug-and-play extension methods (e.g., PI, GP, PCW) should not be confused with full model fine-tuning; only position embeddings are typically modified or frozen during extension.44- Comparing APE and RoPE models requires controlling for identical training data and procedures, otherwise performance gaps may stem from pretraining differences rather than positional encoding.4546## Evidence (verbatim from paper)4748> Table 2 demonstrates the performance of existing embedding models on our LongEmbed benchmark. ... Table 3: Results (%) of context window extension methods on E5-RoPEBase and E5-Mistral. For datasets, P, N, NQA, QMS, SFD, WQA is short for Passkey, Needle, NarrativeQA, QMSum, SummScreenFD, 2WikiMultihopQA.4950## Citation5152```bibtex53@misc{zhu2024longembed,54 title={LongEmbed: Extending Embedding Models for Long Context Retrieval},55 author={Zhu et al. (2024)},56 year={2024},57 note={arXiv:2404.12096}58}59```6061- arXiv: 2404.12096