﻿# ogbl-citation2: keep each citation query attached to its negative candidates

Evaluate ogbl-citation2 by preserving query-specific negative references, score grouping and official MRR handling instead of flattening pairs into a global ranking problem.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-ogbl-citation2-query-specific-negative-ranking/
Language: en

## Define the query before scoring edges

The [ogbl-citation2 specification](https://ogb.stanford.edu/docs/linkprop/) evaluates missing-reference ranking using source-specific negative candidates. A score belongs to a particular source paper and candidate reference, not merely to an isolated pair in an arbitrary batch. Preserve the query identity alongside both positive and negative examples. Otherwise a later concatenation step can create apparently valid score arrays that compare the true reference against another paper's candidates.

## Keep candidate rows aligned through batching

When processing a large evaluation set on limited GPU memory, split scoring work without losing the candidate grouping. Store an explicit query index and candidate position, then reconstruct the expected arrangement before invoking the evaluator. Do not assume data-loader completion order preserves the original grouping under shuffling or parallel execution. A tiny diagnostic set with deliberately distinguishable query scores can expose this failure more clearly than checking that the final tensor dimensions are accepted.

## Preserve the rank calculation and tie policy

The [official link evaluator](https://github.com/snap-stanford/ogb/blob/master/ogb/linkproppred/evaluate.py) implements the ranking calculation and handling of equal scores. An independent implementation that sorts tied candidates arbitrarily may produce a different result even with identical model outputs. Compare a small set containing ties before replacing the evaluator. This matters especially when a baseline emits repeated values or numerical precision changes compress different scores into the same represented value.

## Do not replace retrieval evaluation with pair accuracy

Thresholded edge accuracy and query-conditioned reciprocal rank answer different questions. A model can separate many easy non-links without placing the missing reference near the top of its own candidate list. Conversely, a useful relative ordering does not calibrate scores as probabilities that a citation exists. Keep training-negative sampling and benchmark evaluation candidates separately documented. Choosing an easier evaluation candidate population changes the test, even if the model and training data remain identical.

## Maintain a traceable reproduction path

The [official citation example](https://github.com/snap-stanford/ogb/blob/master/examples/linkproppred/citation2/gnn.py) provides a concrete score-collection path to inspect. Preserve the dataset release as well: similarly named older tasks are not automatically interchangeable. The existing [SciDocs task guide](/journal/data-guide-scidocs-citation-retrieval-task/) distinguishes retrieval questions, and the [scholarly-identity guide](/journal/data-guide-openalex-work-author-disambiguation/) helps maintain paper identity. A reproducible citation benchmark requires aligned queries, candidates and evaluator semantics together, not a headline metric name alone.
