Peering into the Mind of Language Models: An Approach for Attribution in Contextual Question Answering (2024)

Abstract: With the enhancement in the field of generative artificial intelligence (AI), contextual question answering has become extremely relevant. Attributing model generations to the input source document is essential to ensure trustworthiness and reliability. We observe that when large language models (LLMs) are used for contextual question answering, the output answer often consists of text copied verbatim from the input prompt which is linked together with "glue text" generated by the LLM. Motivated by this, we propose that LLMs have an inherent awareness from where the text was copied, likely captured in the hidden states of the LLM. We introduce a novel method for attribution in contextual question answering, leveraging the hidden state representations of LLMs. Our approach bypasses the need for extensive model retraining and retrieval model overhead, offering granular attributions and preserving the quality of generated answers. Our experimental results demonstrate that our method performs on par or better than GPT-4 at identifying verbatim copied segments in LLM generations and in attributing these segments to their source. Importantly, our method shows robust performance across various LLM architectures, highlighting its broad applicability. Additionally, we present VERIFIABILITY-GRANULAR1, an attribution dataset which has token level annotations for LLM generations in the contextual question answering setup.

heading: 1 Introduction
text: The surge in the capabilities of Large Language Models (LLMs) has revolutionized natural language understanding. Their ability to comprehend and generate human-like text has resulted in their widespread adoption across various industries. A prominent and pivotal application of these models
1Dataset is available at https://github.com/ Anirudh-Phukan/verifiability-granular.
is question answering, particularly in contextual settings. The ability of LLMs to parse, interpret, and respond to queries within a given context has facilitated efficient information retrieval and comprehension.
Despite the remarkable strides made in contextual question answering, challenges persist within LLMs. While LLMs excel in generating informative responses, they often fall short in providing explicit references or attributions to the specific sections or sources within the context from which their answers derive (Liu et al., 2023b). The absence of this attribution impedes the ability to verify the authenticity and accuracy of the generated information. Attribution not only enables verification (Rashkin et al., 2023) but also increases user trust and confidence in the responses generated by these models, thus fostering their broader acceptance and utilization across diverse domains (Bohnet et al., 2022).
Existing methods for attribution typically align within three primary categories (Li et al., 2023): Systems fine-tuned or trained explicitly for attribution tasks (Weller et al., 2023; Gao et al., 2023b), retrieve-then-read (Chen et al., 2017; Lee et al., 2019) and approaches relying on post-generation attribution (Gao et al., 2023a; Huo et al., 2023). However, each of these approaches encounters substantial challenges in achieving accurate and granular attribution, thereby limiting their effectiveness.
The initial category, which consists of systems tailored or explicitly trained for attribution tasks, poses a significant challenge (Huang and Chang, 2023). This challenge primarily arises because the training process demands extensive resources, including time, computational power, and a large corpus of annotated data.
Furthermore, the continuous development of more sophisticated models requires retraining, perpetuating an unending cycle of adaptation. Additionally, the need for regression testing to ensure
11481
answer quality amplifies the burden, creating a considerable bottleneck in practical application and scalability.
On the other hand, the second category—postgeneration attribution—offers an alternative but not without its own set of drawbacks. This approach relies on leveraging retrieval models to trace the sources of the generated answers. However, this method suffers from the overhead associated with these retrieval models, which often demand substantial computational resources and time. Furthermore, the granularity of attribution is constrained by the chunk size at which retrieval is performed, limiting the precision of attribution.
Lastly, the third category—retrieve then read methods—also grapples with its unique set of complications. Similar to the post-generation attribution approach, this method faces the problem of retrieval method overhead and chunking issues. The concept here is to utilize retrieved evidence as a basis for generating answers and consequently, attributions. However, as outlined in (Gao et al., 2023a), retrieval does not equate to attribution due to the potential integration of external knowledge.
Our proposed method aims to surmount the limitations posed by existing attribution approaches by adopting a distinct strategy that eliminates the need for additional training while offering granular attributions. By delving into the inner workings of the LLM during its generation process, we sidestep the resource-intensive training requirements.
The crux of our approach lies in accessing the hidden state representations of tokens produced by the LLM when generating responses. Leveraging the contextual cues provided by the input—context, question, and generated answer—we extract these hidden state representations via a forward pass
through the model. These hidden representations which happen to be contextual embeddings of tokens are then matched to perform attribution. An overview of this process is shown in Figure 1.
Operating at a token-level granularity mirrors the natural generation process of LLMs. Unlike conventional post generation attribution methods that grapple with decisions on chunking at paragraph or sentence levels, our approach bypasses this dilemma. By steering clear of chunk-based attributions, we are liberated from arbitrary segmentation of the context, which often leads to imprecise referencing and diluted contextual connections.
The existing public datasets curated for the task of attribution (attribution of LLM generations) have annotations only at the response level or at the sentence level (for every sentence within the response). (Kamalloo et al., 2023; Liu et al., 2023b; Malaviya et al., 2023). To assess our method’s effectiveness, token-level annotations are essential. Consequently, we process the data collected by Liu et al. (2023b) to generate token-level annotations. We release this dataset to facilitate further research on token-level attribution.
In essence, our approach offers a unique and efficient solution to the problem of attribution in contextual question answering. Additionally, we also introduce a dataset that facilitates token-level attribution. With this in mind, we are excited to share our primary contributions in this paper.
• We introduce a pioneering method for attribution in contextual question answering. The strengths of our approach include its tokenlevel granularity ensuring precise attributions, lack of additional retrieval model overhead and its training-free nature which ensures consistent answer quality.
• Our experimental findings demonstrate the efficacy of our method across various model families. This indicates that leveraging hidden layer representations for attribution can be broadly applied across different LLM architectures, highlighting the wide-ranging applicability of our approach.
• Additionally, we release the VERIFIABILITYGRANULAR dataset, which contains tokenlevel attributions for LLM generations in the contextual question answering setup.

heading: 2 Related Work
text: Researchers have employed different approaches for the attribution of generated or identified text spans. A shared task was organized by Thorne et al. (2018) to encourage researchers to build systems capable of performing fact verification and attribution to the source texts. Evans et al. (2021) emphasized the role of source attribution in fostering truthful and responsible AI. The growing concern of fake news detection in AI-based news generation has also been considered as an attribution task (Pomerleau and Rao, 2017; Ferreira and Vlachos, 2016). In addition to automatic attribution, studies on manual attribution have been performed by domain specific individuals (Borel, 2023; Li et al., 2015). While we discuss about fact verification as an attribution task, it is important to note that user interactions have also been found to require attribution (Dziri et al., 2022). Petroni et al. (2022) has highlighted the fact that wikipedia articles needs validation and that the citations need to be attributed. On the other hand Sarti et al. (2023b) introduced a python library based on GPT-2 capable of identifying feature attributions generated from the Insequence model; capable of performing in multilingual settings (Sarti et al., 2023a). Recently, researchers performed attribution task on multimodal systems as well (Ancona et al., 2017; Holzinger et al., 2021; Zhao et al., 2023).
However, what is missing in prior art is the utilisation of the contextual guidance inherently present during generation for the attribution task. In our work, we tackle this problem by utilising the contextual information encoded during generation by the LLM and attribute spans to semantically relevant parts of the source document.

heading: 3 Problem Statement
text: We observe a phenomenon in contextual question answering using LLMs which results in a comprehensive answer typically characterized by factual spans, replicated verbatim from various segments of the provided context, interwoven with "glue text". An example of this phenomenon is shown in Figure 2. Yang et al. (2023) also note this pattern and use references to losslessly speed up LLM inference.
Building upon the aforementioned observations, we dissect the challenge of attribution in the contextual generation setting into two distinct yet interconnected sub-problems. The first sub-problem involves the identification of tokens within the output that have been directly copied from the provided context.
The second sub-problem delves deeper into the attribution of these identified tokens. This step involves mapping these tokens back to their original positions within the document. In essence, this implies tracing back the tokens to the exact sections within the document from which they were copied verbatim.
By doing this, we aim to establish a clear flow of information from the source document to the generated output, thereby enabling a more nuanced understanding of the context generation process.
The task at hand involves two distinct sub-
tasks within the context of attributing the output of a large language model (LLM). We are given a document D represented as a sequence of tokens (d1, d2, . . . , dn), a question Q, and an answer A represented as a sequence of tokens (a1, a2, . . . , am). Our objective comprises two interconnected subtasks:
Subtask 1: Token Attribution Identification. This subtask involves identifying a subset of tokens in A, denoted as Aattr ⊆ A, that require attribution to tokens in D. Mathematically, this can be expressed as selecting tokens ai ∈ A that are directly influenced or copied from D. In our current study, we restrict the scope to tokens that are verbatim copied from D.
Subtask 2: Corresponding Token Mapping. For each token in Aattr, this subtask aims to find a mapping function f : Aattr → D such that for every token ai ∈ Aattr, there exists a corresponding token or sequence of tokens in D to which ai can be attributed.
Formally, the mapping function can be expressed as:
f : Aattr → D, s.t. ∀ai ∈ Aattr f(ai) = (dj , . . . , dk) ⇐⇒ ai is attributed to (dj , . . . , dk) in D
In this formulation, the function f establishes a connection between the tokens in the answer requiring attribution and their corresponding tokens or token sequences in the document D.

heading: 4 Proposed Work

heading: 4.1 Motivation
text: Humans easily identify which parts of a document they use to answer questions. This skill to trace information back to its source is key for effective communication, especially when discussing complex ideas. Similarly, we propose that Large Language Models (LLMs) have an inherent awareness of the document parts they use while generating answers. This awareness is likely captured within the hidden states of the LLM, which encode token information during the generation process.
Our work is based on the idea that if LLMs can generate responses combining copied segments and self-generated "glue text", they must inherently differentiate between copied content and selfgenerated content. This differentiation is what we
aim to uncover. By accessing and analyzing the hidden states of an LLM, we seek to reveal how it uses and attributes source information in its responses.
This approach allows us to trace how the LLM processes and uses the provided context at a detailed, token-level granularity. We believe that fully understanding how LLMs generate responses requires examining the process at this fundamental level - where each token’s role in the response is clarified and attributed to its original source. Not only does this give us an understanding of a LLM’s inner workings, but also accomplishes the useful task of attributing outputs, which helps humans easily verify/navigate the LLM outputs.

heading: 4.2 Methodology
text: Given a language model, denoted as M , we construct a prompt P by concatenating the document D, represented as a sequence of tokens (d1, d2, . . . , dn), the question Q, and the answer A, represented as a sequence of tokens (a1, a2, . . . , am). This concatenation is formally expressed as P = D +Q+A, where ‘+‘ denotes the concatenation operation. The prompt P is then passed through the model M in a forward pass to obtain the hidden layer representations for each token in P . These representations capture the contextual information encoded by the model for each token. An illustrative example of this process is provided below.

 Document: {document} Based on the information contained in
the document, answer the question with details to the best of your abilities. Think step by step and explain your answer if that will help better understand the answer.
Q: {question} A: 
 {answer}
Let’s denote the hidden layer representation of each token ti for a specific layer l as hli.

heading: 4.2.1 Identifying extractive output tokens
text: For the first sub-task of identifying tokens in answer A that are directly copied from document D, we perform the following operation. For any specific layer l and for all tokens ai ∈ A, we say that a token ai comes from D if there exists a token dj ∈ D such that the cosine similarity between hli and hlj is greater than a threshold θ.
This can be formally represented as:
∀ai ∈ A, if ∃dj ∈ D s.t. Cosine(hli, h l j) > θ =⇒ ai comes from D

heading: 4.2.2 Attributing Extractive Spans
text: Given a span S in A to be attributed, consisting of tokens a1, . . . , an, we compute the average hidden layer representation hS for each token ai ∈ S as:
hS = 1
n
n∑
i=1
hli
Next, we use hS to identify anchor tokens in D. For each token dj ∈ D, we compute the cosine similarity between hS and hlj and select tokens with the highest similarities as anchor tokens, denoted as DT .
For each anchor token da ∈ DT , we explore windows of tokens around da, up to a maximum length L. We calculate the average hidden layer representation hW for each window W and identify the window with the highest similarity to hS . The highest-ranked window is considered the final attribution for the span S.
In cases where D is segmented into evidence spans e ∈ E, the score for each e is the similarity between hS and the best window within e.

heading: 5 Experimental Setup
text: In this section, we outline the details of our experimental setup; the dataset, the evaluation metrics; and the baselines.

heading: 5.1 Datasets
text: QuoteSum (Schuster et al., 2023):2 This dataset consists of questions, relevant passages, and human-written semi-extractive answers. In the process of dataset construction, the human annotators were tasked to answer multiple source questions by combining information from various sources. They were instructed to explicitly extract factual spans and weave them together into a coherent, wellgrounded passage. The dataset comprises of 4,009 semi-extractive answers to 1,376 unique questions in total and is split into train, validation and test sets with ratios 60%, 7%, 33%, respectively.
2Downloaded from https://github.com/ google-research-datasets/QuoteSum/tree/ main. The dataset is licensed under CC-BY-SA-4.0 license.
Verifiability-Granular: We also curate a dataset with token-level attributions called VERIFIABILITY-GRANULAR (VERI-GRAN) by processing the dataset introduced by (Liu et al., 2023b)3. The original dataset contains commercial generative search engines generated responses to input queries along with the retrieved content used for the generation. Annotations map sentences in the response to portions of the source text.
We split the source text using nltk.sent_tokenize4
and filter the samples that map a response statement to only one sentence of the source text. Characters are matched using diff_match_patch5 and tokens are annotated based on if all characters in the corresponding tokens match. Some additional post-processing (removing spans containing only punctuation and stop words) is done to obtain annotations in the same format as the QuoteSum dataset. The dataset contains 170, 197 annotated statements and 272, 320 annotated spans in the dev and test set respectively.

heading: 5.2 Metrics
text: The evaluation metrics for the two sub-tasks are described separately below.

heading: 5.2.1 Metrics for Sub-task 1
text: For the first sub-task, which involves the identification of spans that have been directly copied from the context, we use token-level precision, recall, and F1 score as our metrics. The ground truth for this task is the set of tokens marked as spans explicitly extracted from the context.

heading: 5.2.2 Metrics for Sub-task 2
text: For the second sub-task, which entails attributing the identified spans to their original positions within the document, we use accuracy as our metric. Accuracy is computed as the fraction of instances where the system correctly predicts the paragraph from which the span was extracted. This allows us to measure how effectively the system can trace the origin of the spans within the document.

heading: 5.3 Baselines
text: In the context of our study, we identify and utilize a number of baselines for both sub-tasks.
3Downloaded from https://tinyurl.com/ verifiability. The dataset is licensed under MIT license.
4https://github.com/nltk/nltk 5https://github.com/google/
diff-match-patch

heading: 5.3.1 Baselines for Sub-task 1
text: For the first sub-task, the identification of copied spans, it is worth noting that, to our best knowledge, no existing system can perform this task without being explicitly trained which alters the quality of the answers. Common methods such as fewshot prompting and fine-tuning tend to modify the answer. Thus, we resort to a modified version of the SEMQA prompt (Schuster et al., 2023), whereby instead of prompting the system to generate an answer via few-shot prompting, we instruct it to identify spans within a provided answer (prompt included in Appendix A.7, Figure 13). We prompt GPT 3.56 and GPT-47 using this modified prompt and they serve as our baselines for the first sub-task.

heading: 5.3.2 Baselines for Sub-task 2
text: GPT 3.5 and GPT-4 prompted with the modified SEMQA prompt (prompt included in Appendix A.7, Figure 14) are used as baseline for the second sub-task as well, i.e., attributing the identified spans to their original source paragraph. In addition, we also employ retrieval methods such as BM25 (sparse) (Robertson et al., 2009), GTR (dense) (Ni et al., 2021), and MonoT5 (Nogueira et al., 2020) as baselines for this task.
By comparing the performance of our system against these baselines, we aim to evaluate its effectiveness in tracing the origin of the spans.

heading: 6 Results and Analysis
text: We perform experiments for our approach (§ 4.2) with the following LLMs: Llama-7b (Touvron et al., 2023), Llama-70b (Touvron et al., 2023), Mistral-7b (Jiang et al., 2023), Yi-6b (Young et al., 2024) and OPT-350m (Zhang et al., 2022). Note that OPT-350m has been excluded from comparision on VERIFIABILITY-GRANULAR dataset due to its limitation of 2048 token context length and the dataset contains samples upto 4096 tokens. All of our experiments were run on a A100 machine with 4 80GB GPUs.

heading: 6.1 Results for Sub-task 1
text: The performance of our method and the baselines on sub-task 1, i.e., identifying the copied spans, is summarized in Table 1 and Figure 3 for QuoteSum and VERIFIABILITY-GRANULAR datasets respectively. We observe that our proposed method
6https://openai.com/blog/chatgpt 7https://openai.com/research/gpt-4
performs better than GPT models on the QuoteSum dataset and performs on par with GPT-4 on VERIFIABILITY-GRANULAR.
As seen in Table 1, while trying to optimize for F1 on the VERIFIABILITY-GRANULAR dataset the scores we obtain indicate that the optimal solution is to mark all tokens as copied. Therefore, for a better analysis of model performance we plot the PR curves as shown in Figure 3.
The consistency in performance metrics across all models for this sub-task suggests that the capability to identify extracted tokens via hidden representations is not confined to any particular model family or size. This observation underscores the broader applicability and versatility of our proposed methodology, affirming its effectiveness regardless of the underlying architecture or capacity of the language model being used.
The selection of the best hyperparameters (layer, threshold) for each of our models was based on the F1 performance metric. We share more details in the Appendix (Section A.3). The results presented in Table 1 and Figure 3 are derived from the test set.
The results indicate a considerable shortfall in the performance of GPT-3.5, particularly in terms of recall. This suggests that the model is unable to accurately identify all tokens considered by the annotators as being extracted from the document. A representative example of this failure case is illustrated in the Appendix (Figure 6, Section A.4).
As can be seen from the example, GPT-3.5 tends to identify entities rather than the specific spans that have been directly copied from the document. Even GPT-4, which demonstrates a better understanding of the task, occasionally overlooks certain
components like "The" that are parts of the directly copied spans.
An additional challenge with the GPT models is their tendency to hallucinate, leading to the introduction or elimination of content that doesn’t exist in the original answer. We try to recover from the failure by taking spans marked on the modified response and superimposing it on the original response.
To elaborate our observations, we delve into the performance variation across different model families and layers in this sub-task, as illustrated in Figure 4. For more precise comparisons among closely located numbers, the later layers from the Yi-6b model have been excluded due to their substantially lower performance compared to others.
The smoothest graph among all the model families belongs to OPT-350m which shows a gradual increase in performance until the middle layer, followed by a similarly gradual decrease. This performance peak at the middle layers aligns with the findings of (Zou et al., 2023), suggesting that earlier layers are often dedicated to low-level tasks, while later layers tend to be excessively focused on next token prediction.
Interestingly, the larger models, despite their varied architectures, exhibit a shared performance trend, with a peak at the earlier layers followed by a subsequent decrease. This pattern suggests that for these larger models, the sub-task of identifying extracted tokens tends to be a relatively low-level or straightforward task. Consequently, the best performance for these models is typically observed in the earlier layers.

heading: 6.2 Results for Sub-task 2
text: Table 2 presents the performance results for the second sub-task. For each model utilizing our methodology in this task, the sole hyperparameter is the layer. The results provided in the table are derived
from evaluations conducted on the test set of QuoteSum and VERIFIABILITY-GRANULAR datasets.
The results indicate that our methods perform on par with GPT-4 (∼ 90%) on the QuoteSum dataset, while they outperform GPT-4 by ∼ 15% on VERIFIABILITY-GRANULAR. Note that the human performance on VERI-GRAN is 92.04%, calculated as the mean performance of 4 NLP practitioners on the dataset.
The reason for this is the much harder nature of the later dataset due to the larger number of pas-
sages (3.38 vs 69.1 passages on average). Prompting GPT to attribute already generated answers is essentially a retrieval task. It has been observed by (Liu et al., 2023a) that LLM retrieval performance degrades with increasing context length. Our method benefits from the contextual representations of LLM embeddings without relying on the LLM for retrieval and matching representations directly.
Two noteworthy observations from the dataset and results are:
1. The specific nature of the datasets necessitate a delicate balance between two competing tasks: directly matching the substring in the span to be attributed, and disambiguating among multiple instances of the substring. The former is a low-level task, while the latter requires a more nuanced, high-level understanding of context-based matching.
2. The successful performance of models across different families and capacities suggests that approach of matching based on hidden representations is broadly applicable.
Similar to sub-task 1, we carry out a detailed analysis of performance on sub-task 2 across various model configurations and layers, as depicted in Figure 5.
A fundamental difference between the OPT350m and larger models lies in the influence of token positions on the layer 0 embedding. For OPT-350m, the token’s position directly impacts its layer 0 representation. This differs significantly from larger models, where the layer 0 representation depends solely on the token ID like Word2Vec (Mikolov et al., 2013), with the token’s position not having a direct influence. Instead, in larger models, the token position is a part of the transformer’s learning process (Su et al., 2023).
In light of this distinction, our methodology, observed in Table 2, excludes layer 0 for the larger models while choosing the best layer. Because its representation, which is solely dependent on the token ID, tends to prioritize exact substring matches.
Therefore, OPT-350m begins with lower performance that gradually at the middle and the final layers. On the other hand, all larger models across different families exhibit a similar trend where they start with the highest performance at layer 0. This high initial performance is largely attributable to
the dataset’s characteristics, which contain numerous examples that can be unambiguously matched using exact substring match.
However, the dataset also comprises examples with multiple similar substrings, necessitating disambiguation. This requirement for contextual understanding is well catered to by the middle and later layers, as our ablation study in the Appendix (Section A.2) reveals. Thus, the slight upturns in performance experienced by the larger models in the middle and later layers indicates the trade-off between exact and contextual matching.

heading: 7 Discussion & Conclusion
text: Through this study, we introduce a novel, efficient solution to the challenge of attribution in contextual question answering. Our method leverages the hidden state representations of LLMs, providing detailed, granular attributions without requiring extensive model retraining. Our approach’s ability to perform token-level attribution easily lends itself to end-user applications, and we have included an actual system input-output in the Appendix (Section A.6) depicting the same.
Our experimental results, across various model configurations and layers, demonstrate the efficacy of our approach. Notably, our method performs on par or better than training-free baselines in both identifying tokens in an answer that are directly copied from the context and attributing these tokens to their original positions in the document. Additionally we make available VERIFIABILITYGRANULAR dataset, which contains token-level attributions for LLM generations in the contextual question answering setup.
Perhaps one of the most interesting findings from our study is that the ability to identify extracted tokens and attribute them back to the source is not
exclusive to a specific model family. This suggests that our approach can be applied broadly across different LLM architectures, underscoring its versatility.

heading: 8 Limitations & Future Work
text: One limitation of our work stems from the specific nature of the QuoteSum and VERIFIABILITYGRANULAR datasets we utilized for our experiments. The datasets are constructed such that only verbatim spans from the document are annotated and attributed in the answers. Our method, thus, is primarily evaluated on verbatim spans. However, our method is not specifically designed for verbatim spans only; it could potentially work with paraphrased information as indicated in our experiments with a synthetically paraphrased version of Quotesum presented in the Appendix (Section A.5).
In the future, we intend to employ datasets that include paraphrased spans. Testing on such data will allow us to assess the method’s effectiveness in attributing paraphrased information, identify potential challenges, and adapt our methodology accordingly.
We also see potential for our method to be useful beyond the realm of contextual question answering. We tried mapping an LLM generated text span in Spanish to its source document in English (Figure 12).
Interestingly, our method shows potential for this use case too. We envision applying our approach to other tasks that involve information extraction and attribution to a given context. This will not only enhance our understanding of the generation process of LLMs but also extend the applicability and value of our method. We are currently limited by the availability of datasets to perform detailed analyses of other applications.

heading: A Appendix
text: A.1 Performance over target span position In this section, we analyze if the position of the target span (the span that needs to be attributed) within the answer influences the efficacy of our methodology. The start character of each span is normalized with respect to the length of the answer and the accuracy is measured for all the models on Sub-task2. As shown in Figure 8, the accuracy improves with increasing span position for all models. In decoder-only models each step can access information from previously generated or processed tokens only. As the model progresses through the text, it accumulates more information and context about the text it is analyzing. We believe that this behaviour is the reason why accuracy increases when we attribute later text spans.
A.2 Performance of layers in the disambiguation task setting
Given a span that needs to be attributed, there are instances in the dataset where ground truth attribution sub-string is present multiple times over different sources. During inference, our approach has to both identify the correct attribution sub-string and also disambiguate between the multiple occurances of the sub-string. Disambiguating over these multiple occurences, requires contextual understanding of the span to be attributed in order to choose between the occurences. Data points that require disambiguation are collected from the test set of the QuoteSum dataset.
We measure performance across all layers for different models on this subset (Figure 9). We compute the performance when one of the multiple occurrences of the sub-string is chosen randomly. This is highlighted as the random baseline in the figure.
Figure 9 shows an interesting trend, where early layers perform worse than the random baseline on the disambiguation task. Early layers capture low level, basic features of the input text, making them less suitable for a complex task such as disambiguation. Performance improves as we use later layers, with the middle layers yielding the best performance for Llama-70b and Mistral-7b, and later layers yielding the best performance for Llama-7b and OPT-350m.
A.3 Effect of hyper-parameters on Sub-task 1 performance
We present graphs for precision, recall and F1 in Figure 7 generated during our experiments on the QuoteSum train set, which show the impact of the threshold θ, and the choice of layer on the performance of our method (Llama-7b) for Sub-task 1. θ was chosen for each layer-model setup to achieve the best f1 score. Interestingly we note that in the earlier layers, higher thresholds are preferred. We hypothesize that there’s a higher chance of lowlevel information overlapping, necessitating more stringent filtering at the earlier layers.
A.4 Limitations of GPT models for Sub-task 1
Figure 6 depicts a qualitative example where GPT models fail in identifying directly copied spans from a source document on the QuoteSum dataset. In this example GPT-3.5 is only attributing entities like Lincoln Castle, Battle of Lincoln and the Second Battle of Lincoln. GPT-4 has a better understanding of the task but leaves out tokens like ’The’ which were copied verbatim from the source.
A.5 Synthetic Paraphrasing of QuoteSum
We paraphrase the QuoteSum dataset by prompting GPT-4 as shown below. A sample from the dataset is shown in Figure 10.
Document: {document} Based on the information contained in
the document, answer the question with details to the best of your abilities. Think step by step and explain your answer if that will help better understand the answer.
Q: {question} A: {answer} Given the above source passages, a
question and an answer. The answer summarizes the given sources while explicitly copying spans from the sources. Paraphrase the non-entity
parts of the answer within [] while keeping entities intact and rewrite in the same format as original answer.
Paraphrased Answer:
We computed the sub-task 2 performance of the various methods on the paraphrased test set and summarize the results in Table 3.
We observe that the performance of all the methods drop on the paraphrased version of QuoteSum by nearly the same amount(1-3%). This probably implying that synthetic paraphrasing setup while harder than the original dataset is not difficult enough to offer additional insights.
A.6 Qualitative Example for Sub-task 1 and Sub-task 2
To illustrate the utility of our method, a qualitative example is presented in Figure 11.
A.7 Prompts for GPT baselines We present the prompts used for our GPT-based baselines for Sub-task 1 and Sub-task 2 in Figure 13 and Figure 14 respectively. For Sub-task 1, the LLM has to respond with copied spans along with the source paragraph number. For Sub-task 2, we mark the verbatim copied spans in "[]" and prompt the LLM to identify the source paragraph only.
Given source passages, a question and an answer. The answer summarizes the given sources while explicitly copying spans from the sources. Identify the copied spans using brackets and the respective source number to indicate that this span was copied. Make sure to use all relevant sources and properly quote them. Here are some examples:
Question: Who was the bond girl in you only live twice? [1]You Only Live Twice (film) : Blofeld then orders Osato to kill Bond. Bond then meets ... [2]Aki (James Bond) : Aki is a fictional character created for the 1967 "James Bond" film "You Only Live Twice” ... [3]Aki (James Bond) : Following her death, Aki is almost immediately replaced by Kissy Suzuki and is not ... [4]You Only Live Twice (film) : The tall set could be seen from away, and attracted many people from ... [5]Aki (James Bond) : Aki does not appear in Ian Fleming's 1964 novel. She was originally named Suki ... Answer: Aki is the Bond girl in You Only Live Twice , although Kissy Suzuki is considered the 'main' Bond girl in this film, but Aki has a bigger role and is more memorable . Quoted answer: [ 3 Aki ] is [ 3 the ] [ 3 Bond ] girl in [ 1 You Only Live Twice ] , although [ 3 Kissy Suzuki is considered the 'main' Bond girl in this film, but Aki has a bigger role and is more memorable ] .
Question: who are the new cast members in american horror story? [1]American Horror Story: Roanoke : American Horror Story: Roanoke is the sixth season of the FX horror anthology television ... [2]American Horror Story: Coven : Returning cast members from the previous seasons of the series include: Sarah Paulson ... [3]American Horror Story: Freak Show : Returning cast members from the of the series include: Sarah Paulson, Evan Peters ... [4]American Horror Story: Cult : Returning cast members from previous seasons include Sarah Paulson, Evan Peters, Cheyenne ... [5]American Horror Story : cast. In September 2016, the full main cast was announced after the first episode with the ... Answer: According to sources, the new cast members in Roanoke are Cuba Gooding Jr. and André Holland . In Coven, sources say the new cast members are Emma Roberts and Kathy Bates. In Freak Show, the new cast members are Michael Chiklis and Finn Wittrock. In Cult, the new cast members are Billie Lourd and Alison Pill. Quoted answer: According to sources, the new [ 1 cast members ] in [ 1 Roanoke ] are [ 1 Cuba Gooding Jr. and André Holland ] . In Coven, sources say the [ 2 new cast members ] are [ 2 Emma Roberts and Kathy Bates. ] In Freak Show, the [ 3 new cast members ] are [ 3 Michael Chiklis and Finn Wittrock. ] In Cult, the [ 4 new cast members ] are [ 4 Billie Lourd and Alison Pill. ]
Question: {question} {document} Answer: {clean_answer} Quoted answer:
Figure 13: Prompt for GPT-based baselines for Task-1.
Given source passages, a question and an answer. The answer summarizes the given sources while explicitly copying spans from the sources. Identify the copied spans using brackets and the respective source number to indicate that this span was copied. Make sure to use all relevant sources and properly quote them. Here are some examples:
Question: Who was the bond girl in you only live twice? [1]You Only Live Twice (film) : Blofeld then orders Osato to kill Bond. Bond then meets ... [2]Aki (James Bond) : Aki is a fictional character created for the 1967 "James Bond" film "You Only Live Twice” ... [3]Aki (James Bond) : Following her death, Aki is almost immediately replaced by Kissy Suzuki and is not ... [4]You Only Live Twice (film) : The tall set could be seen from away, and attracted many people from ... [5]Aki (James Bond) : Aki does not appear in Ian Fleming's 1964 novel. She was originally named Suki ... Marked answer: [ Aki ] is [ the ] [ Bond ] girl in [ You Only Live Twice ] , although [ Kissy Suzuki is considered the 'main' Bond girl in this film, but Aki has a bigger role and is more memorable ] . Annotated answer: [ 3 Aki ] is [ 3 the ] [ 3 Bond ] girl in [ 1 You Only Live Twice ] , although [ 3 Kissy Suzuki is considered the 'main' Bond girl in this film, but Aki has a bigger role and is more memorable ] .
Question: who are the new cast members in american horror story? [1]American Horror Story: Roanoke : American Horror Story: Roanoke is the sixth season of the FX horror anthology television ... [2]American Horror Story: Coven : Returning cast members from the previous seasons of the series include: Sarah Paulson ... [3]American Horror Story: Freak Show : Returning cast members from the of the series include: Sarah Paulson, Evan Peters ... [4]American Horror Story: Cult : Returning cast members from previous seasons include Sarah Paulson, Evan Peters, Cheyenne ... [5]American Horror Story : cast. In September 2016, the full main cast was announced after the first episode with the ... Marked answer: According to sources, the new [ cast members ] in [ Roanoke ] are [ Cuba Gooding Jr. and André Holland ] . In Coven, sources say the [ new cast members ] are [ Emma Roberts and Kathy Bates. ] In Freak Show, the [ new cast members ] are [ Michael Chiklis and Finn Wittrock. ] In Cult, the [ new cast members ] are [ Billie Lourd and Alison Pill. ] Annotated answer: According to sources, the new [ 1 cast members ] in [ 1 Roanoke ] are [ 1 Cuba Gooding Jr. and André Holland ] . In Coven, sources say the [ 2 new cast members ] are [ 2 Emma Roberts and Kathy Bates. ] In Freak Show, the [ 3 new cast members ] are [ 3 Michael Chiklis and Finn Wittrock. ] In Cult, the [ 4 new cast members ] are [ 4 Billie Lourd and Alison Pill. ]
Question: {question} {document} Answer: {clean_answer} Quoted answer:
Figure 14: Prompt for GPT-based baselines for Task-2.

heading: Future Work
text: In the future, we intend to employ datasets that include paraphrased spans. Testing on such data will allow us to assess the method’s effectiveness in attributing paraphrased information, identify potential challenges, and adapt our methodology accordingly. We also see potential for our method to be useful beyond the realm of contextual question answering. We tried mapping an LLM generated text span in Spanish to its source document in English (Figure 12). Interestingly, our method shows potential for this use case too. We envision applying our approach to other tasks that involve information extraction and attribution to a given context. This will not only enhance our understanding of the generation process of LLMs but also extend the applicability and value of our method. We are currently limited by the availability of datasets to perform detailed analyses of other applications