---
title: Tie-Aware Retrieval Metrics (TRM)
url: https://www.emergentmind.com/topics/tie-aware-retrieval-metrics-trm
type: topic
---

# Tie-Aware Retrieval Metrics (TRM)

Searching arXiv for relevant papers on tie-aware retrieval metrics, ties in ranking evaluation, and related rank similarity measures.
Tie-aware Retrieval Metrics (TRM) are ranking metrics that explicitly account for tied scores or distances by defining the metric value as the average over all possible permutations of the tied items, rather than by committing to an arbitrary tie-breaking rule. In the hashing literature, the term denotes tie-aware versions of Average Precision (AP) and Normalized Discounted Cumulative Gain (NDCG) for Hamming ranking, where integer-valued Hamming distances induce extensive ties [1705.08562]. In low-precision retrieval, the same term denotes a broader evaluation protocol in which tied candidates are treated as order-uncertain and the evaluation reports the expected metric value together with range and bias, thereby quantifying uncertainty introduced purely by ties [2508.03306].

## 1. Origins, problem setting, and motivation

The original motivation for TRM in retrieval arose from supervised hashing for nearest-neighbor retrieval. A hash function
\[
\Phi:\mathcal{X}\to\{-1,1\}^b
\]
maps each item to a \(b\)-bit code, and retrieval is performed by ranking database items in ascending Hamming distance to the query. The induced distance can be written as
\[
d_\Phi(x,x')=\frac{1}{2}\big(b-\Phi(x)^\top\Phi(x')\big)\in\{0,1,\dots,b\},
\]
so only \(b+1\) distinct distance values are available. When the database contains tens or hundreds of thousands of items, many items inevitably share the same distance to a query, especially for short codes [1705.08562].

This discreteness creates a direct conflict with standard AP and NDCG, whose usual definitions assume a total order. Under Hamming ranking, each distance value defines a tie group
\[
R^{(d)}=\{i\mid d_\Phi(x_q,x_i)=d\},
\]
and there is no canonical internal order within \(R^{(d)}\). Random tie-breaking, deterministic secondary keys such as ID order, and best-case or worst-case tie-breaking all produce metric values that may differ materially for the same retrieval system. The hashing paper argues that this makes comparison ambiguous and motivates tie-aware AP and tie-aware NDCG as deterministic alternatives [1705.08562].

A later motivation came from low-precision retrieval. When relevance scores are computed in BF16 or FP16, the reduced mantissa creates spurious ties because distinct underlying scores collide on the representable grid:
\[
s_i=\phi_{(B)}(z_i).
\]
Documents with the same low-precision score form tie groups
\[
G_n=\{i\mid s_i=v_n\},
\]
ordered by distinct score values \(v_1>v_2>\dots>v_N\). In this setting, naive evaluation can exhibit high variability and systematic bias. On MIRACL Reranking with Qwen3-Reranker and softmax scoring, the reported BF16 range reaches 25.59 percentage points for nDCG@10 and 38.03 points for MRR@10, while the tie-oblivious scores overestimate the TRM expectation by +6.66 and +9.08 points respectively [2508.03306]. These results place ties at the center of retrieval evaluation rather than at its margins.

## 2. Formal definition and core principles

The central construction of TRM is to keep the order between tie groups fixed and average the chosen ranking metric over all permutations within each tie group. If \(M\) is any ranking metric and \(\pi\) ranges over permutations that reorder documents only within ties, the tie-aware metric is
\[
E[M]=\mathbb{E}_{\pi\sim\mathcal{P}}[M(\pi)],
\]
where \(\mathcal{P}\) is the uniform distribution over admissible within-group permutations [2508.03306]. In the hashing formulation, the same idea is expressed as averaging AP or NDCG over all permutations inside each Hamming-distance bin \(R^{(d)}\), yielding a deterministic score equal to the expected standard metric under uniform random tie-breaking [1705.08562].

Several properties follow directly from this construction. TRM is tie-aware because it explicitly models the ambiguity inside tie groups; deterministic because the expectation is uniquely defined for fixed scores and labels; and consistent because it reduces to the ordinary metric when every tie group has size \(1\) [1705.08562]. In the low-precision setting, TRM additionally separates the expected score from the uncertainty induced by ties through two auxiliary quantities:
\[
\mathrm{Range}(M)=M_{\max}-M_{\min},
\]
and
\[
\mathrm{Bias}(M)=M_{\text{obl}}-E[M],
\]
where \(M_{\text{obl}}\) is the conventional tie-oblivious score produced by a specific evaluation pipeline [2508.03306].

Two recurring parameterizations organize the tied-ranking structure. In Hamming retrieval, the natural statistics are distance-conditioned relevance histograms, with counts
\[
n_{d,v}=|R^{(d)}\cap\{i\mid A_q(i)=v\}|,
\]
their cumulative versions \(N_{d,v}\), and bin totals \(n_d\) and \(N_d\) [1705.08562]. In low-precision retrieval, the basic quantities are tie-group sizes \(|G_n|\), the number of relevant documents \(r_n\) in each group, the group-wise relevance probability
\[
p_n=\frac{r_n}{|G_n|},
\]
the cumulative size
\[
C_n=\sum_{m<n}|G_m|,
\]
and the number of items from group \(G_n\) that fall into the top-\(k\) prefix,
\[
t_n=\max\{0,\min(|G_n|,k-C_{n-1})\}.
\]
Both parameterizations turn tied ranking into a counting problem rather than a permutation-enumeration problem [2508.03306].

| Source | Retrieval setting | Tie-aware output |
|---|---|---|
| "Hashing as Tie-Aware Learning to Rank" [1705.08562] | Hamming ranking with integer distances | Tie-aware AP and tie-aware NDCG |
| "Reliable Evaluation Protocol for Low-Precision Retrieval" [2508.03306] | BF16/FP16 score ties | \(E[M]\), Range, Bias for multiple metrics |
| "The Treatment of Ties in Rank-Biased Overlap" [2406.07121] | Ranking similarity under ties | \(RBO^{w}\), \(RBO^{a}\), \(RBO^{b}\) |

## 3. Metric families and closed-form formulations

In the hashing formulation, tie-aware AP is defined for binary affinities and tie-aware DCG/NDCG for graded affinities. The key result is that AP and DCG decompose by Hamming-distance bins. For AP, the contribution of each bin depends on the number of relevant items in that bin, the bin size, and the cumulative counts above the bin; for NDCG, the expected gain at each position inside a tie group is obtained from the relevance histogram of that group. The resulting metrics are exactly the expected values of standard AP and DCG/NDCG under uniform random tie-breaking within each distance bin [1705.08562].

The low-precision formulation generalizes this closed-form program to several standard IR metrics under binary relevance. Expected Hits@\(k\), Recall@\(k\), Precision@\(k\), and \(F_1@k\) follow directly by linearity of expectation from the expected number of relevant documents contributed by each tie group within the top-\(k\) prefix. Expected nDCG@\(k\) is obtained by weighting each partially observed tie group with the usual DCG discount
\[
w_r=\frac{1}{\log_2(r+1)},
\]
and normalizing by
\[
\mathrm{IDCG@}k=\sum_{r=1}^{\min(N_+,k)}\frac{1}{\log_2(r+1)}.
\]
The same paper also provides closed forms for MRR@\(k\) and MAP@\(k\), again without enumerating within-group permutations [2508.03306].

The metric-specific scope of TRM has therefore expanded over time. In the 2017 hashing setting, TRM specifically denotes tie-aware AP and NDCG specialized to Hamming ranking [1705.08562]. In the 2025 low-precision setting, TRM becomes a broader evaluation family covering nDCG@10, MRR@10, MAP@3, Recall@\(k\), Precision@\(k\), and \(F_1@k\), together with the uncertainty summaries range and bias [2508.03306]. A plausible implication is that TRM is best understood as a design pattern for ranking metrics under score coarsening, rather than as a single fixed metric.

## 4. Algorithms, efficiency, and optimization

For Hamming retrieval, TRM is computationally efficient because Hamming distance has only \(b+1\) bins. The hashing paper computes tie-aware metrics from per-query histograms and states that, for fixed \(b\), counting sort and histogram operations evaluate the metrics in \(O(b|S|)\), linear in database size [1705.08562]. This matters because the tie-aware formulation is not merely more principled than ad hoc tie-breaking; in Hamming space it is also operationally natural.

The same paper goes further by optimizing tie-aware AP and NDCG directly. Since the original problem is discrete—binary codes, integer distances, and hard histograms—it replaces the sign activation with a scaled hyperbolic tangent,
\[
\phi_i(x)\approx \hat{\phi}_i(x)=\tanh(\alpha f_i(x;w)),
\]
and defines a relaxed distance
\[
\hat d_\Phi(x,x')=\frac{1}{2}\big(b-\hat\Phi(x)^\top\hat\Phi(x')\big).
\]
Hard binning is replaced by a differentiable triangular kernel \(\delta(z,d)\), producing soft histogram counts \(\hat n_{d,v}\). Because the original bin contributions sum over integer ranks, the finite sums are approximated by integrals, yielding smooth surrogates for tie-aware AP and DCG/NDCG that can be optimized by backpropagation. The full Jacobian over a minibatch is implemented in \(O(b|V|M^2)\), and test-time retrieval uses exact Hamming distance on thresholded binary codes [1705.08562].

In low-precision retrieval, TRM is purely post hoc. The system first sorts documents by score in the ordinary way, which costs \(O(L\log L)\) for \(L\) candidates. A single scan then aggregates tie groups and relevance counts, and the closed-form metrics run in \(O(\min\{k,N\})\) or \(O(k)\) depending on the metric, with at most \(O(L)\) additional arithmetic per query. The stated overhead is therefore far below the cost of the model forward pass or initial sort, and no sampling or permutation enumeration is required [2508.03306].

## 5. Reliable evaluation, range, bias, and reporting practice

A defining feature of the newer TRM literature is that it treats expected score as only one component of reliable evaluation. When ties are abundant, the same fixed set of scores and labels induces a family of admissible rankings, so a single tie-oblivious metric cannot characterize evaluation stability. TRM therefore reports \(E[M]\) as the primary performance number, \(\mathrm{Range}(M)\) as the uncertainty due solely to internal tie ordering, and \(\mathrm{Bias}(M)\) as the deviation of a legacy tie-breaking procedure from the expected value [2508.03306].

This framework is paired with High-Precision Scoring (HPS), in which a low-precision model keeps inference in BF16 but upcasts the final scoring step to FP32. HPS reduces the number and size of spurious ties; TRM then quantifies any remaining ambiguity. For the same MIRACL example discussed above, BF16\(\to\)FP32 reduces the nDCG@10 range from 25.59 to 1.13 and the MRR@10 range from 38.03 to 1.21, while bias drops to 0.24 and 0.21 respectively [2508.03306]. The two components are explicitly presented as complementary rather than interchangeable.

The reporting recommendation in this line of work is to publish
\[
(E[M],\mathrm{Range}(M))
\]
for each metric and cutoff, optionally accompanied by the conventional \(M_{\text{obl}}\), Bias, \(M_{\max}\), and \(M_{\min}\) for backward comparability [2508.03306]. In the hashing literature, the analogous practical lesson is that tie-aware AP and NDCG eliminate ambiguity caused by best-case, worst-case, or arbitrary tie-breaking, while remaining close to the average behavior of random tie-breaking over many queries [1705.08562]. Taken together, these works define a shift from “choose a tie-breaking rule” to “treat tie order as latent uncertainty and evaluate it explicitly.”

## 6. Related tie-aware ranking formalisms and semantic distinctions

TRM belongs to a broader effort to make ties first-class objects in ranking evaluation. In machine translation meta-evaluation, the paper "Ties Matter: Meta-Evaluating Modern Metrics with Pairwise Accuracy and Tie Calibration" argues that existing Kendall-style variants fail to reward correct prediction of ties and can even be gamed. It proposes pairwise accuracy,
\[
acc=\frac{C+T_{hm}}{C+D+T_h+T_m+T_{hm}},
\]
together with tie calibration that introduces ties by thresholding small score differences [2305.14324]. Although this work is not itself a retrieval metric, it sharpens a general point that is central to TRM: ties carry information, and ad hoc handling can systematically distort comparative conclusions.

A closely related development appears in tie-aware Rank-Biased Overlap. "The Treatment of Ties in Rank-Biased Overlap" distinguishes several tie semantics rather than a single universal rule. \(RBO^{a}\) interprets ties as uncertainty and equals the expected bare RBO over random tie-breaking; \(RBO^{b}\) normalizes by measurable overlap in the style of Kendall’s \(\tau_b\); and \(RBO^{w}\) adopts an equality or “sports ranking” semantics in which tied items share rank mass [2406.07121]. This semantics-driven decomposition is important for TRM because it shows that tie handling is not merely an implementation detail: it encodes assumptions about what a tie means.

The literature therefore supports two distinct but compatible views. One view treats ties as uncertainty about an underlying strict order, leading naturally to expectations, ranges, and untiedness-normalized variants [2508.03306; 2406.07121]. The other treats ties as genuine equality classes, which motivates equality-style overlap or calibrated pairwise decisions [2406.07121; 2305.14324]. A plausible implication is that the correct TRM variant depends on whether ties arise from coarse measurement, reduced numerical precision, or an intended notion of equivalence.

The acronym itself is not unique across machine learning. In latent world-model planning, "Beyond Euclidean Proximity: Repairing Latent World Models with Horizon-Matched Trajectory Reachability Metrics" uses TRM to mean Trajectory Reachability Metrics and explicitly states that this is not the information-retrieval meaning of Tie-aware Retrieval Metrics [2605.22164]. Within retrieval and ranking evaluation, however, TRM consistently denotes principled handling of tied candidates through expectation-based or semantics-aware metric definitions.

## 7. Significance, scope, and limitations

The principal significance of TRM is methodological. In both Hamming retrieval and low-precision retrieval, tie-oblivious metrics can be unstable, implementation-dependent, and capable of reversing model comparisons. TRM replaces this arbitrariness with deterministic expectations and, in the newer protocol, with explicit uncertainty quantification through range and bias [1705.08562; 2508.03306]. This suggests that ties should be treated as an intrinsic part of the observable ranking structure whenever scores are coarse, quantized, or intentionally bucketed.

The scope of current TRM formulations is nevertheless bounded by their assumptions. The low-precision protocol assumes uniform random permutation within each tie group; the paper notes that real systems may instead impose structured non-uniform tie-breaking based on recency or ID order, in which case the expectation model would need to change [2508.03306]. The hashing formulation is specialized to Hamming ranking and derives its efficiency from the finite set of distance bins [1705.08562]. More generally, extensions to additional metrics require new derivations rather than automatic inheritance [2508.03306].

At the same time, the available evidence points to a broad domain of applicability. The low-precision paper explicitly identifies BF16 or FP16 inference, quantized embeddings, and other systems with coarse or bucketed scores as settings in which TRM should be used [2508.03306]. The hashing paper makes the same argument for short binary codes, where ties are especially prominent [1705.08562]. Related work on RBO and meta-evaluation further indicates that tie awareness is relevant not only to effectiveness metrics but also to rank similarity measures and pairwise ranking diagnostics [2406.07121; 2305.14324].

In this sense, Tie-aware Retrieval Metrics constitute a family of principled ranking-evaluation methods for tied outputs. Their common core is the replacement of arbitrary tie-breaking by explicit modeling of within-group order uncertainty; their concrete realizations range from tie-aware AP and NDCG in Hamming space to expectation, range, and bias reporting for low-precision retrieval systems [1705.08562; 2508.03306].

Source: https://www.emergentmind.com/topics/tie-aware-retrieval-metrics-trm