Many prediction problems ask a model to attach zero, one, or several labels to each candidate item, while almost every candidate should get zero labels. Document-level relation extraction is the clearest case. The model reads a whole Wikipedia article, and for every pair of entities it must say which relations, if any, hold between them ("born in", "member of", and so on). Between 94% and 97% of entity pairs have no relation at all. The standard approach trains one learned cutoff score per pair, and a relation is predicted when its score beats that cutoff. That cutoff is asked to do two jobs at once. It must reject the huge mass of unrelated pairs, and it must also separate correct from incorrect relations on the rare related pairs. Because unrelated pairs dominate training, the cutoff drifts upward, and the model then misses relations it has actually ranked first.
We propose to split the decision into two parts. A cardinality head predicts how many relations a pair has (0, 1, 2, or more). It reads long-range document evidence and is trained with an imbalance-aware objective. A relation ranker is trained only on pairs that have at least one relation, so its gradients are never dominated by the negative pairs. At test time the model keeps the top-$k$ relations from the ranker, where $k$ is the predicted count. The claim is specific: the remaining errors in current systems come from coupling these two jobs, not from the lack of a better single threshold. We say how a simple post-hoc threshold correction would refute the claim, and we test it directly.
Core Claim
The field has named two distinct failure modes. Adaptive Hinge Balance Loss for Document-Level Relation Extraction shows that with the threshold class of ATLOP, 78.22% of wrong "no relation" errors on Re-DocRED are cases where the correct label was ranked first but fell below an inflated threshold. They call this "threshold drag", and the error type FN_CRK (false negative, correct ranking). Their hinge weighting cuts this share to 43.84%. It leaves FN_IRK untouched: false negatives where even the ranking is wrong.
Our hypothesis is that both errors share one cause. The same relation logits are pushed down on thousands of negative pairs, so they are poorly shaped on the rare positive pairs. That pressure inflates the threshold, which produces FN_CRK. It also distorts the relative ordering of relations, which produces FN_IRK. If this is right, removing negative pairs from the ranker's training should reduce FN_IRK, something neither loss reweighting nor threshold tuning can do. Moving the "is anything here?" question into a dedicated count head should in turn remove threshold drag. Because the count head sees long-range statistics about how the document connects the two entities, the effective cutoff should differ from pair to pair, not just from class to class.
Research Program
The backbone is ATLOP's encoder with localized context pooling. That module uses the Transformer's attention to pool the tokens both entities attend to, so it already captures cross-sentence context. On top of it we build two heads that share the pair representation $h_{so}$ for subject $s$ and object $o$.
The ranker outputs relation logits $f_r(h_{so})$. It is trained with a multi-label softmax ranking loss over the gold relations, and only on pairs whose gold set is non-empty.
The cardinality head outputs a distribution $q(k \mid x)$ over $k \in \{0,1,2,3^{+}\}$. Its input is $h_{so}$ concatenated with global-context features: the total mutual attention mass between the two entities' mentions, the number of sentences that contain both, the mention counts, and the sentence distance. The hypothesis is that these features capture why a distant pair is unrelated in a way the local pair embedding does not.
Since $k=0$ covers about 95% of pairs, the count head is trained with a logit-adjusted cross-entropy:
$$\mathcal{L}_{\text{card}} = -\log \frac{\exp(g_{k^*}(x) + \log \pi_{k^*})}{\sum_{k} \exp(g_k(x) + \log \pi_k)}$$
Here $g_k(x)$ is the head's score for count $k$, $k^*$ is the gold count, and $\pi_k$ is the training frequency of count $k$. Adding $\log \pi_k$ during training and dropping it at inference counters the majority count. The decision rule is then
$$\hat{Y}(x) = \operatorname{top}_{\hat{k}(x)}\{f_r(x)\}, \qquad \hat{k}(x) = \arg\max_k q(k \mid x) - c_k,$$
where $c_k$ is a per-count cost tuned on the development set, the multi-label analogue of the set-size penalty in Cardinality-Aware Set Prediction and Top-$k$ Classification. The two heads are trained jointly with a shared encoder, so this is not a hard cascade.
The count head's training also depends on relation frequency. Tail relations appear in positive pairs that are themselves rare. We therefore weight positive-pair count errors by the inverse frequency of the pair's rarest gold relation. This is how the dataset's long tail enters the model without the fixed head/mid/tail bins of AMTL.
Prior work plays three roles here. The motivation comes from HingeABL's error decomposition and from AMTL (An Adaptive Multi-Threshold Loss…), which shows that a single threshold hurts tail relations. The method borrows from set prediction with an explicit count predictor, as in DeepSetNet, and from Cortes et al.'s cardinality selector. Both were studied on multi-class or image tasks where "zero labels" is neither possible nor dominant. Our setting makes $k=0$ the overwhelming case, which is exactly where their framing has not been tested.
There are also constraints. The DC-Prophet pipeline in DC-Prophet filters normal cases first and then classifies the rest. The dossier notes that such cascades permanently lose rare events the first stage misses, which is why we train jointly and allow soft $k$. Revisiting DocRED found that over 60% of triples were missing from the original DocRED labels. A count head trained on DocRED would learn to under-count, so Re-DocRED is our primary benchmark.
We differ from None Class Ranking Loss and from ATLOP in the same way. Both learn an instance-dependent "none" anchor, but that anchor still sits in the same logit space and is trained against every negative pair. We take negatives out of the ranker entirely. We also differ from DREEAM. DREEAM improves which context is pooled by supervising attention with evidence sentences, but does not change how the pooled scores are thresholded. Our method is complementary to it, and we test the combination.
Baselines
The naive reference point is ATLOP's encoder with independent sigmoid outputs and one global cutoff of 0.5, trained with binary cross-entropy. It shows how much any adaptive decision rule buys.
The first real baseline is ATLOP itself, with its learned threshold class. The file reports 63.4 F1 on DocRED for ATLOP.
The strongest competitor on the exact question we ask is HingeABL on ATLOP. It targets threshold drag directly, and the file reports that it raises Re-DocRED F1 from 77.56 to 79.79 (Adaptive Hinge Balance Loss). AMTL reports the highest absolute number in the file: 82.02 F1 on Re-DocRED with the TTM-RE model, plus an 8.63-point gain on the Tail-10 relations with DocuNet (AMTL). Because TTM-RE is a different backbone, we will re-run AMTL's loss on our ATLOP encoder rather than compare against 82.02. We will also report our heads on a DocuNet backbone so the Tail-10 comparison is like for like. For NCRL, the file gives 65.81 Ign F1 on the DocRED test set with DeBERTa-Large; we re-run it on our backbone.
For fairness, every method uses the same encoder checkpoint and training data. Each gets the same number of epochs and the same hyperparameter search budget: 20 trials over learning rate and the method's own loss parameters, chosen by development F1. We report means and spread over five seeds.
Beating HingeABL means three things on Re-DocRED at matched backbone: higher overall F1 by more than the seed spread, a lower FN_IRK count, and higher macro F1 over relations.
Three ablations isolate the key ingredient. The first trains the ranker on all pairs rather than positives only; this tests whether excluding negatives is what reduces FN_IRK. The second removes the global-context features from the count head. The third replaces the predicted $\hat{k}$ with the oracle count, which bounds how much error comes from counting versus ranking.
Why not just…?
Why not just tune a per-relation threshold on the development set after training ATLOP? This is the most serious threat. If threshold drag is a constant upward bias, subtracting a tuned offset per relation should recover most of HingeABL's gain at zero cost. We found no reported result on Lacuna for post-hoc per-class threshold tuning of ATLOP on Re-DocRED, so we will run it as a headline baseline. It cannot, by construction, change the ranking, so it should leave FN_IRK where it is. Our claim also predicts that the drag is pair-dependent: it should be larger for long-distance, weakly connected pairs. We will test this by stratifying pairs by sentence distance and mutual attention mass. If post-hoc tuning matches our method in every stratum, then the count head's use of global context adds nothing, and we will say so.
Why not just stack HingeABL, AMTL, and DREEAM? These methods fix different things: loss weights, per-segment cutoffs, and attention pooling. The stack is a legitimate baseline, and we will run DREEAM with HingeABL. All three, however, keep training relation logits against every negative pair. HingeABL's own analysis leaves 43.84% FN_CRK and an untouched FN_IRK share. If the stacked system matches ours on FN_IRK, that refutes our causal story about negative-pair pressure. We also report our heads on top of DREEAM, to show the gains compose rather than overlap.
Why not just use a separate two-stage pipeline, first an existence classifier and then a relation classifier? This is close in spirit to our method and to DC-Prophet. The difference is that a hard filter discards any rare positive it misses, while our jointly trained count head shares the encoder and lets the development-set cost trade recall for precision. We run the hard cascade with the same encoder. If it matches us, the contribution reduces to "decoupling helps," which is still a useful finding.
Why not just use focal loss or class reweighting? Reweighting changes gradient scale, not which examples shape the relation logits. The dossier notes it does not add missing tail diversity. It is included inside AMTL's collaborative-loss setup, and we additionally run focal loss on ATLOP.
Proposed Experiments
The primary benchmark is Re-DocRED, with its denser labels and 94% negative pairs. We report F1, Ign F1, macro F1 over relations, Tail-10 F1, and HingeABL's FN_CRK/FN_IRK error decomposition. We also report count-head accuracy and calibration for each value of $k$.
Secondary benchmarks test different regimes. On DocRED, we expect the count head to under-count because of missing labels. On CDR and GDA, relation sets are small, so we can check whether the benefit survives when cardinality is almost always 0 or 1. On a 3% low-resource Re-DocRED split, where PRiSM reports that BERT-base goes from 10.44 to 37.02 F1 by escaping the "predict no relation" trap, we test whether a separately trained count head avoids that trap without relation descriptions.
The decisive checks are three. First, positives-only ranking must reduce FN_IRK relative to all-pairs ranking at matched overall threshold behavior; if it does not, the core causal claim fails. Second, the gap between our method and post-hoc per-relation thresholds must grow with entity distance and shrink with mutual attention mass; if it is flat, context-conditioned counting is unnecessary. Third, the oracle-$k$ run must show a clearly larger upper bound than predicted $k$ achieves. That tells us whether future effort belongs in counting or in ranking, which is the practical question this line of work has left open.
References
- Adaptive Hinge Balance Loss for Document-Level Relation Extraction
- Document-Level Relation Extraction with Adaptive Thresholding and Localized Context Pooling
- Cardinality-Aware Set Prediction and Top-$k$ Classification
- An Adaptive Multi-Threshold Loss and a General Framework for Collaborating Losses in Document-Level Relation Extraction
- DeepSetNet: Predicting Sets with Deep Neural Networks
- DC-Prophet: Predicting Catastrophic Machine Failures in DataCenters
- Revisiting DocRED - Addressing the False Negative Problem in Relation Extraction
- None Class Ranking Loss for Document-Level Relation Extraction
- DREEAM: Guiding Attention with Evidence for Improving Document-Level Relation Extraction
- PRiSM: Enhancing Low-Resource Document-Level Relation Extraction with Relation-Aware Score Calibration