How Much Can RAG Help the Reasoning of LLM?

## Abstract

Abstract Retrieval-Augmented Generation (RAG) has gained significant popularity in modern Large Language Models (LLMs) due to its effectiveness in introducing new knowledge and reducing hallucinations. However, the deep understanding of RAG remains limited, how does RAG help the reasoning process and can RAG help improve the reasoning capability remains question. While external documents are typically considered as a method to incorporate domain-specific information, they also contain intermediate reasoning results related to the query, this suggests that documents could enhance the reasoning capability of LLMs, which has not been previously explored. In this paper, we investigate this issue in depth and find that while RAG can assist with reasoning, the help is limited. If we conceptualize the reasoning process as a tree with fixed depth, then RAG struggles to assist LLMs in performing deeper reasoning. Additionally, the information in the documents requires preprocessing to filter out noise. We demonstrate that this preprocessing is difficult to achieve simply fine-tuning of the LLM, it often necessitates numerous additional transformer layers to solve the problem. To simplify the problem, we propose DPrompt tuning, which effectively resolves the issue within just limited transformer layers, leading to improved performance.

## 1 Introduction

Large Language Models (LLMs) (Brown, ) have demonstrated remarkable capabilities across a variety of tasks, including text generation and question answering (Ouyang et al., ; Wei et al., ), code generation (Gu, ), and information retrieval (Dai et al., ). However, current LLMs often suffer from serious hallucinations (Huang et al., ) due to a lack of factual information. Moreover, the knowledge embedded within LLMs is encoded in their parameters (Yang et al., ), meaning that incorporating new knowledge requires further fine-tuning, which is both time-consuming and resource-intensive. Consequently, augmenting LLMs with external retrievers has led to significant performance improvements (Lewis et al., ; Zhao et al., ; Izacard et al., ).

Despite the widespread adoption of RAG in modern LLMs, a comprehensive understanding of how RAG aids inference remains an open question. Most researchers currently view RAG primarily as a method to provide domain-specific knowledge (Zhang et al., ), often seeking to adapt LLMs to particular domains through RAG (Soudani et al., ). However, the impact of RAG on enhancing reasoning capacity has yet to be thoroughly investigated.

First, we aim to understand how RAG operates and whether it can improve the reasoning capabilities of LLMs. We can consider the LLM as computing $p(y|q)$, where $q$ represents the query and $y$ is the corresponding answer. In this context, retrieval-augmented generation can be expressed as $p(y|q,d_{1},d_{2},\ldots,d_{k})$, where $d_{i}$ is the $i\text{-th}$ document retrieved based on the query $q$. Additionally, the well-known prompting technique, Chain of Thought (CoT) (Wei et al., ), which significantly enhances the reasoning ability of LLMs, can be represented as $p(y|q,x_{1},x_{2},\ldots,x_{k})$, where $x_{i}$ denotes the step-by-step reasoning results. Both CoT and RAG aim to incorporate additional information into the input to achieve better performance. It has been theoretically demonstrated and experimentally verified that CoT effectively improves the reasoning ability of LLMs (Feng et al., ; Wei et al., ; Chu et al., ). Thus, the question arises: Can RAG also enhance the reasoning capabilities of LLMs?

Fixed-depth transformer models with log precision can be simulated by constant-depth circuits (Merrill & Sabharwal, ), indicating that LLMs are limited to fixed-depth reasoning. When conceptualizing the reasoning path as a tree, the maximum depth remains constant (Merrill & Sabharwal, ). Chain of Thought (CoT) generates step-by-step reasoning or explanations rather than providing direct answers, formalized as $x_{1}=f(x),\ x_{2}=f(x,x_{1}),\ldots,y=f(x,x_{1},\ldots,x_{k})$. This process allows CoT to effectively expand reasoning depth by execute $f$ multiple times, potentially reaching infinite depth with sufficient CoT steps (Feng et al., ; Li et al., ). In contrast, Retrieval-Augmented Generation (RAG) does not facilitate multiple inferences; instead, it retrieves existing relevant information to generate answers (Shi et al., ). While RAG cannot stack LLM layers to enhance reasoning capability, the retrieved documents may include intermediate reasoning results, thereby reducing the number of layers needed for inference and enabling the LLM to tackle more complex problems, thus aiding its reasoning ability.

In this paper, we first demonstrate that RAG can enhance the reasoning ability of LLMs, enabling them to tackle more complex problems. If the model can initially solve problems with a reasoning depth of $l$, then with the addition of relevant document information, it could address problems with a reasoning depth of $l+c$, where $c$ is a constant determined by the quality of the retrieved information. This shows that RAG can help to improve the reasoning capability of LLM.

However, in real-world RAG scenarios, the information retrieved from documents is not always directly usable and often requires further processing because documents may contain noise information (Jiang et al., ; ), and some documents may even be completely distracting, containing incorrect answers (Shi et al., ; Wu et al., ). Such noise and distracting documents can negatively impact performance. While some works attempt to fine-tune the model to filter out noise (Xu et al., ) and distracting documents (Yan et al., ), these filtering processes may require additional reasoning depth and could ultimately harm overall performance. Also some works train another filter model (Yan et al., ; Asai et al., ), but this approach results in additional reasoning cost and makes it difficult to eliminate the inherent noise in the documents.

Therefore, a critical question arises: How difficult is the filtering problem, and can we effectively solve it within a limited number of layers? If the efforts to filter out noise is even more than the help RAG brings, RAG fail to improve the reasoning capability. First, we show that fine-tuning methods like LoRA also struggle to filter out noise without compromising reasoning capability, since filtering irrelevant tokens while maintaining the original attention patterns for relevant tokens proves challenging. This indicates that the filtering process cannot be effectively incorporated into the original reasoning steps of LLMs, necessitating additional reasoning depth for filtering, which can ultimately degrade the reasoning capability of the model.

Then we show that judging the relevance of a token can hardly be implemented by limited number of transformer layers. Considering the query ‘Alice is exhausted but Bob is still excited; how does Bob feel?’ Here, ‘exhausted’ is noise and should be excluded from the inference. However, assessing relevance necessitates considering the token ‘Bob’ in the query alongside ‘Alice’ the subject of ‘exhausted’. Thus, evaluating relevance requires the information from three or more tokens. Yet, the attention mechanism typically computes only pair-wise relationships, making it challenging to resolve this issue within a limited number of transformer layers (Sanford et al., ). With the number of transformer layers required for preprocessing increases, utilizing the document information for inference would help less, and even hurt the reasoning capability. To address this, we propose DPrompt tuning which transforms the triple-wise problem into a pair-wise one, and the pair-wise problem can be effectively tackled by limited layer of transformers, ultimately enhancing the reasoning ability of Retrieval-Augmented Language Models (RALM).

The main contributions of this paper are: (1) We demonstrate that RAG can enhance the reasoning ability of LLMs; however, this improvement is limited, allowing Retrieval-Augmented Language Models (RALMs) to solve problems that require slightly more reasoning depth than before; (2) We assert that fine-tuning the model to filter out noise while preserving its original functionality is challenging. This indicates that noise would lead to worse performance even after finetuning; (3) We further reveal that the inherent triple-wise nature of the filtering process may necessitate numerous transformer layers for effective document preprocessing, which could significantly degrade reasoning ability. To address this, we propose a method to transform the problem into a pair-wise format, making it easier to solve.

In Section 2, we explore the extent to which RAG can enhance the reasoning of LLMs, demonstrating that RAG has limited potential to improve reasoning capacity. In Section 3, we discuss the negative impact of noise on performance and the challenges associated with incorporating the filtering process into the reasoning process. In Section 4, we highlight the complexities involved in judging relevance, illustrating that solving this problem requires multiple layers, and we propose a method to simplify the process.

## 2 How Does RAG Help Reasoning

In this section, we explore the extent to which RAG can enhance the reasoning ability of LLMs, aiming to deepen our understanding of its role in reasoning. As demonstrated by Merrill & Sabharwal (), transformer-based models are constrained to a fixed depth of reasoning due to the limited number of layers. Chain of Thought (CoT) facilitates step-by-step reasoning, effectively stacking multiple LLMs to address a single problem. Thus, the question is: How can RAG assist during the reasoning process, and how much additional reasoning capacity can RAG provide to LLMs?

### 2.1 The fission of RAG

If we consider the reasoning steps of an LLM as a tree, the maximum reasoning depth is fixed at $L$ due to the constraints of the depth of the model. Additionally, the maximum width of this tree is also limited, as the number of attention heads per layer is finite.
For a reasoning tree $\mathcal{T}$ with $L$ layers, let the number of nodes in layer $i$ be denoted as $n_{i}$, and refer to the $j\text{-th}$ node in the $i\text{-th}$ layer as $u_{i,j}$. The retrieved document $d$ contains relevant information that can be leveraged to replace certain reasoning nodes with extracted document content. For instance, consider the query Who is the actor playing Jason on General Hospital?’ (Yoran et al., ). In this scenario, there may be a node $u_{i,j}$ representing the information about What is General Hospital?’. If we provide a document containing detailed information about General Hospital, the computation for $u_{i,j}$ can effectively be replaced by extracting relevant information from that document.

###### Definition 2.1 (Reasoning Tree) .

For a reasoning tree ${\mathcal{T}}_{L}$ of $L$ layers, and there are $n_{l}$ nodes in each layer $l$, $n_{L-1}=1$, all nodes in layer $l$ are connected to at least to one node in layer $l+1$. with probability $1-q_{l}$, node $u_{l,i}$ are connected to $u_{l+1,j}$, and the isolated nodes are randomly connected to a node in case of useless nodes.

In the reasoning tree, each node represents a calculation, with the output being some intermediate reasoning results. The connection between nodes $u_{i,j}$ and $u_{i-1,k}$ indicates that the calculation of $u_{i,j}$ relies on the output of $u_{i-1,k}$. The parameter $q_{l}$ reflects the sparsity of these connections. Consequently, for a node $u_{i,j}$, a document may contain relevant information, allowing the calculation for $u_{i,j}$ to be effectively replaced by information extracted from the document.

###### Definition 2.2 (Retrieval) .

For a reasoning tree ${\mathcal{T}}_{L}$, with probability $p_{l}$, the nodes in layer $l$ can be replaced by retrieved documents.

It’s important to recognize that processing documents also necessitates a certain depth of reasoning. However, extracting information from a document is fundamentally an information extraction process, whereas directly addressing a query is a purely inferential process. Therefore, we can assume that the cost of information extraction is lower than that of inference. This enables LLMs to leverage external information, thereby simplifying complex reasoning tasks.

###### Assumption 2.3 .

If the document $d$ contains information about node $u$ at the $l\text{-}th$ layer, then only $\lambda\cdot l$ layers are needed to extract the information from $d$, $\lambda<1$.

This assumption suggests that while processing documents requires some reasoning depth, it is generally shallower than the inference needed for directly addressing a query. Therefore, utilizing information from documents should be a more efficient solution. In this way, RAG can eliminate certain nodes and potentially enhance the expressive power of LLMs. However, this also indicates that RAG cannot completely minimize reasoning depth, as some layers are necessary for document processing. Consequently, for a reasoning tree ${\mathcal{T}}_{L}$, at least $\lambda\cdot L$ layers will be required to process the documents, even if we retrieve the documents directly lead to the answer.

The document not only simplifies the calculation of $u_{i,j}$ but also eliminates all nodes that are solely connected to $u_{i,j}$. These nodes contribute only to the reasoning of $u_{i,j}$, and since the information of $u_{i,j}$ can be directly derived from the document, their reasoning is rendered unnecessary. Thus, retrieving a single document related to node $u_{i,j}$ can result in the reduction of multiple lower-layer nodes. This process is similar to fission reactions in nuclear weapons, where the reduction of one node triggers the reduction of many others. Consequently, if all nodes in the $l^{\prime}$th layer are reduced by the Retrieval-Augmented Generation (RAG) method, any layer where $l\leq l^{\prime}$ can also be eliminated, effectively decreasing the overall reasoning depth.

Figure: Figure 1: The reasoning tree of LLM. $u_{i,j}$ represents nodes, and $D1,D2,D3$ represents the document information.
Refer to caption: x1.png

As illustrated in Figure 1, the reasoning tree consists of 4 layers, and we have retrieved 3 documents that provide information for nodes $u_{2,0}$, $u_{1,1}$ and $u_{2,2}$, respectively. and with document $D1$, node $u_{1,0}$ can also be erased because it contributes only to $u_{2,0}$, and with $D2$, $u_{0,1}$ is not also necessary, the same applies to node $u_{1,2}$ and $u_{1,3}$ because of $D3$. Consequently, all 4 nodes in layer 1 can be either accessed or reduced through the documents, meaning that all nodes in layer 1 and 0 are unnecessary. This results in a reasoning depth of 2 instead of 4. Thus, with relevant documents, RAG can effectively reduce the reasoning complexity of the problem, enabling the LLM to solve problems of higher complexity.

Figure: Figure 2: plot of $f(t)$ and $y=t$
Refer to caption: x2.png

We can observe that the elimination of a single node can significantly impact numerous nodes in shallower layers, much like a fission reaction. If this fission process can expand effectively, RAG could greatly enhance the reasoning capacity of LLMs. However, if the fission reaction halts at a certain threshold, the benefits may be limited. Therefore, to assess how many layers can be reduced by RAG, it is essential to determine whether this fission-like process can terminate. Understanding this dynamic is crucial for evaluating how RAG can improve reasoning capabilities and the overall efficiency of LLMs in complex problem-solving scenarios.

Consider a reasoning tree ${\mathcal{T}}_{L}$, let $t_{l+1}$ stands for the percentage of erased nodes in layer $l+1$, then the probability of one node being erased in layer $l$ is affected by $t_{l+1}$ and the retrieval probability $p_{l}$, and the sparsity of the layer $q_{l}$, let $t_{l}=f(t_{l+1},p_{l},q_{l})$, in the following of the paper, we will omit $p_{l},q_{l},t_{l+1}$, using simply $t_{l}=f(t)$.

The function $f(t)$ is expected to be increasing with respect to $t$, with $f(0)=p_{l}$ and $f(1)=1$. Defining $g(t)=f(t)-t$, which represents growth in layer $l$, we can consider the existence of a point $\hat{t}\in(0,1)$ where $g(\hat{t})=0$. If for $t>\hat{t}$, $g(t)<0$, this indicates that the expected number of erased nodes will be smaller than in the previous layer, suggesting that the fission reaction will not propagate indefinitely but will instead reach a critical threshold. Beyond this point, the number of nodes eliminated in the subsequent layer is expected to decrease compared to the current layer, thereby limiting the expansion of the fission reaction.

###### Theorem 2.4 (Fission of RAG) .

Let $t_{l}$ be the percentage of erased nodes in layer $l$, and let $n=n_{l+1}$. Then for layer $l$, if the retrival probability $p_{l}<1-\frac{1}{q_{l}^{n}-\ln q_{l}^{n}}$, then there exists $\hat{t}\in(0,1)$ satisfying $g(\hat{t})=0$, and for $t>\hat{t}$, $g(t)<0$.

The proof is detailed in Appendix A.1. This theorem indicates that the erased nodes cannot propagate indefinitely like a fission reaction; rather, they will stop at a certain threshold. Specifically, when $p_{l}<1-\frac{1}{q_{l}^{n}-\ln q_{l}^{n}}$ and $t\geq\hat{t}$, it follows that $f(t)\leq t$. As illustrated in Figure 2, if $x\leq\hat{t}$, the probability of erasure increases, whereas for $x>\hat{t}$, it gradually decreases, stabilizing at $\hat{t}$.

The existence of $\hat{t}$ primarily depends on $p_{l}$ and $q_{l}^{n}$. In a regular reasoning tree, there are fewer nodes at the top and more nodes in shallower layers, resulting in tighter connections (smaller $q$ and $n$ at higher levels). Define $h(q,n)=1-\frac{1}{q_{l}^{n}-\ln q_{l}^{n}}$. Assuming $q\in[0.1,0.8]$ and $n\in[2,16]$, with $q_{i}-q_{j}=\eta(n_{i}-n_{j})$, we find that $h(q,n)\geq 0.7$. This suggests that to sustain the fission reaction, we need to retrieve most intermediate reasoning results, which becomes challenging in higher layers, as we mainly retrieve information about basic concepts during reasoning. Consequently, this leads to the termination of the fission reaction in those upper layers. We set the maximal $n$ as 16 because Merrill & Sabharwal () shows that two heads can simulate one reasoning node in the circuits, and for LLMs with 32 heads, the maximal $n$ is 16, and with larger $n$, $h(q,n)$ increases, making it harder for the fission reaction to continue.

Now we consider the scenario where the fission reaction converges to a certain point and calculate the probability of erasing a layer. As the probability of replacing a node approaches $\hat{t_{l}}$, we assume that the probability of replacing a node in layer $l$ is $\hat{t_{l}}$, i.e., $t_{l}=\hat{t_{l}}$. In Appendix A.2, we demonstrate through simulation that $t_{l}\approx\hat{t_{l}}$, which validates our assumption.

###### Theorem 2.5 .

With $p_{l}<1-\frac{1}{q^{n}-n\ln q}$, if we want probability $\delta$ that all nodes in layer $l$ can be replaced by document information, we need $p_{l}\gtrsim 1-\frac{\epsilon}{1-q^{\epsilon n}}$, and $\epsilon\leq 1-\sqrt[n]{\delta}$.

Figure: Figure 3: plot of the threshold, the y-axis is $1-\frac{\epsilon}{1-q^{\epsilon n}}$, x-axis is the layer and $\delta$ is the probability of replacing the whole layer
Refer to caption: x3.png

The proof is presented in Appendix A.2. According to the theorem, $1-\frac{\epsilon}{1-q^{\epsilon n}}$ is decreasing with $\epsilon$, so for a feasible solution, we require a large $\epsilon$, i.e., a small $\sqrt[n]{\delta}$. Considering a similar scenario with $q\in[0.1,0.8]$ and $n\in[2,16]$, where $q_{i}-q_{j}=\eta(n_{i}-n_{j})$, as shown in Figure 3, high-probability layer erasure is primarily achievable in lower layers, as we cannot retrieve much information from higher layers. However, we also observe that with a small probability, effectively erasing higher layers is possible, indicating that RAG can significantly enhance LLM reasoning. This suggests that if we are fortunate enough to retrieve documents that directly lead to the answer, we can substantially reduce reasoning complexity. Nonetheless, in typical scenarios, the assistance is limited since most retrieved documents contain only basic information.

###### Definition 2.1 (Reasoning Tree) .

###### Definition 2.2 (Retrieval) .

###### Assumption 2.3 .

###### Theorem 2.4 (Fission of RAG) .

###### Theorem 2.5 .

## 3 Noise in the Document

In real-world applications of RAG, Due to the limited capacity of the retriever, distractions frequently arise in the retrieved documents (Shi et al., ; Wu et al., ). Moreover, even in relevant documents, the presence of noise information is common (Jiang et al., ; ; Xu et al., ). So we cannot directly use the information from retrieved documents; further processing is necessary because those noise and distracting information can be mistakenly interpreted as relevant, significantly degrading the performance of RALM. In this section, we examine the extent to which distracting and noisy information impacts overall performance.

For a token ${\bm{x}}$, we assume that its embedding contains two distinct pieces of information: ${\bm{w}}$, which acts as the regressor to determine the relevance of the document to the query, and ${\bm{s}}$, representing other information useful for inference. Thus, we can express the relationship as $H({\bm{x}})=H({\bm{s}},{\bm{w}})$, where $H(\cdot)$ denotes entropy. Let ${\bm{z}}$ be the token embedding after passing through the transformer layers, and let ${\bm{Z}}=[{\bm{z}}_{1}^{T},\ldots,{\bm{z}}_{n}^{T}]$, where $n$ is the sequence length. We use ${\bm{Z}}_{r}$ to denote the embeddings of the related tokens.

When generating new tokens, the token embedding is integrated into the inference process. Therefore, if more information about ${\bm{w}}$ is incorporated into ${\bm{z}}$ (resulting in a high $I({\bm{w}};{\bm{z}})$), the model can effectively recognize irrelevant tokens when conducting inference. Conversely, if the information is limited, the model is likely to be significantly affected by noise and distracting information in the input.

###### Theorem 3.1 (Impact of Noise) .

Given a set of input tokens, with $\delta$ percent of related and $1-\delta$ percent of distractions. If we assume documents contribute the same, and LLM conducts the filtering before inference, then

$$ $\mathcal{L}(\delta)-\mathcal{L}(1)\leq c_{1}\sqrt{\left(\frac{(1-\delta)H({\bm{w}}|{\bm{z}})}{\delta(I({\bm{w}};{\bm{z}})+1)}\right)\cdot H({\bm{Z}}_{r})}+c_{2},$ (1) $$

where $\mathcal{L}(\delta)$ stands for the loss with $\delta$ percent of relevant documents and $\mathcal{L}(1)$ means the loss with all information related to the query, no distraction is involved. ${\bm{z}}$ is the embedding of documents, $H(\cdot)$ and $I(\cdot;\cdot)$ represents the entropy and mutual information. $c_{1},c_{2}$ are constants and the value is shown in Appendix B.1.

The proof is presented in Appendix B.1. From Equation 1, we see that the generalization error decreases as $\delta$ increases. This indicates that if not all information needed to distinguish irrelevant tokens is captured in the embedding, an increasing number of distracting documents will have negative affect on performance.
The term $H({\bm{Z}}_{r})$ represents the amount of relevant token information utilized to infer the final result, suggesting that the greater the reliance of the LLM on documents, the more detrimental the impact of noise becomes. Furthermore, performance is primarily determined by $I({\bm{w}};{\bm{z}})$, which quantifies the information in the embedding relevant for assessing the document’s relevance.
Recent studies indicate that LLMs effectively perform information compression (Delétang et al., ; Huang et al., ; Yu et al., ), retaining only the information pertinent to the downstream task while discarding extraneous noise, specifically $H({\bm{z}}|{\bm{s}})$. Consequently, only limited information about how to differentiate irrelevant documents is preserved, leading to diminished performance.

###### Theorem 3.1 (Impact of Noise) .

### 3.1 Finetuning Helps But not Perfectly

Clearly, noise in the documents negatively impacts the performance of LLMs. Some researchers focus on fine-tuning the model to better filter out irrelevant documents, thereby enhancing performance (Yoran et al., ; Zhang et al., ; Jiang et al., ). However, filtering out noise may require additional reasoning layers, which could hinder the reasoning ability of RALM. Therefore, we aim to explore whether we can incorporate the filtering process into the reasoning process, specifically addressing the question: can we filter out irrelevant information while conducting the original inference?

Let ${\bm{r}}$ represents the relevance of tokens, $r_{i}=0$ means that token ${\bm{x}}_{i}$ is a noise token, otherwise the token is relevant. Let $attn({\bm{x}}_{i},{\bm{x}}_{j})=({\bm{W}}_{q}{\bm{x}}_{i})^{T}{\bm{W}}_{k}{\bm{x}}_{j}$ represent the original attention layer of the LLM. And we assume that the desired self-attention function is:

$$ $\widehat{attn}({\bm{x}}_{i},{\bm{x}}_{j})=\begin{cases}0&\text{ if }\ r_{j}=0,\\ ({\bm{W}}_{q}{\bm{x}}_{i})^{T}{\bm{W}}_{k}{\bm{x}}_{j}&\text{ else, }\end{cases}$ (2) $$

The desired attention pattern should effectively exclude noise while preserving the original attention of relevant tokens. We assume that, in the presence of relevant tokens, the original model represents the optimal solution, as it is specifically trained to address the problem. Therefore, $\widehat{attn}$ can be considered the optimal response when confronted with noise, as it effectively filters out irrelevant tokens and utilizes the relevant information in the most efficient manner.

Finetuning the model involves adjusting its parameters, which allows the finetuned model to be expressed as $attn^{\prime}({\bm{x}}_{i},{\bm{x}}_{j})=\left(({\bm{W}}_{q}+\Delta{\bm{W}}_{q}){\bm{x}}_{i}\right)^{T}\left({\bm{W}}_{k}+\Delta{\bm{W}}_{k}\right){\bm{x}}_{j}={\bm{x}}_{i}^{T}({\bm{W}}+\Delta{\bm{W}}){\bm{x}}_{j}$, where ${\bm{W}}={\bm{W}}_{q}^{T}{\bm{W}}_{k}$ and $\Delta{\bm{W}}$ represents the adjustments. The critical question arises: can we finetune the model to approximate the optimal one, i.e., is there a $\Delta{\bm{W}}$ such that $\sigma(attn^{\prime}({\bm{x}}_{i},{\bm{x}}_{j}))\approx\sigma(\widehat{attn}({\bm{x}}_{i},{\bm{x}}_{j}))$? $\sigma(\cdot)$ represents the softmax.

###### Theorem 3.2 .

if there exists $attn^{\prime}({\bm{x}}_{i},{\bm{x}}_{j})={\bm{x}}_{i}({\bm{W}}+\Delta{\bm{W}}){\bm{x}}_{j}$, $\epsilon$ approximates $\widehat{attn}({\bm{x}}_{i},{\bm{x}}_{j})$ i.e., $(1-\epsilon)\sigma(\widehat{attn}(x_{i},x_{j}))\leq\sigma(attn^{\prime}(x_{i},x_{j}))\leq(1+\epsilon)\sigma(\widehat{attn}(x_{i},x_{j}))$, then we need

$$ $\delta\lesssim\ln\frac{1}{1-\epsilon},$ $$

where $\delta=\max({\bm{x}}_{i}^{T}\Delta{\bm{W}}{\bm{x}}_{j})-\min({\bm{x}}_{i}^{T}\Delta{\bm{W}}{\bm{x}}_{j})$, and $x_{j}$ is a relevant token.

The proof is presented in Appendix B.2. To effectively fine-tune the model for filtering out irrelevant information in the attention matrix, we need $\delta\approx 0$. This implies that for all tokens to be retained, ${\bm{x}}_{i}^{T}{\bm{W}}{\bm{x}}_{j}$ must remain nearly constant. As a result, approximating the optimal solution proves to be quite challenging.

Since the self-attention layer struggles to filter out irrelevant information while maintaining optimal reasoning performance, a pertinent question arises: can the feed-forward network connected to the self-attention layer effectively filter out mistakenly incorporated information? Here, we denote the information necessary to assess the relevance of the involved tokens as $\hat{{\bm{w}}}$, so $H(\hat{{\bm{w}}})=H({\bm{w}}_{i1},{\bm{w}}_{i2},\ldots)$, where ${\bm{w}}_{ij}$ represents the relevance information of the token aggregated by self-attention and those tokens form the input to the feed forward layer.

###### Theorem 3.3 .

For a Feed Forward Network $f$ and the input embedding $v$ contains $1-\delta$ percent of noise information, assume the optimal function is $\hat{f}(x)$ which filter out the noise and finish the inference, then

$$ $\begin{split}&\Pr\left(||f(x)-\hat{f}(x)||>t^{\prime}\right)>\frac{1}{C}\left(H({\bm{v}})-\delta\frac{I(\hat{{\bm{w}}};{\bm{v}})+1}{H(\hat{{\bm{w}}})}\cdot I({\bm{s}};{\bm{v}})\right),\end{split}$ (3) $$

where $t$ is a constant, $t^{\prime}=t+c_{1}\sqrt{(1-\delta)\frac{H(\hat{{\bm{w}}}|{\bm{v}})-1}{H(\hat{{\bm{w}}})}\cdot I({\bm{s}};{\bm{v}})}+c_{2}$. $H({\bm{v}})$ stands for all the information needed to conduct inference. $C=\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}$ is a constant and we show it in the Appendix.

The proof is detailed in Appendix B.3. From the above theorem, it is evident that achieving better performance requires the input to incorporate information that effectively distinguishes irrelevant tokens (a large $I(\hat{{\bm{w}}};{\bm{v}})$) and the necessary information for inference (a large $I({\bm{s}};{\bm{v}})$). Additionally, there should be minimal noise incorporated into the input (a large $\delta$). As previously noted, the self-attention module struggles to filter out irrelevant information while retaining relevant tokens, which makes it difficult to increase $\delta$. Furthermore, it is difficult to integrate additional information about $\hat{{\bm{w}}}$ (i.e., to increase $I(\hat{{\bm{w}}};{\bm{v}})$) because the input to the MLP layer is given by ${\bm{v}}=\sum_{j}a_{i,j}{\bm{x}}_{j}{\bm{W}}_{v}$, resulting in ${\bm{v}}$ being an embedding of dimension $m$ and precision $p$. This limited dimensionality makes it challenging to encapsulate all the necessary information for filtering out irrelevant documents for all involved tokens. Consequently, the Feed Forward Layer is unlikely to achieve optimal performance when dealing with noisy input.

###### Theorem 3.2 .

###### Theorem 3.3 .

## 4 Extra Lyaers for Filtering

Clearly, noise in the documents adversely affects the performance of large language models (LLMs), and filtering out this information without compromising the performance ability of the retrieval-augmented language model (RALM) is challenging. Additional layers are necessary for effectively filtering out irrelevant information. If we cannot resolve the filtering issue within a limited number of layers, the overall reasoning capability of the RALM may fall below that of standard reasoning models, resulting in retrieved documents failing to enhance the reasoning abilities of the LLM. Therefore, the crucial question is: how many layers are required to effectively address the filtering problem?

### 4.1 The Triple-Wise Problem

For an input sequence ${\bm{X}}=[{\bm{x}}_{0}^{T},{\bm{x}}_{1}^{T},\ldots,{\bm{x}}_{n-1}^{T}]$, the vector ${\bm{r}}$ indicates the relevance of each token. Specifically, for each token ${\bm{x}}_{i}$, a relevance score of $r_{i}=0$ signifies that the token is irrelevant to the query. It’s crucial to note that calculating $r_{i}$ does not solely depend on the token embedding ${\bm{x}}_{i}$ and the query; rather, it may require the involvement of three or more tokens. For instance, in the query “Alice is exhausted, but Bob is still very excited, showing no signs of fatigue. How does Bob feel?”, the word “exhausted” acts as noise and should be excluded during inference. However, determining relevance necessitates considering “Bob” in the query alongside “Alice”, the subject of “exhausted”. Therefore, identifying the relevance of a token demands information from multiple tokens, yet self-attention computes relationships only between pairs, making it challenging to address this issue within a single transformer layer.

Consider a simple scenario in which three tokens are sufficient to determine the relevance of a given token. The task is to ascertain whether there exists information indicating that token ${\bm{x}}_{i}$ is noise relative to the query. Let $g({\bm{x}}_{i},{\bm{x}}_{a},{\bm{x}}_{b})$ be the function designed to identify whether tokens ${\bm{x}}_{a}$ and ${\bm{x}}_{b}$ suggest that token ${\bm{x}}_{i}$ is a relevant token, if $g({\bm{x}}_{i},{\bm{x}}_{a},{\bm{x}}_{b})=0$, then $x_{i}$ is a noise token, otherwise it is relevant. Thus, the problem can be framed as follows:

$$ $r_{i}=\begin{cases}0&\text{ if }\ \exists\ a,b\ s.t.\ g(x_{i},x_{a},x_{b})=0,\\ 1&\text{ else. }\end{cases}$ $$

And we need a transformer based model ${\mathcal{M}}$ to calculate ${\bm{r}}={\mathcal{M}}({\bm{X}})$, and we can show that one layer of transformer can hardly complete the task.

###### Theorem 4.1 .

For input documents of length $n$, and a constant $c$ if $mpH\leq c\cdot nH({\bm{w}})/\log\log n$, then there is no one layer transformer ${\mathcal{M}}$ with embedding size $m$, precision $p$ and $H$ heads to judge the relevance of tokens.

Consequently, a single layer of multi-head attention struggles to assess the relevance of a token. As noted in Conjecture 19 of Sanford et al. (), even multiple layers of multi-head attention may not effectively resolve this issue. The challenge arises from the triple-wise nature of the problem contrasted with the pair-wise nature of attention; the model can only evaluate a token’s relevance when its embedding contains substantial information.
For example, to assess the token “fatigue” in the sentence “Alice is exhausted, but Bob is still very excited, showing no signs of fatigue. How does Bob feel?”, the embedding must encompass information about its subject, “Bob”, as well as contextual details from phrases like “no signs of” and “showing”. Therefore, a significant amount of information must be incorporated into the embedding before any judgement can be made.
However, a single layer of self-attention can only consider the input $\sum_{j}a_{i,j}{\bm{x}}_{j}$, which contains information up to $mp$, where $m$ represents the embedding dimension and $p$ indicates precision. The term $mp$ signifies the maximal entropy of the embedding, which means the maximal information the embedding can carry. This suggests that multiple attention layers may be necessary to encompass all relevant information effectively.

Furthermore, this method renders Assumption 2.3 unrealistic, as assessing relevance requires a deep understanding of the document, thereby increasing the number of layers necessary for effective information extraction. If we assume that $t$ layers are needed to evaluate relevance, then extracting information about node $u_{l,j}$ would require $\lambda\cdot l+t$ layers. This could potentially exceed $l$, and extracting information from documents may necessitate a greater reasoning depth than standard reasoning.
Consequently, nodes located below layer $\frac{t}{1-\lambda}$ cannot access document information because their reasoning would be finished faster than information extraction of documents. Then the reasoning depth cannot be easily reduced, as it primarily occurs in the lower layers. Therefore, leveraging document information may not enhance reasoning ability; in fact, it could potentially degrade performance if the model becomes overly reliant on document information rather than employing vanilla reasoning.

###### Theorem 4.1 .

### 4.2 Simplicify the Problem

Therefore, reducing the number of layers required for filtering is essential to enhancing the reasoning ability of retrieval-augmented language models (RALMs). In the retrieval-augmented generation (RAG) setting, we can simplify the triple-wise problem. By precalculating information from the document and representing this summarized information as one or a few additional tokens (virtual prompt tokens), we can evaluate the relevance of a token using only the information from the token itself, the query, and the summarized document.

This approach simplifies the problem to:

$$ $r_{i}=\begin{cases}0&\text{ if }\ \exists\ a,b\ s.t.\ g(x_{i},x_{v},x_{b})=0,\\ 1&\text{ else. }\end{cases}$ $$

where $x_{v}$ represents the virtual prompt token. By fixing the position of one token, we can utilize the first transformer layer to aggregate information of $x_{i}$ and $x_{v}$. In the second layer, the problem is actually a pair-wise one because $x_{i}$ already hold enough information about $x_{v}$, so $x_{i}$ and $x_{b}$ are enough to judge the relevance. This approach effectively reformulates the triple-wise problem into pair-wise one, which the transformer can more readily address within a single layer. This could be done because we fix the position of one information, then the triple-wise problem becomes two pair-wise problem. Otherwise, we need to incorporate plenty of information before final judgement, because we do not know which one could be useful when judging the relevance. With the virtual document token, we summarize those information about judging the relevance in a fixed position, and we can easily gather those information for final judgement

However, most large language models (LLMs) are trained in an autoregressive manner, meaning that a token cannot aggregate information from any tokens that appear later in the sequence; thus, $a_{i,j}=0$ if $j>i$. Typically, the query is positioned after the document tokens, preventing these document tokens from assessing their relevance effectively. Consequently, the relevance judgement must occur during the calculation of the query embedding, complicating the assessment process and limiting the model’s ability to utilize document information to judge the relevance.

Instead, if we position the query ahead of documents, then the relevance can be effectively calculated for document tokens. This arrangement enables the information of query to be effectively transferred to the document tokens for relevance judgement. Therefore, we can hypothesize that when there is noise in the document, placing the query at the beginning would help the judgement.

Considering the scenario where we aim to judge the relevance of the first token of the documents, with the relevance being determined by the first token of the query (a pair-wise situation), we can demonstrate that placing the query ahead is beneficial.

###### Proposition 4.2 .

Using auto-regressive transformer to solve the pair-wise problem requires $mp\geq(n_{document}+1)H({\bm{w}})$. Putting the query ahead only requires $mp\geq 2H({\bm{w}})$, where $n_{document}$ represents the number of documents.

**Table 1: The performance with noise.**
| Model | gold | gold_r | dis | dis_r |
| --- | --- | --- | --- | --- |
| LLama3 | 0.62 | 0.67 | 0.41 | 0.53 |
| Vicuna | 0.55 | 0.59 | 0.52 | 0.44 |
| Mistral | 0.66 | 0.69 | 0.59 | 0.62 |

This is primarily because documents cannot assess their relevance when the query is placed after them. In this scenario, the query must evaluate the relevance of all documents. However, if the query is positioned first, the documents can independently assess their own relevance.

We conduct experiments on three models with a subset of NQ (Kwiatkowski et al., ), more details about the experiment is shown in Appendix D. As shown in Table 1, positioning the query ahead significantly enhances performance. The term ”gold” refers to the configuration ”query, gold-document” indicating that the query is placed before the documents, with only the gold document (which contains the answer) included. In contrast, ”dis” represents the configuration ”query, gold-document, distraction-document” where one distracting document is incorporated. The notation ”gold-r dis-r” signifies that the query has been placed both ahead and after of the documents. It is clear that this arrangement improves performance across all three models except for vicuna when faced with distraction, we assume that this is mainly because vicuna is finetuned on a conversation dataset, which makes the model already capable of handling distracting documents, and the reversed query document order have negative impact on the filtering process.

###### Proposition 4.2 .

## 5 DPrompt tuning

As stated in the previous section, effectively addressing this problem requires the use of virtual tokens at the beginning of the prompt to represent the document’s information. To accomplish this, we propose training an additional model to extract information from the document and utilize the embeddings to encapsulate this information. We then append these virtual tokens to the front of the prompt before conducting inference.

It is important to note that the model used for information extraction does not impose any additional inference costs on the LLM, because the calculations are solely based on the document, This allows us to precalculate the embeddings and directly retrieve the information while retrieving documents, ensuring that there is no extra cost during inference.

Specifically, we fine-tune a BERT-base-uncased model with an additional multi-layer perceptron (MLP) to project the embeddings to the appropriate dimensions. Given an input prompt, we identify the relevant documents, encode them as virtual tokens, and then inject these tokens at the front of the prompt.

Additionally, we perform inference with the query both before and after the documents to optimize performance. And we put the virtual tokens represents the documents before the query for all tokens to effectively take advantage of the virtual token. We also employ LoRA fine-tuning methods to enhance the model’s ability to leverage the information in the virtual document tokens.

**Table 2: Performance of DPrompt tuning**
|  | LLama3 | Vicuna | Mistral |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
|  | gold | gold dis | gold | gold dis | gold | gold dis |
| vanilla | 0.67 | 0.53 | 0.59 | 0.44 | 0.69 | 0.62 |
| Lora | 0.71 | 0.5 | 0.55 | 0.43 | 0.67 | 0.62 |
| Prompt | 0.63 | 0.54 | 0.55 | 0.43 | 0.65 | 0.61 |
| Lora+Prompt | 0.65 | 0.57 | 0.63 | 0.49 | 0.69 | 0.63 |
| Dprompt | 0.72 | 0.58 | 0.65 | 0.51 | 0.71 | 0.64 |

We conduct experiments using a subset of Natural Questions (NQ) dataset (Kwiatkowski et al., ), we utilize Contriever to extract documents, treating those that do not contain the answer as distracting documents (Cuconasu et al., ). It’s important to note that while the gold documents contain relevant information, they also include significant amounts of noise. More experimental details are shown in Appendix D.

In the ”gold” configuration, the prompt contains only the query and one gold document, which is the most relevant to the query. The ”gold dis” configuration includes one gold document along with two distracting documents in the input prompt.

From Table 2, we can see that DPrompt tuning achieves significant performance improvements across all three models. This indicates that adding virtual tokens at the beginning enhances the LLM’s ability to distinguish irrelevant information. However, there are instances where the LoRA-fine-tuned model performs worse than the vanilla reasoning with RAG, aligning with previous findings that fine-tuned RALM may performs worse (Lakatos et al., ). We also conduct experiments with regular order (query ahead of documents) and we put the result in Appendix D.2

## 6 Conclusion

In this paper, we highlight that while RAG can enhance the reasoning capabilities of LLMs, it often only expands a limited number of reasoning depth unless we directly obtain information leading to the answer. However, noise within the documents can negatively affect performance, and processing these documents demands a certain depth of reasoning, we further demonstrate that filtering irrelevant information cannot be achieved within a few transformer layers due to its intrinsic triple-wise nature. To address this, we propose a method called DPrompt tuning which allows for effective resolution within few layers of the transformer.

## Appendix A Expressive Power of RAG

### A.1 Proof of Theorem 2.4

Assume there is a tree of $L$ layers and each layer has $n_{l}$ nodes, the top of the tree got only one node. There are connections between the layer and its upper layer, the probability of connection is $1-q_{l}$, if node $u_{l,i}$ is not connected to any node, than we randomly sample a node and set the connection, the probability of no connection is obviously $q_{l}^{n_{l+1}}$

The connection can be regarded as reasoning paths, and RAG can ignore the reasoning path, directly give the answer corresponding to node $u_{l,i}$, $u_{l,i}$ stands for the $i^{th}$ node of the $l^{th}$ layer. Assume that node $u_{l,i}$ is retrived by RAG, then all the downstream nodes connect to and only to node $u_{l,i}$ can also be erased.

Assume in layer $l+1$, $r_{l+1}$ nodes are erased, then for layer $l$, let $n=n_{l+1}$, the probability of nodes being erased is,

$$ $p_{e}=(1-q_{l}^{r_{l+1}})q_{l}^{n-r_{l+1}}+q_{l}^{n}\frac{r_{l+1}}{n}$ (4) $$

$1-q_{l}^{r_{l+1}}$ means it connects to at least one of the $r_{l+1}$ nodes, and $q_{l}^{n-r_{l+1}}$ means that it is not connected to other nodes. So the first item $(1-q_{l}^{r_{l+1}})q_{l}^{n-r_{l+1}}$ means that when the node is connected to at least one of the $r_{l+1}$ nodes, and not connected to other nodes. And the second item $q_{l}^{n}\frac{r_{l+1}}{n}$ means that it is not connected to any of nodes, so the connection is randomly set, and the setted node is erased.

Also, RAG can retrieve some information about layer $l$, Assume that with probability $p_{l}$, RAG retrieves information about node $u_{l,i}$, then, the percentage of node erased by converge and RAG are $t_{l}$, $n$ stands for the number of nodes in layer $l+1$

$$ $\begin{split}p&=p_{e}+p_{l}\cdot(1-p_{e})\\ &=\left((1-q_{l}^{r_{l+1}})\cdot q_{l}^{n-r_{l+1}}+q_{l}^{n}\frac{r_{l+1}}{n}\right)+p_{l}\cdot\left(1-\left((1-q_{l}^{r_{l+1}})\cdot q_{l}^{n-r_{l+1}}+q_{l}^{n}\frac{r_{l+1}}{n}\right)\right)\\ &=q_{l}^{n}\left(q_{l}^{-r_{l+1}}-1+\frac{r_{l+1}}{n}\right)+p_{l}-p_{l}q_{l}^{n}\left(q_{l}^{-r_{l+1}}-1+\frac{r_{l+1}}{n}\right)\\ &=\left(q_{l}^{n}-p_{l}q_{l}^{n}\right)\left(q_{l}^{-r_{l+1}}-1+\frac{r_{l+1}}{n}\right)+p_{l}\\ \end{split}$ $$

$$ $\mathbb{E}(t_{l})=p=\left(q_{l}^{n}-p_{l}q_{l}^{n}\right)\left(q_{l}^{-kt_{l+1}}-1+t_{l+1}\right)+p_{l}$ $$

$t_{l}$ stands for the percentage of nodes could be erased, consider a function $f(t)$ where

$$ $f(t)=\left(q_{l}^{n}-p_{l}q_{l}^{n}\right)\left(q_{l}^{-nt}-1+t\right)+p_{l}$ $$

$$ $\begin{split}f^{\prime}(t)&=\left(q_{l}^{n}-p_{l}q_{l}^{n}\right)\left(-nq_{l}^{-nt}\ln q_{l}+1\right)\end{split}$ $$

Considering $g(t)=f(t)-t$ then,

$$ $\begin{split}g^{\prime}(t)&=\left(q_{l}^{n}-p_{l}q_{l}^{n}\right)\left(-nq_{l}^{-nt}\ln q_{l}+1\right)-1\\ &=(1-p_{l})q_{l}^{n}(-nq_{l}^{-nt}\ln q_{l}+1)-1\end{split}$ $$

For simplicity, we use $p$ and $q$ instead of $p_{l}$ and $q_{l}$
When $g^{\prime}(t)=0$, we can dervie that:

$$ $\displaystyle(1-p)\cdot q^{n}\cdot\left(-nq^{-nt}\ln q+1\right)-1=0$ $\displaystyle-(1-p)q^{n}nq^{-nt}\ln q+(1-p)q^{n}-1=0$ $\displaystyle-(1-p)q^{n}nq^{-nt}\ln q=1-(1-p)q^{n}$ $\displaystyle q^{-nt}=\frac{1-(1-p)q^{n}}{(p-1)q^{n}n\ln q}$ $\displaystyle-nt\ln q=\ln\left(1-(1-p)q^{n}\right)-\ln\left((p-1)q^{n}n\ln q\right)$ $\displaystyle t=\frac{\ln\left((p-1)q^{n}n\ln q\right)-\ln\left(1-(1-p)q^{n}\right)}{n\ln q}$ $\displaystyle t=\frac{n\ln q+\ln\left((p-1)n\ln q\right)-\ln\left(1-(1-p)q^{n}\right)}{n\ln q}$ $\displaystyle t=1+\frac{\ln\frac{(p-1)n\ln q}{1-(1-p)q^{n}}}{n\ln q}$ $$

It is easy to see that $f^{\prime}(t)$ is monotonically increasing with $t$ and $f^{\prime}(t)>0$, so when $t<1+\frac{\ln\frac{(p-1)n\ln q}{1-(1-p)q^{n}}}{n\ln q}$, $f^{\prime}(t)<1$ and reversely, when $t>1+\frac{\ln\frac{(p-1)n\ln q}{1-(1-p)q^{n}}}{n\ln q}$, $f^{\prime}(t)>1$.

So $g(t)=f(t)-t$ will decrease first and increase later, and $g(0)=f(0)-0=f(0)=p_{l}\geq 0$, and $g(1)=0$. And the question is, is there a chance that $g(t)<0$, which means that the nodes erased in layer $l$ is fewer that layer $l+1$? In this case, the fission reaction can reach a bound, otherwise, the fission continues until it erase all nodes.

Apparently, if $\frac{\ln\frac{(p-1)n\ln q}{1-(1-p)q^{n}}}{n\ln q}>=0$, then $1$ will be the first zero-point of $g(t)$ because $g(t)$ monotonically decreases with $t$, so $g(t)>=0$ with $t\in[0,1]$. Otherwise, if $\frac{\ln\frac{(p-1)n\ln q}{1-(1-p)q^{n}}}{n\ln q}<0$, then, $g(t)$ decreases first and increases, and let $g^{\prime}(\hat{t})=0$, we have $g(\hat{t})<0$, then $1$ will be the second zero-point, so $g(t)$ could be smaller than 0 with $t\in[0,1]$.

Apparently $n\ln q<0$, so with $\ln\frac{(p-1)n\ln q}{1-(1-p)q^{n}}>0$, then $g(t)$ could be smaller than 0 with $t\in[0,1]$.

$$ $\displaystyle\ln\frac{(p-1)n\ln q}{1-(1-p)q^{n}}>0$ $\displaystyle(p-1)n\ln q-\left(1-(1-p)q^{n}\right)>0$ $\displaystyle-(1-p)n\ln q-1+(1-p)q^{n}>0$ $\displaystyle(1-p)(q^{n}-n\ln q)>1$ $\displaystyle 1-p>\frac{1}{q^{n}-n\ln q}$ $\displaystyle p<1-\frac{1}{q^{n}-n\ln q}$ $$

Therefore, when $p<1-\frac{1}{q^{n}-n\ln q}$, there exists $g(t)<0$, and when $p>=1-\frac{1}{q^{n}-n\ln q}$, $g(t)>=0$

When $g(t)<0$, it means that $f(t)<t$, so for layer $l$, the number of erased nodes is smaller than layer $l+1$. So the fission reaction fail, and there is a threshold for the number of erased number, the threshold is the first zero-point of $g(t)$.

###### Theorem A.1 (fission of RAG) .

For layer $l$, if the retrival probability $p_{l}<1-\frac{1}{q^{n}-n\ln q}$, then there exists $\hat{x}\in(0,1)$ satisfying $g(\hat{x})=0$.

Apparently, for lower levels of the tree, the connection is tighter and the retrieval is harder, therefore, it is impossible that $p_{l}>=1-\frac{1}{q^{n}-n\ln q}$ satisfies, so for lower levels, $t_{l}<t_{l+1}$. When the level gets higher, the retrieval becomes easier and the connection is sparser, so it is more likely to satisfy that $p_{l}>=1-\frac{1}{q^{n}-n\ln q}$. Therefore, with RAG, we can greatly erase the computation of first layers and even erase the whole layer which increases the expressive power of transformer.

###### Theorem A.1 (fission of RAG) .

### A.2 Proof of Theorem 2.5

Figure: Figure 4: The simulated value of replacing probability
Refer to caption: x4.png

To assess whether $t$ converges to $\hat{t}$, we conducted a simulation experiment with 10 repetitions, where $p_{l}\sim N(0.8-0.06l,0.01)$, $q_{l}\sim N(0.8-0.06l,0.01)$, and $n_{l}\sim N(16-1.4l,0.01)$, where $l$ represents the layer index.
As depicted in figure 4, it is observed that $t$ is quite close to the corresponding $\hat{t}$, the critical point where the fission reaction stops, therefore, with high probability $t\approx\hat{t}$. Also we can notice that the variance in higher layers are quite large, this means that with probability that we happen to retrieve some information quite close to the answer, then we can erase the higher layers, but in normal cases, we can only reduce the lower layers. Also, the critical point decreases when the layer index increases, showing that we can replace more nodes in the lower levels. But due to the large number of nodes, replacing the whole layer is also a tricky problem.

###### Assumption A.2 .

The probability of erasing in layer $l$ satisfies $t_{l}\approx z_{l}$, $z_{l}$ is the first zero point of $g(t)$.

For simplicity, we use $z$ instead of $z_{l}$, and $g(z)=0$,

$$ $\displaystyle\left(q^{n}-pq^{n}\right)\left(q^{-nz}-1+z\right)+p-z=0$ $\displaystyle-\left(q^{-nz}-1+z\right)q^{n}p+p+q^{n-nz}-q^{n}+q^{n}z-z=0$ $\displaystyle\left(q^{n}-q^{n-nz}-q^{n}z+1\right)p+q^{n-nz}-q^{n}+q^{n}z-z=0$ $\displaystyle\left(q^{n}-q^{n-nz}-q^{n}z+1\right)p=q^{n}-q^{n-nz}-q^{n}z+z$ $\displaystyle p=\frac{q^{n}-q^{n-nz}-q^{n}z+z}{q^{n}-q^{n-nz}-q^{n}z+1}$ $$

Assume $\xi=q^{n-nz}+q^{n}z-q^{n}$, then $p=\frac{z-\xi}{1-\xi}$.

If we need $t_{l}\geq\sqrt[n]{\delta}$, then,

$$ $\displaystyle z_{l}\geq\sqrt[n]{\delta}$ $\displaystyle p\geq\frac{\sqrt[n]{\delta}-\xi}{1-\xi}$ $$

Assume $z=1-\epsilon$, then, $\epsilon\leq 1-\sqrt[n]{\delta}$, $\xi=q^{n(1-z)}+q^{n}z-q^{n}=q^{n\epsilon}-\epsilon q^{n}$.

$$ $p=\frac{1-\epsilon-q^{\epsilon k}+\epsilon q^{n}}{1-q^{\epsilon k}+\epsilon q^{n}}=1-\frac{\epsilon}{1-q^{\epsilon k}+\epsilon q^{n}}\approx 1-\frac{\epsilon}{1-q^{\epsilon k}}$ $$

###### Theorem A.3 .

With $p_{l}<1-\frac{1}{q^{n}-n\ln q}$, if we want probability $\delta$ that layer $l$ can be totally covered i.e., $r_{l}^{n}\geq\delta$, we need $p_{l}\gtrsim 1-\frac{\epsilon}{1-q^{\epsilon n}}$, and $\epsilon\leq 1-\sqrt[n]{\delta}$.

###### Assumption A.2 .

###### Theorem A.3 .

## Appendix B The Impact of Noise

### B.1 Proof of Theorem 3.1

###### Assumption B.1 .

The model conducts filtering before inference, and those information regarded as noise would not be used during inference. When there are $\delta$ percent of relevant tokens and $1-\delta$ percent of noise information are included in the inference, let ${\bm{X}}_{r}$ and ${\bm{X}}_{n}$ represents the relevant tokens and noise, ${\bm{X}}$ represents the input to the inference, then $I({\bm{X}}_{r};{\bm{X}})=\delta H({\bm{X}})$ and $I({\bm{X}}_{n};{\bm{X}})=(1-\delta)H({\bm{X}})$

Assume that there are $\delta$ percent of tokens are actually related to the query, and other $1-\delta$ percent tokens are distractions. In addition, with probability $p_{e}$ the model mistakenly classify is the document relevant or not. Then, after filtering, $\delta\cdot(1-p_{e})$ percent of relevant tokens and $(1-\delta)\cdot p_{e}$ distractions are left in the input. Then the percentage of distraction is,

$$ $\alpha=\frac{(1-\delta)\cdot p_{e}}{(1-\delta)\cdot p_{e}+\delta\cdot(1-p_{e})}=\frac{(1-\delta)p_{e}}{p_{e}+\delta-2\delta p_{e}}=\frac{1-\delta}{\frac{\delta}{p_{e}}-2\delta+1}$ $$

Based on Fano’s inequality, $p_{e}\geq\frac{H({\bm{w}}|{\bm{z}})-1}{H({\bm{w}})}$, ${\bm{z}}$ is the embedding obtained by transformer, and we assume that ${\bm{s}}$ is the information we need to extract from document for further generation, ${\bm{w}}$ is the information to identify the relevance of tokens.

$$ $\displaystyle H({\bm{w}}|{\bm{z}})=H({\bm{w}})-I({\bm{w}};{\bm{z}})$ $\displaystyle p_{e}\geq\frac{H({\bm{w}})-I({\bm{w}};{\bm{z}})-1}{H({\bm{w}})}$ $\displaystyle\alpha\geq\frac{1-\delta}{\frac{\delta H({\bm{w}})}{H({\bm{w}})-I({\bm{w}};{\bm{z}})-1}-2\delta+1}$ $$

###### Theorem B.2 (Theorem 1 of Kawaguchi et al. ( 2023 ) ) .

Let $l\in\{1,\dots,D\}$. Suppose that $\phi^{s}_{l}$ is fixed independently of the training dataset $s$. Then, for any $\delta>0$, with probability at least $1-\delta$, the following holds:

$$ $\displaystyle\Delta(s)\leq G_{3}^{l}\sqrt{\frac{I(X;Z_{l}|Y)\ln(2)+G_{2}^{l}}{n}}+\frac{G_{1}^{l}(0)}{\sqrt{n}},$ $$

where $G_{1}^{l}(0)=\mathcal{O}(1)$, $G_{2}^{l}=\mathcal{O}(1)$, and $G_{3}^{l}=\mathcal{O}(1)$, as $n\rightarrow\infty$.

The theorem above regard the first $l$ layers of a model as a encoder, and the rest as decoder. In LLM, we encode the token embeddings one by one and then decode from those encoded embedding to generate new tokens. In this way, $Z_{l}$ is actually the output embeddings of tokens, and $I(X;Z|Y)=H({\bm{Z}}_{d})=\frac{\alpha}{1-\alpha}H({\bm{Z}}_{r})$, where $H({\bm{Z}}_{d})$ stands for the entropy of those distracting tokens and $H({\bm{Z}}_{r})$ stands for the entropy of those relevant tokens.

$$ $\begin{split}\frac{\alpha}{1-\alpha}&=\frac{(1-\delta)p_{e}}{p_{e}+\delta-2\delta p_{e}}\cdot\frac{p_{e}+\delta-2\delta p_{e}}{p_{e}+\delta-2\delta p_{e}-(1-\delta)p_{e}}\\ &=\frac{(1-\delta)p_{e}}{p_{e}+\delta-2\delta p_{e}-(1-\delta)p_{e}}\\ &=\frac{(1-\delta)p_{e}}{\delta-\delta p_{e}}=\frac{1-\delta}{\frac{\delta}{p_{e}}-\delta}\end{split}$ $$

then, if we assume that the model can perfectly take advantage of existing information

$$ $\begin{split}I(X;Z|Y)&=\frac{\alpha}{1-\alpha}\cdot H({\bm{Z}}_{r})\\ &=\left(\frac{(1-\delta)(H({\bm{w}}|{\bm{z}})-1)}{\delta(I({\bm{w}};{\bm{z}})+1)}\right)\cdot H({\bm{Z}}_{r})\end{split}$ (5) $$

Using Theorem B.2, we can observe that,

$$ $\begin{split}\Delta(s)&\leq G_{3}\sqrt{\frac{I(X;Z|Y)\ln(2)+G_{2}}{n}}+\frac{G_{1}(0)}{\sqrt{n}}\\ &\leq G_{3}\sqrt{\frac{I(X;Z|Y)\ln(2)}{n}}+\sqrt{\frac{G_{2}}{n}}+\frac{G_{1}(0)}{\sqrt{n}}\\ &=c_{1}\sqrt{I(X;Z|Y)}+c_{2}\\ &=c_{1}\sqrt{\left(\frac{(1-\delta)(H({\bm{w}}|{\bm{z}})-1)}{\delta(I({\bm{w}};{\bm{z}})+1)}\right)\cdot H({\bm{Z}}_{r})}+c_{2}\\ &\leq c_{1}\sqrt{\left(\frac{(1-\delta)H({\bm{w}}|{\bm{z}})}{\delta(I({\bm{w}};{\bm{z}})+1)}\right)\cdot H({\bm{Z}}_{r})}+c_{2}\\ \end{split}$ (6) $$

where $c_{1}=G_{3}\sqrt{\frac{\ln 2}{n}}$, $c_{2}=\sqrt{\frac{G_{2}}{n}}+\frac{G_{1}(0)}{\sqrt{n}}$

$$ $\mathcal{L}(\delta)-\mathcal{L}(1)\leq c_{1}\sqrt{\left(\frac{(1-\delta)H({\bm{w}}|{\bm{z}})}{\delta(I({\bm{w}};{\bm{z}})+1)}\right)\cdot H({\bm{Z}}_{r})}+c_{2},$ (7) $$

###### Theorem B.3 (Impact of Distractions) .

Given a set of documents, with $\delta$ percent of related and $1-\delta$ percent of distractions. If we assume documents contribute the same, and we ask the LLM to ignore the irrelevant documents, then,

$$ $\mathcal{L}(\delta)-\mathcal{L}(1)\leq c_{1}\sqrt{\left(\frac{(1-\delta)H({\bm{w}}|{\bm{z}})}{\delta(I({\bm{w}};{\bm{z}})+1)}\right)\cdot H({\bm{Z}}_{r})}+c_{2},$ (8) $$

where $\mathcal{L}(\delta)$ stands for the loss with $(1-\delta)$ distractions and $\mathcal{L}(1)$ means the training loss as in the training stage, no distraction is involved. $I({\bm{Z}}_{d};{\bm{Y}})$ is the mutual information between the embedding of related documents and the final embedding, this shows how much does LLM rely on documents during inference.

###### Assumption B.1 .

###### Theorem B.2 (Theorem 1 of Kawaguchi et al. ( 2023 ) ) .

###### Theorem B.3 (Impact of Distractions) .

### B.2 Proof of Theorem 3.2

Let $attn(x_{i})=({\bm{W}}_{q}{\bm{x}}_{i})^{T}{\bm{W}}_{k}{\bm{X}}_{:i}$ be the original attention layer of LLM, and $attn^{\prime}(x_{i})=\left(({\bm{W}}_{q}+\Delta{\bm{W}}_{q}){\bm{x}}_{i}\right)^{T}({\bm{W}}_{k}+\Delta{\bm{W}}_{k}){\bm{X}}_{:i}$ be the finetuned one and $\widehat{attn}$ be desired function, can we finetune the model to be $\widehat{attn}$?

So we need

$$ $softmax(attn^{\prime}({\bm{X}}))[i]\approx\begin{cases}0&\text{ if }\ \exists\ b\ s.t.\ g_{1}(x_{i},x_{b})=0\\ softmax(attn({\bm{X}}_{r}))[i]&\text{ else }\end{cases}$ $$

where ${\bm{X}}_{r}$ means those related tokens. let ${\bm{A}}_{i,j}=attn({\bm{x}}_{i},{\bm{x}}_{j})=({\bm{W}}_{q}{\bm{x}}_{i})^{T}{\bm{W}}_{k}{\bm{x}}_{j}={\bm{x}}_{i}^{T}{\bm{W}}{\bm{x}}_{j}$

$$ $\begin{split}attn^{\prime}({\bm{x}}_{i},{\bm{x}}_{j})&=\left(({\bm{W}}_{q}+\Delta{\bm{W}}_{q}){\bm{x}}_{i}\right)^{T}({\bm{W}}_{k}+\Delta{\bm{W}}_{k}){\bm{x}}_{j}\\ &={\bm{x}}_{i}({\bm{W}}+\Delta{\bm{W}}){\bm{x}}_{j}\\ &={\bm{x}}_{i}{\bm{W}}{\bm{x}}_{j}+{\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{j}\end{split}$ $$

where $\Delta{\bm{W}}=\Delta{\bm{W}}_{q}{\bm{W}}_{k}+{\bm{W}}_{q}\Delta{\bm{W}}_{k}+\Delta{\bm{W}}_{q}\Delta{\bm{W}}_{k}$

if there exists $\Delta{\bm{W}}_{q}^{\prime},\Delta{\bm{W}}_{k}^{\prime}$ satisfying

$$ ${\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{j}\begin{cases}\leq c_{l}&\text{if $x_{j}$ is noise}\\ \in[c_{h},c_{h}+\delta]&\text{else}\end{cases}$ (9) $$

if ${\bm{x}}_{j}$ is a noise token and ${\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{j}=c_{l}$, then

$$ $\begin{split}softmax(attn^{\prime}({\bm{x}}_{i}))[j]-0&=softmax(A_{i,:}+x_{i}\Delta{\bm{W}}{\bm{X}})[j]\\ &=\frac{\exp(A_{i,j}+x_{i}\Delta{\bm{W}}x_{j})}{\sum_{k}\exp(A_{i,k}+{\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{k})}\\ &=\frac{\exp(A_{i,j}+c_{l})}{\sum_{k}\exp(A_{i,k}+{\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{k})}\\ &=\frac{\exp(A_{i,j}+c_{l}-c_{h})}{\sum_{k}\exp(A_{i,k}+{\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{k}-c_{h})}\\ \end{split}$ $$

if we need $softmax(attn^{\prime}({\bm{x}}_{i}))[j]-0\leq\epsilon^{2}$, due to the optimal value is 0, so to $\epsilon$ approximate the value, we use $\epsilon^{2}$, and let $A_{i,j}=\max(A_{i,:})$, then

$$ $\displaystyle\frac{\exp(A_{i,j}+c_{l}-c_{h})}{\sum_{k}\exp(A_{i,k}+{\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{k}-c_{h})}\leq softmax(attn^{\prime}({\bm{x}}_{i}))[j]-0\leq\epsilon^{2}$ $\displaystyle\exp(A_{i,j}+c_{l}-c_{h})\leq\epsilon^{2}\sum_{k}\exp(A_{i,k}+{\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{k}-c_{h})$ $\displaystyle c_{l}-c_{h}\leq\ln\left(\epsilon^{2}\sum_{k}\exp(A_{i,k}+{\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{k}-c_{h})\right)-A_{i,j}$ $\displaystyle c_{l}-c_{h}\leq\ln\left(\epsilon^{2}n\exp(A_{i,j}+\delta)\right)-A_{i,j}$ $\displaystyle c_{l}-c_{h}\leq\delta+\ln\epsilon^{2}n$ $$

else if ${\bm{x}}_{j}$ is a relevant token, let $c=c_{h}$, and $\sum_{k^{\prime}}\exp(A_{i,k^{\prime}})$ denotes the summation of all relevant tokens, we consider a simple case where ${\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{j}=c_{h}$, and for one token ${\bm{x}}_{k1}$, we have ${\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{k1}=c_{h}+\delta$, and for all other relevant tokens we have ${\bm{x}}_{i}\Delta{\bm{W}}{\bm{x}}_{k}=c_{h}$

$$ $\begin{split}&\hskip 15.00002ptsoftmax(\hat{attn}({\bm{x}}_{i}))[j]-softmax(attn^{\prime}({\bm{x}}_{i}))[j]\\ &=\frac{\exp(A_{i,j})}{\sum_{k^{\prime}}\exp(A_{i,k^{\prime}})}-\frac{\exp(A_{i,j}+x_{i}\Delta{\bm{W}}x_{j})}{\sum_{k}\exp(A_{i,k}+x_{i}\Delta{\bm{W}}x_{k})}\\ &=\frac{\exp(A_{i,j})}{\sum_{k^{\prime}}\exp(A_{i,k^{\prime}})}-\frac{\exp(A_{i,j}+x_{i}\Delta{\bm{W}}x_{j}-c)}{\sum_{k}\exp(A_{i,k}+x_{i}\Delta{\bm{W}}x_{k}-c)}\\ &=\frac{\exp(A_{i,j})}{\sum_{k^{\prime}}\exp(A_{i,k^{\prime}})}-\frac{\exp(A_{i,j})}{\sum_{k}\exp(A_{i,k}+x_{i}\Delta{\bm{W}}x_{k}-c)}\\ \end{split}$ (10) $$

considering $softmax(\hat{attn}({\bm{x}}_{i}))[j]-softmax(attn^{\prime}({\bm{x}}_{i}))[j]=c(\frac{1}{a}-\frac{1}{b})\leq\epsilon\frac{c}{a}$, $c=\exp(A_{i,j})$, $a=\sum_{k^{\prime}}\exp(A_{i,k^{\prime}})$, $b=\sum_{k}\exp(A_{i,k}+x_{i}\Delta{\bm{W}}x_{k}-c)$

$$ $\displaystyle b-a\leq\epsilon b$ $\displaystyle(1-\epsilon)b\leq a$ $\displaystyle b\leq\frac{a}{1-\epsilon}$ $\displaystyle\sum_{k}\exp(A_{i,k}+x_{i}\Delta{\bm{W}}x_{k}-c)\leq\frac{\sum_{k^{\prime}}\exp(A_{i,k^{\prime}})}{1-\epsilon}$ $\displaystyle\sum_{k^{\prime}}\exp(A_{i,k^{\prime}}+x_{i}\Delta{\bm{W}}x_{k}-c)\leq\frac{\sum_{k^{\prime}}\exp(A_{i,k^{\prime}})}{1-\epsilon}$ $\displaystyle\sum_{k^{\prime}-k1}\exp(A_{i,k^{\prime}})+\exp(A_{i,k1}+\delta)\leq\frac{\sum_{k^{\prime}}\exp(A_{i,k^{\prime}})}{1-\epsilon}$ $\displaystyle\exp(A_{i,k1}+\delta)\leq\frac{\epsilon}{1-\epsilon}\sum_{k^{\prime}-k}\exp(A_{i,k^{\prime}})+\frac{\exp(A_{i,k1})}{1-\epsilon}$ $\displaystyle\delta\leq\ln\left(\frac{\epsilon}{1-\epsilon}\sum_{k^{\prime}-k}\exp(A_{i,k^{\prime}})+\frac{\exp(A_{i,k1})}{1-\epsilon}\right)-A_{i,k1}$ $$

Considering the case that $\frac{\epsilon}{1-\epsilon}\sum_{k^{\prime}-k}\exp(A_{i,k^{\prime}})\approx 0$, then we need $\delta\lesssim\ln\frac{1}{1-\epsilon}$

###### Theorem B.4 .

if there exists $attn^{\prime}(x_{i},x_{j})={\bm{x}}_{i}({\bm{W}}+\Delta{\bm{W}}){\bm{x}}_{j}$ satisfying $attn^{\prime}(x_{i},x_{j})-\widehat{attn}(x_{i},x_{j})\leq\epsilon$, then we need

$$ $\begin{split}\delta&\lesssim\ln\frac{1}{1-\epsilon}\\ c_{l}-c_{h}&\leq\delta+\ln\epsilon^{2}n\end{split}$ $$

###### Theorem B.4 .

### B.3 Proof of Theorem 3.3

In the following, we make use of the quantities

$$ $N_{max}(t)=\max_{\hat{v}\in\hat{\mathcal{V}}}N_{\hat{v}}(t),\qquad N_{min}(t)=\min_{\hat{v}\in\hat{\mathcal{V}}}N_{\hat{v}}(t),$ $$

where

$$ $N_{\hat{v}}(t)=\sum_{v\in\mathcal{V}}\mathbbm{1}\{d(v,\hat{v})\leq t\}$ $$

counts the number of $v\in\mathcal{V}$ within a “distance” $t$ of $\hat{v}\in\hat{\mathcal{V}}$.

###### Theorem B.5 .

(Fano’s inequality with approximate recovery in Scarlett & Cevher ())
For any random variables $v,\hat{v}$ on the finite alphabets $\mathcal{V},\hat{\mathcal{V}}$, we have

$$ $P_{e}(t)\geq\frac{H({\bm{v}}|\hat{{\bm{v}}})-1}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}}.$ (11) $$

$P_{e}(t)=\Pr(||{\bm{z}}-\hat{{\bm{z}}}||>t)$, where ${\bm{z}}$ is inferenced by some function and the input is ${\bm{v}}$.

Assume the input to the feed forward layer ${\bm{v}}$, the first $l$ layers are used to identify the relevance and the last few layers are used for inference. The output of the first $l$ layers are ${\bm{v}}_{l}$, and the embedding is used to conduct inference and get the result ${\bm{z}}$. So we can say that with probability $p\geq\frac{H({\bm{v}}_{l}|\hat{{\bm{v}}})-1}{\log\frac{|\mathcal{\mathcal{S}}|}{N_{max}(t)}}$ the resulting embedding fails to be $t$ close to the original one i.e., $d({\bm{z}},\hat{{\bm{z}}})\leq t$, where $\hat{{\bm{v}}}$ stands for the optimal input where all irrelevant information is filtered and all the related information is contained and $\hat{{\bm{z}}}$ is the corresponding output..

Assume that $\hat{{\bm{w}}}$ are equally distributed to each token which satisfies $I({\bm{w}}_{i};{\bm{v}})=I({\bm{w}}_{j};{\bm{v}})$, therefore, for each document, the model holds the same probability of mistakenly identify its relevance. Let $p_{we}$ stands for the error probability of identify noise tokens, and $\delta$ be the percentage of relevant tokens. With probability $\delta p_{we}$, the relevant token is mistakenly regarded as irrelevant, and with probability $(1-\delta)p_{we}$ the irrelevant token is mistakenly regarded as relevant.
So there are $\frac{\delta(1-p_{we})}{\delta(1-p_{we})+(1-\delta)p_{we}}$ percent of information about the relevant ones. Also $p_{we}$ percent of relevant information and $1-p_{we}$ percent of irrelevant information are discarded, then $I({\bm{s}};{\bm{v}}_{l})=\left((1-p_{we})\cdot\delta+p_{we}\cdot(1-\delta)\right)I({\bm{s}};{\bm{v}})$ are the left information about inference, among these, $\frac{\delta(1-p_{we})}{\delta(1-p_{we})+(1-\delta)p_{we}}$ are acutally related information, others are noise information.

In this way,

$$ $\begin{split}I({\bm{v}}_{l};\hat{{\bm{v}}})&=I({\bm{v}}_{l};{\bm{s}})\\ &=\frac{\delta(1-p_{we})}{\delta(1-p_{we})+(1-\delta)p_{we}}\cdot\left((1-p_{we})\cdot\delta+p_{we}\cdot(1-\delta)\right)I({\bm{s}};{\bm{v}})\\ &=\delta(1-p_{we})\cdot I({\bm{s}};{\bm{v}})\\ &\leq\delta(1-\frac{H({\bm{w}}|{\bm{v}}-1)}{H({\bm{w}})})\cdot I({\bm{s}};{\bm{v}})\\ &=\delta(\frac{I({\bm{w}};{\bm{v}})+1}{H({\bm{w}})})\cdot I({\bm{s}};{\bm{v}})\end{split}$ $$

Therefore,

$$ $\begin{split}P_{e}(t)&\geq\frac{H({\bm{v}}|\hat{{\bm{v}}})-1}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}}=\frac{H({\bm{v}})-I({\bm{v}};\hat{{\bm{v}}})}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}}\\ &\geq\frac{H({\bm{v}})-g_{1}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}}\end{split}$ $$

where $g_{1}(\delta,I({\bm{w}};{\bm{v}}))=\delta(\frac{I({\bm{w}};{\bm{v}})+1}{H({\bm{w}})})$

So when there is no noise, the inference can be conducted based on tose information, then we have

$$ $\begin{split}\Pr\left(||z-\hat{z}||>t\right)&\geq\frac{H({\bm{v}})-g_{1}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}}\\ \Pr\left(||z-\hat{z}||\leq t\right)&\leq 1-\frac{H({\bm{v}})-g_{1}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}}\end{split}$ $$

Considering the noise in the embedding of ${\bm{v}}_{l}$, and the noise would have negative impact on the inference.

Also the extra noise information contained in ${\bm{v}}_{l}$ is

$$ $\begin{split}I({\bm{v}}^{-};{\bm{v}}_{l})&=\frac{(1-\delta)p_{we}}{\delta(1-p_{we})+(1-\delta)p_{we}}\cdot\cdot\left((1-p_{we})\cdot\delta+p_{we}\cdot(1-\delta)\right)I({\bm{s}};{\bm{v}})\\ &=(1-\delta)p_{we}\cdot I({\bm{s}};{\bm{v}})\\ &=(1-\delta)\frac{H({\bm{w}}|{\bm{v}})-1}{H({\bm{w}})}\cdot I({\bm{s}};{\bm{v}})\end{split}$ $$

###### Theorem B.6 (Theorem 2 of Kawaguchi et al. ( 2023 ) ) .

Let ${\mathcal{D}}\subseteq\{1,2,\dots,D+1\}$. Then, for any $\delta>0$, with probability at least $1-\delta$ over the training set $s$, the following generalization bound holds:

$$ $\displaystyle\Delta(s)\leq\min_{l\in{\mathcal{D}}}Q_{l},$ (12) $$

where for $l\leq D$,

$$ $Q_{l}\hskip-2.0pt=G_{3}^{l}\sqrt{\frac{\left(I(X;Z_{l}^{s}|Y)+I(\phi_{l}^{S};S)\right)\ln(2)+\widehat{\mathcal{G}}_{2}^{l}}{n}}+\frac{G_{1}^{l}(\zeta)}{\sqrt{n}};$ $$

and for $l=D+1,$

$$ $Q_{l}={\mathcal{R}}(f^{s})\sqrt{\frac{I(\phi_{l}^{S};S)\ln(2)+\check{\mathcal{G}}_{2}^{l}}{2n}},$ $$

Here, $S\sim{\mathcal{P}}^{\otimes n}$, $G_{1}^{l}(\zeta)=\hat{{\mathcal{O}}}(\sqrt{I(\phi_{l}^{S};S)+1})$, $\widehat{\mathcal{G}}_{2}^{l}=\hat{{\mathcal{O}}}(1)$, $\check{\mathcal{G}}_{2}^{l}=\hat{{\mathcal{O}}}(1)$, and $G_{3}^{l}=\hat{{\mathcal{O}}}(1)$ as $n\rightarrow\infty$. The formulas of $G_{1}^{l}(\zeta)$, $\widehat{\mathcal{G}}_{2}^{l}$, $\check{\mathcal{G}}_{2}^{l}$, and $G_{3}^{l}$ are given in Appendix.

using $||f(x)-\hat{f}(x)||$ as the loss function, then we have that

$$ $\begin{split}{\mathcal{L}}-\hat{{\mathcal{L}}}&\leq G_{3}^{l}\sqrt{\frac{\left(I(X;Z_{l}^{s}|Y)+I(\phi_{l}^{S};S)\right)\ln(2)+\widehat{\mathcal{G}}_{2}^{l}}{n}}+\frac{G_{1}^{l}(\zeta)}{\sqrt{n}}\\ &=c_{1}\sqrt{I({\bm{v}}^{-}|{\bm{v}}_{l})+I(\phi_{l}^{S};S)}+c_{3}\\ &\leq c_{1}\sqrt{I({\bm{v}}^{-}|{\bm{v}}_{l})}+c_{1}\sqrt{I(\phi_{l}^{S};S)}+c_{3}\\ &\leq c_{1}\sqrt{I({\bm{v}}^{-}|{\bm{v}}_{l})}+c_{2}\end{split}$ (13) $$

where $c_{2}=c_{3}+c_{1}\sqrt{I(\phi_{l}^{S};S)}$
Therefore,

$$ $\Pr\left(||f(x)-\hat{f}(x)||\leq t+c_{1}\sqrt{I({\bm{v}}^{-}|{\bm{v}}_{l})+}+c_{2}\right)\leq 1-\frac{H({\bm{v}})-g_{1}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}}$ (14) $$

with $I({\bm{v}}^{-};{\bm{v}}_{l})=(1-\delta)\frac{H({\bm{w}}|{\bm{v}})-1}{H({\bm{w}})}\cdot I({\bm{s}};{\bm{v}})=g_{2}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})$.

$$ $\begin{split}&\Pr\left(||f(x)-\hat{f}(x)||>t+c_{1}\sqrt{g_{2}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})+}+c_{2}\right)\\ &\hskip 15.00002pt>\frac{H({\bm{v}})-g_{1}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}}\end{split}$ (15) $$

###### Theorem B.7 .

For a Feed Forward Network $f$ and the input $x$ contains $1-\delta$ percent of noise information, assume the optimal function is $\hat{f}(x)$ which filter out the noise and finish the inference, then

$$ $\begin{split}&\Pr\left(||f(x)-\hat{f}(x)||>t^{\prime}\right)>\frac{H({\bm{v}})-g_{1}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})}{\log\frac{|\mathcal{\mathcal{V}}|}{N_{max}(t)}},\end{split}$ (16) $$

where $t^{\prime}=t+c_{1}\sqrt{g_{2}(\delta,I({\bm{w}};{\bm{v}}))\cdot I({\bm{s}};{\bm{v}})}+c_{2}$. $g_{1}(\delta,I({\bm{w}};{\bm{v}}))=\delta(\frac{I({\bm{w}};{\bm{v}})+1}{H({\bm{w}})})$ $g_{2}(\delta,I({\bm{w}};{\bm{v}}))=(1-\delta)\frac{H({\bm{w}}|{\bm{v}})-1}{H({\bm{w}})}$

###### Theorem B.5 .

###### Theorem B.6 (Theorem 2 of Kawaguchi et al. ( 2023 ) ) .

###### Theorem B.7 .

## Appendix C Extra Layers for Filtering

### C.1 Proof of Theorem 4.1

###### Fact C.1 (Set disjointness communication lower bound (Yao, 1979 ) ) .

Suppose Alice and Bob are given inputs $a,b\in\{0,1\}^{n}$, respectively, with the goal of jointly computing $\mathrm{DISJ}(a,b)=\max_{i}a_{i}b_{i}$ by alternately sending a single bit message to the other party over a sequence of communication rounds.
Any deterministic protocol for computing $\mathrm{DISJ}(a,b)$ requires at least $n$ rounds of communication.

$$ $r_{i}=\begin{cases}0&\text{ if }\ \exists\ a,b\ s.t.\ g(x_{i},x_{a},x_{b})=0\\ 1&\text{ else }\end{cases}$ $$

In normal cases, judging the value of $r_{i}$ requires calculating $g(x_{i},x_{a},x_{b})$ for all $a\in[0,n_{d})$ and $b\in[n_{d},n_{d}+n_{q})$. Here we simplify the question, and we consider the situation where $g(x_{i},x_{a},x_{b})=0$ only if $b=a+n_{d}$ and $n_{q}=n_{d}$. Apparently, this is a special case of the original problem, and if one layer of self-attention fail to solve this, it is impossible for it to solve the original problem.

If we assume that the input is like,

$$ ${\bm{x}}_{i}\in\begin{cases}\{{\bm{x}}_{i}\}&\text{if}\ i=0,\\ \{0,{\bm{x}}_{a}\}&\text{if}\ i\in\{1,\dots,n_{d}-1\},\\ \{0,{\bm{x}}_{b}\}&\text{if}\ i\in\{n_{d},\dots,2\cdot n_{d}-1\}.\end{cases}$ (17) $$

Given input $(a,b)\in\{0,1\}^{n_{d}}\times\{0,1\}^{n_{d}}$, let $x_{i}=x_{a}$ if and only if $a_{i}=1$ and let $x_{i}=x_{b}$ if and only if $b_{i-n_{d}}=1$. In this way $r_{i}=0$ if and only if $\mathrm{DISJ}(a,b)=1$.

For simplicity, we use $n=n_{d}$. Now consider a more complex situation where Alice and Bob each hold a matrix ${\bm{A}}\in\mathbb{R}^{n\times d}$, ${\bm{B}}\in\mathbb{R}^{n\times d}$.
each row of the matrix contains ${\bm{w}}$, so $d=H({\bm{w}})$. and we assume that ${\bm{x}}=[{\bm{s}},{\bm{w}}]$.

Then

$$ ${\bm{x}}_{i}=\begin{cases}{\bm{x}}_{i}&\text{if}\ i=0,\\ [{\bm{s}},{\bm{a}}_{i}]&\text{if}\ i\in\{1,\dots,n_{d}-1\},\\ [{\bm{s}},{\bm{b}}_{i}]&\text{if}\ i\in\{n_{d},\dots,2\cdot n_{d}-1\}.\end{cases}$ (18) $$

Let $\mathrm{DISJ1}({\bm{A}},{\bm{B}})=\max_{i}(g^{\prime}({\bm{x}},{\bm{a}}_{i},{\bm{b}}_{i}))$, where the function $g^{\prime}$ acts similar with $g$, but it takes ${\bm{a}},{\bm{b}}$ as input, and ${\bm{x}}$ is a fixed constant as ${\bm{x}}_{i}$. So the calculation of $DISJ1$ requires $n\times H({\bm{w}})$ bits of communication.

Also similar to the setting of $x$, $r_{i}=1$ if and only if $\mathrm{DISJ1}({\bm{A}},{\bm{B}})=1$.

Then, this is the same with the 3Match problem, following the proof of Theorem 7 in Sanford et al. (), and with the following form of transformer $f({\bm{X}})$, $2pH\log\log n+mpH\log\log n\approx mpH\log\log n$ bits are communicated.

$$ $f({\bm{X}})=\phi(f_{h}({\bm{X}})),$ $$

where $\phi$ stands for the feed forward layers.

$$ $f_{h}({\bm{X}})=\frac{\sum_{i=1}^{N}\exp\left(({\bm{W}}_{q}x_{1})^{T}{\bm{W}}_{k}x_{i}\right){\bm{W}}_{v}x_{i}}{\sum_{i=1}^{N}\exp\left(({\bm{W}}_{q}x_{1})^{T}{\bm{W}}_{k}x_{i}\right)}$ $$

Therefore, only we require $mpH\log\log n\geq nH({\bm{w}})\rightarrow mph\geq nH({\bm{w}})/\log\log n$.

###### Theorem C.2 .

For input documents of length $n$, if $mpH\leq\Omega(nH({\bm{w}})/\log\log n)$, then there is no one layer transformer ${\mathcal{M}}$ with embedding size $m$, precision $p$ and $H$ heads satisfying ${\mathcal{M}}(X)=r$.

Also, as shown in Sanford et al. (), multiple layers of multi-headed
attention are subject to the same impossibility

###### Conjecture C.3 .

Every multi-layer transformer that computes Match3 must have width, depth, embedding dimension, or bit complexity at least $N^{\Omega(1)}$.

However, one layer of transformer can effectively solve Match2 problem, for RAG, we can simply fix one or some token to represent the information of a document, in this way $g(x_{i},x_{a},x_{b})$ becomes $g(x_{i},x_{0},x_{b})$, if we use the first transformer layer to aggregrate information of $x_{i}$ and $x_{0}$, then use the second layer to gather $x_{b}$ and judging the relevance by MLP layers, then the problem can be solved.

therefore, $g(x_{i},x_{a},x_{b})=g(x_{i},x_{a},x_{b})=g^{\prime}(x_{i}^{\prime},x_{b}^{\prime})$. Then the problem becomes a pair-wise problem, and transformer can easily solve it.

###### Proposition C.4 .

Using transformer to solve $r_{i}=\begin{cases}0&\text{ if }\ \exists\ a,b\ s.t.\ g^{\prime}(x_{i}^{\prime},x_{b}^{\prime})=0\\
1&\text{ else }\end{cases}$ requires $mpHD\geq n_{d}H({\bm{w}})$.

This mainly dues to the self regression of LLM, token $x_{i}$ can not gather information of token $x_{j}$ if $j>i$, which means that all the judgement of is done during the calculation of query rather than the document tokens because we put the documents ahead of the query. However, if we put the query first, then $g^{\prime}(x_{i},x_{b})$ can be effectively calculated in the document token.

###### Fact C.1 (Set disjointness communication lower bound (Yao, 1979 ) ) .

###### Theorem C.2 .

###### Conjecture C.3 .

###### Proposition C.4 .

## Appendix D Experiments

We conduct experiments using the Natural Questions (NQ) dataset (Kwiatkowski et al., ), which is a large-scale collection of real-world queries derived from Google search data. Each entry consists of a user query and the corresponding Wikipedia page that contains the answer. We utilize Contriever to extract documents, treating those that do not contain the answer as distracting documents (Cuconasu et al., ). Due to the limited computational resource, we only sample 1000 queries to test the performance.

we use different task instruction when query is ahead or after the documents.

- •
query ahead document: ”You are given a question and you MUST respond with a short answer (max 5 tokens) based on the provided documents. If none of the documents contain the answer and you do not know the answer, please respond with NO-RES.”
- •
query after document: You are given a question and you MUST respond with a short answer (max 5 tokens) based on the provided documents. If none of the documents contain the answer and you do not know the answer, please respond with NO-RES. The question will be presented both before and after the documents.

Also, in the query after document situation, we actually also put the query after the documents to make LLM remember what the question is.

We conduct experiments on a single Nvidia RTX 3090 24G, the rank for LoRA finetuning is $64$, and we use 1,8,15 virtual tokens for prompt tuning and find the best performing one. We finetuning the learning rate with in $\{5e-7,1e-6,3e-6,5e-6,1e-5\}$.

We use three models to show the performance.

- •
meta-llama/Meta-Llama-3.1-8B-Instruct
- •
lmsys/vicuna-7b-v1.5
- •
mistralai/Mistral-7B-Instruct-v0.3

Due to limited computational resources, we sample 1,000 queries for training, and we use the code of Cuconasu et al. () to extract those gold and distracting documents.

### D.1 RAG brings more sparsity

When we implement RAG, it may struggle to reduce many layers, but it effectively helps to decrease numerous nodes, introducing some sparsity to LLMs. In Figure 1, Document 1 contains information about $u_{2,2}$, which can aid in reducing the calculations for nodes $u_{1,2},u_{1,3}$, and so on. This allows for the pruning of certain parameters used to compute these nodes, resulting in a sparser LLM when utilizing RAG.

To verify this, we conduct experiments on the NQ dataset, employing the Wanda pruning method (Sun et al., ). Specifically, the pruning parameters are assessed based on their score, which is defined as

$$ $S_{i,j}=|W_{i,j}|\cdot||X_{j}||_{2},$ $$

where $|W_{i,j}|$ represents the absolute value of the parameter, while $X_{j}$ denotes the input. The score is evaluated as the product of its magnitude and the norm of the corresponding input activations, which directly indicates the importance of each parameter for the inference.

We utilize the query along with one relevant document that directly contains information related to the query as input. As expected, with increasing sparsity, conducting inference using only the query leads to worse performance. However, inference with RAG maintains similar performance until the model becomes too sparse to retrieve information from the documents. Also as sparsity increases, the fine-tuned model gradually outperforms the vanilla model with RAG because the fine-tuned version can stop calculating certain nodes and focus on other computations with limited parameters. While using RAG in LLMs can enhance performance, it does not fully leverage the sparse nature of RALM. Consequently, as sparsity increases, the fine-tuned RAG surpasses the regular RAG.

Figure: Figure 5: The performance of LLM after pruning, query means inference with only query, gold means the gold document is included, and gold lora means we finetune the model with gold document.
Refer to caption: x5.png

### D.2 Experiments on query document order

**Table 3: Performance on regular order**
|  | LLama3 | Vicuna | Mistral |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
|  | Gold | Gold Dis | Gold | Gold Dis | Gold | Gold Dis |
| vanilla | 0.62 | 0.41 | 0.55 | 0.52 | 0.66 | 0.59 |
| Lora | 0.66 | 0.54 | 0.55 | 0.55 | 0.66 | 0.57 |
| Prompt | 0.63 | 0.54 | 0.57 | 0.48 | 0.62 | 0.58 |
| Lora+Prompt | 0.66 | 0.55 | 0.58 | 0.56 | 0.64 | 0.61 |
| Dprompt | 0.66 | 0.6 | 0.61 | 0.64 | 0.66 | 0.61 |

In Table 3, we show the performance when the prompt is in regular order, which means that we put the documents ahead of the query. We can observe that although DPrompt tuning performs best, the improvement is not as significant as the reversed order, which shows that the reversed order can actually help when faced with irrelevant information

## Appendix E Related Work

Many recent works have explored better RAG strategies. Shi et al. () treat the model as a black box and design a retriever to enhance performance. However, Shi et al. () found that distracting documents in the retrieved set significantly weaken performance, leading some to address this by fine-tuning the LLM (Yoran et al., ; Zhang et al., ). Additionally, researchers have identified that noise in the prompt can negatively impact performance, prompting efforts to eliminate this noise and compress prompts (Jiang et al., ; ; Pan et al., ). Xu et al. () first highlighted the duality of RAG, encompassing both benefits and detriments. Understanding how these factors influence the reasoning capabilities of LLMs remains an open question.

Merrill & Sabharwal () proves that the expressive power of LLM is constrained to $TC^{0}$, but Feng et al. (); Li et al. () shows that by Chain of Thought prompting, we can infinitely stack transformer layers to solve any DP problems, Zeng & Lee () further prove the rank needed to adapt the model for other takss by LoRA, and Petrov et al. () shows that prompt tuning can be a universal approximator with enough prompt length, while prompt tuning fail to change the attention pattern and can only bias the output (Petrov et al., ). RAG is also one kind of prompting technique, and it also try to involve more information when conducting inference like CoT. But how does RAG helps to improve the expressive power of LLM has not been studied before.

## Peer Reviews

confidence: 2
contribution: 3
initial_rating: 6
presentation: 3
questions: See weaknesses.
soundness: 3
strengths: Strengths:

- Provides novel analysis of RAG capabilities
- Presents solid theoretical foundations supported by empirical evidence
- Introduces effective methods for noise filtering in RAG systems
- Clearly identifies limitations in fine-tuning approaches for noise filtering
- Develops an innovative prompting technique as a practical solution
summary: The paper examines an unexplored aspect of Retrieval Augmented Generation (RAG) by investigating its potential to enhance LLMs' reasoning capabilities. While RAG is commonly used for incorporating domain knowledge through external documents, the authors make an interesting observation that these documents often contain intermediate reasoning steps. This leads to their core research question: whether RAG can improve LLMs' complex reasoning abilities. Their investigation reveals that RAG's assistance in reasoning is limited and requires careful document preprocessing to filter noise. The authors identify that this preprocessing challenge cannot be effectively addressed through simple LLM fine-tuning, as it typically demands multiple additional transformer layers. As a solution, they propose DPrompt tuning, which efficiently handles these challenges using minimal transformer layers and achieves better performance without extensive fine-tuning requirements.
weaknesses: Weaknesses:

- Assumption 2.3 has notable limitations. When retrieved documents are relevant but significantly longer than the original query, or when information extraction requires multiple hops, the problem may not be simplified as claimed. This challenges the assumption that information extraction is simpler than layered reasoning paths, particularly considering LLM processing time.
- Limited experimental validation across domains, particularly lacking evaluation on multi-hop question answering tasks (e.g., HotpotQA) and long-form text generation.

- Missing References:

- - On noise filtering: https://arxiv.org/abs/2311.08377
- - On fine-tuning RAG models:
- - - https://arxiv.org/abs/2310.11511
- - - https://arxiv.org/abs/2410.01782

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: Q1: Why is the connection between different nodes in adjacent layers assumed to occur with probability `q` when defining the reasoning tree?

Q2: If a deterministic representation is used, causing f(t),  as expressed in Line 212, to no longer increase with respect to `t` , is the subsequent analysis still valid? (A simple scenario is when a node has three child nodes, with the first two having two child nodes each, and the last one having five. In this case, the erase rate does not exhibit a monotonic relationship.)

Q3: Di He et al. proved that CoT can enhance computational power through the “thought” portion, enabling the resolution of arbitrary DP problems. Additionally, other studies have shown that adding meaningless characters during reasoning can also increase computational capacity, thereby enhancing the model’s reasoning ability. Considering these findings simultaneously, whether they would impact the original conclusions.
soundness: 2
strengths: The strengths of this paper lie in its formal modeling of the reasoning process. By exploring the issues in the reasoning process involving RAG under given assumptions, it decomposes RAG’s involvement into two parts: document processing and inference incorporation. It also provides insights into why RAG struggles to perfectly resolve the reasoning process. Additionally, the paper conducts an extensive analysis of how to overcome the noise in retrieved documents.
summary: This paper analyzes the issues in using RAG to solve reasoning problems from the perspective of a reasoning tree.
It concludes that only when most intermediate reasoning results are retrieved can the reasoning depth be significantly reduced.
It also argues that the noise introduced in the retrieval stage cannot be resolved through fine-tuning.
Finally, the paper proposes a method that uses an additional model to condense the retrieved documents.
weaknesses: The limitations of this paper include a lack of concrete basis for the assumptions used in modeling the reasoning process, as well as a lack of corresponding experiments to validate the modeling of noise effects. Additionally, the proposed method, DPrompt Tuning, shows limited innovation and is tested only on NQ, which does not have high requirements for multi-step reasoning (compared to the node depth used in the author’s modeling).

---

confidence: 4
contribution: 4
initial_rating: 5
presentation: 3
questions: 1.	In your modeling, you describe the role of RAG as reducing the depth of reasoning required for a given question probabilistically. Can it cover the conditions under which RAG mitigates hallucinations or corrects reasoning errors(where it may increase reasoning depth but help guide the model to the correct solution path)?
2.	All three models have been trained on chat data and are aligned, but the explanation given in lines 482-485 seems rather tenuous—could you provide a stronger justification?
3.	The training method in this paper only uses 1,000 samples, whereas other methods like self-RAG use tens of thousands. Could the weaker performance of the LoRA baseline in your experiments be due to insufficient data?
4.	How was the data constructed for baseline training? Did it include both gold and distractor documents?
5.	Why didn’t you use benchmarks for noise robustness, such as RGB(Chen, Jiawei, et al. "Benchmarking large language models in retrieval-augmented generation."), for evaluating RAG?
soundness: 3
strengths: - This paper utilized the concept of reasoning trees to deeply investigate the extent to which RAG can assist in reasoning, and theoretically analyzed that RAG helps improve reasoning ability but also has limitations.
- This work analyzed the theoretical impact of different noise filtering methods on reasoning.
- To address the challenges of noise filtering, the authors proposed the DPrompt tuning method. This approach transforms complex ternary relation problems into more manageable binary relation problems, which is theoretically sound and has been empirically proven effective.
summary: - This paper demonstrated that RAG can enhance the reasoning ability of LLMs to a certain extent, but the improvement is limited.
- It highlights the challenges of simply fine-tuning models to filter out noise, and shows that filtering noise often requiring additional reasoning layers.
- This paper revealed the complexity of filtering noisy documents and proposed the DPrompt tuning method to simplify the problem.
weaknesses: 1.	The authors theoretically demonstrate the extent to which RAG aids reasoning, but experimental evidence on reasoning tasks would be valuable to support these claims.
2.	Although the authors analyze the limitations of common noise filtering methods for noisy documents theoretically, experimental data is needed to make these arguments more robust.
3.	The experimental setup lacks clarity; methods in Table 1 should be accompanied by detailed explanations of the differences between relevant baselines.
4.	The Natural Questions (NQ) dataset typically contains relatively simple questions with low reasoning requirements, which somewhat diverges from the topic of the paper.
5.	This paper lacks an experimental setting to evaluate whether the model can reason effectively using only noisy documents in the context.
6.	While the paper emphasizes noise filtering, it lacks discussion of related noise filtering works, such as Wang et al.'s "Learning to filter context for retrieval-augmented generation" or the re-rank-based filter method by Glass et al. in "Re2G: Retrieve, rerank, generate."
7.	In line 740, "k" appears to be a typo and should actually be "n".

Meta-review: This paper explores the intriguing question of whether retrieval augmented generation (RAG) can enhance the reasoning capabilities of large language models (LLMs). The authors investigate this hypothesis and propose a novel framework to leverage RAG for improved reasoning. Their experiments demonstrate the effectiveness of their method, surpassing alternative approaches like LoRA.

The paper addresses an interesting and under-explored area, presenting a clear and logical flow. However, its empirical support is limited.  As noted by other reviewers, more extensive experiments across diverse reasoning tasks are needed to validate the proposed method. While the authors provided additional experiments during the rebuttal, both the reviewers and I believe further evaluation is necessary.

Additionally, concerns exist regarding the assumptions made in the paper, which are considered strong and potentially impractical. Strengthening the empirical evaluation and relaxing these assumptions would significantly bolster the paper's position and contribution.

Decision: Reject