SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Under this assumption, the utility of a scorer  $f$  on  $(\mu^X, y)$  w.r.t. ranking metric  $u: S_\ell \times \mathbb{R}_{\geq 0}^\ell \to \mathbb{R}_{\geq 0}$  is computed by (overloading  $u$  for future brevity)
$$
\mathbb {E} _ {\mu} [ u (f) ] := \mathbb {E} _ {X \sim \mu^ {X}} \mathbb {E} _ {R \sim p _ {\exp (f (X))}} [ u (R, y (X)) ].
$$
We define the risk (or suboptimality) of  $f$  as the difference between its utility to the maximum-attainable utility on the problem (e.g., the maximum is 1 when  $u = \mathrm{NDCG}$ ):
$$
\mathcal {R} (f) = \mathbb {E} _ {X \sim \mu^ {X}} \left[ \max  _ {r \in S _ {\ell}} u (r, y (X)) \right] - \mathbb {E} _ {\mu} [ u (f) ].
$$
The next technical challenge is that unlike in classification where the perfect classifier is unique (i.e., achieving zero error), the perfect ranker is generally not: e.g., both rank assignments  $(1,2,3)$  and  $(2,1,3)$  achieve maximum utility (i.e.,  $\mathcal{R} = 0$ ) on a list with ground-truth scores  $(1,1,0)$ . Prior analyses of domain adaptation leverage this uniqueness [5, 52]; instead, ours does not rely on uniqueness (else the bound would be loose) with the following Lipschitz assumptions:
Assumption 4.3. The ranking metric  $u: S_{\ell} \times \mathbb{R}_{\geq 0}^{\ell} \to \mathbb{R}_{\geq 0}$  is upper bounded by  $B$ , and is  $L_{u}$ -Lipschitz w.r.t. the ground-truth scores  $y$  in the second argument (in Euclidean distance).
Assumption 4.4. The input lists  $X$  reside in a metric space  $\mathcal{X}$ , and the ground-truth scoring function  $y: \mathcal{X} \to \mathbb{R}_{\geq 0}^{\ell}$  is  $L_{y}$ -Lipschitz (in Euclidean distance on the output space).
We will show that Assumption 4.3 is satisfied by both RR and NDCG. Assumption 4.4 says that similar lists (i.e., close in  $\mathcal{X}$ ) should have similar ground-truth scores, and is satisfied, e.g., when  $\mathcal{X}$  is finite; such is the case with text data, which are one-hot encoded after tokenization.
Assumption 4.5. The list features  $Z$  reside in a metric space  $\mathcal{Z}$ , and the class  $\mathcal{H}$  of scoring functions,  $h: \mathcal{Z} \to \mathbb{R}^{\ell}$ , is  $L_{h}$ -Lipschitz (in Euclidean distance on the output space).
Assumption 4.6. The class  $\mathcal{G}$  of feature maps,  $g:\mathcal{X}\to \mathcal{Z}$ , satisfies that  $\forall g\in \mathcal{G}$ , the restrictions of  $g$  to the supports of  $\mu_S^X$  and  $\mu_T^X$ ,  $g|_{\mathrm{supp}(\mu_S^X)},g|_{\mathrm{supp}(\mu_T^X)}$  respectively, are both invertible with  $L_{g}$ -Lipschitz inverses.
Assumption 4.5 is standard in generalization and complexity analyses, and could be enforced, e.g., with  $L^2$ -regularization [1, 4]. The last assumption is technical, saying that the inputs can be recovered from their feature representations by a Lipschitz inverse  $g^{-1}$ . This means that the feature map  $g$  should retain as much information from the inputs (on each domain), which is a desideratum of representation learning. Note that this assumption does not conflict with the goal of invariant representation learning: there is always a sufficiently expressive  $\mathcal{G}$  s.t.  $\exists g \in \mathcal{G}$  satisfying the assumption and  $\mu_S^{Z,\mathrm{list}} = \mu_T^{Z,\mathrm{list}}$ .
We are now ready to state our domain adaptation generalization bound for ranking:
Theorem 4.7. Under Assumptions 4.2 to 4.6, for any  $g \in \mathcal{G}$ , define the minimum joint risk by  $\lambda_g^* = \min_{h'} (\mathcal{R}_S(h' \circ g) + \mathcal{R}_T(h' \circ g))$ , then for all  $h \in \mathcal{H}$ ,
$$
\mathcal {R} _ {T} (h \circ g) \leq \mathcal {R} _ {S} (h \circ g) + 4 \big (L _ {u} L _ {y} L _ {g} + B \ell L _ {h} \big) W _ {1} (\mu_ {S} ^ {Z, \text {l i s t}}, \mu_ {T} ^ {Z, \text {l i s t}}) + \lambda_ {g} ^ {*},
$$
where  $\mu^{Z,\mathrm{list}}$  is the marginal distribution of the list features  $Z = g(X)$ ,  $\mu^{Z,\mathrm{list}}(z) \coloneqq \mu^X(g^{-1}(z))$ .
The key feature of this bound is that it depends on list-level alignment,  $W_{1}(\mu_{S}^{Z,\mathrm{list}},\mu_{T}^{Z,\mathrm{list}})$ , hence it provides theoretical support for the list-level alignment proposed in Section 3.2.2. It can be instantiated to specific ranking metrics by simply verifying the Lipschitz condition  $L_{u}$  of Assumption 4.3:
Corollary 4.8 (Bound for MRR). RR is 1-Lipschitz in  $y$ , thereby
$$
\mathbb {E} _ {\mu_ {T}} \left[ \mathrm {R R} (h \circ g) \right] \geq \mathbb {E} _ {\mu_ {S}} \left[ \mathrm {R R} (h \circ g) \right] - 4 \left(L _ {y} L _ {g} + \ell L _ {h}\right) W _ {1} \left(\mu_ {S} ^ {Z, \text {l i s t}}, \mu_ {T} ^ {Z, \text {l i s t}}\right) - \lambda_ {g} ^ {*}.
$$
Corollary 4.9 (Bound for NDCG). If  $C^{-1} \leq \mathrm{IDCG} \leq C$  for some  $C \in (0, \infty)$  on  $(\mu_S^X, y_S)$  and  $(\mu_T^X, y_T)$  almost surely, then NDCG is  $\widetilde{O}(C\sqrt{\ell})$ -Lipschitz in  $y$  almost surely, thereby
$$
\mathbb {E} _ {\mu_ {T}} \left[ \mathrm {N D C G} (h \circ g) \right] \geq \mathbb {E} _ {\mu_ {S}} \left[ \mathrm {N D C G} (h \circ g) \right] - \widetilde {O} \left(C \sqrt {\ell} L _ {y} L _ {g} + \ell L _ {h}\right) W _ {1} \left(\mu_ {S} ^ {Z, \text {l i s t}}, \mu_ {T} ^ {Z, \text {l i s t}}\right) - \lambda_ {g} ^ {*}.
$$
5 Experiments on Passage Reranking
To demonstrate the empirical benefits of invariant representation learning with list-level alignment (ListDA) for unsupervised domain adaptation, we evaluate it on the passage reranking task $^5$  and compare to zero-shot transfer, item-level alignment (ItemDA), as well as a recent method based on query synthesis [37]. Note that our method is not specialized to text (re)ranking; in Appendix D, we evaluate ListDA on a web ranking task from the Yahoo! Learning to Rank Challenge.
In passage reranking, given a text query, we are to rank candidate passages based on their relevance to the query from a retrieved set. Reranking is employed in scenarios where the corpus is too large for using accurate but expensive models such as cross-attention neural rankers to rank every (millions of) documents. Rather, a two-stage approach is taken: a simple but efficient model such as sparse or dense retrievers (e.g., BM25 [49] and DPR [28]) is first used to retrieve a candidate set of (hundreds of) passages, then a more sophisticated (re)ranking model is used to refine and improve their ranks.
We use BM25 to retrieve 1,000 candidate passages in the first-stage, and focus on the adaptation of a RankT5 listwise reranker [76], a cross-attention model derived from the T5 base language model with 250 million parameters [48]. It takes the concatenation of the query and the document (q-d pair) as input and outputs an embedding. We treat the q-d embeddings computed on the same list as the list feature—consistent with the setting in Section 3.2. For the task training loss function, we use the softmax cross-entropy ranking loss:  $\ell(s,y) = -\sum_{i=1}^{\ell} y_i \log(\exp(s_i) / \sum_{j=1}^{\ell} \exp(s_j))$ .
4IDCG is lower bounded, e.g., if every list contains at least one relevant item, and upper bounded when the ground-truth scores are upper bounded.
<sup>5</sup>We will use the terms document and passage interchangeably.
Figure 3: Block diagram of the cross-attention RankT5 text ranking model with ListDA.
Datasets. In our domain adaptation experiments, we use the MS MARCO dataset for passage ranking [3] as the source domain, which contains 8 million passages crawled from the web covering a wide range of topics with 532,761 search query and relevant passage pairs. The target domains are biomedical (TREC-COVID [62], BioASQ [59]) and news articles (Robust04 [64]). The data are preprocessed consistently with the BEIR benchmark [57]; their paper includes dataset statistics.
Since the training split of the target domain datasets does not contain q-d relevance annotations, our setting is unsupervised. It also does not contain any queries, but these are required for performing domain adaptation, because the input lists are defined to consist of q-d pairs. To acquire training queries on the target domains, we synthesize them in a zero-shot manner following [37], by using a T5 XL query generator (QGen) trained on MS MARCO relevant q-d pairs. QGen synthesizes each query as a seq-to-seq task given a passage, and the generated queries are expected to be relevant to the input passages. See Table 7 for sample QGen q-d pairs.
Methods. In zero-shot transfer, the reranker is trained on MS MARCO and evaluated on the target domain without adaptation. In QGen pseudolabel (QGen PL), we treat QGen q-d pairs synthesized on the target domain as relevant pairs, and train the reranker on them in addition to MS MARCO. This method is specific to text ranking, and is used in several recent works on domain adaptation of text retrievers and rerankers [37, 54, 65].
ItemDA (item-level alignment) is the prior implementation of invariant representation learning for ranking [12, 58, 68], and is set up according to Section 3.2.1 with adversarial training described in Section 3.1. The adversarial loss is aggregated from the losses of five three-layer MLP discriminators (no improvements from using wider or more layers),  $\sum_{i=1}^{5} \mathcal{L}_{\mathrm{ad}}(g, f_{\mathrm{ad}}^{(i)})$ , for reducing the sensitivity to the randomness in the initialization and training process [16]. Our ListDA (list-level alignment) is set up according to Section 3.2.2, and the discriminator is an ensemble of five stacks of three T5 (transformer) encoding blocks. To predict the domain identity of a list feature  $z = (v_1, \dots, v_\ell)$ , we feed the vectors into the transformer blocks all at once as a sequence, take the mean-pool of the  $\ell$  output embeddings, then project it to a logit with a linear layer. A block diagram of ListDA is in Fig. 3.
Further details including hyperparameters and the construction of training lists (i.e., sampling negative pairs) are relegated to Appendix C, where we also include additional results such as using the pairwise logistic ranking loss, a hybrid adaptation method combining ListDA and QGen PL, and using transformers as the discriminator for ItemDA.
The main results are presented in Table 1, where we report metrics that are standard in the literature (e.g., TREC-COVID uses NDCG@20), and evaluate rank assignments by the descending order of the predicted scores. Since TREC-COVID and Robust04 are annotated with 3-level relevancy, the scores are binarized for mean average precision (MAP) and MRR as follows: on TREC-COVID, we map 0 (not relevant) and 1 (partially relevant) to negative, and 2 (fully relevant) to positive; on Robust04, 0 (not relevant) to negative, and 1 (relevant) and 2 (highly relevant) to positive.
6All adaptation methods are applied on each source-target domain pair separately.
Table 1: Reranking performance of RankT5 on top 1000 BM25-retrieved passages.
Target domain	Method	MAP	MRR@10	NDCG@5	NDCG@10	NDCG@20
Robust04	BM25	0.2282	0.6801	0.4396	0.4088	0.3781
Zero-shot	0.2759	0.7977†	0.5857†	0.5340†	0.4856†
QGen PL	0.2693	0.7644	0.5406	0.5034	0.4694
ItemDA	0.2822*†	0.8037†	0.5822†	0.5396†	0.4922†
ListDA	0.2901*†‡	0.8234*†	0.5979†‡	0.5573*†‡	0.5126*†‡
TREC-COVID	BM25	0.2485	0.8396	0.7163	0.6559	0.6236
Zero-shot	0.3083	0.9217	0.8328	0.8200	0.7826
QGen PL	0.3180*‡	0.8907	0.8373	0.8118	0.7861
ItemDA	0.3087	0.9080	0.8276	0.8142	0.7697
ListDA	0.3187*‡	0.9335	0.8693*‡	0.8412*‡	0.7985‡
BioASQ	BM25	0.4088	0.5612	0.4580	0.4653	0.4857
Zero-shot	0.5008‡	0.6465	0.5484‡	0.5542‡	0.5796‡
QGen PL	0.5143*‡	0.6551	0.5538‡	0.5643‡	0.5915*‡
ItemDA	0.4781	0.6383	0.5315	0.5343	0.5604
ListDA	0.5191*‡	0.6666*‡	0.5639*‡	0.5714*‡	0.5985*‡
Source domain is MS MARCO. Gain function in NDCG is the identity map. *Improves upon zero-shot with statistical significance  $(p \leq 0.05)$  under the two-tailed Student's  $t$ -test. Improves upon QGen PL. Improves upon ItemDA.
Across all three datasets, ListDA achieves the best performance, and the fact that it uses the same training resource as QGen PL demonstrates the added benefits of list-level invariant representations for domain adaptation. The favorable comparison of ListDA to ItemDA corroborates the discussion in Sections 3.2 and 4 that for domain adaptation on ranking problems, item-level alignment is insufficient for transferability, sometimes even resulting in negative transfer (vs. zero-shot). Rather, list-level alignment is the more appropriate approach.
5.2 Analyses of ListDA
Quality of QGen. An explanation for why ListDA outperforms QGen PL despite the same resources is that the sampling procedure (Appendix C.3) of negative q-d pairs could introduce false negatives into the training data. This is supported by the observation in [54] that QGen synthesized queries lack specificity and could be relevant to many documents. While these false negative labels are used for training in QGen PL, they are discarded in ListDA, which is thereby less likely to be affected by false negatives, or even false positives—when synthesized queries are not relevant to the input passages (see Table 9 for samples). Although out of the scope, better query generation is expected to improve the performance of both QGen PL and ListDA.
Size of Target Data. Unsupervised domain adaptation requires sufficient unlabeled data, but not all domains have the same amount: BioASQ has 14 million documents (so is the total number of QGen queries, as we synthesize one per document), but Robust04 only has 528,155, and TREC-COVID 171,332.
In Fig. 4, we plot the performance of ListDA under varying numbers of target QGen queries (which is the number of target training lists). Surprisingly, on Robust04 and TREC-COVID, using just  $\sim 100$  target QGen queries (0.03% and 0.06% of all, respectively) is sufficient for ListDA to achieve full performance! Although the number of queries is small, since we retrieve 1,000 documents per query, the amount of distinct target documents in those 100 lists could be substantial—up to 100,000, or 29.5% and 60.7% of the respective corpora.
The performance begins to drop when reduced to  $\sim 10$  queries, which caps the amount of distinct documents at 10,000 (2.7% and 5.8%, respectively). The same data efficiency, however, is
Figure 4: ListDA performance under different target sizes. Lower grey horizontal line is zero-shot, upper red line is ListDA using all QGen queries.
not observed on BioASQ, likely due to the size and hardness of the dataset, such as the use of specialized biomedical terms (see examples in Tables 7 to 9).
Learning to Rank and Text Ranking. Learning to rank historically focuses on tabular data, for which, a wide range of models are developed [34], from SVMs [27], gradient boosted decision trees [9], to neural rankers [8, 42, 45]. Another traditional research direction is the design of ranking losses (surrogate to ranking metrics), which can be categorized into pointwise, pairwise, and listwise approaches [10, 7, 74, 24].
Recent advances in large neural language models have spurred interest in applying them on text ranking tasks [33, 46], leading to cross-attention models [22, 39, 40, 44] and generative models based on query likelihood [14, 77, 78, 50]. A different line of work is neural text retrieval models, which emphasizes efficiency, and has seen the development of dual-encoder [28, 70], late-interaction [29, 23], and models leveraging transformer memory [56].
Domain Adaptation in Information Retrieval. Work on this subject can be categorized into supervised and unsupervised domain adaptation. The former assumes access to labeled source data and (a small amount of) labeled target data (a.k.a. few-shot learning) [54]. This work focuses on the unsupervised setting, where target domain data do not have annotations. Cohen et al. [12] apply invariant representation learning to unsupervised domain adaptation for text ranking, followed by Tran et al. [58] for enterprise email search, and Xin et al. [68] for dense retrieval. However, unlike our proposed list-level alignment method (ListDA), they learn invariant representations at the item-level. A recent family of adaptation methods is based on query generation [37, 65], originally proposed for dense retrieval.
Invariant Representation Learning. Domain-invariant representation learning is a popular family of adaptation methods [35, 17, 13], to which our proposed ListDA belongs. Besides ranking, these methods are also applied in fields including vision and language, and on tasks ranging from cross-domain sentiment analysis, question-answering [31, 61], and to cross-lingual learning and machine translation [67, 30].
Zhao et al. [72] and Tachet des Combes et al. [55] point out that on classification problems, attaining perfect feature alignment and high source accuracy are insufficient to guarantee good target performance. This occurs when the marginal distributions of labels differ, or the learned features contain domain-specific and nontransferable components. Although their findings do not directly apply to ranking, still, they suggest two potential directions for future work: one is whether Theorem 4.7 would admit a fundamental lower bound under distributional shifts in the ground-truth scores, and another is to modify ListDA to include a component for isolating out nontransferable features, as in domain separation networks [6].
We proposed an implementation of invariant representation learning for ranking via list-level feature alignment, and based on which, established a domain adaptation generalization bound for ranking. Our theoretical and empirical results illustrate the significance of preserving the list structure for achieving effective domain adaptation, which is overlooked in prior work.
A broader message is that when working with (feature) representations, either for domain adaptation or other purposes, they should be analyzed at the same level (or structure) at which the data are defined for the task of interest and the metrics are computed. The results of this paper is such an example—by moving from item-level alignment to the more appropriate list-level alignment, we extracted more potentials from invariant representation learning for domain adaptation on ranking problems.
We thank the anonymous reviewers for their comments and suggestions on improving the presentation. This research was supported in part by the Google Visiting Researcher program and in part by the Center for Intelligent Information Retrieval. Han Zhao's work was partly supported by the Defense Advanced Research Projects Agency (DARPA) under Cooperative Agreement Number: HR00112320012. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of the sponsors.
[1] Martin Anthony and Peter L. Bartlett. Neural Network Learning: Theoretical Foundations. Cambridge University Press, 1999.
[2] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein Generative Adversarial Networks. In Proceedings of the 34th International Conference on Machine Learning, pages 214-223, 2017.
[3] Payal Bajaj, Daniel Campos, Nick Craswell, Li Deng, Jianfeng Gao, Xiaodong Liu, Rangan Majumder, Andrew McNamara, Bhaskar Mitra, Tri Nguyen, Mir Rosenberg, Xia Song, Alina Stoica, Saurabh Tiwary, and Tong Wang. MS MARCO: A Human Generated MAchine Reading COprehension Dataset, 2018. arXiv:1611.09268 [cs.CL].
[4] Peter L. Bartlett, Dylan J. Foster, and Matus Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, 2017.
[5] Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of Representations for Domain Adaptation. In Advances in Neural Information Processing Systems, 2007.
[6] Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain Separation Networks. In Advances in Neural Information Processing Systems, 2016.
[7] Sebastian Bruch, Shuguang Han, Michael Bendersky, and Marc Najork. A Stochastic Treatment of Learning to Rank Scoring Functions. In Proceedings of the 13th International Conference on Web Search and Data Mining, pages 61-69, 2020.
[8] Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. Learning to Rank using Gradient Descent. In Proceedings of the 22nd International Conference on Machine Learning, pages 89-96, 2005.
[9] Christopher J.C. Burges. From RankNet to LambdaRank to LambdaMART: An Overview. Technical Report MSR-TR-2010-82, Microsoft Research, 2010.
[10] Zhe Cao, Tao Qin, Tie-Yan Liu, Ming-Feng Tsai, and Hang Li. Learning to Rank: From Pairwise Approach to Listwise Approach. In Proceedings of the 24th International Conference on Machine Learning, pages 129-136, 2007.
[11] Olivier Chapelle and Yi Chang. Yahoo! Learning to Rank Challenge Overview. Journal of Machine Learning Research: Workshop and Conference Proceedings, 14:1-24, 2011.
[12] Daniel Cohen, Bhaskar Mitra, Katja Hofmann, and W. Bruce Croft. Cross Domain Regularization for Neural Ranking Models using Adversarial Learning. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pages 1025-1028, 2018.
[13] Nicolas Courty, Rémi Flamary, Amaury Habrard, and Alain Rakotomamonjy. Joint distribution optimal transportation for domain adaptation. In Advances in Neural Information Processing Systems, 2017.
[75] Honglei Zhuang, Xuanhui Wang, Michael Bendersky, and Marc Najork. Feature Transformation for Neural Ranking Models. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 1649–1652, 2020.
[76] Honglei Zhuang, Zhen Qin, Rolf Jagerman, Kai Hui, Ji Ma, Jing Lu, Jianmo Ni, Xuanhui Wang, and Michael Bendersky. RankT5: Fine-Tuning T5 for Text Ranking with Ranking Losses. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2308-2313, 2023.
[77] Shengyao Zhuang and Guido Zuccon. TILDE: Term Independent Likelihood moDEl for Passage Re-ranking. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 1483-1492, 2021.
[78] Shengyao Zhuang, Hang Li, and Guido Zuccon. Deep Query Likelihood Model for Information Retrieval. In Advances in Information Retrieval, pages 463-470, 2021.
Proposition A.1. Let  $\mu, \mu'$  be distributions supported on a metric space  $(\mathcal{X}, d)$ , define and assume  $R = \sup_{(x, x') \in \operatorname{supp}(\mu \times \mu')} d(x, x') \leq \infty$ , and let  $\mathcal{L}(f)$  denote the balanced 0-1 loss of a discriminator  $f: \mathcal{X} \to \{0, 1\}$ , given by
$$
\mathcal {L} (f) := \mathbb {E} _ {X \sim \mu} [ f (X) ] + \mathbb {E} _ {X ^ {\prime} \sim \mu^ {\prime}} [ 1 - f (X ^ {\prime}) ],
$$
then  $W_{1}(\mu ,\mu^{\prime})\leq R(1 - \min_{f}\mathcal{L}(f))$
Proof. Let  $\Gamma(\mu, \mu')$  denote the collection of couplings between  $\mu, \mu'$ , then by the definition of the Wasserstein-1 distance,
$$
\begin{array}{l} W _ {1} (\mu , \mu^ {\prime}) = \inf _ {\gamma \in \Gamma (\mu , \mu^ {\prime})} \int_ {\mathcal {X} \times \mathcal {X}} d (x, x ^ {\prime}) \mathrm {d} \gamma (x, x ^ {\prime}) \\ \leq R \inf  _ {\gamma \in \Gamma (\mu , \mu^ {\prime})} \int_ {\mathcal {X} \times \mathcal {X}} \mathbb {1} [ x \neq x ^ {\prime} ] d \gamma (x, x ^ {\prime}) \\ = R \left(1 - \sup  _ {\gamma \in \Gamma (\mu , \mu^ {\prime})} \int_ {\mathcal {X} \times \mathcal {X}} \mathbb {1} [ x = x ^ {\prime} ] \mathrm {d} \gamma (x, x ^ {\prime})\right) \\ = R \left(1 - \int_ {\mathcal {X}} \min  \left(\mu (x), \mu^ {\prime} (x)\right) \mathrm {d} x\right) \\ = R \int_ {\mathcal {X}} \max  \left(0, \mu^ {\prime} (x) - \mu (x)\right) d x \\ = \frac {R}{2} \int_ {\mathcal {X}} \left| \mu^ {\prime} (x) - \mu (x) \right| d x, \tag {1} \\ \end{array}
$$
because  $\int (\mu'(x) - \mu(x)) \, \mathrm{d}x = 0$ . Note that the last line is  $R$  times the total variation between  $\mu, \mu'$ . On the other hand, rewrite
$$
\mathcal {L} (f) = \int_ {\mathcal {X}} (f (x) \mu (x) + (1 - f (x)) \mu^ {\prime} (x)) d x = 1 - \int_ {\mathcal {X}} \left(\frac {1}{2} - f (x)\right) (\mu (x) - \mu^ {\prime} (x)) d x.
$$