\section{Introduction}
\label{sec:intro}

Researchers spend considerable time exploring sources to understand key arguments, concepts and facts about a specific topic.
For example, surveys show that many legal researchers, recruitment professionals, and healthcare researchers require high-recall Boolean or structured queries over domain-specific collections \cite{russell2018information}.
In contrast, \texttt{CODEC}\xspace focuses on researchers within social sciences (History, Economics, and Politics) to develop complex topics that can be satisfied by web documents and entities within standard knowledge bases (i.e. Wikipedia).

Figure \ref{fig:topic} shows an example topic, where a financial researcher wants to understand \textit{How has the UK's Open Banking Regulation benefited Challenger Banks?}. The researcher would use a standard commercial search engine to identify valuable information, reformulating queries to investigate varying dimensions of the topic, e.g. `Open Banking products', `Challenger Banks fundraising', etc.
Through this iterative process, the researcher is trying to identify useful sources (i.e. documents) and understand the critical concepts (i.e. entities).
\texttt{CODEC}\xspace \footnote{available at \url{https://github.com/grill-lab/CODEC} and \textit{ir-datasets} \cite{macavaney:sigir2021-irds}} is a dataset that seeks to benchmark document and entity ranking on complex long-form essay questions.

\begin{figure}[h!]
    \centering
    \includegraphics[scale=0.25]{images/econ_topic.png}
    \caption{Example \texttt{CODEC}\xspace topic: economics-1.}
    \label{fig:topic}
\end{figure}

\begin{figure*}[h!]
    \centering
    \includegraphics[scale=0.8]{images/overview.pdf}
    \caption{Overview of \texttt{CODEC}\xspace. Social science researchers develop topics based on new complex topic criteria. Annotators assess initial pooled runs before using an interactive search system to issue manual queries and explore the topic. Documents are from \texttt{CODEC}\xspace's focused web document collection and entities from KILT's \cite{petroni2021kilt} version of Wikipedia.}
    \label{fig:overview}
\end{figure*}

Studies show that a large proportion of information needs are about entities or relate to entities \cite{kumar2010characterization, guo2009named}.
This is particularly true for essay-style questions across social sciences, where the information need generally focuses on key events (e.g. \textit{How close did the world come to nuclear war during the Cuban Missile Crisis?}), people (e.g. \textit{How did Colin Kaepernick impact the political discourse about racism in the United States?}), or things (e.g. \textit{What technological challenges does Bitcoin face to becoming a widely used currency?}).
Previous work demonstrates that incorporating entity-based information improves ad-hoc retrieval, with the most notable improvements made on complex topics \cite{Dalton2014EntityQF}.

COmplex Document and Entity Collection (\texttt{CODEC}\xspace) supports two distinct tasks: document ranking and entity ranking.
Document ranking is the task, given an information need $Q$, to return a relevance-ranked list of documents $[D_1,...,D_N]$ from a document corpus $C_D$.
Entity ranking is the task, given an information need $Q$, to return a relevance-ranked list of entities $[E_1,..,E_N]$ from an entity knowledge base $KB_E$.
Entity links between the documents and entities provide structured connections between both tasks.
We also release the manual query reformulations from the researcher annotating the topic with mapped relevance judgments.
Figure \ref{fig:overview} shows the setup of these tasks.
Although tasks can be undertaken independently, \texttt{CODEC}\xspace has aligned document and entity judgments to allow joint exploration of these tasks.
This setup will allow researchers to leverage \texttt{CODEC}\xspace to target two key limitations of current neural ranking models:

\textbf{(1) Entity-centric representations:} Prior work has shown that ad-hoc retrieval \cite{Dalton2014EntityQF, xiong2017word} and entity ranking \cite{dietz2019ent} can be improved by leveraging entity information.
Yet, current state-of-the-art methods rely solely on text representations and lack the understanding of entities and their relationships.
For example, dense retrieval underperforms BM25 on even simple entity queries \cite{sciavolino2021simple}.
\texttt{CODEC}\xspace provides aligned document and entity judgments that are unified through entity-linking connections.
For example, we demonstrate simple entity-based query expansion statistically improves MAP and Recall@1000 for document retrieval over strong initial retrieval systems.
\texttt{CODEC}\xspace enables entity-centric ranking models to be developed on complex topics.

\textbf{(2) Complex topics:}
Compared to easier general factoid or short keyword queries \cite{huston2010evaluating}, \texttt{CODEC}\xspace curates long natural-language queries where relevant topic information spans many entities and documents.
Figure \ref{fig:topic} shows an example topic query and narrative.
\texttt{CODEC}\xspace queries average 12.5 words in length, considerably longer than many datasets, i.e. TREC Deep Learning \cite{craswell2021overview} averages 5.8 words.
We also deliberately do not release shorter keyword `title' queries, such as TREC CORE \cite{core2017trec} and TREC Robust \cite{Voorhees_TREC2004_robust}, to challenge end-to-end ranking on long, natural language queries.

We develop new complex topic criteria to produce topics that require deep knowledge and research to identify the key facts and arguments.
Using topic narratives as a proxy for topic complexity, these contain on average 143.4 words and 23.7 explicitly mentioned entities.
Annotators also required, on average, 9.2 manual query reformulations to reasonably understand these topics.

These query reformulations are released to allow the development of query expansion and query reformulation on complex topics.
We show that query expansion using the query reformulations significantly improves MAP and Recall@1000 on document ranking and MAP, NDCG@10 and Recall@1000 on entity ranking. Additionally, we find the best manual reformulation performs better than the original query.

Figure \ref{fig:overview} shows the \texttt{CODEC}\xspace dataset creation process that is designed for entity-centric ranking over complex topics.
Social science experts across History (History teacher, History scholar), Economics (trader, accountant, investment banker) and Politics (political scientist, politician) generate 42 topics based on the developed criteria.

Experts also suggest 24 focused research websites for the corpus.
Topics across History, Economics and Politics are selected because (1) this allows a  broad range of complex topics and (2) there is sufficient topic overlap to share a single web document corpus.
After reviewing several standard document collections, none had enough focused content for these topics, with History topics having the poorest coverage.
Thus, web content from Common Crawl is used with website-specific parsers to create a curated document corpus of around 700k heterogeneous web documents (blogs, news, interviews, etc.).
Wikipedia via KILT \cite{petroni2021kilt} is the entity knowledge base (KB) for entity ranking.
Entity linking is run over the document corpus using REL \cite{vanHulst:2020:REL}, which is an effective end-to-end entity linker.

Experienced IR experts (the authors) produce 6,186 document (147.3 per topic) and 11,323 entity (269.6 per topic) relevance judgments.
We use a two-stage assessment process: (1) assessing pooled runs of BM25 \cite{robertson1994some}, BM25 with RM3 expansion \cite{abdul2004umass}, ANCE \cite{xiong2020approximate}, MonoT5 \cite{nogueira2020document}, commercial search engine, and entity linkers \cite{Wu2020ZeroshotEL, decao2020autoregressive}.
Then (2) allowing assessors to formulate a series of manual queries (average 9.2 queries per topic) to search and annotate different aspects of the topics.
This assessment process is intended to simulate the research process of complex topics on document and entity ranking.

We evaluate strong document and entity ranking systems using \texttt{CODEC}\xspace, including sparse retrieval, dense retrieval, and neural Language Model (LM) re-ranking.
The results show significant headroom for improvement within the current first-pass and re-ranking search systems on these complex topics.
The best performing document ranking system has MAP under 0.35 and NDCG under 0.5, while the best-performing entity ranking system has MAP under 0.25 and NDCG under 0.45.
Comparing these measures to comparable systems on TREC Deep Learning \cite{craswell2021overview}, where NDCG@10 is 0.7 and MAP is 0.55, highlights that \texttt{CODEC}\xspace complex topics are challenging for current systems.

Analysis shows a positive correlation between document relevance and the occurrence of the most relevant entities.
These findings support the complementary relationship between the document and entity ranking tasks and motivate the development of future models that leverage both \cite{Dalton2014EntityQF, dietz2019ent}.
We explore this directly by leveraging \texttt{CODEC}\xspace entity judgments within document ranking via query expansion, which improves document ranking by a statistically significant amount.

\texttt{CODEC}\xspace is a valuable resource for IR researchers, supporting the development of new neural methods that leverage entity-centric representations. The key contributions of \texttt{CODEC}\xspace are:

\begin{itemize}

    \item \textbf{Test collection:}
    We release a test collection to benchmark complex research topics on document and entity ranking.
    We produce new guidelines for complex topics and have social sciences experts generate 42 new topics.
    We curate a new document corpus from 24 focused sources covering diverse social science domains across History, Economics, and Politics.
    We release 6,186 document and 11,323 entity judgments.

    \item \textbf{Analysis of system performance:}
     We study the behaviour of strong systems (sparse retrieval, dense retrieval, and LM re-ranking) that highlights failures and provide headroom for improvement on complex topics.
     We highlight specific failures due to models lacking the ability to encode or utilize entities and their relationships.

    \item \textbf{Aligned entity and document tasks:}
    We design the dataset to have aligned document and entity judgments to allow the development of new entity-centric ranking models.
    We show that document relevance is positively correlated with the proportion of most relevant entities contained within the document.
    We show that we can improve document ranking using entity query expansion.

    \item \textbf{Query reformulation:}
    A two-stage assessment process allows the assessment of strong pooled runs, followed by a manual exploration of the topic using multiple live search systems.
    These query reformulations (387 queries in total) are also released.
    We show that the best query reformulation outperforms the original query.
    Additionally, query expansion that uses all query reformulations improves document and entity ranking.

\end{itemize}

\section{Related Work}
\label{sec:related}

We provide an overview of the related literature across document ranking, entity ranking, and query reformulation.

\subsection{Document ranking}

Document ranking is the task of retrieving a ranked list of relevant documents from a corpus given a specified information need.
In recent years, pre-trained language models  \cite{Li_etal_2020_PARADE,  MacAvaney_etal_SIGIR2019, nogueira2020document} and dense retrieval systems \cite{khattab2020colbert, xiong2020approximate} have been shown to improve document ranking.
However, findings have shown failures of neural retrieval on even simple entity queries \cite{sciavolino2021simple}.

Within the field of domain-specific research (i.e. legal, recruitment, and healthcare), high-recall Boolean or structured queries over domain-specific collections are standard \cite{russell2018information}.
\texttt{CODEC}\xspace instead focuses on social sciences (History, Economics, and Politics) and open-ended essay-style topics that more closely align with web or newswire search.
For example, TREC Robust \cite{Voorhees_TREC2004_robust} and TREC CORE \cite{core2017trec}, provide a similar style of natural language queries.
However, \texttt{CODEC}\xspace topics are more current and provide extensive narratives, i.e. \texttt{CODEC}\xspace narratives average 143.4 words versus TREC CORE's 44.0.

MS MARCO \cite{MS_MARCO_v1} is a family of passage and document test collections consisting of web queries, passages or documents, with sparse relevance judgments.
However, MS MARCO's annotation technique means that the queries tend to be artificially easy and exhibit undesirable qualities like the `maximum passage bias' \cite{Li_etal_2020_PARADE}.
TREC Deep Learning \cite{craswell2021overview} extends MS MARCO with dense judgments to provide a more useful benchmark, and DL-HARD \cite{mackie2021dlhard} develops a more challenging subset with annotations and metadata.
\texttt{CODEC}\xspace differs from these datasets in terms of length of queries, i.e. TREC Deep Learning averages 5.8 words compared to \texttt{CODEC}\xspace's 12.5 words.
\texttt{CODEC}\xspace provides a new focused document corpus that provides good coverage of complex social science topics.
Additionally, aligned entity and document judgments will allow researchers to explore the related task of entity ranking.

\subsection{Entity ranking}

Entity ranking is the task of retrieving a ranked list of relevant entities from an entity knowledge base given a specified information need.
Past studies have shown that entity ranking improves by leveraging mentions in text passages to create a topic-specific text-entity graph \cite{dietz2019ent}.
Transformer-based embeddings have been shown to be a reasonable entity ranking baseline \cite{chatterjee2021entity}, with a strong performance on the related tasks such as entity linking \cite{wu2019zero}.
Entity ranking closely relates to entity aspect linking, where the task is to identify the fine-grained semantics of the entity that relates to a mention in a contextual passage \cite{nanni2018entity, ramsdell2020large}.
Incorporation of entity aspects has also been shown to improve entity ranking \cite{chatterjee2021entity}.

INEX 2009 XML Entity Ranking Track \cite{demartini2009overview} focuses on entity ranking and entity list completion from Wikipedia XML documents.
The queries are generally factoid in nature, i.e. `Italian Nobel prize winners' and `Formula 1 drivers that won the Monaco Grand Prix'.
In contrast, \texttt{CODEC}\xspace asks entity ranking systems to rank important named entities or general concepts on complex topics, `What technological challenges does Bitcoin face to becoming a widely used currency?' Where relevant entities include [Cyberattack] and [Transaction Cost], as well as the explicitly mentioned [Bitcoin].

DBpedia-Entity \cite{balog2013test} and DBpedia-Entity v2 \cite{hasibi2017dbpedia} are test collections for entity search over the structured DBpedia knowledge base.
These encompass four slightly different entity search tasks, i.e. named entity search, ad-hoc entity ranking, list completion, and natural language entity-based QA.
The key difference is \texttt{CODEC}\xspace uses a free-text based entity KG (Wikipedia), the topics are more open-ended, and there is an aligned document ranking task.

TREC CAR  \cite{dietz2017trec} is a passage and free-text entity ranking dataset built from Wikipedia and uses Wikipedia titles and headings as keyword queries.
TREC CAR is the closest setup to \texttt{CODEC}\xspace, and the sparse entity and document relevance judgements could provide a useful pre-training step.
\texttt{CODEC}\xspace differs based on the complex natural language queries, heterogeneous text corpus (instead of solely Wikipedia), and focus on document ranking.

\subsection{Query Reformulation}

\citet{culpepper2021hard} highlight that users routinely reformulate queries to satisfy an information need, and show the high variance of retrieval performance across these query variants.
In fact, \citet{culpepper2021hard} find that query formulations have a comparable effect to the actual topic complexity in terms of overall system performance.
\texttt{CODEC}\xspace provides over 387 manual query reformulations to support research in this space, i.e. query performance prediction and automatic query reformulation.

\citet{liu2019comparative} show the benefits of human and automatic query reformulations on document ranking systems, with human reformulations being the most effective.
Analysis on \texttt{CODEC}\xspace supports these findings that the best reformulations improve document and entity ranking.
ORCAS is a click dataset that aligns with TREC Deep Learning \cite{craswell2020orcas}, which is useful for identifying clusters of related queries or related documents.
However, \texttt{CODEC}\xspace provides manual query reformulation on a single information need, providing more fine-grained topic-specific query reformulations.

\section{CODEC}

\texttt{CODEC}\xspace is a test collection that provides two tasks: document ranking and entity ranking.
A complex topic is defined as an essay-style question where essential information can span across multiple entities and documents (see Section \ref{sec:topics} for more detail).

This dataset benchmarks a researcher who is attempting to find supporting entities and documents that will form the basis of a long-form essay discussing the topic from various perspectives.
The researcher would explore the topic to (1) identify relevant sources and (2) understand key concepts.

\subsection{Task Definition}
\label{sec:task-def}

\texttt{CODEC}\xspace supports both document ranking and entity ranking tasks.
Document ranking systems have to return a relevance-ranked list of documents $[D_1,...,D_N]$, from a document corpus $C_D$, for a given natural language query $Q$.
Entity ranking systems have to return a relevance-ranked list of entities $[E_1,...,E_N]$, from an entity knowledge base $KB_E$, for a given natural language query $Q$.
Document ranking uses \texttt{CODEC}\xspace's new document corpus and entity ranking uses KILT as the entity KB.
For the experimental setup, we provide four pre-defined `standard' folds for k-fold cross-validation to allow parameter tuning.
Initial retrieval or re-ranking of provided baseline runs can both be evaluated using this test collection.
\texttt{CODEC}\xspace setup encourages exploration of the related entity and document ranking tasks; however, both tasks can also be undertaken in isolation.

\subsection{Topic Generation}
\label{sec:topics}

\texttt{CODEC}\xspace provides complex topics that intend to benchmark the role of a researcher.
Understanding these topics requires deep knowledge and investigation to identify the key documents and entities.

Social science experts from History (History teacher, published History scholar), Economics (FX trader, accountant, investment banker) and Politics (political scientists, politician) helped to generate interesting and factually-grounded topics.
The authors develop the following criteria for complex topics:

\begin{itemize}

    \item \textbf{Open-ended essay-style}:
    Satisfying the information need of this topic comprehensively would require a long-form essay-style response.
    Factoid questions or questions that only require a short answer are not suitable.

    \item \textbf{Natural language question}:
    The query should be long, natural language-based.
    Keyword queries are not suitable.

    \item \textbf{Multiple points of view}:
    It is preferable if the topic elicits debate and multiple points of view.
    A good response would thus require an understanding of each of these dimensions.

    \item \textbf{Concern multiple key entities}:
    It is preferable if the topic concerns multiple key entities (people, things, events, etc.).

    \item \textbf{Complexity}:
    It is preferable if the topic requires an educated adult to undertake significant research to understand it.

    \item \textbf{Knowledge}:
    It is preferable if the topic requires deep knowledge to understand satisfactorily.

\end{itemize}

The domain experts write 42 topics with minimal post-processing from the authors to align styles or correct spelling or grammatical errors.
There is an equal number of topics per target domain, i.e. 14 History topics, 14 Economics topics, and 14 Politics topics.
Each topic contains a query and narrative.
The query is the question the researcher seeks to understand by exploring documents and entities, i.e., the text input posed to the search system.
The narratives provide an overview of the topic (key concepts, arguments, facts, etc.) and allow non-domain experts to understand the topic.
Due to the complexity of these topics, the narratives are not completely comprehensive but provide a useful starting point for annotators.
We also review pooled runs to assess whether topics are too easy (i.e. lots of highly ranked relevant documents) or do not align with the corpora (i.e. not enough relevant documents or entities to satisfy the information need).

Table \ref{tab:topic-stats} shows the average number of words and entities in topic queries and narratives.
Entity statistics are calculated by running GENRE \cite{decao2020autoregressive} over the queries and narratives.
An average of 12.5 words and 2.4 entities per query supports long natural language queries that include entities.
Narratives provide a good proxy for the complexity of the underlying information need, and 143.4 words and 23.7 entities support this complexity.

\input{tables/topics_stats}

\subsection{Document Corpus}
\label{sec:doc-corpus}

We want \texttt{CODEC}\xspace document corpus to have enough high-quality coverage of current social science topics.

\subsubsection{Focused Content}

We perform initial exploration on standard document collections (MS MARCO, TREC Washington Post, etc.) with \texttt{CODEC}\xspace topics but find critical coverage gaps within required research content.
History topics have particularly low coverage and would require augmentation from historical authority sites.
This motivates building upon a subset of Common Crawl to create a new focused document corpus for the target domains.
Table \ref{tab:corpus_docs} shows the distribution of documents.

We leverage our domain experts, who recommend suitable seed websites or sections of websites.
The pool contains a mixture of clearly specialized websites (i.e. economicsdiscussion.net, history.com, brookings.edu) and several general newswire websites (bbc.co.uk, latimes.com, etc.).
Social science experts requested up-to-date newswire websites for contextualizing current economic and political topics.
We also run the topics through a commercial search engine to ensure appropriate coverage and that each domain has enough representation.

\input{tables/corpus_docs}

\subsubsection{Corpus Generation Pipeline}

The document corpus pipeline takes the focused seed websites and uses Common Crawl and URL pattern matching to extract ~300GB of HTML across recent crawls in 2021  (CC-MAIN-2021-[21,17,10,14]).
We develop 24 custom BeautifulSoup HTML parsers to extract text and metadata while removing any advertising and formatting.
This creates documents with fields:

\begin{itemize}
    \item \textbf{id}: Unique identifier is the MD5 hash of URL.

    \item \textbf{url}: Location of the webpage (URL).

    \item \textbf{title}: Title of the webpage if available.

   \item \textbf{contents}: The text content of the webpage after removing any unnecessary advertising or formatting.
   New lines provide some structure between the extracted sections of the webpage, while still easy for neural systems to process.
\end{itemize}

We then run multiple filtering stages to ensure the documents are of suitable length and unique.
First, the extracted text has to contain at least 30 words, approximately a paragraph.
Second, we identify that several websites contain the same (or very similar) webpage hosted on different URLs.
Thus, we run a de-duplication step by grouping webpages from the same website that (1) have the same \textit{title} and (2) cosine similarity between document tokens greater than 95\%.
We solely include the document with the longest \textit{contents} in the final corpus.
This removes 96,900 duplicates and results in a final corpus containing 729,824 documents.
The corpus is released in jsonlines format.

\subsubsection{Entity Linking}

We run the REL \cite{vanHulst:2020:REL} entity linker over the entire 729,824 document corpus to provide structured connections between documents and entities.
REL is a lightweight neural entity linker that allows easy deployment and strong performance.
We use the suggested setup for mention detection, i.e. Flair \cite{akbik2018contextual} which is a Named Entity Recognition (NER) model based on contextualized word embeddings.
We use REL's pre-trained model for candidate selection that uses a 2019-07 version of Wikipedia (i.e. closely aligns with the 2019/08/01 Wikipedia version for entity KB).
For each document we provide a list of entity links containing fields:

\begin{itemize}
    \item \textbf{mention}: Text spans in document that is linked to entity.

    \item \textbf{prediction}: Top predicted entity link (Wikipedia title).

    \item \textbf{prediction\_kilt}: We map \textit{prediction} entity link to KILT id to align with entity KB and entity judgments.

    \item \textbf{candidates}: Top-k entity link candidates (Wikipedia title).

    \item \textbf{candidates\_kilt}: We map \textit{candidates} entity links to KILT ids to align with entity KB and entity judgments.

   \item \textbf{conf\_ed}: Score of Flair NER model.

   \item \textbf{score}: Scores of REL candidate selection model.

\end{itemize}

We release the full 18GB of entity links in jsonlines format.
This will allow researchers to use entity links within document and entity ranking easily.
Table \ref{tab:corpus_els} shows breakdown of the 27.5m entity links (37.7/document) and 144.1m entity candidates (197.5/document).

\input{tables/entity_links}

\subsection{Entity KB}
\label{sec:entity-kb}

\texttt{CODEC}\xspace uses KILT's \cite{petroni2021kilt} Wikipedia KB for the entity ranking task, which is based on the 2019/08/01 Wikipedia snapshot.
KILT contains 5.9M preprocessed articles which are freely available to use.
The entity pages are primarily text-based with minimal structure to indicate headings or passages, i.e. very similar to Document Corpus.
KILT is selected for \texttt{CODEC}\xspace's KB because it aligns with related knowledge-grounded tasks (fact-checking, open-domain QA, entity linking, etc.).
KILT also provides inter-entity entity links based on Wikipedia mentions, which could be helpful when identifying how related entities are to each other.

\subsection{Relevance Criteria}
\label{sec:relevance}

We perform relevance assessment on a graded scale (between 0 and 3) using developed guidelines to ensure a consistent assessment process.
Guidelines take inspiration from those of HC4 \cite{ecir2022hc4} and are adapted for our tasks (full guidelines online).

\subsubsection{Document Criteria}

The key question for document relevance is: \textit{How valuable is the most important information in this document?}

\begin{itemize}

    \item \textbf{Very Valuable (3):}
    The most valuable information in the document would be found in the lead paragraph of a report written on the topic.
    This includes central topic-specific arguments, evidence, or knowledge.
    This does not include general definitions or background.

    \item \textbf{Somewhat valuable (2):}
    The most valuable information in the document would be found in the body of such a report.
    This includes valuable topic-specific arguments, evidence, or knowledge.

    \item \textbf{Not Valuable (1):}
    Although on topic, the information contained in the document might only be included in a report footnote or omitted entirely.
    This consists of definitions or background information.

    \item \textbf{Not Relevant (0):}
    Not useful or on topic.

\end{itemize}

\subsubsection{Entity Criteria}

The key question for entity relevance is: \textit{How valuable is understanding this entity to contextualize document knowledge?}

\begin{itemize}

     \item \textbf{Very Valuable (3):}
    This entity would be found in the lead paragraph of a report written on the topic.
    It is absolutely critical to understand what this entity is for understanding this topic.

    \item \textbf{Somewhat valuable (2):}
    The entity would be found in the body of such a report.
    It is important to understand what this entity is for understanding this topic.

    \item \textbf{Not Valuable (1):}
    Although on topic, this entity might only be included in a report footnote or omitted entirely.
    It is useful to understand what this entity is for understanding this topic.

    \item \textbf{Not Relevant (0):}
    This entity is not useful or on topic.

\end{itemize}

\subsection{Assessment Process}
\label{sec:assessment}

\texttt{CODEC}\xspace uses a 2-stage assessment approach to balance adequate coverage of current systems while allowing annotators to explore topics using iterative search systems.

\subsubsection{Initial Run Assessment}

We generate pools from runs using state-of-the-art sparse and dense retrieval methods. For document runs we use top-100 BM25 \cite{robertson1994some}, BM25 using RM3 expansion \cite{abdul2004umass}, ANCE \cite{xiong2020approximate}, BM25 re-ranked with MonoT5 \cite{nogueira2020document}, BM25 using RM3 expansion re-ranked with MonoT5, and ANCE re-ranked by MonoT5.
We also use a commercial search engine where the top-100 search results are limited to the 24 corpus websites, and the URLs are mapped back to document ids.
Pyserini \cite{lin2021pyserini} is used for BM25 and BM25 with RM3 expansion with default parameters.
We use MS Marco fine-tuned versions of ANCE and MonoT5.

For entity runs, we also use a pool of the top-100 results from BM25, BM25 using RM3 expansion, ANCE, BM25 re-ranked with MonoT5, BM25 with RM3 re-ranked with MonoT5, and ANCE re-ranked with MonoT5.
We use ELQ \cite{Wu2020ZeroshotEL}, which is an end-to-end entity linking model for questions, to produce an entity run on the queries.
GENRE \cite{decao2020autoregressive}, sequence-to-sequence entity linking model, is used to produce an entity run using the narrative.
We again use a commercial search engine where top-100 search results are limited to Wikipedia and URLs mapped back to document ids.

We devise a weighting ratio for document and entity pooling based on an analysis of several topics across domains.
This process takes (1) top-k for each initial system run, then (2) intersection across specified sub-groups, before (3) sampling until the required threshold is reached.
The pooling method provides an initial 60 documents and entities for annotators to assess, which provides a reasonable starting point for annotation before the topic exploration stage.

Experienced IR annotators (the authors) judge the top 60 documents before doing the same for the top 60 entities.
Documents are deliberately judged before entities to provide the annotator with the necessary topic knowledge to assess entity relevance.

\subsubsection{Topic Exploration}

After the initial runs are assessed, annotators are allotted between two and three hours to use live search systems to explore key dimensions of topics to find relevant documents or entities.
Annotators need to construct a minimum of 6 new manual query reformulations.
Figure \ref{fig:overview} shows the query reformulations for the economics-1 topic.
Annotators are encouraged to run these queries through a commercial search engine for spell checking and evaluate whether the results are on topic.

The live search systems use a hybrid BM25, BM25 with RM3 expansion and ANCE for initial retrieval, with re-ranking from MonoT5.
This system returns the top 50 documents and top 50 entities to the assessor.
Similar to how a researcher would use commercial search systems to explore a topic iteratively, annotators do not need to assess all returned documents and entities.
Annotators are encouraged to scan returned result lists using the title and keyword highlighting to decide whether the document or entity is worth considering before annotating.
This process is designed to identify the highly-relevant documents and entities not currently returned by baseline systems.
Annotators are encouraged to keep searching until they cannot find new relevant documents or entities.

\subsubsection{Judgments}

Table \ref{tab:judgments} shows the distribution of judgments across the 42 judged topics, which includes 6,186 document judgments (147.3 per topic) and 11,323 entity judgments (269.6 per topic).
\textit{Highly Valuable (3)} only makes up 7\% of document judgments and 7\% of entity judgments.
\texttt{CODEC}\xspace also releases the manual query reformulations, with the topic exploration phase providing around 74\% of overall judgements.
There are 387 additionally issued queries overall (9.2 per topic), which can be used to explore query performance prediction or system improvement via query reformulations.

\input{tables/judgments}

\subsubsection{Evaluation}
\label{sec:evaluation}

We provide TREC-style query-relevance files with graded relevance judgments (0-3) for entity and document evaluation.
The official measures for both tasks include MAP and Recall@1000 with binary relevance above 1 (i.e. relevance mappings: \textit{0=0.0, 1=0.0, 2=1.0, 3=1.0}), and NDCG@10 with custom weighted relevance judgments (i.e. relevance mappings: \textit{0=0.0, 1=0.0, 2=1.0, 3=2.0}).
We deliberately gear measures toward the most key documents and entities (i.e. relevance scores of 2 or 3) to prioritise systems ranking these higher vs more tangential but on-topic information (i.e. relevance score of 1).

MAP assumes the user wants to find many relevant documents or entities, exposing ranking order throughout the run.
On the other hand, NDCG10 with custom scaling to overweight critical information aim to provide a clear signal of whether systems highly rank the essential documents and entities.
Due to recall being important for research-based tasks, Recall@1000 shows missed information.

\section{Experimental Results}
\label{sec:exp}

We conduct an in-depth analysis of sparse, dense and neural re-ranking systems on \texttt{CODEC}\xspace across document and entity tasks.
Document ranking shows a neural re-ranker with query expansion is the best performing system, and entity ranking is particularly challenging for neural systems in a zero-shot setting.
We highlight critical system failures, including models lacking (1) the ability to filter based on entities and relationships and (2) identify latent dimensions of the topic.
Using \texttt{CODEC}\xspace's aligned document and entity judgments, we show that an entity-based query expansion technique significantly outperforms other systems.
We also demonstrate how manual query reformulations can improve system performance.
Firstly, showing the best query reformulation significantly outperforms the original query.
Secondly, we demonstrate that a reformulation-based query expansion technique significantly outperforms other systems.

\subsection{Systems}
\label{sec:baselines}

For sparse retrieval methods, the full text of entities and documents are both indexed using Pyserini \cite{lin2021pyserini}, with Porter stemming, and stopwords removed.
We use the released `standard' four folds for cross-validation on sparse baselines and release the tuned parameters for each fold.
We optimise \textbf{BM25} \cite{robertson1994some} for MAP via parameter grid search of $k1$ (between 0.1 and 5.0 with step of 0.2) and $b$ (between 0.1 and 1.0 with step of 0.1).

For \textbf{BM25+RM3} \cite{abdul2004umass}, we use tuned $k1$ and $b$ fold parameters for BM25, and optimise RM3 for MAP via parameter grid search of $fb\_terms$ (between 5 and 95 with step of 5), $fb\_docs$ (between 5 and 20 with step of 5), and $original\_query\_weight$ (between 0.2 and 0.8 with step of 0.1).

ANCE \cite{xiong2020approximate} is a dense retrieval model that constructs harder negative samples using the Approximate Nearest Neighbor (ANN) index.
We use an MS Marco fined-tune ANCE model and Pyserini's wrapper for easy indexing.
Following the methodology in the ANCE paper, \textbf{ANCE+FirstP} takes the first 512 BERT tokens of each document to represent that document.
While \textbf{ANCE+MaxP} shards the document into a maximum of four 512-token shards with no overlap, and the highest-scoring shard represents the document.
For entity ranking, we solely used ANCE+FirstP due to computational overhead.
Using the first paragraph of Wikipedia to represent an entity is common practice in entity linking \cite{Wu2020ZeroshotEL}.

\textbf{T5} \cite{nogueira2020document} is state-of-the-art LM re-ranker that casts text re-ranking into a sequence-to-sequence setting and has shown impressive results.
We use Pygaggle's \cite{lin2021pyserini} MonoT5 model, which is fine-tuned using MS Marco.
The model is not fine-tuned specifically on \texttt{CODEC}\xspace and is used in a transfer-learning setup because of the size and scope of the current benchmark.
For document and entity ranking, we employ a max-passage approach similar to \citet{nogueira2020document} to re-rank initial retrieval runs (BM25, BM25+RM3, ANCE-FirstP, ANCE-MaxP).
The document is sharded in 512 tokens shards with a 256 overlapping token window (maximum 12 shards per document), and the highest scored shard is taken to represent the document.

Significance testing is conducted using a paired-t-test approach at a 5\% threshold, which is common within the IR community \cite{smucker2007comparison}.

\subsection{Analysis of Current Systems}
\label{sec:analysis-current}

The official evaluation measures are calculated on runs to a depth of 1,000 documents and entities (full result tables in Github repository).
\texttt{CODEC}\xspace performs all evaluation using the \textit{ir\_measures} package \cite{macavaney:ecir2022-irm} and provides commands to make evaluation straightforward.

\input{tables/document_baselines}

Table \ref{tab:document-baselines} shows system performance for document ranking.
Based on Recall@1000 of 0.800 the best performing method is BM25+RM3, outperforming BM25 and dense retrieval from ANCE-MaxP.
BM25+RM3 adds pseudo-relevant terms to the query based on a first-pass retrieval run; 80-95 terms are optimal.
For example, RM3 improves Recall@1000 on economics-18 topic, \textit{Was the crash that followed the dot-com bubble an overreaction considering the ultimate success of the internet?} by 32\% by adding or increasing the weight of terms such as [Amazon], [Pets.com], and [crash].
Many of these terms are entities, which supports research based on entity expansion.

\subsubsection{Document Ranking}

An example of a hard topic for initial retrieval is economics-12, \textit{What are the common problems or criticisms aimed at public sector enterprises?}, with Recall@1000 of under 0.55 for all systems.
This topic requires a lot of latent knowledge, and analysis of relevant documents shows they contain minimal keyword overlap with the query.
This is supported by the annotator having to enter sixteen wide-ranging queries reformulations to find relevant documents and entities.

T5-MaxP improves all initial retrieval runs, with BM25+RM3+T5 having the highest MAP (0.346) and ANCE-MaxP+T5 having the highest NDCG@10 (0.481).
However, an overall MAP of under 0.35 and NDCG@10 under 0.5 leave sufficient headroom for new document ranking systems to improve on complex queries.
For comparison, TREC Deep Learning similar systems have an approximate MAP of 0.55 and NDCG@10 of 0.70.

For example, a hard topic of document re-ranking across all systems is politics-22, \textit{What was the role of technology in the Arab Spring?}.
BM25+RM3+T5 has a Recall@1000 of 0.8 but an NDCG@10 of only 0.20.
By analysing the top-ranked baseline runs, it is clear that models cannot filter documents based on `technology' (concept) used during the `Arab Spring' (event).
For example, several top-ranked documents discuss Arab startups, science in Islamic World, or Blockchain in Politics.

\subsubsection{Entity Ranking}

\input{tables/entity_baselines}

Table \ref{tab:entity-baselines} shows the system performance on the entity ranking task.
Performance for entity ranking is lower when compared to document ranking, emphasising that entity ranking is a challenging task within the \texttt{CODEC}\xspace setup.
The best system is BM25+RM3 with Recall@1000 of 0.685, which has a statistically significant difference compared with BM25.
ANCE-FirstP's Recall@1000 of 0.340 is significantly worse than other initial retrieval methods.
This could be partially driven by ANCE only using the first passage (and not the whole Wikipedia page) or entity ranking being different from MS Marco document ranking fine-tuning.

\input{tables/entity_baselines}

T5 re-ranking zero-shot does not improve well-tuned sparse retrieval systems but improves ANCE-FirstP initial retrieval run.
The best end-to-end retrieval system is BM25 with RM3 expansion, with a MAP of 0.209 and an NDCG@10 of 0.412.

Analysis of system failures shows key concepts proved particularly hard to retrieve.
For example, in topic economics-2, \textit{What technological challenges does Bitcoin face to becoming a widely used currency?}, all retrieval systems return anticipated named entities, i.e. [Bitcoin], [Blockchain], and [Satoshi Nakamoto].
However, systems miss the key concepts that are needed to truly understand this information need, i.e. [Transaction time], [Transaction cost], [Quantum technology], [Carbon footprint], and [Cyberattack].
Looking at the judgment mappings, these missed entities come from manual queries issued by the researcher looking at these specific dimensions.
This motivates improved representations of entities that incorporate entity language models based upon document mentions that are more query-specific.

Topics with core entities explicitly named in the query have better entity ranking performance.
For example, history-17, \textit{How significant was Smallpox in the Spanish defeat of the Aztecs?}, all systems placed [History of smallpox in Mexico], [Fall of Tenochtitlan], and [Spanish conquest of the Aztec Empire] in top ranks.

\subsection{Entities in Document Ranking}
\label{sec:entity-link-exp}

\texttt{CODEC}\xspace allows researchers to explore the role of entities in document ranking using the provided document judgment, entity judgments, and entity links that connect documents and entities.

To understand the relationship between document and entity relevance, we take the 6,186 document judgments and map the relevance of entities mentioned in each document using the entity links and entity judgments.
We assume entities without judgments are \textit{Not Relevant}.
We analyse both top-1 predicted entity and top-k candidate entities for document ranking.
Figure \ref{fig:entity-to-doc-rank} shows the Pearson Correlation Coefficient between document relevance and the percentage of entities in the document grouped by relevance, i.e. \textit{Not Relevant}, \textit{Not Valuable}, \textit{Somewhat Valuable},\textit{Very Valuable}.
Both predicted entity (+0.19) and candidate entities (+0.22) support that documents with higher proportions of \textit{Very Valuable} entities are positively correlated with document relevance.

\begin{figure}[h!]
    \centering
    \includegraphics[scale=0.37]{images/corr_ent_doc.png}
    \caption{Correlation of document and entity relevance.}
    \label{fig:entity-to-doc-rank}
\end{figure}

We develop an entity query feedback method to build on these findings.
Prior work has shown enriching queries with entity-based information improves ad hoc ranking performance \cite{Dalton2014EntityQF}.

\textbf{Entity-QE} is an oracle entity feedback method that enriches the query with names of  relevant entities taken from entity judgments.
We use Pyserini BM25 for initial retrieval, removing stopwords, using Porter stemming, and using \texttt{CODEC}\xspace tuned BM25 fold parameters.
With \texttt{CODEC}\xspace standard four-folds, we cross-validate the (1) weighting of original query terms, (2) weighting of \textit{Very Valuable} entity terms, and (3) weighting of \textit{Somewhat Valuable} terms. Across the four folds, Entity-QE term weighting is: (1) original queries average 9.2 terms with 80\% weighting, with \textit{Very Valuable} entities adding 42.6 terms on average with 16\% weighting, and \textit{Somewhat Valuable} entities adding 77.8 terms on average with 4\% weighting.

\input{tables/entity_qe}

Table \ref{tab:entity-qe} shows Entity-QE improves Recall@1000 to 0.857, which is statistically significant when compared to the best initial retrieval systems BM25+RM3.
\textbf{Entity-QE+T5} uses T5 as a re-ranker with the same setup as used in baseline runs and improves NDCG@10 to 0.476 and MAP to 0.356, a statistically significant improvement.
Overall, these findings support that entity-centric ranking methods benefit complex topics.
\texttt{CODEC}\xspace having aligned document and entity judgments will enable new classes of neural ranking models to be developed and evaluated.

\subsection{Query Reformulation}

In this section, we study the utility of the manually reformulated queries used by the experts.
We show that the best manual reformulation outperforms the original query on document and entity ranking.
We also develop a query expansion method that uses all query reformulations that improve over the strong baselines.

\subsubsection{Best Reformulation vs Original Query}

We use a tuned BM25 and RM3 expansion model to analyse the performance of query reformulations against the original query, as this is a strong system across document and entity ranking.
Figure \ref{fig:query-reform} shows the distribution of the best query reformulation against the original query across document and entity ranking for MAP, NDCG@10, and Recall@1000.

\begin{figure}[h!]
    \centering
    \includegraphics[scale=0.35]{images/original_vs_best.png}
    \caption{Boxplot BM25+RM3 topic performance of (1) original query, and (2) best manual query reformulation. Blue dot indicates means and orange line median across topics.}
    \label{fig:query-reform}
\end{figure}

The best query reformulation improves Recall@1000 of document ranking to 0.845, a statistically significant difference.
As is depicted in the boxplot, the best reformulation leads to almost 75\% of topics having Recall@1000 over 0.80.
However, the best query reformulation has a smaller relative improvement on Recall@1000 for entity ranking (0.712) and is not statistically significant.
This suggests that several query reformulations are required for a robust initial entity ranking (as shown in Section \ref{sec:reform-eq}).

Analysing history-6 topic, \textit{What were the lasting social changes brought about by the Black Death?}, the original query performs poorly with a Recall@1000 of 0.428 on document ranking.
However, seven of thirteen query reformulations have Recall@1000 between 0.810 and 0.905, i.e \textit{The Black Death (Bubonic Plague) and end of Feudalism}, \textit{The Black Death (Bubonic Plague) and the Renaissance}, and \textit{Bubonic Plague / Black Death and Roman Catholic Church}.
The researcher is iterating on entity names and synonym expansion to identify missing documents and entities.

The best reformulation significantly improves document and entity ranking compared to the original query on MAP and NDCG@10 measures.
Document ranking MAP improves from 0.233 to 0.270, and NDCG@10 from 0.327 to 0.407.
NDCG@10 saw the largest relative improvement, with around 75\% topics having an NDCG@10 over 0.3 (i.e. proportionally fewer failing topics than the original query).
Similarly, the best query reformulation significantly improves entity ranking, with MAP improving from 0.209 to 0.248 and NDCG@10 from 0.412 to 0.557.

Entity ranking NDCG@10 saw a 35\% improvement due to the best query reformulation, the largest relative improvement of any measure across either task.
Analysing the runs, this was driven by query reformulations accessing specific clusters of highly relevant entities within the top ranks.
For example, the original query for topic history-15, \textit{Why did Winston Churchill lose the 1945 General Election after winning World War II?}, had an NDCG@10 of 0.323.
The best query reformulation, \textit{Appeasement and Great Depression cost Conservatives in 1945 General Election}, improves NDCG@10 to 0.609.
The improvement of top-ranked entities is due to the introduction of key events (i.e. [Appeasement] and [Great Depression]) and entities (i.e. [Conservatives]) being part of the query reformulation.

\subsubsection{Reformulation Query Expansion}
\label{sec:reform-eq}

We develop a query feedback method \textbf{Reform-QE}, which uses both the original and query reformulation terms.
We use BM25 in a similar setup to Entity-QE, cross-validating the weighting of the original query terms against the weighting of the aggregate query reformulation terms.
The original queries average 9.2 terms, and the aggregate query reformulation averages 42.8 terms.
For document ranking, the original queries average 66.7\% weighting and aggregate query reformulation averages 33.3\% weighting across the folds.
For entity ranking, the original queries average 60\% weighting and aggregate query reformulation averages 40\% weighting across the folds.
\textbf{Reform-QE+T5} uses T5 as a re-ranker with the same setup as used in baseline runs.

Table \ref{tab:reform-qe-doc} depicts document ranking results for the query feedback methods that use the query reformulations.
Reform-QE significantly improves over the best initial retrieval system, BM25+RM3+T5, achieving Recall@1000 of 0.864.
Reform-QE+T5 also has the highest NDCG@10 and a statistically significant improvement in MAP when compared with BM25+RM3+T5.

\input{tables/reform_doc}

Table \ref{tab:reform-qe-ent} shows entity ranking results of the query feedback methods that use the query reformulations.
Reform-QE significantly outperforms the best entity system, BM25+RM3, across MAP, NDCG@10, and Recall@1000.
There is a larger relative improvement when using query reformulations compared to document ranking, highlighting how several queries are needed to expose the full range of relevant entities.

\input{tables/reform_ent}

Overall, query reformulations offer systems a chance to explore complex topics and access information about key dimensions of the topic not explicitly expressed in the query.
\texttt{CODEC}\xspace query reformulations allow research into query reformulation or query performance prediction on complex topics.

\section{Conclusion}
\label{sec:con}

We introduce \texttt{CODEC}\xspace, a document and entity ranking resource that focuses on complex research topics.
Social science researchers produce 42 topics spanning History, Economics, and Politics.
To support open research, we create a new semantically annotated focused collection derived from subsets of the Common Crawl.
\texttt{CODEC}\xspace is grounded to the KILT's Wikipedia knowledge base for entity linking and retrieval.
We provide 17,509 document and entity judgments (416.9 per topic) by assessing the pooled initial runs and manual exploration of the topics using interactive search systems, adding 387 manual query reformulations (9.2 per topic).

\texttt{CODEC}\xspace system analysis demonstrates topics are challenging for state-of-the-art traditional models and neural rankers.
Failures demonstrate encoding entities and relationships is challenging for both document and entity ranking.
Specifically, queries with large amounts of latent knowledge, where new expansion techniques are a promising research direction.

We find that document relevance is positively correlated with the occurrence of relevant entities.
We leverage this relationship with an entity query expansion method that outperforms strong baseline systems on document ranking.
We also demonstrate that query reformulation can play an important role in accessing latent dimensions within complex topics.
Both individual query reformulations and aggregated reformulations improve document and entity ranking.
Overall, this resource represents an important step toward developing and evaluating entity-centric search models on complex topics.

\section{Future Work}
\label{sec:future-work}

We envision \texttt{CODEC}\xspace to be an evolving collection, with additional judgments and tasks added in the future, i.e. knowledge grounded generation, passage ranking, and entity linking.
The topics could also be further enhanced with facet annotations and semantic annotations to support tail and non-KG entities research.

\section{Acknowledgements}
\label{sec:ack}

The authors would like to thank all the domain experts who gave up their valuable time to help develop \texttt{CODEC}\xspace, especially Jamie Macfarlane and Louise Lu.
Additionally, we'd like to acknowledge Federico Rossetto for his support and help with visualisation.
This work is supported by the 2019 Bloomberg Data Science Research Grant, the Engineering and Physical Sciences Research Council grant EP/V025708/1, and the 2019 Google Research Grant.

\bibliographystyle{ACM-Reference-Format}
\balance


\section*{Supplementary Material}
Details of the computational methods, including the details for DFT calculations, and the DCD model; Results of the electrostatic potential for h-AlN, h-GaN and all monochalcogenides from DFT, DCD model and analytical formula; Potential fluctuations as a function of distance for all 2D materials from DFT, DCD model and analytical formula;
Structures of the 2D materials in crystallographic information file (cif) format. \\

\section*{Acknowledgments}
This work was supported by the Northwestern University MRSEC under National Science Foundation grant No.~DMR-1720139 (Q.Z., P.D.). Work performed at the Center for Nanoscale Materials, a U.S. Department of Energy Office of Science User Facility, was supported by the U.S. DOE, Office of Basic Energy Sciences, under Contract No. DE-AC02-06CH11357. We gratefully acknowledge use of the Bebop cluster in the Laboratory Computing Resource Center at Argonne National Laboratory. P.D. would like to acknowledge fruitful discussions with Cristian Cortès, Lincoln Lauhon, and Mark Hersam.

\section{Computational Methods}	\label{SecSI:method}
All first-principles calculations based on Density Functional Theory are performed using the Quantum-Espresso package~\cite{Giannozzi2009QE,Giannozzi2017QE}, with Optimized norm-conserving Vanderbilt pseudopotentials~\cite{Hamann2013} obtained from the PseudoDojo library~\cite{Van2018pseudodojo}. Exchange-correlation potentials use Perdew-Burke-Ernzerhof (PBE) parametrization of the generalized gradient approximation~\cite{Perdew1996}. The plane-wave cutoff energy is 90 Ry for all systems studied in this work. $k$-point sampling of 16$\times$16 is used for h-BN with in-plane size of 2.51$\times$2.51 \AA, or equivalent for other cell sizes. The vacuum regions are all larger than 21 \AA. Convergences of total and electronic energies are 10$^{-5}$ eV/atom, and $10^{-6}$ eV, respectively.

\section{Analytical Derivation: Periodic 2D array of charges not contained within a plane}

The potential from a periodic charge configuration, where the unit cell is a rectangular lattice with lattice constants of $a, b$ is:
\begin{align}
V(x,y,z=d) = k\sum_{n_1,n_2,i} \frac{q_i}{\sqrt{(n_1a+x_i-x)^2+(n_2b+y_i-y)^2+d^2}} \quad \& \quad \sum_i q_i = 0 \label{eq:1}.
\end{align}

Using Fourier transform, see detailed derivation in our previous work\cite{Zhou2021SAM}, Eq.\ref{eq:1} becomes:
\begin{align} \label{eq0}
	V(x,y,z=d)

	=k_e \sum_i \frac{q_i}{a} \sum_{\vec{k}}{}'
	\frac{e^{-2\pi\left[ i k_1(x-x_i)/a+ i  k_2(y-y_i)/b+d \sqrt{k_1^2/a^2+k_2^2/b^2}\right]}}
	{\sqrt{k_1^2b^2/a^2+k_2^2}}
\end{align}

We can extend this formulation to consider a neutral periodic 2D array of charges that are not contained within one plane, but have varying distances along the perpendicular direction. In this case Eq.~\ref{eq:1} becomes
\begin{align}
V(x,y,z=d) = k_e\sum_{n_1,n_2,i} \frac{q_i}{\sqrt{(n_1a+x_i-x)^2+(n_2b+y_i-y)^2+(z_i-d)^2}} \quad \& \quad \sum_i q_i = 0 \label{eq:2}.
\end{align}
$\delta$ in Eq.S12 in the SI of our previous work\cite{Zhou2021SAM}  is now defined as $\delta = (d-z_i)/a$, which leads to a modified form of the final expression, eq.~\ref{eq:final}, as
\begin{align}
V(x,y,z=d)
&=k_e\sum_i \frac{q_i}{a} \left[\frac{2\pi z_i}{b} + \sum_{\vec{k}}{}'
\frac{e^{-2\pi\left[ i k_1(x-x_i)/a+ i  k_2(y-y_i)/b+(d-z_i) \sqrt{k_1^2/a^2+k_2^2/b^2}\right]}}
{\sqrt{k_1^2b^2/a^2+k_2^2}}\right]. \label{eq:final}
\end{align}
We note that in the case where the charge distribution yields a net dipole the first term is the potential  due to a periodic array of dipoles in the far-field limit, which can be equated to an infinite parallel-plate capacitor. Note in order to recover the expected potential difference, we need to calculate the potential different between $z=\pm d$, which picks up a factor of two.

\subsection{Formula Derivation for hexagonal BN, AlN and GaN}
\begin{figure}[H]
	\centering
	\includegraphics[width=0.35\linewidth]{Figures/BNcell.jpg}
	\caption{An Orthorombic Cell of monolayer h-BN, same for AlN and GaN where the N atoms are in gray.} \label{fig:BNcell}
\end{figure}
As shown in Fig.~\ref{fig:BNcell}, each orthorombic cell of h-BN (same for 2D AlN and GaN) with lattice parameters $a, b$, has four atoms (two B atoms and two N atoms), two B atoms with charge $q$ at position $\boldsymbol r(x,y,z=0)$ of  $(0,0,0), (-1/2a,-1/2b,0)$ and two N atoms with charge $-q$ at $(0,1/3b,0), (-1/2a, -1/6b, 0)$ when defining the h-BN plane at $z=0$. The potential at position $(x,y,z=d)$ is then (\emph{hereinafter, $x,y$ are in fractional coordinates, and $d$ has the same unit as $a$ and $b$}):
\begin{align}
	V(x,y,z=d) & = k_e \frac{q}{ab} \sum_{\vec{k}}{}' \frac{e^{-2\pi d M_k}}{M_k} \left\{ \cos[2\pi (k_1x+k_2y)] +  \cos[2\pi(k_1(x-\frac{1}{2})+k_2(y-\frac{1}{2})]\right. \nonumber \\
	& \left. {\qquad} - \cos[2\pi(k_1x+k_2(y-\frac{1}{3}))] + \cos[2\pi k_1(x-\frac{1}{2})+2\pi k_2(y-\frac{5}{6})] \right\} \\
	& = k_e\frac{4q}{ab} \sum_{\vec{k}}^{k_1+k_2=2n}{}' \frac{e^{-2\pi d \sqrt{k_1^2/a^2+k_2^2/b^2}}}{\sqrt{k_1^2/a^2+k_2^2/b^2}} \left[- \sin(2\pi k_1x + 2\pi k_2y -\frac{1}{3}\pi k_2)\sin(\frac{\pi k_2}{3})\right]
\end{align}

We could achieve $>$ 99\% accuracy with $k_1=[-1,1], k_2=[-2,2]$, and $b=\sqrt{3}a$. Therefore,
\begin{align}\label{eq:BN}
		V(x,y,d) & =k_e\frac{2A_1q}{a} e^{\frac{-4\pi d}{\sqrt{3}a}}
\end{align}
where $A_1=-2\sqrt{3}\sin(2\pi y-\frac{\pi}{3})\left[\cos(2\pi x)+\cos(2\pi y-\frac{\pi}{3})\right]$

The in-plane potential modulation defined as $\Delta V$ is:
\begin{align}
	\Delta V & = V_{max} - V_{min} = V(0,1/3b,d) - V(0,0,d)  \nonumber \\
	& = k_e\frac{18q}{a} e^{\frac{-4\pi d}{\sqrt{3}a}}
\end{align}

In the case of a rotation of the h-BN plane in angle $\theta$, the potential keeps the same form as Eq.~\ref{eq:BN}, but with a angle dependent $A_1(\theta)$, therefore
\begin{equation}
V(x,y,d,\theta) = k_e\frac{2A_1(\theta)q}{a}e^{\frac{-4\pi d}{\sqrt{3}a}}
\end{equation}
where
\begin{equation}
	A_1(\theta)=-2\sqrt{3}\sin(2\pi y(\theta)-\frac{\pi}{3})\left[\cos(2\pi x(\theta))+\cos(2\pi y(\theta)-\frac{\pi}{3})\right] \nonumber
\end{equation}
and $x(\theta)= x\cos \theta +\frac{b}{a}y\sin \theta, y(\theta)=-\frac{a}{b}x\sin \theta + y\cos \theta$

\subsection{Formula Derivation for Hexagonal BN, AlN and GaN with Buckling}

For monolayer hexagonal structures, we consider here the case when the atoms are not planar, i.e.two point charges $q$ at position $\boldsymbol r(x,y,z)$ of  $(-1/2a,-1/b,z_1), (0,0,z_2)$ and two N atoms with charge $-q$ at $(-1/2a, -1/6b,z_3), (0,1/3b, z_4)$. when defining the average position of all the atoms in $z$ direction as $z=0$, we have:
\begin{align}\label{eq:BNz}
V(x,y,-d)
& = k_e \frac{q}{ab}\sum_{\vec{k}}{}' cos[2\pi(k_1x+k_2y)] \left((-1)^{k_1+k_2} e^{-2\pi z_1 M_k} +  e^{-2\pi z_2M_k}\right) \frac{e^{-2\pi dM_k}}{M_k} \nonumber \\
& - k_e \frac{q}{ ab}\sum_{\vec{k}}{}' cos[2\pi k_1x + 2\pi k_2(y-\frac{1}{3})] \left( (-1)^{k_1+k_2} e^{-2\pi z_3 M_k} +e^{-2\pi z_4M_k}\right) \frac{e^{-2\pi dM_k}}{M_k} \nonumber \\
& + k_e\frac{q}{ab}(z_1+z_2-z_3-z_4)
\end{align}
where the last term in Eq.~\ref{eq:BNz} is correcting for the dipole effects. We then can derive the analytical formula for two different cases here:

\noindent \textbf{Case \Romannum{1}: $z_1=z_2=-z_3=-z_4=\Delta z$,}
\begin{align}
V(x,y,z=-d) &=  k_e \frac{q}{ab}\sum_{\vec{k}}{}' \frac{e^{-2\pi d M_k}}{M_k}
\{
\cos\left[2\pi (k_1x+k_2y)\right]e^{-2\pi \Delta zM_k} -
\cos\left[2\pi (k_1x+k_2(y-\frac{1}{3}))\right] e^{2\pi \Delta zM_k}
\}
\end{align}
Using Taylor expansion, we can achieve $>95$\% accuracy to the first order, and $>$99\% accuracy to the second order (Eq.~\ref{eq:z195}), therefore
\begin{align}
V(x,y,z=-d)=& k_e \frac{q}{a}e^{-\frac{4\pi d}{\sqrt{3}a}}
\{
(A_1+A_1^{\prime}) e^{-\frac{4\pi \Delta z}{\sqrt{3}a}}
- (A_1^{\prime}-A_1) e^{\frac{4\pi \Delta z}{\sqrt{3}a}}
\} \\
\approxeq &
\begin{cases}
k_e\frac{2q}{a}\left[ A_1(1+\frac{8\pi^2 \Delta z^2}{3a^2}) - A_1^{\prime}\frac{4\pi \Delta z}{\sqrt{3}a} \right] e^{-\frac{4\pi d}{\sqrt{3}a}} \\%  \label{eq:z199} \\
k_e\frac{2q}{a}\left[ A_1- A_1^{\prime}\frac{4\pi \Delta z}{\sqrt{3}a} \right] e^{-\frac{4\pi d}{\sqrt{3}a}}  \label{eq:z195}
\end{cases}
\end{align}
where $A_1 = -2\sqrt{3}\sin(2\pi y-\frac{\pi}{3})\left[\cos(2\pi x)+\cos(2\pi y-\frac{\pi}{3}) \right]$, and\\
$A_1^{\prime} = 2\cos(2\pi y-\frac{\pi}{3})\left[\cos(2\pi x)-\cos(2\pi y-\frac{\pi}{3}) \right]+1$.

\vspace{12pt}
\noindent \textbf{Case \Romannum{2}: $z_1=-z_2=-z_3=z_4=\Delta z$,}
\begin{align}
	V(x,y,z=-d) = &k_e\frac{q}{ab} \sum_{\vec{k}}{}' \frac{e^{-2\pi dM_k}}{M_k} \left[e^{2\pi \Delta zM_k} + (-1)^{k_1+k_2}e^{-2\pi \Delta zM_k} \right] \nonumber \\
	& \left\{ \cos \left[2\pi (k_1x+ k_2 y)\right]-(-1)^{k_1+k_2} \cos \left[2\pi(k_1x+k_2(y-\frac{1}{3})) \right] \right\}
\end{align}
We can achieve $>99$\% accuracy with $-1\leq k_1 \leq 1, -2 \leq k_2 \leq 2$ and to second order Taylor expansion, therefore
\begin{align}
V(x,y,z=-d) = k_e \frac{2q}{a}\left[A_1 \left(1+\frac{8\pi^2 \Delta z^2}{3a^2}\right)e^{\frac{-4\pi d}{\sqrt{3}a}} + A_2 \frac{\Delta z}{a} e^{\frac{-2\pi d}{\sqrt{3}a}}  + A_3 \frac{\Delta z}{a}e^{\frac{-2\pi d}{a}}  +A_4 \frac{\Delta z}{a} e^{\frac{-2\sqrt{7}\pi d}{\sqrt{3}a}} \right]
\end{align}

and $>98$\% accuracy to the first order in Taylor expansion, where
\begin{align}
V(x,y,z=-d) = k_e \frac{2q}{a}\left[A_1e^{\frac{-4\pi d}{\sqrt{3}a}} + A_2 \frac{\Delta z}{a} e^{\frac{-2\pi d}{\sqrt{3}a}}  + A_3 \frac{\Delta z}{a}e^{\frac{-2\pi d}{a}}  +A_4 \frac{\Delta z}{a} e^{\frac{-2\sqrt{7}\pi d}{\sqrt{3}a}} \right]
\end{align}

where $A_2=4\pi \cos(2\pi y-\frac{\pi}{3})/\sqrt{3}, A_3 = 8\pi \cos(2\pi x)/\sqrt{3}, A_4=8\pi \cos(2\pi x)\cos(4\pi y-\frac{2\pi}{3})$.

\subsection{Formula For Metal MonoChalcogenides}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.4\linewidth]{Figures/MMCq.jpg}
	\caption{(a) top view and (b) side view of the unit cell and the positions of the point charges for metal monochalcogenides shown as black dots.} \label{fig:MMCq}
\end{figure}

Monolayer of metal monochalcogenides (MMC) MX where M=Ge, Sn, Pb and X=S,Se,Te has four atoms per unit cell as shown in Fig.~\ref{fig:MMCq} (b). We can use two point charges $\hat{r}_1 (-x_0a, -y_0b, -\Delta z)$ and $\hat{r}_2 (x_0a, y_0b, \Delta z)$ with charges of $q$ and $-q$, respectively, to represent each MX as shown in Fig.~\ref{fig:MMCq}.
Since the total dipole moment is zero, the potential is\\
\begin{align}
	V(x,y,z=d) &=k_e\sum_i \frac{q_i}{ab}  \sum_{\vec{k}}{}' \frac{e^{-2\pi (d-z_i)M_k }}{M_k} cos\left\{2\pi \left[k_1(x-x_i)+k_2(y-y_i)\right]\right\} \\
	& = k_e\frac{q}{ab} \sum_{\vec{k}}{}' \frac{e^{-2\pi dM_k}}{M_k} \left\{  \cos\{2\pi\left[k_1(x+x_0)+k_2(y+y_0)\right]\}e^{2\pi \Delta z M_k} \right.  \nonumber \\
	& \qquad \qquad \qquad \qquad  \left. {} - \cos\{2\pi\left[k_1(x-x_0)+k_2(y-y_0)\right]\}e^{-2\pi \Delta z M_k}
	\right\}
\end{align}

As we can achieve accuracy $> 98$\% with $-1 \leq k_1, k_2  \leq 1$, therefore
\begin{align}\label{eq:mmc}
V(x,y,z=d) = & k_e \frac{q}{a} \left\{ \frac{4\left[C_x C_y e^{2\pi \Delta z \sqrt{1/a^2+1/b^2}} - D_x D_y e^{-2\pi \Delta z\sqrt{1/a^2+1/b^2}} \right]}{\sqrt{b^2/a^2+1}} e^{-2\pi d\sqrt{1/a^2+1/b^2}} \nonumber \right. \\
& \left. {\qquad} + 2  \left[C_y e^{2\pi \Delta z/b} - D_y e^{-2\pi \Delta z/b} \right]e^{\frac{-2\pi d}{b}} \right. \nonumber \\
& \left. {\qquad} + \frac{2a }{b} \left[C_x e^{2\pi \Delta z/a} - D_x e^{-2\pi \Delta z/a} \right]e^{\frac{-2\pi d}{a}}  \right\}
\end{align}
where $C_x=\cos[2\pi (x+x_0)], D_x=\cos[2\pi (x-x_0)],C_y=\cos[2\pi (y+y_0)],D_y=\cos[2\pi (y-y_0)]$.
We can achieve $>98$\% accuracy using Taylor expansion to the second order (Eq.~\ref{eq:mmc2}), and $>95$\% to the first order(Eq.~\ref{eq:mmc1}), we have
\begin{align} \label{eq:mmc2}
V(x,y,d) & = k_e \frac{q}{a}  \left\{ B_1(x,y,\Delta z) e^{-2\pi d\sqrt{1/a^2+1/b^2}} \nonumber \right. \\
& \left. + B_2(x,y,\Delta z) e^{\frac{-2\pi d}{b}} + B_3(x,y,\Delta z) e^{\frac{-2\pi d}{a}}  \right\}
\end{align}
\begin{align} \label{eq:mmc1}
V(x,y,z=d) = & k_e \frac{q}{a} \left\{ \frac{B_1+ B_1^{\prime} 2\pi \sqrt{\frac{b^2}{a^2}+1}\frac{\Delta z}{b} }{\sqrt{b^2/a^2+1}} e^{-2\pi d\sqrt{1/a^2+1/b^2}} \nonumber \right. \\
& \left. {\quad} + \left[B_2+B_2^{\prime}2\pi \frac{\Delta z}{b}\right]e^{\frac{-2\pi d}{b}} +  \frac{a}{b}\left[B_3+B_3^{\prime} 2\pi\frac{\Delta z}{a}\right] e^{\frac{-2\pi d}{a}} \right\}
\end{align}
where $B_1 = 4(C_xC_y-D_xD_y), B_1^{\prime}=4(C_xC_y+D_xD_y), B_2=2(C_y-D_y), B_2^{\prime}=2(C_y+D_y), B_3 = 2(C_x-D_x), B_3^{\prime}= 2(C_x+D_x)$.

\subsection{Analytical Formula for Moir\'{e} Structures}
For a unit cell rotated by angle $\theta$, the potential can be computed by replacing $x,y$ in Eq.\ref{eq:BN} and Eq.\ref{eq:mmc2} by (note that $x,y$ are in fractional coordinates of the cell vectors):
\begin{align}
    & x(\theta)=x\cos \theta + \frac{b}{a}y\sin \theta \nonumber \\
    & y(\theta) = -\frac{a}{b}x sin \theta + y\sin \theta
\end{align}
Therefore, by adding the potential with the above $x(\theta), y(\theta)$, we can obtain angle-specific analytical formula for moir\'{e} structures. For example, for two layers of h-BN in the configuration as shown in Fig. 4(a), the potential at the center 2D material can be computed as:
\begin{align}
    V(x,y,d_1,d_2,\theta)=k_e\frac{2q}{a}\left[A(x,y)e^{\frac{-4\pi d_1}{\sqrt{3}a}}+A(x(\theta),y(\theta))e^{\frac{-4\pi d_2}{\sqrt{3}a}}\right]
\end{align}
where $d_1, d_2$ are the distance of the two layers of h-BN, which are considered as equal in Fig.4. Same can be obtained for transition metal monochalcogenides using Eq.\ref{eq:mmc2}.

Meanwhile, using the analytical formula for the potential, we can derive their electric field by:
\begin{align}
    \vec{F}(x,y,z,\theta) = -\left[\frac{\partial V(x,y,d,\theta)}{\partial x} \vec{x} + \frac{\partial V(x,y,d,\theta)}{\partial y} \vec{y} +\frac{\partial V(x,y,d,\theta)}{\partial z} \vec{z}\right]
\end{align}

\section{Lattice Parameters and Charges}

\begin{table}[H]
	\centering
	\captionsetup{margin={1.0cm,1.0cm}}
	\caption{\ lattice parameters and the absolute magnitude of the point charges $q$ for each 2D material studied in this work. The positions for the positive and negative point charges are shown in Fig.3(d), Fig.\ref{figs:AlNz}(d), Fig.\ref{figs:GaNz}(d) for the hexagonal monolayer, and Fig.\ref{figs:MMCall} for MMCs.}
	\label{tbl:qstr}
	\begin{tabular*}{0.7\textwidth}{@{\extracolsep{\fill}}cccc}
		\hline
		2D & a (\AA) & b (\AA) & $|q|$ \\ \hline
		h-BN	& 2.51	& 2.51	& 0.89
 \\
		h-AlN	& 3.13	& 3.13	& 1.47
\\
		h-GaN	& 3.21	& 3.21	& 1.18
\\
	    GeS	& 3.65	& 4.50	& 0.23
\\
		GeSe	& 3.97	& 4.30	& 0.25
\\
		GeTe	& 4.39	& 4.24	& 0.18
\\
		SnS	& 4.09	& 4.30	& 0.26
\\
		SnSe	& 4.29	& 4.39	& 0.30
\\
		SnTe	& 4.55	& 4.58	& 0.25
\\

		PbS	& 4.25	& 4.25	& 0.50
\\
		PbSe	& 4.41	& 4.41	& 0.48
\\
		PbTe	& 4.64	& 4.64	& 0.36\\
		\hline
	\end{tabular*}
\end{table}

\section{Potential Results for h-AlN and h-GaN}
\begin{figure}[H]
	\centering
	\includegraphics[width=0.9\linewidth, center]{Figures/FigAlNz.pdf}
	\caption{In-plane electrostatic potential at $d=3.03$ \AA from single layer of h-AlN computed from (a) DFT, (d) the DCD model, (g) formula. The left two columns show the potential for h-AlN with Raman-active (second column) and infrared-active (third column) phonon mode, see atomic configurations on the top, computed from DFT, DCD model and formula, respectively.} \label{figs:AlNz}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.9\linewidth, center]{Figures/FigGaNz.pdf}
	\caption{In-plane electrostatic potential at $d=3.03$ \AA from single layer of h-GaN computed from (a) DFT, (d) the DCD model, (g) formula. The left two columns show the potential for h-GaN with Raman-active (second column) and infrared-active (third column) phonon mode, see atomic configurations on the top, computed from DFT, DCD model and formula, respectively.} \label{figs:GaNz}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.9\linewidth, center]{Figures/FigBNVdline.pdf}
	\caption{$\Delta V_{pot}=V_{max}-V_{min}$ as a function of $d$ for (a) h-BN, (b) h-AlN, (c) h-GaN computed from DFT, model and formula.} \label{figs:BNdline}
\end{figure}

\section{Potential Results for all Transition Metal MonoChalcogenides}
\begin{figure}[H]

	\subfloat{\includegraphics[width=0.99\linewidth,center]{Figures/FigGeSnX1d_top.pdf}} \\%\hspace{0.5pt}
	\subfloat{\includegraphics[width=0.5\linewidth,center]{Figures/FigPbX1d_top.pdf}}
	\caption{Potential from transition metal monochalcogenides at distances of $\sim$ 3.1 \AA above computed using DFT, model and analytical formula in Eq.\ref{eq:mmc2}. The black dots show the positions of the bottom two atoms. The plus and minus symbols mark the positions of the postive and negative charges. } \label{figs:MMCall}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.9\linewidth, center]{Figures/FigMMCVdline.pdf}
	\caption{$\Delta V_{pot}=V_{max}-V_{min}$ as a function of $d$ for MMCs computed from DFT, model and formula.} \label{figs:MMCdline}
\end{figure}

\section{Impacts of Stacking and Twist Angle on the Potential and Electric Field for MMCs}
\begin{figure}[H]
	\centering
	\includegraphics[width=0.9\linewidth, center]{Figures/FigSVF0.pdf}
	\caption{(a-d) Potential at the center 2D materials from two layers of SnTe $d=3.18$\AA\ above and below, see the configuration in Fig.4(a), with twist angle $\theta=0$ but different stackings where $\textbf{R}$ is the in-plane translation of the cell in fractional coordinates. (e-h) in-plane electric field where the length and direction of the arrows show the magnitude and direction of the electric field, respectively.} \label{figs:MMCt0}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.6\linewidth, center]{Figures/FigSVF20.pdf}
	\caption{In-plane electric field distribution for a moir\'{e} structure. For a heterostructure as shown in Fig.4 (a) for SnTe with a twist angle $\theta=20^o$, the (a) potential and (b) in-plane electric field.} \label{figs:MMCt20}
\end{figure}