Asyncval: A Toolkit for Asynchronously Validating Dense Retriever Checkpoints during Training

Shengyao Zhuang, Guido ZucconarXiv 2022 · DOI

TL;DR

Validating dense retriever (DR) checkpoints during training is notoriously slow because it requires re-encoding millions of documents into vectors for every single evaluation step. Asyncval solves this bottleneck by decoupling the validation loop from training onto a separate GPU and utilizing smart corpus subset sampling, slashing checkpoint validation time from two hours down to just 10 minutes without losing evaluation fidelity.

What Problem Does This Paper Address?

In standard deep learning tasks like text classification, checkpoint validation is straightforward: you pause training, run quick inference on a small held-out validation set, log the metric, and resume.

For Dense Retrievers (DRs), however, validation is an efficiency nightmare. To evaluate how well a DR checkpoint performs full retrieval, the entire text corpus must first be encoded into dense vectors using the newly updated model weights. For standard benchmarks like MS MARCO (8.8 million passages) or Natural Questions (21 million passages), this encoding step can take upwards of two hours on a powerful GPU like an Nvidia V100. Doing this sequentially inside a standard training loop makes frequent validation completely impractical, forcing researchers to rely on unreliable proxies like training loss or simply using the final epoch's checkpoint.

Methods

Asyncval introduces a Python-based toolkit designed to make DR validation fast, automated, and non-blocking via two core strategies:

  1. Asynchronous Execution (Multi-GPU Pipeline): Asyncval uncouples the validation process from the main training routine. Training runs continuously on one GPU, while a second GPU listens to the checkpoint directory. Whenever a new checkpoint is saved, Asyncval automatically loads it, performs validation, and logs the results in parallel without pausing the trainer.
  2. Corpus Subset Sampling: To avoid encoding millions of passages every time, Asyncval includes a corpus splitting feature. It filters the full corpus down to a high-quality subset based on a baseline retrieval run (e.g., BM25 or a pre-trained DR) combined with the ground-truth validation labels (qrels). By keeping only the top-$k$ passages relevant to the validation queries, the number of documents needing vector encoding is drastically reduced.

Additionally, the toolkit enforces pre-tokenization of the corpus and query sets, removing redundant text-processing overhead across different checkpoint evaluations.

Figure 1: Standard validation VS Asyncval validation for validating dense retriever model checkpoints during training.

Datasets

The authors demonstrated the toolkit using:

  • MS MARCO v1 (Passage Ranking Dataset): A large-scale dataset containing roughly 8.8 million passages, used to train a BERT-based dense retriever and evaluate validation speeds.
  • Natural Questions (NQ): Mentioned as a target large-scale use case containing 21 million passages.

Key Insights and Ideas

  • Zero-Overhead Validation: If the time it takes to validate a checkpoint is shorter than the training interval between checkpoints, the validation overhead effectively drops to zero. Training time is no longer Total Training Time + Total Validation Time, but simply Total Training Time + Final Checkpoint Validation Time.
  • Baseline Quality Dictates Fidelity: The choice of the baseline model used for corpus sampling matters. Sampling a subset using a strong dense retriever baseline (like TCT-ColBERTv2) yields validation curves that almost perfectly overlap with full-corpus evaluation trends. BM25 sampling still accurately captures the relative performance improvements over time, though it tends to slightly overestimate absolute MRR@10 metrics.

Key Results

  • 12x Validation Speedup: Validating a checkpoint on the full MS MARCO corpus took over 2 hours. Using Asyncval's subset sampling with a top-100 cutoff reduced this validation time to just 10 minutes.
  • High Fidelity Tracking: As shown in the tracking dashboard below, the validation trends on sampled subsets closely mirror the full corpus evaluation (purple line), allowing researchers to reliably identify peak model performance and apply early stopping.
Figure 2: Wandb dashboard with Asyncval. Left: MRR@10 for each checkpoint. Right: the time required to validate each checkpoint.

Limitations and Future Work

  • Hardware Requirements: The primary asynchronous mode requires an extra GPU dedicated solely to validation. While Asyncval can still be run sequentially on a single GPU after training is complete (leveraging the corpus splitting feature to save time), it loses the real-time training-parallelization benefits.
  • Hyperparameter Tuning: Users must carefully choose their subset sampling baseline and cutoff depth ($k$) to balance the trade-off between absolute metric accuracy (fidelity) and validation speed.

Summary updated

BibTeX
@misc{zhuang2022asyncval,
  author = {Shengyao Zhuang and Guido Zuccon},
  title = {{Asyncval: A Toolkit for Asynchronously Validating Dense Retriever Checkpoints during Training}},
  year = {2022},
  eprint = {2202.12510},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.12510},
}
Figure