# Counterfactual Editing for Search Result Explanation

Zhichao Xu<EMAIL_ADDRESS>University of Utah ,  Hemank Lamba
<EMAIL_ADDRESS>Dataminr, Inc. ,  Qingyao Ai<EMAIL_ADDRESS>Tsinghua University ,  Joel Tetreault<EMAIL_ADDRESS>Dataminr, Inc.
and  Alex Jaimes<EMAIL_ADDRESS>Dataminr, Inc.

###### Abstract.

Recently substantial improvements in neural retrieval methods also bring to
light the inherent blackbox nature of these methods, especially when viewed
from an explainability perspective. Most of existing works on Search Result
Explanation (SeRE) are designed to provide factual explanation, i.e. to
find/generate supporting evidence about documents’ relevance to search
queries. However, research in cognitive sciences have shown that human
explanations are contrastive i.e. people explain an observed event using some
counterfactual events; such explanations reduce cognitive load, and provide
actionable insights. Though already proven effective in machine learning and
NLP communities, the formulation and impact of counterfactual explanations
have not been well studied for search systems. In this work, we aim to
investigate the effectiveness of this perspective via proposing and evaluating
counterfactual explanations for the task of SeRE. Specifically, we first
conduct a user study where we investigate if counterfactual explanations
indeed improve search sessions’ effectiveness. Taking this as a motivation, we
discuss the desiderata that an ideal counterfactual explanation method for
SeRE should adhere to. Next, we propose a method $\text{CFE}^{2}$
(CounterFactual Explanation with Editing) to provide pairwise explanations to
search engine result page. Finally, we showcase that the proposed method when
evaluated on four publicly available datasets outperforms baselines on both
metrics and human evaluation.

Explainable Search, Counterfactual Explainability, Ad hoc Retrieval

††copyright: none††ccs: Information systems Retrieval models and ranking

##  1\. Introduction

Search systems such as those used within search engines and product search
have played a central role in the way people acquire information. Albeit
effective, recent advancements of neural retrieval methods (Lin et al., 2021)
provides little human-interpretable evidence of the underlying reasoning they
use to determine relevance (Singh and Anand, 2019, 2020). Providing
explanations on Search Engine Result Page (SERP) to explain documents’
relevance has been shown to improve search sessions’ efficiency and users’
trust towards the system (Mi and Jiang, 2019; Ramos and Eickhoff, 2020).

In line with the general work of explainable AI literature (Miller, 2019; Tan
et al., 2022; Verma et al., 2020), these explanations are factual in nature.
The goal of these factual explanations is to find/generate supporting evidence
for model’s decisions, i.e. to answer the ”Why A” question. Most existing
works currently utilize factual explanation for the task of Search Result
Explanation (SeRE), i.e. to find/generate supporting evidence to explain
documents’ relevance w.r.t. the search query. Examples of factual explanations
are snippet-based (Chen et al., 2020; Bast and Celikik, 2014; Turpin et al.,
2007; Verstak and Acharya, 2012) methods and NLG-based methods (Rahimi et al.,
2021; Yu et al., 2022).

However, research in cognitive science has shown that human explanations are
contrastive (Miller, 2019), i.e. people explain an observed event using some
counterfactual events/contrast cases.111Although the definitions of
‘Counterfactual‘ and ‘Contrastive‘ have minor difference in literature (Ross
et al., 2020; Miller, 2019; Wachter et al., 2017), they can be seen as
equivalent in SeRE problem setting, as a counterfactual query will naturally
lead to a different search result, i.e. a contrast case. Instead of answering
the ”Why A” question, counterfactual explanation answers the ”Why A rather
than B” question. For example, Alice gets rejected in credit card application
and the counterfactual explanation is, were her credit history to be one year
longer, the application would have been approved. Such explanations prune the
space of causal factors to reduce the users’ cognitive load (Jacovi et al.,
2021; Lipton, 1990) and provide actionable suggestions (Verma et al., 2020).
Although counterfactual explanations have proven effective in other
communities (Verma et al., 2020; Ross et al., 2020; Jacovi et al., 2021),
there is no similar work studying its effectiveness for search systems.

In this work, we examine the impact of counterfactual explanation within SeRE
task. We study whether providing counterfactual explanations can be useful to
enhance the search session effectiveness and efficiency, and propose a novel
method to generate counterfactual explanation for a given document pair within
current SERP. More specifically, we investigate:

RQ1. Effectiveness of Counterfactual Explanations: Can counterfactual
explanation improve search session’s effectiveness (user’s relevance
judgements accuracy) and efficiency (user’s time to locate relevant
documents)?

RQ2. Design Principles and Evaluation for Counterfactual Explanations: What
are the desired properties of counterfactual explanations for the task of
SeRE? How do we evaluate the quality of machine generated counterfactuals?

RQ3. Method for Counterfactual Explanations: How do we design an algorithm to
provide counterfactual explanations for the pairwise relevance pairs within
current SERP?

(a) A sample workflow of one edit.

(b) A closer look at the editing algorithm.

Figure 1. An overview of CFE2. Fig 1(a) shows a sample workflow of one edit.
CFE2 takes an query as input, then 1.A search model $\mathbf{S}$ generates a
SERP; for a document pair $(d,d^{\prime})$, 1.B masker $\mathbf{M}$ generates
importance score, then 1.C editor $\mathbf{E}$ performs editing. Fig 1(b)
shows a more detailed editing loop. 2.A the top-1 important token from query
is masked and masked query is prepended to counterfactual document and input
to editor; 2.B the editor predicts word and stores the candidate edits to beam
$\mathcal{B}$; then the editor checks flip, if not flip, 2.C it will mask one
more token and run word prediction/decoding again; if flip, then 2.D editing
is complete and editor will output the counterfactual query with lowest
perplexity.

To address these research questions, we (1) deploy an user study to validate
the effectiveness of counterfactuals. We find that adding human-written
counterfactuals to the prevalent titles+snippets SeRE paradigm can improve
users’ accuracy to find relevant documents from SERP with only minor
compromise of response time; (2) discuss the possible formulations of
counterfactual explanations in search systems and propose four design
principles with corresponding metrics for counterfactual explanations for SeRE
task; (3) correspondingly propose a model named Counterfactual Editing for
Search Result Explanation ($\text{CFE}^{2}$), overview shown in Figure 1. To
summarize, our contributions are:

  * •

We prove with a user study that counterfactual explanations can improve search
sessions’ effectiveness.

  * •

We operationalize four desiderata into corresponding evaluation metrics to
facilitate the validationy of counterfactual explanation for SeRE task.

  * •

We design an algorithm, named Counterfactual Editing for Search Result
Explanation ($\text{CFE}^{2}$) which performs better than baselines on both
automatic metrics and human evaluation.

The proposed method $\text{CFE}^{2}$ additionally has following strengths:

  * •

Plug and Play: $\text{CFE}^{2}$ is designed for blackbox setting, i.e. it
doesn’t depend on specific choices of underlying retrieval model and can serve
as plug-in component to existing ad hoc retrieval applications.

  * •

Min. Modification: $\text{CFE}^{2}$ can provide counterfactuals that are of
minimum modifications compared to original query $q$, satisfying the
definition of counterfactual explainability.

  * •

Zero shot: $\text{CFE}^{2}$ can use off-the-shelf transformer-based word
prediction model which requires no additional training and can work
effectively for queries from different corpus.

  * •

Scalability: $\text{CFE}^{2}$ is computationally efficient, meeting the low-
latency requirement of SeRE task.

##  2\. Related Work

Our related work flows from four sub-areas: (a) explainable AI and search, (b)
factual and counterfactual explanations, (c) contrastive editing and (d)
connection to query suggestion/reformulation. We show a comparison of
$\text{CFE}^{2}$ with other SeRE methods in Table 1.

Explainable AI and Search: By whether the explanations are generated by the
decision model itself, the existing explanation paradigms can be broadly
classified into two categories: model-intrinsic (or pre-hoc) explanations and
model-agnostic (or post-hoc) explanations (Madsen et al., 2021; Anand et al.,
2022). Rudin (Rudin, 2018) argues in favor of model-intrinsic explanations
(e.g. saliency attribution methods (Sundararajan et al., 2017)) for better
faithfulness and fidelity. However, intrinsically explainable systems often
introduce extra model complexity and challenge the search/retrieval systems’
low latency design principle. In this work, we opt to study post-hoc
explanation for search/retrieval, where we treat the underlying retrieval
model as a blackbox and no knowledge w.r.t. the model architecture or
parameters is known. But as we discussed in §5.4, the proposed method can also
be adapted to whitebox setting with minimum effort.

Table 1. Comparison with existing SeRE methods, ✓/✗ means depending on specific model configurations. Methods | Properties
---|---
Model-agnostic |  Counter- factual |  Minimum Modifi. |  Comp. Complex.
| Perturbation-based
---
methods (Singh and Anand, 2019, 2020; Verma and Ganguly, 2019)
✓ | ✗ | ✗ |  Medium
| Extractive
---
Snippets (Bast and Celikik, 2014; Turpin et al., 2007)
✓/✗ | ✗ | ✗ |  Low
| Abstractive
---
Snippets (Chen et al., 2020)
✓ | ✗ | ✗ |  High
| Query-biased
---
Summary (Tombros and Sanderson, 1998)
✓ | ✓/✗ | ✗ |  High
| Query-biased
---
Generation (Rahimi et al., 2021)
✓ | ✓/✗ | ✗ |  High
|  $\text{CFE}^{2}$ (Ours)
---
✓ | ✓ | ✓ |  Medium

Existing works on explainable search are mainly centered on answering the
questions such as (i) why is this document relevant to the query (pointwise)
i.e. to explain document’s relevance, (ii) why is this document ranked higher
than the other (pairwise)? i.e. to explain the ranking or (iii) why is this
set of documents returned (listwise)?

Works on pointwise explanation broadly falls into three categories: (a)
Snippet-based methods provide snippets (sentences or sentence fragments) as
explanations and have been provided in mainstream search engine applications
(Google, Bing, etc.) (Verstak and Acharya, 2012). It is also referred to as
query-biased summarization by Tombros and Sanderson (1998). Turpin et al.
(2007) propose to use snippets as explanations in search engine result page
(SERP). Bast and Celikik (2014) propose an algorithm to efficiently generate
extractive snippets based on Inverted Index data structure. More recently,
Chen et al. (2020) propose an abstractive snippet generation algorithm. (b)
NLG methods propose to generate natural language explanations separately to
explain documents’ relevance. GenEx (Rahimi et al., 2021) utilizes an encoder-
decoder structure to generate terse explanations in addition to extractive
snippets. (c) Perturbation-based methods perturb the input (query and
document) to create saliency maps to explain documents’ relevance. Verma and
Ganguly (2019) and Singh and Anand (2019) adapt LIME (Ribeiro et al., 2016) to
generate word-based explanations to explain one single document’s relevance
w.r.t. the search query.

Very few works are centered on pairwise explanations. Singh and Anand (2019)
propose EXS to explain pairwise ranking preference. They cast the ranking
problem to a binary classification problem, i.e. relevant/irrelevant and
perturb the words in documents to provide token-level explanations. The
explanation is in the shape of Document $d$ is more relevant than $d$’ because
of these words in $d$. In our work, we also aim to explain a neural ranker’s
pairwise preference but we focus on providing counterfactual explanations,
i.e. Document $d^{\prime}$ would be ranked higher than $d$ if you modify your
query $q$ to $q^{\prime}$. Thus, our method can provide users with ways to
understand model’s reasoning and take actions such as reformulating the query
to improve the search’s effectiveness.

To the best of our knowledge, LiEGe (Yu et al., 2022) is the only work that
aims to jointly explain the entire list of retrieved documents.

Factual and Counterfactual Explanation: Existing factual explanation (Tan et
al., 2022; Verma et al., 2020) methods mostly aim to find/generate supporting
evidence to explain model predictions. All works discussed were examples of
factual explanations. Some representative methods include input feature
attribution methods (Wallace et al., 2020; Shrikumar et al., 2017) and natural
language explanations (Wiegreffe et al., 2020). From causal inference
perspective, counterfactual explanation doesn’t directly answer the ”why” part
of prediction (Verma et al., 2020), but instead answers the what-if question,
i.e. what would the model predict if the current input is changed?

As discussed by Miller (2019) and Lipton (1990), human explanations are
contrastive from cognitive science perspective; people explain an observed
event using some counterfactual events. Cai et al. (2019) show that providing
example-based explanations such as counterfactual explanations can improve
system’s scrutability. Multiple works from NLP community (Wu et al., 2021;
Ross et al., 2020; Jacovi et al., 2021) have discussed the formulation and
usage of counterfactual explanations.

Within IR community, there has been very limited work on counterfactual
explainability. Shang et al. (2022) and Tan et al. (2021) study counterfactual
explanations for recommendation. PRINCE (Ghazimatin et al., 2020) is designed
to provide actionable and concise explanations for user actions. However,
whether and how counterfactual explanation can improve search systems remains
an open question. In this work, we answer this question by proposing a method
to generate counterfactual explanation and test it’s effectiveness to explain
the pairwise relevance from the retrieval model.

Contrastive Editing: Ross et al. (2020) proposed Minimum Contrastive Editing
(MiCE) method to explain NLP models. They prepend classification labels to
input text and apply a binary search method to find minimum modification to
input text to alter the prediction of the NLP classifier. Our method shares
similar design choices but is different from following perspective: (a) our
method is designed for ranking task compared to the classification task; (b)
MiCE operates on longer text input and uses a span infilling approach for
editing while our method operates on shorter queries and uses a different
token prediction approach. (c) MiCE uses gradient attribution method to select
important tokens to mask, which requires full knowledge w.r.t. the prediction
model. In contrast, our method utilizes a separate Masker model $\mathbf{M}$
to select important tokens thus operates in a blackbox setting and can serve
as a plug-in explanation method to any search/retrieval model.

Connection to Query Reformulation Methods: Modern search engines usually
include query reformulation entries on SERPs. Hassan et al. (2013) study
users’ query reformulation behaviors as an indicator of satisfaction in search
sessions. Hirsch et al. (2020) study the effect of query reformulation in
E-commerce search platforms. While both query reformulation methods and CFE2
provide counterfactual queries, the goal of query reformulation is to improve
search sessions’ effectiveness and facilitate users’ information seeking
process (Wu et al., 2018; Manning et al., 2008), but CFE2 aims to provide
explanations to the retrieved documents and their pairwise relevance
relations.

##  3\. Motivation & Problem Statement

In search systems, a counterfactual event is when a user issues a different
query, and subsequently the system retrieves a different set of documents.
Correspondingly, the contrastive cases can be generated by either retrieving
(1) different set of documents; or (2) different set of pairwise relevance
relations i.e. a previously lower ranked document is now ranked at a higher
position. This echoes the listwise and the pairwise explanation paradigm of
explainable search respectively. Since even a minor perturbation to the
original query is likely to result in a completely different set of documents
being retrieved, which is intractable as document collection size increases,
we will limit the scope of this study to only pairwise counterfactual
explanations. More specifically, we study the pairwise relevance relations
within the same current search engine result page, e.g. one document at a
higher rank position and one document at a lower rank position. We formulate
this problem, informally, as follows:

###### Informal Problem 1.

Generate a counterfactual query for a given counterfactual document such that
the counterfactual query is as close as the original query, and leads to
retrieving the counterfactual document ranked above the original document.

Though a lot of other studies have reported the effectiveness of
counterfactual explanations in other domains (Miller, 2019; Ross et al., 2020;
Tan et al., 2021; Ghazimatin et al., 2020; Jacovi et al., 2021), their effect
on search applications is still unknown. To study the usefulness of
counterfactual search explanations through the pairwise implementation (as
defined by the above mentioned problem formulation), we rely on user study. In
the rest of this section, we present the user study where we leverage
carefully hand-crafted counterfactual explanations and study its effectiveness
on search session. Since this is not the primary contribution of the paper, we
keep our descriptions concise.

Figure 2. Effect of counterfactual queries on search sessions’ effectiveness -
higher number of correct responses at a minor compromise in time taken to
choose the right document.

User Study: For the user study, we design a web app, where we present each
user with a pre-filled query and a set of top $5$ documents that were
retrieved from the collection of documents using BM25 (Robertson et al.,
2009). To imitate the layout of a Search Engine Result Page (SERP), for every
document we also show a snippet of text that serves as factual explanation to
explain the document’s relevance. Additionally, for each query and set of
documents, a human expert who was well-versed with the dataset also crafted
counterfactual queries for all documents besides the top document.
Furthermore, we ensured the system will rank the given document higher than
the original document with the constructed counterfactual queries.

Each user was asked to read through the pre-filled query and the set of
retrieved documents, and then choose the most relevant document that answers
the original query. Each incoming user was randomized for each query to see
either no counterfactual explanation (control) or counterfactual explanations
(treatment) on the SERP.222We show the screenshots of the web app in Appendix
A Additionally, we measured each user’s selection of what document is relevant
(to measure correctness) and the time to choose the correct document (to
measure effectiveness). We conduct user study through Amazon
MTurk333https://www.mturk.com/ and recruited $30$ participants who had varying
frequency of conducting searches using web platforms. Each MTurker was given
the link to the web app and responses were collected through the app. Each
participant was asked to go through $20$ queries that were coming from
ClimateFEVER (Diggelmann et al., 2020; Thakur et al., 2021). Additionally, we
also conducted attention checks for each user session and disqualified the
users who failed simple attention checks.

Findings: Based on the above mentioned user study, we compute two key metrics
i.e. (a) number of times the correct document was chosen and (b) time taken to
choose the correct document. We note that there were 14 out of 20 queries for
which the treatment group of users outperformed the control group of users in
terms of the correctness of relevance judgements. This shows that the users
were consistently finding the counterfactual explanations better than the
standard factual snippet based explanations. Similarly, we observed that for
the queries where both groups of users had non-zero correct answers, the
treatment group was faster than the control group in 9 out of 14 queries.
However, on average, the response time for correct queries for the treatment
group is marginally longer than the response time for the control group. Both
of the metrics averaged per query is shown in Figure 2. We hypothesize that
the relatively larger response time for the treatment group could also be due
to the fact that the user has to go and read significantly more text
(introduced by counterfactual queries) than the control group.

##  4\. Evaluation Principles and Metrics

From the user study in §3, we learn that human written counterfactual queries
can help in improving search sessions’ effectiveness. However, there are no
established principles or guidelines for generating and metrics for evaluating
counterfactual queries for search systems. In this section, we propose several
intuitive design principles, and propose metrics to validate each of those
principles for the task of generating counterfactual queries.

As mentioned earlier, for this paper, we focus on pairwise counterfactual
explanations for search systems, and we define the problem formally as below:

###### Problem Statement 1.

(1) Given: original query $q$, document pair $(d,d^{\prime})$ in a SERP, such
that $\textit{rel}(q,d)>\textit{rel}(q,d^{\prime})$, (2) Generate:
counterfactual query $q^{\prime}$ such that
$\textit{rel}(q^{\prime},d^{\prime})>\textit{rel}(q^{\prime},d)$.

Here, the modified query $q^{\prime}$ serves as a counterfactual query to the
original query $q$, and serves as an explanation to the original triplet
$(q,d,d^{\prime})$. Generating such a counterfactual explanation not only
provides explainability of why a search result is retrieved, but also produces
actionability (in terms of query reformulation) where the user can leverage
the counterfactual query $q^{\prime}$ to retrieve more documents similar to
$d^{\prime}$. A summary of all the symbols used is presented in Table 2.

Table 2. Table of symbols $q$, $d$, $\mathcal{D}$ |  query, document, set of all documents
---|---
$q^{\prime}$, $d^{\prime}$ |  counterfactual query, counterfactual document
$\mathbf{S}$, $\mathbf{M}$, $\mathbf{E}$ |  Search Model, Masker Model, Editor Model
$\textit{rel}(q,d)$ |  relevance score of document $d$ for query $q$ using the search model $\mathbf{S}$
$\pi(q)$ |  List of documents sorted by rel returned by search model $\mathbf{S}$ for query $q$
$\mathcal{B}$, $b$ |  Beam, beam size
$\textit{ppl.}(\cdot)$ |  Perplexity Calculator, computed by the mean perplexity of a sequence; a smaller value indicates the sequence is ”fluent” from natural language perspective

Desiderata: There has been significant work in coming up with an extensive and
agreeable list of desiderata for explainable systems (Miller, 2019; Jacovi and
Goldberg, 2020; Ross et al., 2020). It has been shown that counterfactual
explanations satisfy most of the desiderata (Miller, 2019). In this work, we
take into account some of the important desiderata factors and adapt them for
search systems. More importantly, we operationalize the relevant desiderata
factors to metrics such that given explanations can be evaluated properly. An
ideal counterfactual explanation method needs to have the following desiderata
- (a) Max #Flips: Our explanation system should be effective in achieving the
objective for which it is designed444also known as _soundness_ (Miller, 2019;
Lipton, 1990), i.e. it ensures that counterfactual query generated could flip
the ranking order of the original document with the counterfactual document
for all or most of the random document pairs in the collection. (b) Closeness:
the generated counterfactual query should be close i.e. semantically to the
original query. Ensuring that the generated counterfactual queries are close
to the original queries makes the explanations more intelligible and more
actionable for the end-user. Furthermore, it also ensures that with respect to
the original query, the so generated explanation ensures low complexity and
parsimony. (c) Fluency: It is imperative that the counterfactual query and
hence the explanation is fluent. Coherent and less complex queries are deemed
to be more useful (Miller, 2019) (d) Low Latency: We also need to enable the
counterfactual query generation system to provide explanations in real-time.
This ensures the counterfactual queries are _interactive_ and _actionable_ for
users.

Given the above desiderata, we operationalize the above factors into metrics
to judge the effectiveness of any proposed or existing methods. We detail them
below:

  * •

Flip Rate: the proportion of the edited counterfactual queries that satisfy
the objective i.e.
$\textit{rel}(q^{\prime},d^{\prime})>\textit{rel}(q^{\prime},d)$. This metric
captures the factor Max #Flip.

  * •

CosSim: Cosine Similarity computed between the vector representation of $q$
and $q^{\prime}$ from output of search model $\mathbf{S}$. It is bound to
$[0,1]$ where higher CosSim indicates higher similarity from $\mathbf{S}$
(optimizes for Closeness).

  * •

BERTScore-F1: BERTScore (Zhang et al., 2019) evaluates the semantic similarity
between two sequences using contextualized representations from a transformer-
based model. It has been widely used in evaluating generation tasks and
adopted by previous explainable search works (Yu et al., 2022). It is bound to
$[0,1]$ where higher BERTScore-F1 indicates higher semantic similarity
(optimizes for Closeness).

  * •

Fluency: we first use a large-scale pretrained language model GPT-2 (Radford
et al., 2019) to compute the mean perplexity of the generated counterfactual
and the original query, respectively; then we compute Fluency by

(1)
$\vspace{-2pt}\text{Fluency}=\textit{ppl.}(q^{\prime})/\textit{ppl.}(q)\vspace{-2pt}$

where $\textit{ppl.}(\cdot)$ denotes mean perplexity of a text sequence.
Fluency=1.0 is an ideal case indicating the counterfactual query is of the
same fluency as original query; 0¡Fluency¡1 means the generated counterfactual
is more fluent than original query (optimizes for Fluency).

  * •

Runtime: We also measure the average running time per edit (captures Latency).

We should note that these metrics are a comprehensive reflection of the
quality of counterfactual queries. Additionally, to check their coherency with
human’s understanding, we also include a human evaluation in experiments (§6).

##  5\. $\text{CFE}^{2}$: Counterfactual Explanation w. Editing

Given the desiderata in §4, we propose an approach of generating
counterfactual query, named Counterfactual Explanation with Editing (
$\text{CFE}^{2}$). Briefly, $\text{CFE}^{2}$ consists of three components:
Search Model $\mathbf{S}$, Masker Model $\mathbf{M}$ and the Editor Model
$\mathbf{E}$. First, $\mathbf{S}$ returns a SERP where $d$ is top-1 ranked
document. Then, masker $\mathbf{M}$ assigns each token in $q$ an importance
score. After that, for counterfactual document
$d^{\prime}\in(\pi_{q}\backslash d)$ (other documents returned by SERP),
Editor model $\mathbf{E}$ will edit the original query $q$ to generate
$q^{\prime}$. Fig 1 shows an overview of our framework and a sample editing
workflow.

###  5.1. Search Model $\mathbf{S}$

Since the proposed counterfactual explanation framework operates in a blackbox
setting, i.e. being model-agnostic and independent of the underlying search
model, we have the freedom to choose any search model we favor. In this paper,
we conduct all our experiments using CL-DRD (Zeng et al., 2022), a SOTA single
vector dense retrieval model based on DistilBERT (Sanh et al., 2019), but it
can also be replaced with other search models such as BM25 (Robertson et al.,
2009) or MonoT5 (Nogueira et al., 2020). For query $q$, $\mathbf{S}$ will
assign each document in $\mathcal{D}$ a ranking score and generate a ranklist
$\pi(q)$ correspondingly. The SERP for which we provide explanations, consists
of both the ranklist $\pi(q)$ and the query $q$.

###  5.2. Masker Model $\mathbf{M}$

The goal of the masker model $\mathbf{M}$ is to identify tokens in $q$ such
that they can be replaced with terms that alter the meaning of the query and
tries to achieve the objective of returning the counterfactual document over
the original document. To do this, we leverage a methodology that is similar
to ColBERT (Khattab and Zaharia, 2020), which is a dense retrieval model
designed for neural ad-hoc retrieval.

Given a query $q=q_{(1)}q_{(2)}\ldots q_{(l)}$ of $l$ tokens and a document
$d=d_{(1)}d_{(2)}\ldots d_{(n)}$ of $n$ tokens, we can get a bag of
contextualized token embeddings for each token in $q$ and $d$ from output of
BERT (Devlin et al., 2018), this we denote by $\mathbf{v}$. For each token
$q_{(i)}$ in $q$, we estimate its importance score $r_{i}$ by computing it as
follows:

(2)
$r_{i}=\max_{j\in|n|}\mathbf{v}_{q_{(i)}}\cdot\mathbf{v}_{d_{(j)}}^{\mathbf{T}}$

where $\mathbf{v}_{q_{(i)}}$ and $\mathbf{v}_{d_{(j)}}$ denote the
contextualized token embedding for $i$-th token in $q$ and $j$-th token in
$d$, respectively; $\max$ denotes a max pooling operation over all tokens in
$d$. Here the pooling operation indicates the per-token importance score
w.r.t. the whole document; and different $r_{i}$ indicates the contribution of
each token to the overall ranking score of $(q,d)$ pair, as computed by
$\textit{rel}(q,d)=\sum^{l}r_{i}$. We use $r_{i}$ as an approximation of
token-level importance of the query $q$.

###  5.3. Editing Algorithm

Given the input triplet $(q,d,d^{\prime})$, the task of counterfactual query
editing is to edit original query $q$ to a counterfactual query $q^{\prime}$.
We formulate counterfactual query editing task as a generation task for a
predefined number of $n$ tokens. Specifically, we try to find a counterfactual
query $q^{\prime}=q^{\prime}_{(1)},q^{\prime}_{(2)},\ldots q^{\prime}_{(l)}$
from original query $q=q_{(1)},q_{(2)},\ldots q_{(l)}$. First, we mask a few
important tokens in $q$ as measured by $r_{i}$, which is computed by the
masker model. Next, we run a word prediction algorithm (also known as Masked
Language Modeling task) to predict the masked tokens [MASK] in an
autoregressive manner. Since we may have multiple [MASK]s to predict and the
candidate space is the whole vocabulary $\mathcal{V}$, it is infeasible to
track all possible edits and rate them. Therefore, we leverage a common
technique in natural language generation - Beam Search to prune the search
space. In addition, given that we want to ensure Closeness (§2), we formulate
the algorithm as an iterative process, i.e. we start from only one [MASK]
token, and gradually increase the number of [MASK]s until we find an edit that
achieves the objective of returning document $d^{\prime}$ at a higher
relevance score than the original document $d$. We present the complete
editing algorithm in Algo. 1. Our method can be divided into three steps:

Step 1: Decoding (line 3-10): We start with replacing top-$n$ important tokens
as identified by $\mathbf{M}$ with [MASK] to get the masked query
$q^{\mathbf{M}}$; Then, we prepend $q^{\mathbf{M}}$ to the counterfactual
document $d^{\prime}$ and use the concatenated sequence as input to Editor
model $\mathbf{E}$. $\mathbf{E}$ will then run a pre-specified transformer
model to predict the masked tokens in an autoregressive manner.

To be more specific, at the start of timestep $t$, the beam $\mathcal{B}$
maintains a beam of $b$ possible edits $q^{\mathbf{E}}_{t-1}$ from the
previous timestep $t-1$. For each existing $q^{\mathbf{E}}_{t-1}$, the
probability of token $i$ being predicted at current timestep $t$ is computed
by normalizing the logits over token $i$ with a softmax function

(3)
$\textit{Prob}(i|q^{\mathbf{E}}_{t-1})=\frac{\exp(\textit{logit}_{i})}{\sum_{j=1}^{|\mathcal{V}|}\exp(\textit{logit}_{j})}$

where the denominator is computed over the whole vocabulary $\mathcal{V}$.

Then for each existing possible edit $q^{\mathbf{E}}_{t-1}$ in $\mathcal{B}$,
we add one of the corresponding $b$ most probable tokens, resulting in
$b\times b$ new possible edits. For these new possible edits, we compute the
new probabilities

(4)
$\textit{Prob}(q^{\mathbf{E}}_{t+1}=[q_{t}^{\mathbf{E}};i])=\textit{Prob}(q^{\mathbf{E}}_{t})\cdot\textit{Prob}(i)$

We sort the possible edits at current timestep by the newly computed
probabilities from Eq. 4 and again select the top-$b$ edits to refresh the
beam $\mathcal{B}$. Then we move to the next timestep $t$+1.555Given the
limited space, we can not put on a complete description of beam search, we
refer readers to (Reddy et al., 1977; Leblond et al., 2021) for more details.

Step 2: Checking (line 11-13): After one round of editing is completed, we
check all possible edits in $\mathcal{B}$. If there are edits that can flip
the results, i.e.
$\textit{rel}(q^{\prime},d^{\prime})>\textit{rel}(q^{\prime},d)$, we choose
among these edits the one with lowest perplexity computed by the Perplexity
Calculator $\textit{ppl.}(\cdot)$.

Step 3: Iterative Search (line 2-17): We start from masking one token and
perform step 1-2. If there are no edits in $\mathcal{B}$ that can flip the
results, we mask one more token and keep on repeating step 1-2 until an
available edit is found or there are no more tokens from $q$ that can be
masked.

The design choices of our editing algorithm echo our desiderata: (1) we start
the search for counterfactuals from one token such that we can achieve
Closeness; (2) we stop the search when a counterfactual can flip the result
such that the principle of Max #Flips is satisfied; (3) we choose the
counterfactual query with lowest perplexity among the candidates that can flip
the result to meet the Fluency principle. (4) We use word prediction model as
the backbone for Editor $\mathbf{E}$. In our implementation, we use a light
model
DistilBERTForMaskedLM666https://huggingface.co/docs/transformers/model_doc/distilbert,
which has a fully connected layer on top of a DistilBERT for word prediction
to meet the Low Latency principle. but it can also be replaced with other word
prediction algorithms (e.g. BERTForMaskedLM, etc.)

Algorithm 1 Detailed Editor Algorithm

1:Original query $q=q_{(1)},q_{(2)},\ldots,q_{(l-1)},q_{(l)}$,
$\mathbf{M}(q,d)=r_{1},r_{2},\ldots,r_{l}$, top-1 document $d$, desired
relevant document $d^{\prime}$,
$\textit{rel}(q,d)$¿$\textit{rel}(q,d^{\prime})$ and Perplexity Calculator
$\textit{ppl.}(\cdot)$,

2:Edited Query $q^{\prime}$

3:Initialize an empty beam $\mathcal{B}$

4:while $i$ in range(1,$n$+1) do

5: Mask top-$i$ important tokens in $q$ to get $q^{\mathbf{M}}$

6: Prepend masked $q^{\mathbf{M}}$ to desired document $d^{\prime}$ and input
to $\mathbf{E}$

7: Predict the top-$b$ tokens for timestep 1 and save $q^{\mathbf{E}_{1}}$ and
$\textit{Prob}(q^{\mathbf{E}_{1}})$ to beam $\mathcal{B}$

8: for timestep $t$ in range(2,$i$+1) do

9: Compute $\textit{Prob}(q^{\mathbf{E}_{t}})$ by Eq. 3 and Eq. 4.

10: Sort $\textit{Prob}(q^{\mathbf{E}_{t}})$, save top-$b$
$q^{\mathbf{E}_{t}}$ and $\textit{Prob}(q^{\mathbf{E}_{t}})$ to $\mathcal{B}$.

11: end for

12: $\Omega\leftarrow$ $q_{c}\in\mathcal{B}$ that satisfy
$\textit{rel}(q^{\prime},d^{\prime})$¿$\textit{rel}(q^{\prime},d)$

13: if $\Omega\neq\emptyset$ then

14: $q^{\prime}=\underset{q_{c}\in B}{\text{argmin}}\,\textit{ppl.}(q_{c})$.

15: break

16: else if $\Omega=\emptyset$ then

17: $i=i+1$

18: end if

19:end while

20:return Null if not $q^{\prime}$ else $q^{\prime}$

###  5.4. Discussions and Limitations

Finetuning on the Corpus of Target Dataset. It is well known that large scale
transformer-based language models can improve performance when finetuned on
the target dataset (Devlin et al., 2018; Roberts et al., 2019). In our
experiments, we also finetune DistilBERTForMaskedLM on our target dataset and
report its performance.

Is DistilBERT a Fair Comparison? One concern that readers may have is that our
editor model and search model both use DistilBERT as backbone, and this may
question the model-agnostic claim of the proposed methodology. To alleviate
this concern, we also experiment with off-the-shelf BERTForMaskedLM and report
its performance in Appendix C. The results show no significant performance
difference but significantly higher computational overhead as bert-base-
uncased has 110M parameters compared to distilbert-base-uncased’s 66M.
However, such concerns can be alleviated by using special hardware designed
for quick inference.

Can $\text{CFE}^{2}$ guarantee Minimum Modification? Unfortunately, the answer
is no. Effectively searching for targeted counterfactuals has been an open
challenge in machine learning (Dandl et al., 2020; Russell, 2019) and
especially challenging for natural language (Jacovi et al., 2021; Ross et al.,
2020) as space for possible perturbations is extremely huge. This prevents us
from guaranteeing that perturbation with exactly minimal modification has been
discovered. Therefore, we rely on approximating this search process as defined
in §5.3 Step 3.

Adapting $\text{CFE}^{2}$ to Whitebox setting. $\text{CFE}^{2}$ is designed
for blackbox setting, i.e. we assume no knowledge w.r.t. the underlying
retrieval model except for model input and output. Therefore, we rely on an
additional masker model $\mathbf{M}$ to estimate the query’s per token
importance score. In a whitebox setting where we have the knowledge of the
underlying retrieval model, i.e. its structure and parameters, we can easily
replace masker model $\mathbf{M}$ with saliency-based methods such as InteGrad
(Sundararajan et al., 2017) to estimate the per token importance scores.

##  6\. Experiments Setup

Table 3. Evaluation results of our method compared to baselines. Runtime is
measured by #seconds/edit, we highlight the best performance among the models
and * denotes statistically significant with paired t-test on all test pairs
at 0.05 level compared to the best baseline. Significance test of Fluency is
conducted upon —Fluency-1—.

Dataset | Metric | Mask-only | MaxFlip | Summary |  GenEx (Rahimi et al., 2021) |  $\text{CFE}^{2}$ w.o. finetune |  $\text{CFE}^{2}$ w. finetune
---|---|---|---|---|---|---|---
FEVER | Flip Rate | 0.868 | 0.997 | 0.979 | 0.941 | 0.999 | 0.999
CosSim | 0.900 | 0.844 | 0.883 | 0.894 | $\textbf{0.944}^{*}$ | $0.939^{*}$
BERTScore-F1 | 0.761 | 0.840 | 0.856 | 0.865 | $\textbf{0.949}^{*}$ | $0.944^{*}$
Fluency | 3.508 | 0.623 | 0.706 | 0.756 | $\textbf{0.972}^{*}$ | $0.834^{*}$
Runtime | 0.251 | 2.303 | 1.428 | 0.401 | $0.364^{*}$ | $0.364^{*}$
SciFact | Flip Rate | 0.690 | 1.000 | 0.986 | 0.990 | 1.000 | 1.000
CosSim | 0.695 | 0.838 | 0.869 | 0.838 | $0.963^{*}$ | $\textbf{0.967}^{*}$
BERTScore-F1 | 0.828 | 0.850 | 0.843 | 0.855 | $0.962$ | 0.966
Fluency | 32.212 | 0.386 | 3.160 | 1.491 | $1.478$ | $\textbf{1.370}^{*}$
Runtime | 1.598 | 2.734 | 1.639 | $\textbf{0.694}^{*}$ | 0.828 | 0.828
FiQA | Flip Rate | 0.888 | 0.996 | 0.973 | 0.899 | $\textbf{0.999}^{*}$ | $0.998$
CosSim | 0.924 | 0.832 | 0.889 | 0.849 | $0.957^{*}$ | $\textbf{0.959}^{*}$
BERTScore-F1 | 0.805 | 0.849 | 0.850 | 0.862 | $0.963^{*}$ | $\textbf{0.964}^{*}$
Fluency | 5.135 | 0.383 | 0.699 | 1.645 | $1.110^{*}$ | $\textbf{0.993}^{*}$
Runtime | 0.295 | 2.429 | 1.130 | 0.652 | $\textbf{0.352}^{*}$ | $\textbf{0.352}^{*}$
NQ | Flip Rate | 0.852 | 0.996 | 0.984 | 0.923 | $\textbf{0.999}^{*}$ | $0.998^{*}$
CosSim | 0.892 | 0.848 | 0.885 | 0.895 | $0.934^{*}$ | $\textbf{0.937}^{*}$
BERTScore-F1 | 0.728 | 0.835 | 0.834 | 0.875 | $\textbf{0.962}^{*}$ | $0.946^{*}$
Fluency | 3.236 | 0.420 | 0.952 | 1.554 | $1.159$ | $\textbf{1.012}^{*}$
Runtime | 0.247 | 2.682 | 1.285 | 0.441 | $\textbf{0.257}^{*}$ | $\textbf{0.257}^{*}$

Compared Methods: To the best of knowledge, this work is among the very first
to propose counterfactual explanations for ad hoc search system; and there are
no existing algorithms we can compare to directly (see Table 1). We conduct
experiments with following methods that are relatively closer to our setting:

  * •

MaxFlip: we first separate the counterfactual passage $d^{\prime}$ into
multiple sentences, and select the sentence with lowest perplexity from the
sentences that can flip the pairwise relevance from $\mathbf{S}$.

  * •

Summary: we use a pretrained T5 model to summarize the counterfactual passage
and use it as the counterfactual query.

  * •

GenEx (Rahimi et al., 2021): GenEx is originally designed to generate terse
abstractive explanations given $(q,d)$ pair and is trained using $(q,d,e)$
triplets where $e$ is golden reference explanations. The model utilizes a
customized encoder-decoder structure featured by a query-attention layer and
query-masked decoding. As we do not have access to $(q,d,q^{\prime})$ triplets
where counterfactual queries $q^{\prime}$ can be used as golden reference to
train the model, we disable the query-specific structures from original GenEx.
Instead, we train the encoder-decoder structure with only $(q,d)$ pairs from
trainset. To be more specific, we format the input by prepending a prompt to
$d$ and finetune the same encoder-decoder structure as GenEx to generate $q$.
Then in test stage, we prepend the same prompt to the counterfactual document
$d^{\prime}$ and ask the model to generate counterfactual query $q^{\prime}$.

  * •

Mask-only: this is an ablation of the proposed method without the Editing
phase, i.e. we only replace the [MASK] token(s) from the masked query with
[PAD] iteratively, until the counterfactual query can flip the pairwise
relevance from $\mathbf{S}$.

  * •

$\text{CFE}^{2}$ w.o. finetuning: the proposed method with off-the-shelf word
prediction model DistilBERTForMaskedLM.

  * •

$\text{CFE}^{2}$ w. finetuning: we finetune the DistilBERTForMaskedLM on the
corpus of the target dataset as an ablation. To be more specific, we construct
the training corpus using the passages from target collections and train the
model with masked language model objective the same as BERT (Devlin et al.,
2018) and DistilBERT (Sanh et al., 2019).

Human Evaluation: To analyze the quality of our counterfactual queries, and
thus the effectiveness of our proposed method, we conduct a human
evaluation.777Screenshot in Fig 6. In the study, annotators were recruited
through MTurk and were asked multiple questions comparing the queries
generated by the 2 methods i.e. our proposed method $\text{CFE}^{2}$ and
closest baseline method GenEx (Rahimi et al., 2021). The annotators were asked
to rate each of the query with respect to original query on the following
metrics (adapted from Natural Language Generation literature (Sai et al.,
2022; Stent et al., 2005; Peng et al., 2020)) - (a) fluency i.e. query being
natural, grammatically correct and are likely to be generated by a human (Sai
et al., 2022), (b) clarity - how easy it is to understand the intent behind
the query (Rosset et al., 2020), (c) closeness-semantic - how semantically
(i.e. in meaning) is the query close to the original query, and (d) closeness-
syntactic - how syntactically (i.e. in syntax) is the query close to the
original query. We run the study on $50$ queries, and each query got at least
$3$ different ratings for all of the metrics from unique workers.
Additionally, we included attention check in the study and disqualified
ratings from the workers who failed the attention check questions888Across all
metrics, we achieved Fleiss’ Kappa agreement rate ranging from $0.08$ (Slight
Agreement) to $0.22$ (Fair Agreement).

Table 4. Summary of datasets

| Train | Dev | Test | Avg. Word Lengths
---|---|---|---|---
Dataset | #Pairs | #Query | #Query | #Corpus | Query | Doc.
FEVER (Thorne et al., 2018) | 140,085 | 6,666 | 6,666 | 5,416,568 | 8.13 | 78.88
SciFact (Wadden et al., 2020) | 920 | - | 300 | 5,183 | 12.37 | 213.63
FiQA (Maia et al., 2018) | 14,166 | 500 | 648 | 57,638 | 10.77 | 132.32
NQ (Kwiatkowski et al., 2019) | 132,803 | - | 3,452 | 2,681,468 | 9.16 | 78.88

Datasets and Partitions: In our experiments, we use four datasets from BEIR
collection (Thakur et al., 2021). NQ (Kwiatkowski et al., 2019) is a question
answering dataset where queries are from Google search engine. FiQA (Maia et
al., 2018) is a QA dataset where queries and documents are collected from
StackExchange posts about investment topics. FEVER (Thorne et al., 2018) is a
claim based dataset built upon Wikipedia corpus; each query is a claim that
may be Supported, Refuted or NotEnoughInfo by a passage from the passage
collection. SciFact (Wadden et al., 2020) is a small scale claim based dataset
with the focus on scientific claims and passages. We skip MS MARCO passage
retrieval dataset (Nguyen et al., 2016; Bajaj et al., 2016) because MS MARCO
dataset’s corpus and shallow annotation strategy leads to lots of repeated
passages/false positives in the passage collection (Bajaj et al., 2016).

We present a summary of dataset statistics in Table 4. For FEVER and FiQA
dataset, we combine queries in dev set and test set to use for test. For each
query in our testset, we first use search model $\mathbf{S}$ to retrieve top-5
passages from passage collections; then we construct the test triplets
$(q,d,d^{\prime})$ using top-1 passage as $d$ and the rest four passages as
$d^{\prime}$, leading to $53328$, $1200$, $4592$ and $1808$ test triplets for
FEVER, SciFact, FiQA, NQ respectively. $\text{CFE}^{2}$ does not rely on
relevance judgements for training so we do not make use of the train pairs for
our method.

Implementation: Our implementation999We will make our implementation public
once this work is accepted is based on PyTorch101010https://pytorch.org/ and
HuggingFace111111https://huggingface.co/docs/transformers/index. We use
offcial checkpoints of CL-DRD and ColBERT as our search model $\mathbf{S}$ and
masker model $\mathbf{M}$ respectively; we use distilbert-base-uncased as our
editing model. For baselines we use t5-base for Summary baseline; we replicate
the structure of GenEx and disable the components that don’t fit our task. For
Editing w. finetuning, we use a standard $0.15$ mask ratio, $128$ block size,
$2e-5$ learning rate, $1e-3$ weight decay and train for multiple epochs on
each dataset. For GenEx, we use hyperparameters reported by the original
paper. For two claim based datasets, i.e. SciFact and FEVER, we use a prompt
of [Find a claim from this passage: ]; for two QA datasets, i.e. FiQA and NQ,
we use a prompt of [Ask a question about this passage: ]. For Summary, we use
$1e-4$ learning rate and no weight decay. We set beam size $b$ to 10 to
balance performance and computational complexity. The choice of beam size’s
effect is studied in §7 and result reported in Fig. 3. All our experiments are
conducted on a single AWS instance p3.2xlarge with 61 GiB of memory and a
single V100 GPU with 16 GiB memory unless otherwise specified. For evaluation,
we use gpt2-large (Radford et al., 2019) to compute fluency and use roberta-
base-uncased (Liu et al., 2019) to compute BERTScore.

##  7\. Result & Analysis

Can $\text{CFE}^{2}$ reach Max #Flips? We can observe from Table 3 that on all
four datasets, $\text{CFE}^{2}$ attains better flip rate compared to
baselines. For example, $\text{CFE}^{2}$ w.o. finetune can each $0.999$ flip
rate on FEVER, FiQA and NQ, and $1.0$ flip rate on SciFact compared to the
strongest baseline MaxFlip’s $0.997$, $0.996$, $0.996$, $1.0$. Interestingly,
we find that after finetuning the word prediction model on target collection,
performance of $\text{CFE}^{2}$ actually downgrades by $0.001$ on FiQA and NQ.
One potential reason is that finetuning makes the model pick up the specific
writing patterns in the target collections and makes it hard to distinguish
between hard negatives at the top ranks of SERP, leading to the slight
downgrade in flip rate.

Can $\text{CFE}^{2}$ reach Closeness? Here we study the CosSim and
BERTScore-F1 metric from Table 3. We notice that on all four datasets,
$\text{CFE}^{2}$ edits achieve significantly higher semantic similarity to the
original queries than the baselines. For example, on FEVER dataset,
$\text{CFE}^{2}$ w.o. finetune reaches $0.944$ CosSim and $0.949$ BERTScore-F1
compared to the best baseline GenEx’s $0.894$, $0.865$. We also discover that
finetuning can improve similarity, or subsequently minimize modifications as
such, but that effect varies across datasets. For example, finetuning leads to
a downgrade of $0.005$ on both CosSim and BERTScore-F1 on FEVER dataset, but
actually improves the scores by $0.004$ and $0.004$ respectively on SciFact
dataset. We hypothesize that this might be because SciFact’s corpus is domain
specific and very different from the pretraining corpus of DistilBERT, and
finetuning on domain specific dataset can improve its performance. The same
observation also holds for FiQA dataset, which is also a very specific
financial domain corpus.

Given the fact that $\text{CFE}^{2}$ operates by iteratively
$\texttt{Masking}\rightarrow\texttt{Predicting}$, one can easily see that the
edits from $\text{CFE}^{2}$ will be of similar length as that of original
query. Moreover, since we are replacing the masked tokens using algorithms
that are trained on the corpus, the meaning and lexical structure will also be
similar to those of original queries. Therefore we do not include lexical
similarity as a metric for fair comparison with baselines.121212The possible
options for lexical similarity evaluation are BLEU (Papineni et al., 2002),
ROGUE (Lin, 2004), Levenshtein Distance (Levenshtein et al., 1966) and Lexical
Tree Similarity (Zhang and Shasha, 1989). However, we do include lexical
similarity in our human evaluation (§7).

Figure 3. Effect of beam size on FiQA dataset where x-axis denotes beam size.
Runtime is measured by #seconds/edit. The line of CosSim overlaps the line of
BERTScore-F1.

Can $\text{CFE}^{2}$ generate Fluent edits? Recall our desiderata that the
counterfactual query should be fluent (low perplexity) by itself and should
have similar perplexity to the original query (details in Eq. 1). From Table 3
we can observe that CFE2 can generate edits that are close to 1 in terms of
Fluency. For example, CFE2 w.o. finetune reaches 0.972 fluency on FEVER
dataset compared to best baseline GenEx’s 0.756.

Another pattern is that after finetuning, CFE2 consistently improves in terms
of Fluency on four datasets. This is expected as previous works (Sanh et al.,
2019; Devlin et al., 2018) have shown that finetuning makes word prediction
models predict more coherent tokens, leading to low perplexity of the
sequences.

We notice that MaxFlip consistently outputs absolutely fluent counterfactuals
(low perplexity). This is because MaxFlip directly selects the lowest
perplexity sentence from the counterfactual document that can flip the
pairwise relevance. We also notice that generation-based baselines including
Summary and GenEx have higher perplexity on domain specific datasets. For
example, Summary has a very high Fluency of 3.160 on SciFact dataset. The
potential reason might be because we calculate perplexity with a pretrained
language model GPT2, which is not trained on such domain specific corpus, thus
it will assign high perplexity to the generated counterfactual queries from
generation-based baselines.

How does $\text{CFE}^{2}$ perform in terms of computational time? Ideally,
explanations on SERP should have low computation complexity to pair with the
low latency search system, and to also enable _interactivity_ and
_actionability_. We notice that on FEVER, FiQA and NQ, $\text{CFE}^{2}$ all
achieves significantly faster inference time than baselines. On SciFact,
$\text{CFE}^{2}$ is slightly slower than GenEx (0.828 seconds/edit compared to
0.694). This is because SciFact queries are long (avg 12.37 words/query from
Table 4) and $\text{CFE}^{2}$ needs multiple iterations to find a good enough
edit. Since real world queries are often terse (Zamani et al., 2020), it is
safe to conclude $\text{CFE}^{2}$ can better meet the low latency design
principle compared to baselines.

How does beam size affect editing performance and runtime? In Figure 3, we
study the sensitivity of the performance due to change in beam size. We
observe that as beam size increases from $5$ to $10$, the fluency quickly
converges to $1$. In addition to this, CosSim, BERTScore-F1 and Flip Rate only
achieve minor improvement. However, the runtime increases as beam size
increases since each word prediction takes $b\times b$ forward passes. Thus,
we choose $b=10$ for all our experiments. The figure shows that different beam
sizes do not affect end metrics in a significant manner showing the robustness
of the framework to the hyperparameters.

Table 5. Effect of rank positions on $\text{CFE}^{2}$ w.o. finetune’s editing performance on FiQA dataset, the rank positions of counterfactual documents are 2-5 repsectively. We highlight the best numbers. Counter. Doc. Rank | 2 | 3 | 4 | 5
---|---|---|---|---
Flip Rate | 1.0000 | 1.0000 | 1.0000 | 0.9992
CosSim | 0.9636 | 0.9596 | 0.9576 | 0.9564
BERTScore-F1 | 0.9685 | 0.9661 | 0.9644 | 0.9631
Fluency | 1.0624 | 1.0729 | 1.1448 | 1.0860
Table 6. Results from human evaluation. p-value are calculated by Wilcoxon signed-rank test (Wilcoxon, 1992). Metric | GenEx (Rahimi et al., 2021) | $\text{CFE}^{2}$ | p-value
---|---|---|---
Fluency | $3.76\pm 0.97$ | $3.83\pm 0.93$ | 1.25e-11
Clarity | $3.59\pm 0.92$ | $3.88\pm 0.95$ | 1.51e-100
Semantic Closeness | $3.12\pm 1.12$ | $3.64\pm 0.88$ | 2.50e-198
Syntactic Closeness | $3.35\pm 1.08$ | $3.61\pm 0.87$ | 8.73e-61

Do rank positions affect editing performance? In Table 5 we show a comparision
of editing performance between different rank positions of the counterfactual
documents. For all rank positions, we observe no siginificant difference in
terms of Flip Rate. In fact, $\text{CFE}^{2}$ only fails to flip the pairwise
relation in 1 out of 1148 instances. In terms of CosSim and BERTScore-F1, we
observe a clear trend that similarity decreases along ranks, although the
difference is minimal. This pattern is anticipated since the original ranking
algorithm CL-DRD relies on Maximum Inner Product Search (MIPS) to construct
the ranklists, thus the lower ranked documents are less similar to the query,
leading to less similar counterfactual queries. We also observe that Fluency
slightly downgrades along ranks. One possible interpretation is that the lower
ranked documents are less similar to the original query, leading to less
similar counterfactual queries in terms of Fluency (higher perplexity compared
to the original query).

Mask-only vs Mask-Edit. We also want to know how important is the Editing
phase of $\text{CFE}^{2}$, therefore we add a simple ablation where we only
mask the original query and report the corresponding metrics. From Table 3 we
can observe the $\text{CFE}^{2}$ w.o. finetune significantly outperforms the
Mask-only ablation in terms of Flip Rate, CosSim, BERTScore-F1 and Fluency,
while the increased latency is minor. This in return proves the importance of
the Editing phase of $\text{CFE}^{2}$.

Human Evaluation: We report the human evaluation in Table 6. We can observe
that among all four metrics, $\text{CFE}^{2}$ edits significantly outperform
edits from GenEx. These results are in alignment with metrics from Table 3 and
validate that the proposed metrics are a good reflection of the generated
counterfactual queries’ quality.

##  8\. Conclusion and Future Work

In this work we study the effectiveness of counterfactual explanations for
search engine result explanation task. First, we conduct a preliminary user
study to validate if adding counterfactual queries as explanations can improve
search sessions’ effectiveness. Next, we discuss desiderata for counterfactual
explanations in search system and operationalize them with appropriate
metrics. Ultimately, we propose $\text{CFE}^{2}$, a framework to automatically
generate counterfactual queries by editing original queries. The proposed
method achieves significant improvement compared to baselines on the proposed
evaluation metrics. Additionally, the effectiveness of the proposed method is
also shown through human evaluation study. For future work, we hope to study
the effectiveness of the $\text{CFE}^{2}$ for the end use-case of query
suggestion/reformulation.

## References

  * (1)
  * Anand et al. (2022) Avishek Anand, Lijun Lyu, Maximilian Idahl, Yumeng Wang, Jonas Wallat, and Zijian Zhang. 2022\.  Explainable Information Retrieval: A Survey.  _arXiv preprint arXiv:2211.02405_ (2022).
  * Bajaj et al. (2016) Payal Bajaj, Daniel Campos, Nick Craswell, Li Deng, Jianfeng Gao, Xiaodong Liu, Rangan Majumder, Andrew McNamara, Bhaskar Mitra, Tri Nguyen, et al. 2016\.  Ms marco: A human generated machine reading comprehension dataset.  _arXiv preprint arXiv:1611.09268_ (2016).
  * Bast and Celikik (2014) Hannah Bast and Marjan Celikik. 2014.  Efficient index-based snippet generation.  _ACM Transactions on Information Systems (TOIS)_ 32, 2 (2014), 1–24.
  * Cai et al. (2019) Carrie J Cai, Jonas Jongejan, and Jess Holbrook. 2019\.  The effects of example-based explanations in a machine learning interface. In _Proceedings of the 24th international conference on intelligent user interfaces_. 258–262.
  * Chen et al. (2020) Wei-Fan Chen, Shahbaz Syed, Benno Stein, Matthias Hagen, and Martin Potthast. 2020.  Abstractive snippet generation. In _Proceedings of The Web Conference 2020_. 1309–1319.
  * Dandl et al. (2020) Susanne Dandl, Christoph Molnar, Martin Binder, and Bernd Bischl. 2020.  Multi-objective counterfactual explanations. In _International Conference on Parallel Problem Solving from Nature_. Springer, 448–469.
  * Devlin et al. (2018) Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018.  Bert: Pre-training of deep bidirectional transformers for language understanding.  _arXiv preprint arXiv:1810.04805_ (2018).
  * Diggelmann et al. (2020) Thomas Diggelmann, Jordan Boyd-Graber, Jannis Bulian, Massimiliano Ciaramita, and Markus Leippold. 2020\.  Climate-fever: A dataset for verification of real-world climate claims.  _arXiv preprint arXiv:2012.00614_ (2020).
  * Ghazimatin et al. (2020) Azin Ghazimatin, Oana Balalau, Rishiraj Saha Roy, and Gerhard Weikum. 2020.  PRINCE: Provider-side interpretability with counterfactual explanations in recommender systems. In _Proceedings of the 13th International Conference on Web Search and Data Mining_. 196–204.
  * Hassan et al. (2013) Ahmed Hassan, Xiaolin Shi, Nick Craswell, and Bill Ramsey. 2013\.  Beyond clicks: query reformulation as a predictor of search satisfaction. In _Proceedings of the 22nd ACM international conference on Information & Knowledge Management_. 2019–2028.
  * Hirsch et al. (2020) Sharon Hirsch, Ido Guy, Alexander Nus, Arnon Dagan, and Oren Kurland. 2020.  Query reformulation in E-commerce search. In _Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval_. 1319–1328.
  * Jacovi and Goldberg (2020) Alon Jacovi and Yoav Goldberg. 2020.  Towards faithfully interpretable NLP systems: How should we define and evaluate faithfulness?  _arXiv preprint arXiv:2004.03685_ (2020).
  * Jacovi et al. (2021) Alon Jacovi, Swabha Swayamdipta, Shauli Ravfogel, Yanai Elazar, Yejin Choi, and Yoav Goldberg. 2021.  Contrastive explanations for model interpretability.  _arXiv preprint arXiv:2103.01378_ (2021).
  * Khattab and Zaharia (2020) Omar Khattab and Matei Zaharia. 2020.  Colbert: Efficient and effective passage search via contextualized late interaction over bert. In _Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval_. 39–48.
  * Kwiatkowski et al. (2019) Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. 2019\.  Natural questions: a benchmark for question answering research.  _Transactions of the Association for Computational Linguistics_ 7 (2019), 453–466.
  * Leblond et al. (2021) Rémi Leblond, Jean-Baptiste Alayrac, Laurent Sifre, Miruna Pislar, Jean-Baptiste Lespiau, Ioannis Antonoglou, Karen Simonyan, and Oriol Vinyals. 2021.  Machine translation decoding beyond beam search.  _arXiv preprint arXiv:2104.05336_ (2021).
  * Levenshtein et al. (1966) Vladimir I Levenshtein et al. 1966\.  Binary codes capable of correcting deletions, insertions, and reversals. In _Soviet physics doklady_ , Vol. 10. Soviet Union, 707–710.
  * Lin (2004) Chin-Yew Lin. 2004\.  Rouge: A package for automatic evaluation of summaries. In _Text summarization branches out_. 74–81.
  * Lin et al. (2021) Jimmy Lin, Rodrigo Nogueira, and Andrew Yates. 2021\.  Pretrained transformers for text ranking: Bert and beyond.  _Synthesis Lectures on Human Language Technologies_ 14, 4 (2021), 1–325.
  * Lipton (1990) Peter Lipton. 1990\.  Contrastive explanation.  _Royal Institute of Philosophy Supplements_ 27 (1990), 247–266.
  * Liu et al. (2019) Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019.  Roberta: A robustly optimized bert pretraining approach.  _arXiv preprint arXiv:1907.11692_ (2019).
  * Madsen et al. (2021) Andreas Madsen, Siva Reddy, and Sarath Chandar. 2021\.  Post-hoc Interpretability for Neural NLP: A Survey.  _arXiv preprint arXiv:2108.04840_ (2021).
  * Maia et al. (2018) Macedo Maia, Siegfried Handschuh, André Freitas, Brian Davis, Ross McDermott, Manel Zarrouk, and Alexandra Balahur. 2018.  Www’18 open challenge: financial opinion mining and question answering. In _Companion proceedings of the the web conference 2018_. 1941–1942.
  * Manning et al. (2008) Christopher D Manning, Prabhakar Raghavan, and Hinrich Schütze. 2008.  _Introduction to information retrieval_.  Cambridge university press.
  * Mi and Jiang (2019) Siyu Mi and Jiepu Jiang. 2019.  Understanding the interpretability of search result summaries. In _Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval_. 989–992.
  * Miller (2019) Tim Miller. 2019\.  Explanation in artificial intelligence: Insights from the social sciences.  _Artificial intelligence_ 267 (2019), 1–38.
  * Nguyen et al. (2016) Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. 2016.  MS MARCO: A human generated machine reading comprehension dataset. In _CoCo@ NIPs_.
  * Nogueira et al. (2020) Rodrigo Nogueira, Zhiying Jiang, and Jimmy Lin. 2020.  Document ranking with a pretrained sequence-to-sequence model.  _arXiv preprint arXiv:2003.06713_ (2020).
  * Papineni et al. (2002) Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002\.  Bleu: a method for automatic evaluation of machine translation. In _Proceedings of the 40th annual meeting of the Association for Computational Linguistics_. 311–318.
  * Peng et al. (2020) Baolin Peng, Chenguang Zhu, Chunyuan Li, Xiujun Li, Jinchao Li, Michael Zeng, and Jianfeng Gao. 2020.  Few-shot natural language generation for task-oriented dialog.  _arXiv preprint arXiv:2002.12328_ (2020).
  * Radford et al. (2019) Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019\.  Language models are unsupervised multitask learners.  _OpenAI blog_ 1, 8 (2019), 9.
  * Rahimi et al. (2021) Razieh Rahimi, Youngwoo Kim, Hamed Zamani, and James Allan. 2021\.  Explaining Documents’ Relevance to Search Queries.  _arXiv preprint arXiv:2111.01314_ (2021).
  * Ramos and Eickhoff (2020) Jerome Ramos and Carsten Eickhoff. 2020.  Search result explanations improve efficiency and trust. In _Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval_. 1597–1600.
  * Reddy et al. (1977) D Raj Reddy et al. 1977\.  Speech understanding systems: A summary of results of the five-year research effort.  _Department of Computer Science. Camegie-Mell University, Pittsburgh, PA_ 17 (1977), 138\.
  * Ribeiro et al. (2016) Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2016\.  Model-agnostic interpretability of machine learning.  _arXiv preprint arXiv:1606.05386_ (2016).
  * Roberts et al. (2019) Adam Roberts, Colin Raffel, Katherine Lee, Michael Matena, Noam Shazeer, Peter J Liu, Sharan Narang, Wei Li, and Yanqi Zhou. 2019.  Exploring the limits of transfer learning with a unified text-to-text transformer.  (2019).
  * Robertson et al. (2009) Stephen Robertson, Hugo Zaragoza, et al. 2009\.  The probabilistic relevance framework: BM25 and beyond.  _Foundations and Trends® in Information Retrieval_ 3, 4 (2009), 333–389.
  * Ross et al. (2020) Alexis Ross, Ana Marasović, and Matthew E Peters. 2020\.  Explaining nlp models via minimal contrastive editing (mice).  _arXiv preprint arXiv:2012.13985_ (2020).
  * Rosset et al. (2020) Corbin Rosset, Chenyan Xiong, Xia Song, Daniel Campos, Nick Craswell, Saurabh Tiwary, and Paul Bennett. 2020.  Leading conversational search by suggesting useful questions. In _Proceedings of The Web Conference 2020_. 1160–1170.
  * Rudin (2018) Cynthia Rudin. 2018\.  Please stop explaining black box models for high stakes decisions.  _stat_ 1050 (2018), 26.
  * Russell (2019) Chris Russell. 2019\.  Efficient search for diverse coherent explanations. In _Proceedings of the Conference on Fairness, Accountability, and Transparency_. 20–28.
  * Sai et al. (2022) Ananya B Sai, Akash Kumar Mohankumar, and Mitesh M Khapra. 2022\.  A survey of evaluation metrics used for NLG systems.  _ACM Computing Surveys (CSUR)_ 55, 2 (2022), 1–39.
  * Sanh et al. (2019) Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2019.  DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter.  _arXiv preprint arXiv:1910.01108_ (2019).
  * Shang et al. (2022) Ruoxi Shang, KJ Kevin Feng, and Chirag Shah. 2022.  Why Am I Not Seeing It? Understanding Users’ Needs for Counterfactual Explanations in Everyday Recommendations. In _2022 ACM Conference on Fairness, Accountability, and Transparency_. 1330–1340.
  * Shrikumar et al. (2017) Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. 2017\.  Learning important features through propagating activation differences. In _International conference on machine learning_. PMLR, 3145–3153.
  * Singh and Anand (2019) Jaspreet Singh and Avishek Anand. 2019.  Exs: Explainable search using local model agnostic interpretability. In _Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining_. 770–773.
  * Singh and Anand (2020) Jaspreet Singh and Avishek Anand. 2020.  Model agnostic interpretability of rankers via intent modelling. In _Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency_. 618–628.
  * Stent et al. (2005) Amanda Stent, Matthew Marge, and Mohit Singhai. 2005\.  Evaluating evaluation methods for generation in the presence of variation. In _international conference on intelligent text processing and computational linguistics_. Springer, 341–351.
  * Sundararajan et al. (2017) Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017.  Axiomatic attribution for deep networks. In _International conference on machine learning_. PMLR, 3319–3328.
  * Tan et al. (2022) Juntao Tan, Shijie Geng, Zuohui Fu, Yingqiang Ge, Shuyuan Xu, Yunqi Li, and Yongfeng Zhang. 2022.  Learning and evaluating graph neural network explanations based on counterfactual and factual reasoning. In _Proceedings of the ACM Web Conference 2022_. 1018–1027.
  * Tan et al. (2021) Juntao Tan, Shuyuan Xu, Yingqiang Ge, Yunqi Li, Xu Chen, and Yongfeng Zhang. 2021\.  Counterfactual explainable recommendation. In _Proceedings of the 30th ACM International Conference on Information & Knowledge Management_. 1784–1793.
  * Thakur et al. (2021) Nandan Thakur, Nils Reimers, Andreas Rücklé, Abhishek Srivastava, and Iryna Gurevych. 2021\.  BEIR: A heterogenous benchmark for zero-shot evaluation of information retrieval models.  _arXiv preprint arXiv:2104.08663_ (2021).
  * Thorne et al. (2018) James Thorne, Andreas Vlachos, Christos Christodoulopoulos, and Arpit Mittal. 2018.  Fever: a large-scale dataset for fact extraction and verification.  _arXiv preprint arXiv:1803.05355_ (2018).
  * Tombros and Sanderson (1998) Anastasios Tombros and Mark Sanderson. 1998.  Advantages of query biased summaries in information retrieval. In _Proceedings of the 21st annual international ACM SIGIR conference on Research and development in information retrieval_. 2–10.
  * Turpin et al. (2007) Andrew Turpin, Yohannes Tsegay, David Hawking, and Hugh E Williams. 2007.  Fast generation of result snippets in web search. In _Proceedings of the 30th annual international ACM SIGIR conference on Research and development in information retrieval_. 127–134.
  * Verma and Ganguly (2019) Manisha Verma and Debasis Ganguly. 2019.  LIRME: locally interpretable ranking model explanation. In _Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval_. 1281–1284.
  * Verma et al. (2020) Sahil Verma, John Dickerson, and Keegan Hines. 2020\.  Counterfactual explanations for machine learning: A review.  _arXiv preprint arXiv:2010.10596_ (2020).
  * Verstak and Acharya (2012) Alexandre A Verstak and Anurag Acharya. 2012.  Generation of document snippets based on queries and search results.  US Patent 8,145,617.
  * Wachter et al. (2017) Sandra Wachter, Brent Mittelstadt, and Chris Russell. 2017\.  Counterfactual explanations without opening the black box: Automated decisions and the GDPR.  _Harv. JL & Tech._ 31 (2017), 841.
  * Wadden et al. (2020) David Wadden, Shanchuan Lin, Kyle Lo, Lucy Lu Wang, Madeleine van Zuylen, Arman Cohan, and Hannaneh Hajishirzi. 2020.  Fact or fiction: Verifying scientific claims.  _arXiv preprint arXiv:2004.14974_ (2020).
  * Wallace et al. (2020) Eric Wallace, Matt Gardner, and Sameer Singh. 2020\.  Interpreting Predictions of NLP Models. In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Tutorial Abstracts_. 20–23.
  * Wiegreffe et al. (2020) Sarah Wiegreffe, Ana Marasović, and Noah A Smith. 2020\.  Measuring association between labels and free-text rationales.  _arXiv preprint arXiv:2010.12762_ (2020).
  * Wilcoxon (1992) Frank Wilcoxon. 1992\.  Individual comparisons by ranking methods.  In _Breakthroughs in statistics_. Springer, 196–202.
  * Wu et al. (2018) Bin Wu, Chenyan Xiong, Maosong Sun, and Zhiyuan Liu. 2018\.  Query suggestion with feedback memory network. In _Proceedings of the 2018 World Wide Web Conference_. 1563–1571.
  * Wu et al. (2021) Tongshuang Wu, Marco Tulio Ribeiro, Jeffrey Heer, and Daniel S Weld. 2021.  Polyjuice: Generating counterfactuals for explaining, evaluating, and improving models.  _arXiv preprint arXiv:2101.00288_ (2021).
  * Yu et al. (2022) Puxuan Yu, Razieh Rahimi, and James Allan. 2022.  Towards Explainable Search Results: A Listwise Explanation Generator. In _Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval_. 669–680.
  * Zamani et al. (2020) Hamed Zamani, Susan Dumais, Nick Craswell, Paul Bennett, and Gord Lueck. 2020.  Generating clarifying questions for information retrieval. In _Proceedings of the web conference 2020_. 418–428.
  * Zeng et al. (2022) Hansi Zeng, Hamed Zamani, and Vishwa Vinay. 2022.  Curriculum Learning for Dense Retrieval Distillation.  _arXiv preprint arXiv:2204.13679_ (2022).
  * Zhang and Shasha (1989) Kaizhong Zhang and Dennis Shasha. 1989.  Simple fast algorithms for the editing distance between trees and related problems.  _SIAM journal on computing_ 18, 6 (1989), 1245–1262.
  * Zhang et al. (2019) Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. 2019.  Bertscore: Evaluating text generation with bert.  _arXiv preprint arXiv:1904.09675_ (2019).

##  Appendix A User Study Details

We present screenshot of two sample pages of the user study in Figure 4
(Counterfactual) and Figure 5 (Non-Counterfactual).

##  Appendix B Human Evaluation

We present screenshot of human user study in Figure 6.

##  Appendix C Effect of Different Word Prediction Algorithm

Table 7. Performance Comparison between CFE2 with not finetuned DistilBERT and
CFE2 with not finetuned BERT. Beam size is set to 10 for both models.

Dataset | Metric | DistilBERT w.o. finetune | BERT w.o finetune
---|---|---|---
FEVER | Flip Rate | $0.999$ | $0.999$
CosSim | $0.944$ | $0.949$
BERTScore-F1 | $0.949$ | $0.955$
Fluency | $0.972$ | $0.951$
Runtime | $0.364$ | $0.504$
SciFact | Flip Rate | 1.000 | $1.000$
CosSim | $0.963$ | $0.967$
BERTScore-F1 | $0.962$ | $0.964$
Fluency | $1.478$ | $1.472$
Runtime | 0.828 | $1.603$
FiQA | Flip Rate | $0.999$ | $0.999$
CosSim | $0.957$ | $9.959$
BERTScore-F1 | $0.963$ | $0.960$
Fluency | $1.110$ | $1.055$
Runtime | $0.352$ | $0.503$
NQ | Flip Rate | $0.999$ | $0.999$
CosSim | $0.934$ | $0.935$
BERTScore-F1 | $0.962$ | $0.961$
Fluency | $1.159$ | $1.112$
Runtime | $0.257$ | $0.398$

We can observe from Table 7 that BERT only achieves minor improvement compared
to DistilBERT in terms of CosSim, BERTScore-F1 and Fluency, and have the same
performance in terms of Flip Rate on all four datasets. In contrast, we
observe CFE2 based on BERT is significantly slower than DistilBERT. For
example, it takes 38.4% more time per edit on FEVER dataset. Therefore, we
conclude that CFE2 with DistilBERT better meets our desiderata.

Figure 4. User Study - Counterfactual Query Page Figure 5. User Study -
NonCounterfactual Query Page Figure 6. Screenshot of Annotation Task. You can
notice the last question being an attention check.