Exploiting Contextual Knowledge in LLMs through $\mathcal{V}$-usable Information based Layer Enhancement
Authors: Xiaowei Yuan, Zhao Yang, Ziyang Huang, Yequan Wang, Siqi Fan, Yiming Ju, Jun Zhao, Kang Liu
Accepted at: acl25

Exploiting Contextual Knowledge in LLMs through \( \mathcal{V} \)-usable Information based Layer Enhancement

Xiaowei Yuan\( ^{1,2,3} \), Zhao Yang\( ^4 \), Ziyang Huang\( ^{1,2} \), Yequan Wang\( ^3,* \), Siqi Fan\( ^5 \), Yiming Ju\( ^3 \), Jun Zhao\( ^{1,2} \), Kang Liu\( ^{1,2,*} \)
\( ^1 \)The Key Laboratory of Cognition and Decision Intelligence for Complex Systems, Institute of Automation, Chinese Academy of Sciences
\( ^2 \)School of Artificial Intelligence, University of Chinese Academy of Sciences
\( ^3 \)Beijing Academy of Artificial Intelligence \( ^4 \)Meituan
\( ^5 \)University of Electronic Science and Technology of China

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities in various tasks, yet they often struggle with context-faithfulness generations that properly reflect contextual knowledge. While existing approaches focus on enhancing the decoding strategies, they ignore the fundamental mechanism of how contextual information is processed within LLMs’ internal states. As a result, LLMs remain limited in their ability to fully leverage contextual knowledge. In this paper, we propose Context-aware Layer Enhancement (CaLE), a novel intervention method that enhances the utilization of contextual knowledge within LLMs’ internal representations. By employing \( \mathcal{V} \)-usable information analysis, CaLE strategically amplifies the growth of contextual information at an optimal layer, thereby enriching representations in the final layer. Our experiments demonstrate that CaLE effectively improves context-faithful generation in Question-Answering tasks, particularly in scenarios involving unknown or conflicting contextual knowledge.

1 Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities in various tasks, yet they face significant challenges, including hallucination and outdated knowledge (Ji et al., 2023; Zhao et al., 2024). Retrieval-Augmented Generation (RAG) has emerged as a promising approach to address these limitations by incorporating external knowledge sources into the generation process (Ram et al., 2023; Gao et al., 2024). The concept of context-faithfulness—the ability to generate responses that accurately reflect provided contextual information—has thus become crucial for LLM applications (Zhou et al., 2023; Shi et al., 2024b). Nevertheless, these models often struggle to properly utilize external contextual information, particularly when it conflicts with their pre-existing parametric knowledge (Xie et al., 2024). As illustrated in the upper part of Figure 1, despite the presence of context indicating "Google", the model still generates a unfaithful output "Apple".

Existing efforts (Shi et al., 2024b; Jin et al., 2024) to enhance the context-faithfulness of LLMs primarily focus on modifying decoding strategies or reweighting knowledge-aware neurons. The optimized decoding strategies (Shi et al., 2024b; Qiu et al., 2024; Yuan et al., 2024) focus on the contrastive mechanism (Li et al., 2023) to ensure a greater reliance on external information. Another line of research is to explore the internal neurons within models (Shi et al., 2024a). They aim to identify and reweight the neurons that are crucial in processing contextual cues. However, these methods are only applicable to predefined data formats, such as triplet facts or multiple-choice questions, thereby limiting their effectiveness in complex scenarios (Jin et al., 2024).

Recent studies (Azaria and Mitchell, 2023; Chen et al., 2024) have demonstrated that LLMs preserve the highly-concentrated information within their internal states. Skean et al. (2024) further reveals that

![An illustration of CaLE Method.](page_1012_370_388_312.png)

Figure 1: An illustration of CaLE Method.
intermediate layers often yield more informative representations for downstream tasks than the final layer. These findings imply that, in RAG tasks, the contextual information within internal states may not always increase monotonically towards the output layer. As illustrated in Figure 1, the correct answer ("Google") attains the top probability at the 26th layer but not the final layer. Therefore, we propose to explore the contextual information retained of LLMs’ internal states for faithful generations.

We conduct a investigation on contextual information flow across model layers utilizing \( \mathcal{V} \)-usable information (Xu et al., 2020; Ethayarajh et al., 2022). It measures the contribution that the inner states of model can help generate the contextual answer. Our findings reveal significant fluctuations in contextual information, which could lead to under-utilization of the given context. This fluctuation may disclose the inherent deficiency in processing the contextual information of current LLMs based on Transformer, and thus present a critical intervention point for preserving and enhancing contextual information flow, potentially improving the context-faithfulness of LLMs.

To remedy the above issues, this paper proposes a Context-aware Layer Enhancement (CaLE) method, which exploits contextual knowledge within model’s internal representations from a layer-specific perspective. Based on \( \mathcal{V} \)-usable information, CaLE identifies the context-aware layer in either a supervised or unsupervised manner, which exhibits the highest contextual information. Then it enhances the layer representations through amplification or residual connections. As a result, the contextual information relevant to the target answers is effectively enriched. As shown in Figure 1, CaLE identifies the 26-th layer that encodes rich information about the correct answer ("Google") and enhances its representations, facilitating accurate response generation at the final layer.

Experiments on CounterFact (Meng et al., 2022a), Natural Questions (NQ) (Kwiatkowski et al., 2019), SQuAD (Rajpurkar et al., 2016) and StrategyQA (Geva et al., 2021a) datasets demonstrate that CaLE significantly improves context-faithful generation in downstream tasks. Furthermore, CaLE’s enhancements to context utilization are independent of and complementary to various decoding strategies, enabling cumulative improvements in the faithfulness of LLMs. This orthogonality to existing decoding methods underscores the versatility of our approach.

The contributions of this paper are as follows:

• Through experimental analysis, we find that LLMs often exhibit a characteristic information fluctuation across the intermediate layers, with certain layers maintaining a high increasing context-faithful information, followed by a plateau or decrease in the deeper layers.

• To mitigate the negative effective of the contextual information degradation, CaLE proposes a context-aware layer identification method to determine an optimal intervening position. Through amplification or residual connect, the further enhancement will lead to richer representations in the final layer.

2 Information Flow Analysis based on \( \mathcal{V} \)-usable information

First, we introduce a method for measuring the contribution of the inner states of the model to the faithfulness of its responses, specifically focusing on how to quantitatively analyze the contextual information contained within each layer’s state. Building on this, we analyze the flow of contextual information across different layers in various models, using the CounterFact (Meng et al., 2022a) dataset to examine the variations in the flow.

2.1 \( \mathcal{V} \)-usable Information

Unlike Shannon’s MI and in violation of the data processing inequality, \( \mathcal{V} \)-*usable information* can be created through computation (Xu et al., 2020; Ethayarajh et al., 2022). It reflects the ease with which a model family \( \mathcal{V} \) can predict the correct answer Y given specific input hidden states \( h_l \) at layer l (Ju et al., 2024).

\[
I_{\mathcal{V}}(h_l \to Y) = H_{\mathcal{V}}(Y) - H_{\mathcal{V}}(Y|h_l)
\] (1)

where \( H_{\mathcal{V}}(Y) \) and \( H_{\mathcal{V}}(Y|h_l) \) denote the *predictive* \( \mathcal{V} \)-entropy and the *conditional* \( \mathcal{V} \)-entropy. The latter can be estimated through the following equations:

\[
H_{\mathcal{V}}(Y) = \inf_{f \in \mathcal{V}} \mathbb{E}[-\ln f[\emptyset](Y)]
\] (2)

\[
H_{\mathcal{V}}(Y|h_l) = \inf_{f \in \mathcal{V}} \mathbb{E}[-\ln f[h_l](Y)]
\] (3)

where the function \( f[\cdot] \) produces a probability distribution over the vocabulary. Put simply, we use the logit lens (nostalgiaerast, 2020) with softmax
function here.

\[
f[h_l](Y) = \frac{e^{v_k}}{\sum_{j \in |Vocab|} e^{v_j}}
\]

where \( v = \text{LogitLens}(h_l)^1 \) represents the logit vector at layer \( l \). The subscript \( k \) represents the token index corresponding to \( Y \).

To evaluate the variations across layers, we adopt \( -H_V \) for observation based on:

\[
\Delta I_V = I_V(h_l \rightarrow Y) - I_V(h_{l-1} \rightarrow Y) = \Delta - H_V
\]

2.2 Information Flow Analysis

We analyze the flow of contextual information using models of similar sizes (Figure 2a), as well as the Llama series models of varying sizes (Figure 2b). The details of the experimental settings are provided in Appendix A.1.

As shown in the Figure 2, the Llama models generally exhibit relatively higher values of \( V \)-usable information in their intermediate layers than the final layer. A comparison between Figure 2a and 2b reveals that the models exhibit a characteristic information fluctuation across the intermediate layers. Specifically, a subset of layers maintains a high, monotonically increasing \( V \)-usable information, followed by either a plateau or a decrease in the deeper layers.

The analysis reveal that **the \( V \)-usable information does not follow a monotonically increasing trend toward the output layer**. Therefore, we propose leveraging the contextual information within the internal states of LLMs to maintain a continuous growth trend, which may potentially counteract subsequent degradation (or stagnation) effects.

1Detailed formula can be found in Appendix B.

3 CaLE: Context-Aware Layer Enhancement

During the inference process, information fluctuations can occur with degradation (or stagnation). This leads to a reduction in the amount of contextual information at the final layer (Skean et al., 2024), resulting in a loss of contextual faithfulness during the final decoding.

To mitigate this issue, we propose CaLE, which first identifies the context-aware layers before degradation and then enhances the contextual representations within these layers. This improvement helps to elevate the \( I_V(h_f; Y) \) in the final layer, thereby enhancing the model’s faithfulness. Furthermore, we provide theoretical proofs to guarantee the effectiveness of CaLE.

3.1 Layer Enhancement Methods

According to Formula 1, \( I_V(h_f; Y) \) can be maximized by minimizing the \( H_V(Y|h_f) \) of the final layer. To minimize the \( V \)-entropy, we propose two intervene methods for enhancing the layer with rich contextual knowledge:

Amplification of Representations at Layer \( l \) (CaLE-A). For layer \( l \), the representation \( h_l \) is directly amplified by a factor \( \alpha_1 \). The enhanced representation \( h_l' \) is given by:

\[
h_l' = \alpha_1 \cdot h_l
\]

where \( \alpha_1 \) is a hyperparameter that amplifies the representation of layer \( l \).

Residual Connection from Layer \( l \) to Subsequent Layers (CaLE-R). A residual connection is added from layer \( l \) to the representations of \( \alpha_2 \) subsequent layers. For any layer \( k \) where \( l + 1 \leq k \leq l + \alpha_2 \), the enhanced representation \( h_l' \) is computed as:

\[
h_k' = h_k + h_l
\]

where \( h_l \) is the representation of layer \( l \), and \( h_k \) is the original representation of layer \( k \).

Both methods ensure that contextual information at layer \( l \) is enhanced and accumulated across subsequent layers.

3.1.1 Theoretical Support for Enhancement

In this section, we present theoretical support for the enhancement on a context-aware layer to minimize the conditional entropy \( H_V(Y|h_f) \).
First, we expand the function \( f[\cdot] \) at the final layer through the lens of residual stream (Elhage et al., 2021; Olsson et al., 2022):

\[
f[h_f](Y) = \frac{e^{v_k + u_k(v_k)}}{\sum_{j \in |Vocab|} e^{v_j + u_j(v_j)}}
\]

where \( v \) denotes the logits at layer \( l \), and \( u(v) \) includes logit contributions from layer \( l+1 \) to the final layer \( f \). The deduction is detailed in Appendix C.

At final layer, the minimization objective \( H_V(Y|h_f) \) (defined as \( H_{V_f} \)) can be simplified into the following form:

\[
H_{V_f} = \mathbb{E}[\ln \sum_j e^{v_j + u_j(v_j)} - (v_k + u_k(v_k))]
\]

As derived in detail in Appendix D.1, the \( H_{V_f} \) with layer \( l \) amplification is given by:

\[
H_{V_f}(\alpha) \overset{\text{def}}{=} \mathbb{E}[\ln \sum_j e^{\alpha v_j + u_j(\alpha v_j)} - (\alpha v_k + u_k(\alpha v_k))]
\]

Additionally, Appendix D.2 demonstrates that the residual method is equivalent to a specific value of \( \alpha^2 \), thereby the theoretical framework is also applicable to the residual method.

Proposition 3.1. [Proof in Appendix E] Let \( \alpha \) denote the amplification factor applied to the hidden states at this layer. If \( k = \arg \max_j v_j \), then

\[
\lim_{\alpha \to \infty} H_{V_f}(\alpha) \approx 0
\]

Since we cannot guarantee that \( v_k \) will achieve the maximum probability proportion at a specific layer, we propose setting \( \alpha > 1 \) as a fixed hyper-parameter for the enhancement method. This adjustment amplifies the probabilities of top-ranking tokens while proportionally attenuating the noise from less relevant tokens. In our experiments, we discuss the impact of different values of \( \alpha \).

3.2 Identifying the Context-Aware Layer

CaLE amplifies the flow of contextual information at an appropriate layer, which can produce significant performance benefits. In this section, we describe the identification method for the layer.

3.2.1 Supervised Layer Identification

The supervised method involves selecting an optimal lay within the Transformer model, by evaluating model performance on a validation set.

Given a set of candidate layers \( \mathcal{L} = \{l_1, l_2, \ldots, l_{n-1}\} \), the method computes the performance \( A(l_i, D_{\text{val}}) \) for each layer \( l_i \) on the validation set \( D_{\text{val}} \). The optimal layer \( l^* \) is identified as the one that maximizes validation accuracy, formally expressed as:

\[
l^* = \arg \max_{l_i \in \mathcal{L}} A(l_i, D_{\text{val}})
\]

Subsequently, the selected layer \( l^* \) is used to evaluate the model’s performance on the test set \( D_{\text{test}} \), yielding the final test performance \( A_{\text{test}} = A(l^*, D_{\text{test}}) \).

3.2.2 Unsupervised Layer Identification

In real-world scenarios, label \( Y \) may not be available for evaluating layer enhancement performance. We aim to approximate \( \mathcal{V} \)-usable information through an alternative metric.

Since the answer \( Y \) is uniquely determined by the context-query pair \( (c, q) \), the information content encoded in \( (c, q) \) necessarily exceeds that of \( Y \). Then we can establish the following:

\[
I_{\mathcal{V}}(h_l; Y) \leq I_{\mathcal{V}}(h_l; c, q)
\]

where

\[
I_{\mathcal{V}}(h_l; c, q) = I_{\mathcal{V}}(h_l; q) + I_{\mathcal{V}}(h_l; c \mid q)
\]

Based on the relationship between Kullback-Leibler (KL) divergence (Kullback and Leibler, 1951) and MI, we have:

\[
\begin{align*}
&I_{\mathcal{V}}(h_l; Y) \leq I_{\mathcal{V}}(h_l; q) + I_{\mathcal{V}}(h_l; c \mid q) \\
&= \mathbb{E}_{P(q)} \left[ \mathrm{KL}[P(h_l \mid q) \parallel P(h_l)] \right] + \\
&\quad \mathbb{E}_{P(q, c)} \left[ \mathrm{KL}[P(h_l \mid q, c) \parallel P(h_l \mid q)] \right]
\end{align*}
\]

It suggests that we can estimate the upper bound of \( \mathcal{V} \)-usable information through the KL divergences of the distribution of hidden states.

Layer Identification based on KL Divergence. Given that this approximation imposes only a unidirectional constraint, it does not provide a definitive guarantee for the \( \mathcal{V} \)-usable information. Therefore, we conduct empirical statistics to assess the reliability of the KL divergence as a measurement criterion.
(a) KLc variation        (b) KLq variation

Figure 3: Variation of the KL divergences across layers in different models. The KLq quantifies the impact of question conditioning on layer representations by measuring their distributional divergence, while KLc captures the incremental influence of context conditioning given the question on these representations. The shaded region represents the confidence interval.

We denote the KL divergences in Formula 14 as follows:

\[
KL_q(l) \overset{\text{def}}{=} \mathrm{KL}[P(\mathbf{h}_l \mid q) \parallel P(\mathbf{h}_l)]
\] (15)

\[
KL_c(l) \overset{\text{def}}{=} \mathrm{KL}[P(\mathbf{h}_l \mid q, c) \parallel P(\mathbf{h}_l \mid q)]
\] (16)

We estimate the KL divergences on the CounterFact (Meng et al., 2022a) dataset with different models. The settings are detailed in Appendix A.2.

Figure 3a demonstrates a strong correlation between \( KL_c(l) \) and \( I_V(\mathbf{h}_l; Y) \) across the models. This consistency suggests that the divergence can effectively approximate the \( V \)-usable information, capturing the incremental influence of context conditioning given the question. Furthermore, for the same question, the information of the correct answer is inherently contained within the context, making \( KL_q \) relatively irrelevant. Supporting evidence from Figure 3b indicates a low correlation between \( I_V(\mathbf{h}_l; Y) \) and \( KL_q \). Therefore, we propose the following approximation:

\[
I_V(\mathbf{h}_l; Y) \propto \mathbb{E}_{P(q,c)} \mathrm{KL} \left[ P(\mathbf{h}_l \mid q, c) \parallel P(\mathbf{h}_l \mid q) \right]
\] (17)

We identify the optimal layer by selecting one that exhibits maximal information in \( I_V(\mathbf{h}_l; Y) \), which is measured by \( KL_c(l) \) according to Formula 17. Therefore, the layer is selected as follows:

\[
l^* = \arg\max_l \mathbb{E}_{P(q,c)}[\mathrm{KL}_c(l)]
\] (18)

Due to the term \( \mathbb{E}_{P(q,c)} \), we measure the average \( KL_c \) across all data points for layer selection.

4 Experiments

4.1 Settings

Data. We evaluate the performance of CaLE across diverse QA datasets, including CounterFact (Meng et al., 2022a) NQ (Kwiatkowski et al., 2019), SQuAD (Rajpurkar et al., 2016), and StrategyQA (Geva et al., 2021a).\footnote{For the CounterFact, \( \alpha_1 = 5 \) for CaLE-A, and \( \alpha_2 = 3 \) for CaLE-R. For the other datasets, \( \alpha_1 = 3 \) and \( \alpha_2 = 1 \).} More details of the data are in Appendix F.

Models. We conduct experiments on state-of-the-art language models, including several variants from the Llama model family—specifically, Llama2-7B, Llama3.1-8B, and Llama3.2-3B—as well as the Mistral-7B and Gemma2-9B models.

Baselines. To demonstrate the effectiveness of CaLE, we compare it with the following baselines: Original, which refers to the LLMs without any modification; Early Exit (Xin et al., 2021; Men et al., 2024; Fan et al., 2024), where the model exits early at the layer with the best performance; and IRCAN (Shi et al., 2024a), which reweights the neurons critical for processing contextual cues. Both intervention methods are supervised.

For the supervised CaLE method, we construct the validation set using 0.5k samples, randomly selected from the training data to ensure no overlap with the test set.

We also combine several decoding methods, since the above methods work in completely different ways with decoding strategies: Context-Aware Decoding (CAD) (Shi et al., 2024b), Contrastive Decoding (CD) (Li et al., 2023), and Contextual Information-Entropy Constraint Decoding (COIECD) (Yuan et al., 2024). Detailed description are provided in Appendix G.

Metrics. We use the Exact Match (EM) and F1 scores for evaluating the QA performance of LLMs. For the binary classification in StrategyQA, the accuracy is used as the metric.

4.2 A Thorough Analysis on the CounterFact Dataset

We first conduct a comprehensive analysis by applying supervised CaLE intervention on the CounterFact dataset. Specifically, we partition the CounterFact dataset into "known" and "unknown" subsets (with "total" representing the complete set). The classification is based on whether the external contextual knowledge is consistent with the model's parametric knowledge (Ren et al., 2025)\footnote{The details of the posteriori judgement for the dataset are in Appendix F.1.}.
<table>
  <tr>
    <th rowspan="2">Models</th>
    <th rowspan="2">Methods</th>
    <th colspan="4">Total</th>
    <th colspan="4">Unknown</th>
    <th colspan="4">Known</th>
  </tr>
  <tr>
    <th>Original</th>
    <th>Early Exit</th>
    <th>IRCAN</th>
    <th>CaLE-R</th>
    <th>CaLE-A</th>
    <th>Original</th>
    <th>Early Exit</th>
    <th>IRCAN</th>
    <th>CaLE-R</th>
    <th>CaLE-A</th>
    <th>Original</th>
    <th>Early Exit</th>
    <th>IRCAN</th>
    <th>CaLE-R</th>
    <th>CaLE-A</th>
  </tr>
  <tr>
    <td rowspan="4">Llama2-7B</td>
    <td>Regular*</td>
    <td>54.32</td><td>70.76</td><td>71.15</td><td>74.86</td><td>74.98</td><td>42.53</td><td>66.47</td><td>63.55</td><td>69.22</td><td>69.62</td><td>39.00</td><td>86.86</td><td>89.35</td><td>92.25</td><td>91.30</td>
  </tr>
  <tr>
    <td>CD</td>
    <td>59.22</td><td>71.36</td><td>74.41</td><td>76.56</td><td>76.26</td><td>51.12</td><td>67.07</td><td>68.71</td><td>71.41</td><td>71.66</td><td>83.51</td><td>86.21</td><td>90.35</td><td>92.15</td><td>90.75</td>
  </tr>
  <tr>
    <td>CAD</td>
    <td>63.67</td><td>69.92</td><td>76.35</td><td>76.81</td><td>75.66</td><td>57.92</td><td>66.32</td><td>66.17</td><td>72.21</td><td>71.44</td><td>79.51</td><td>84.23</td><td>77.66</td><td>89.41</td><td>88.66</td>
  </tr>
  <tr>
    <td>COIECD</td>
    <td>63.72</td><td>70.26</td><td>69.62</td><td>76.76</td><td>75.81</td><td>57.47</td><td>66.62</td><td>66.87</td><td>71.91</td><td>71.51</td><td>81.06</td><td>84.96</td><td>77.91</td><td>90.35</td><td>89.26</td>
  </tr>
  <tr>
    <td rowspan="4">Llama3.1-8B</td>
    <td>Regular</td>
    <td>57.72</td><td>67.52</td><td>65.57</td><td>71.06</td><td>73.91</td><td>45.98</td><td>59.97</td><td>56.32</td><td>63.57</td><td>67.22</td><td>90.05</td><td>86.41</td><td>90.50</td><td>92.50</td><td>92.00</td>
  </tr>
  <tr>
    <td>CD</td>
    <td>62.42</td><td>67.76</td><td>67.77</td><td>73.66</td><td>75.46</td><td>54.07</td><td>61.22</td><td>61.37</td><td>67.42</td><td>70.21</td><td>83.96</td><td>84.56</td><td>86.46</td><td>89.86</td><td>92.03</td>
  </tr>
  <tr>
    <td>CAD</td>
    <td>66.02</td><td>68.30</td><td>70.46</td><td>76.91</td><td>77.31</td><td>62.52</td><td>68.52</td><td>68.52</td><td>75.84</td><td>75.84</td><td>82.82</td><td>82.82</td><td>86.82</td><td>88.62</td><td>92.03</td>
  </tr>
  <tr>
    <td>COIECD</td>
    <td>66.62</td><td>68.45</td><td>70.46</td><td>76.91</td><td>77.31</td><td>60.02</td><td>62.42</td><td>65.02</td><td>71.96</td><td>72.71</td><td>82.81</td><td>82.06</td><td>84.11</td><td>87.16</td><td>87.06</td>
  </tr>
  <tr>
    <td rowspan="4">Llama3.2-3B</td>
    <td>Regular</td>
    <td>57.67</td><td>71.91</td><td>76.61</td><td>76.81</td><td>79.21</td><td>48.28</td><td>66.07</td><td>71.71</td><td>71.16</td><td>74.31</td><td>91.85</td><td>91.25</td><td>93.75</td><td>95.80</td><td>95.90</td>
  </tr>
  <tr>
    <td>CD</td>
    <td>63.02</td><td>72.71</td><td>78.46</td><td>79.16</td><td>80.31</td><td>56.77</td><td>67.37</td><td>74.56</td><td>74.26</td><td>75.86</td><td>85.96</td><td>89.36</td><td>93.50</td><td>94.65</td><td>94.35</td>
  </tr>
  <tr>
    <td>CAD</td>
    <td>69.77</td><td>73.52</td><td>77.71</td><td>81.11</td><td>82.06</td><td>64.87</td><td>68.85</td><td>74.16</td><td>77.01</td><td>78.26</td><td>84.36</td><td>85.81</td><td>90.02</td><td>91.50</td><td>92.05</td>
  </tr>
  <tr>
    <td>COIECD</td>
    <td>69.13</td><td>73.69</td><td>78.52</td><td>80.81</td><td>81.81</td><td>64.02</td><td>68.73</td><td>74.65</td><td>76.66</td><td>78.01</td><td>85.51</td><td>86.96</td><td>91.30</td><td>92.15</td><td>92.60</td>
  </tr>
</table>

* Regular refers to the greedy decoding strategy.

Table 1: EM results on the CounterFact dataset with supervised intervene methods. The CaLE-A/R method denote the amplification or residual methods for enhancement. The highest scores with different decoding strategies are highlighted in bold.

(a) Layer consistency rate across 20 sampling trials for different sampling sizes of the validation set.

(b) Layer selection comparison between supervised and unsupervised CaLE-A.

Figure 4: Validation set size impact on supervised layer selection and comparative layer selection with unsupervised CaLE. The selected layers are detailed in Table 4.

<table>
  <tr>
    <th>EM</th>
    <th>Llama2-7B</th>
    <th>Llama3.1-8B</th>
    <th>Llama3.2-3B</th>
  </tr>
  <tr>
    <td>Superv. unsup.</td>
    <td>CaLE-A/R</td>
    <td>CaLE-A/R</td>
    <td>CaLE-A/R</td>
  </tr>
  <tr>
    <td>Total</td>
    <td>14.86 (±0.00)</td>
    <td>74.98 (±0.00)</td>
    <td>74.98 (±0.00)</td>
  </tr>
  <tr>
    <td>Unknown</td>
    <td>10.21 (±0.00)</td>
    <td>69.42 (±0.00)</td>
    <td>69.42 (±0.00)</td>
  </tr>
  <tr>
    <td>Known</td>
    <td>12.25 (±0.00)</td>
    <td>79.10 (±0.00)</td>
    <td>79.10 (±0.00)</td>
  </tr>
</table>

Table 2: Performance comparison between supervised and unsupervised CaLE. The black numbers represent the scores of the supervised CaLE method, with the values in "( )" indicating the difference between the supervised and unsupervised methods.

4.2.1 Overall Performance

Superior Performance. As shown in Table 1, the experimental results demonstrate that both supervised CaLE variants (CaLE-A and CaLE-R) consistently outperform baseline methods across all models. This suggests that enhancing the context-aware layer within the model significantly improves context-faithfulness generation. Furthermore, the advantage of our method is particularly pronounced when handling new ("unknown") knowledge, whereas IRCAN underperforms even compared to Early Exit method on Llama2-7b and Llama3.1-8b with Regular decoding strategy.

Difference Between CaLE-R and CaLE-A
While both CaLE-R and CaLE-A enhance accuracy, their mechanisms lead to differences in performance. CaLE-R, which incorporates residual connections, provides a stable but modest improvement in the "Unknown" subset. In contrast, CaLE-A, which amplifies knowledge representations, achieves nearly the highest scores across all models. This indicates that CaLE-A's amplification mechanism is more effective at handling new factual knowledge. On the other hand, CaLE-R excels in the generation of consistent internal and external knowledge, as evidenced by its performance in the "Known" subset.

Versatility with Decoding Methods. One of the key strengths of CaLE lies in its versatility across different decoding methods. Regardless of the strategy used—CD, CAD, or COIECD—CaLE-based models consistently achieve higher EM scores compared to other baselines. In contrast, Early Exit and IRCAN do not show the same level of reliability, with fluctuating gains and occasional declines, particularly in the Llama2-7B model.

4.2.2 Comparison between unsupervised and supervised methods of CaLE

In the case of supervised CaLE, we use a validation set size of 0.5k. As shown in Figure 4a, the vertical axis represents the proportion of the mode of the best layer selected based on validation accuracy across 20 trials. The figure indicates that a validation set size of 0.5k is sufficient for robust layer selection. Next, we analyze the KL-based unsupervised CaLE method on CounterFact dataset.

Layer Selection Comparison. As illustrated in Figure 4b, the solid line represents the performance of different amplified layer in a validation set trial. The red dots indicate the layers selected using the KL-based metric in an unsupervised manner. Notably, these layers correspond closely to the peaks in supervised performance, particularly around lay-
ers 23, 25, and 26. This strong correlation suggests that the KL-based selection method effectively identifies context-aware layers that contribute significantly to contextual information.

Performance Comparison. The experimental results in Table 2 further validate this observation. Across various Llama models, although the unsupervised method generally performs worse than the supervised method, it consistently outperforms all other baselines in Table 1. Notably, for Llama2-7B and Llama3.2-3B, the unsupervised CaLE method achieves scores identical to its supervised counterpart, as both methods identify the same layer for enhancement. These findings underscore the effectiveness of the KL-based CaLE, demonstrating its ability to approximate optimal layer selections without the need for labeled supervision.

4.2.3 Further Analysis

Increased Information. Figure 5a provides theoretical validation for the effectiveness of our CaLE-A method. The approach aims to enhance contextual information representation in the model’s final layer, quantitatively assessed through negative \( \mathcal{V} \)-entropy measurements. The results demonstrate that the amplification mechanism successfully transforms the previously observed information degradation, represented by solid lines, into an upward trend, as shown by the dashed lines.

Unknown Contexts with Higher KL Divergence. In Figure 5b, the KL divergence of contexts in "Unknown" subset consistently exhibits a greater magnitude compared to known contexts across deeper layers. The peak observed at layer 25 aligns with the layer selected by the CaLE method, offering robust validation for both approaches. The KL metric provides an interpretable rationale for layer selection decisions, as it quantifies the distributional impact of the contextual input \( c \) on each layer. This metric effectively captures the extent to which different layers encode and propagate contextual knowledge, particularly for new knowledge.

4.3 Application on Diverse QA Datasets

Conflicting Contexts. To further explore CaLE’s effectiveness in handling novel information, we conduct comprehensive contrastive analyses using the NQ dataset (Kwiatkowski et al., 2019) and its variant, NQ-Swap (Longpre et al., 2021). The NQ-Swap dataset, derived from the original NQ, exclusively consists of conflicting contextual knowledge that contradicts the model’s parametric knowledge.

As illustrated in Table 3, the improvement of CaLE is particularly evident when evaluated on the NQ-Swap dataset, which is entirely composed of conflicting knowledge. These findings indicate that CaLE intervention effectively facilitates the utilization of new knowledge in the model.

Generalization on ComplexQA. We extend our evaluation to other complex QA datasets, including SQuAD (Rajpurkar et al., 2016) and StrategyQA (Geva et al., 2021a), across various models. As demonstrated in Table 3, we compare our approach with the strongest baseline method, IRCAN. Our CaLE approach achieves superior performance on the QA datasets compared to the baseline.

For all diverse QA datasets, the CaLE method

<table>
  <tr>
    <th rowspan="2"> </th>
    <th colspan="2">NQ</th>
    <th colspan="2">NQ-Swap</th>
    <th colspan="2">SQuAD</th>
    <th colspan="2">StrategyQA</th>
  </tr>
  <tr>
    <th>EM</th><th>F1</th>
    <th>EM</th><th>F1</th>
    <th>EM</th><th>F1</th>
    <th>Acc</th>
  </tr>
  <tr>
    <td>Llama2-7B<br>unsup</td>
    <td>75.84</td><td>77.48</td>
    <td>53.73</td><td>54.92</td>
    <td>61.37</td><td>73.02</td>
    <td>80.41</td>
  </tr>
  <tr>
    <td>+ CaLE-R</td>
    <td>77.69</td><td>79.41</td>
    <td>58.68</td><td>59.98</td>
    <td>63.52</td><td>74.68</td>
    <td>82.74</td>
  </tr>
  <tr>
    <td>+ CaLE-A</td>
    <td>78.19</td><td>80.06</td>
    <td>58.78</td><td>60.01</td>
    <td>63.59</td><td>74.70</td>
    <td>82.91</td>
  </tr>
  <tr>
    <td>sup</td>
    <td>75.79</td><td>78.81</td>
    <td>58.32</td><td>60.34</td>
    <td>62.01</td><td>73.97</td>
    <td>80.41</td>
  </tr>
  <tr>
    <td>+ IRCAN</td>
    <td>75.79</td><td>78.81</td>
    <td>58.32</td><td>60.34</td>
    <td>62.01</td><td>73.97</td>
    <td>80.41</td>
  </tr>
  <tr>
    <td>+ CaLE-R</td>
    <td>77.59</td><td>79.78</td>
    <td>59.78</td><td>61.35</td>
    <td>64.42</td><td>75.32</td>
    <td>81.26</td>
  </tr>
  <tr>
    <td>+ CaLE-A</td>
    <td>78.19</td><td>80.06</td>
    <td>63.83</td><td>64.83</td>
    <td>64.62</td><td>75.35</td>
    <td>83.16</td>
  </tr>
  <tr>
    <td>Llama3.1-8B<br>unsup</td>
    <td>76.94</td><td>78.81</td>
    <td>49.52</td><td>50.50</td>
    <td>64.93</td><td>78.01</td>
    <td>85.86</td>
  </tr>
  <tr>
    <td>+ CaLE-R</td>
    <td>79.74</td><td>81.39</td>
    <td>53.58</td><td>54.61</td>
    <td>65.68</td><td>78.33</td>
    <td>85.90</td>
  </tr>
  <tr>
    <td>+ CaLE-A</td>
    <td>79.79</td><td>81.43</td>
    <td>53.63</td><td>54.80</td>
    <td>67.38</td><td>79.07</td>
    <td>86.56</td>
  </tr>
  <tr>
    <td>sup</td>
    <td>79.08</td><td>80.89</td>
    <td>59.43</td><td>60.56</td>
    <td>64.58</td><td>76.28</td>
    <td>87.01</td>
  </tr>
  <tr>
    <td>+ IRCAN</td>
    <td>79.08</td><td>80.89</td>
    <td>59.43</td><td>60.56</td>
    <td>64.58</td><td>76.28</td>
    <td>87.01</td>
  </tr>
  <tr>
    <td>+ CaLE-R</td>
    <td>80.44</td><td>81.99</td>
    <td>60.52</td><td>61.80</td>
    <td>67.38</td><td>79.07</td>
    <td>88.11</td>
  </tr>
  <tr>
    <td>Mistral-TB<br>unsup</td>
    <td>77.32</td><td>78.87</td>
    <td>49.13</td><td>50.07</td>
    <td>63.97</td><td>76.09</td>
    <td>87.26</td>
  </tr>
  <tr>
    <td>+ CaLE-R</td>
    <td>79.94</td><td>80.91</td>
    <td>53.43</td><td>54.31</td>
    <td>65.72</td><td>77.80</td>
    <td>87.66</td>
  </tr>
  <tr>
    <td>+ CaLE-A</td>
    <td>80.69</td><td>81.76</td>
    <td>53.38</td><td>54.26</td>
    <td>65.82</td><td>77.81</td>
    <td>88.71</td>
  </tr>
  <tr>
    <td>sup</td>
    <td>78.61</td><td>80.03</td>
    <td>58.02</td><td>58.82</td>
    <td>64.27</td><td>77.02</td>
    <td>86.76</td>
  </tr>
  <tr>
    <td>+ IRCAN</td>
    <td>78.61</td><td>80.03</td>
    <td>58.02</td><td>58.82</td>
    <td>64.27</td><td>77.02</td>
    <td>86.76</td>
  </tr>
  <tr>
    <td>+ CaLE-R</td>
    <td>80.69</td><td>81.76</td>
    <td>58.58</td><td>59.28</td>
    <td>66.42</td><td>78.01</td>
    <td>89.16</td>
  </tr>
  <tr>
    <td>Gemma2-9B<br>unsup</td>
    <td>78.49</td><td>81.46</td>
    <td>47.27</td><td>49.07</td>
    <td>61.42</td><td>75.78</td>
    <td>84.86</td>
  </tr>
  <tr>
    <td>+ CaLE-R</td>
    <td>79.54</td><td>81.93</td>
    <td>51.76</td><td>53.84</td>
    <td>64.22</td><td>77.06</td>
    <td>90.01</td>
  </tr>
  <tr>
    <td>+ CaLE-A</td>
    <td>79.73</td><td>82.12</td>
    <td>52.33</td><td>54.25</td>
    <td>64.92</td><td>79.93</td>
    <td>90.47</td>
  </tr>
  <tr>
    <td>sup</td>
    <td>78.74</td><td>81.39</td>
    <td>65.01</td><td>66.33</td>
    <td>64.10</td><td>76.34</td>
    <td>84.63</td>
  </tr>
  <tr>
    <td>+ IRCAN</td>
    <td>78.74</td><td>81.39</td>
    <td>65.01</td><td>66.33</td>
    <td>64.10</td><td>76.34</td>
    <td>84.63</td>
  </tr>
  <tr>
    <td>+ CaLE-R</td>
    <td>79.54</td><td>81.93</td>
    <td>62.54</td><td>64.81</td>
    <td>66.87</td><td>78.72</td>
    <td>90.15</td>
  </tr>
  <tr>
    <td>+ CaLE-A</td>
    <td>79.94</td><td>82.58</td>
    <td>63.03</td><td>65.38</td>
    <td>67.92</td><td>79.85</td>
    <td>90.41</td>
  </tr>
</table>

Table 3: EM and F1 scores for the diverse QA datasets. The unsup and sup denote the unsupervised and supervised intervene methods. The best scores are highlighted in bold.

Figure 5: Visualization of Analysis on the CounterFact Dataset for Llama models.
almostly outperforms the IRCAN method. Specifically, we observe that the IRCAN method does not perform well on the StrategyQA dataset with long contexts, often exhibiting minimal effects. Furthermore, the supervised CaLE method yields better results than its unsupervised counterpart, with CaLE-A outperforming CaLE-R. This suggests that CaLE-A possesses stronger generalization capabilities relative to CaLE-R.

Effectiveness on Different Model Architectures. Across different model architectures, our method maintains robust performance on the Mistral and Gemma2 models, achieving improvements comparable to those observed with the Llama family models. This finding highlights the effectiveness of our approach.

4.4 Ablation Study

In this section, we analyze the effectiveness of amplifying different components of the Llama2-7B model: Hidden states, Attention, and MLP with different values of \( \alpha \), as illustrated in Figure 6.

Value of \( \alpha \). Amplifying hidden states results in a clear performance boost, with the effectiveness varying across different layers and amplification factors \( \alpha \). The optimal amplification factor appears to be between 4 and 6, as evidenced by the higher EM scores in the upper curves of the left plot.

Intervention Layer. Notably, the intervention is most effective when applied in later layers (20-25), where all \( \alpha \) values lead to convergence around 70% EM score. This suggests that the model’s representational capacity is most malleable and responsive to amplification in these deeper layers, possibly due to their role in high-level feature integration.

Attention and MLP. The Attention and MLP amplification show more erratic results, with fluctuating performance across layers. For these components, amplifying either leads to diminishing returns or even decreases in performance, suggesting that these layers do not benefit from amplification in the same way as hidden states.

The poor performance of Attention and MLP amplification can be attributed to several factors. For the attention mechanism, which is finely controlled for inference tasks (Jin et al., 2024; Zhou et al., 2024), further amplification may disrupt the delicate balance, leading to noise amplification. Furthermore, the MLP is generally responsible for storing knowledge (Meng et al., 2022b; Geva et al., 2021b). The amplifying the entire MLP can result in a proportional increase in all stored knowledge, which may effectively render the amplification meaningless.

5 Related Work

Existing approaches to enhancing context-faithfulness in LLMs can be broadly classified into three categories: fine-tuning methods (Bi et al., 2024), external interventions (Zhou et al., 2023) and internal interventions. The internal interventions predominantly focus on modifying decoding strategies or reweighting knowledge-aware neurons. Methods such as CAD (Shi et al., 2024b) and COIECD (Yuan et al., 2024) optimize decoding strategies through a contrastive mechanism (Li et al., 2023) to promote greater reliance on external information. However, these decoding-based approaches operate at the output level, resulting in only limited improvements. Another stream of research explores the internal states of models. For instance, Jin et al. (2024) and Shi et al. (2024a) aim to identify and reweight neurons crucial for processing contextual cues, thereby alleviating conflicts through targeted interventions at critical points.

6 Conclusion

In this paper, we propose a novel intervention method called CaLE, which exploits contextual knowledge within LLMs’ internal representations. It strategically amplifies the contextual information growth at an appropriate layer, which facilitates richer representations in the final layer. Our experiments demonstrate that CaLE effectively improves
context-faithful generation in QA tasks, particularly in scenarios involving unknown or conflicting contextual knowledge.

Limitations

The CaLE approach is to simply conduct one-time intervention during the inference process. While there are several other potential methods to execute interventions continuously, we leave the exploration of these alternatives for future work.

The intervention analysis on the MLP and Attention components adopts the amplification method proposed in the paper. While numerous studies (Meng et al., 2022b; Geva et al., 2021b) have discussed the role of these components in manipulating knowledge, this study does not specifically explore whether alternative intervention methods beyond amplification, or selective interventions within layers, should be employed. Instead, a uniform approach of amplifying entire layers is adopted, which may introduce limitations.

Acknowledgements

This work was supported by the National Key R&D Program of China (No. 2022ZD0116314), Beijing Natural Science Foundation (L243006) and the National Natural Science Foundation of China (No. 62106249).

References

Amos Azaria and Tom M. Mitchell. 2023. The internal state of an LLM knows when its lying. CoRR, abs/2304.13734.

Baolong Bi, Shaohan Huang, Yiwei Wang, Tianchi Yang, Zihan Zhang, Haizhen Huang, Lingrui Mei, Junfeng Fang, Zehao Li, Furu Wei, Weiwei Deng, Feng Sun, Qi Zhang, and Shenghua Liu. 2024. Context-dpo: Aligning language models for context-faithfulness. Preprint, arXiv:2412.15280.

Chao Chen, Kai Liu, Ze Chen, Yi Gu, Yue Wu, Mingyuan Tao, Zhihang Fu, and Jieping Ye. 2024. INSIDE: llms’ internal states retain the power of hallucination detection. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024.

Yanai Elazar, Nora Kassner, Shauli Ravfogel, Abhilasha Ravichander, Eduard H. Hovy, Hinrich Schütze, and Yoav Goldberg. 2021. Measuring and improving consistency in pretrained language models. Trans. Assoc. Comput. Linguistics, 9:1012–1031.

Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, et al. 2021. A mathematical framework for transformer circuits. Transformer Circuits Thread, 1(1):12.

Kawin Ethayarajh, Yejin Choi, and Swabha Swayamdipta. 2022. Understanding dataset difficulty with V-usable information. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 5988–6008. PMLR.

Siqi Fan, Xin Jiang, Xiang Li, Xuying Meng, Peng Han, Shuo Shang, Aixin Sun, Yequan Wang, and Zhongyuan Wang. 2024. Not all layers of llms are necessary during inference. CoRR, abs/2403.02181.

Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi, Yi Dai, Jiawei Sun, Meng Wang, and Haofen Wang. 2024. Retrieval-augmented generation for large language models: A survey. Preprint, arXiv:2312.10997.

Mor Geva, Daniel Khashabi, Elad Segal, Tushar Khot, Dan Roth, and Jonathan Berant. 2021a. Did aristotle use a laptop? A question answering benchmark with implicit reasoning strategies. Trans. Assoc. Comput. Linguistics, 9:346–361.

Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. 2021b. Transformer feed-forward layers are key-value memories. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, 2021, pages 5484–5495. Association for Computational Linguistics.

Michael Hanna, Ollie Liu, and Alexandre Variengien. 2023. How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language model. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.

Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Yejin Bang, Andrea Madotto, and Pascale Fung. 2023. Survey of hallucination in natural language generation. ACM Comput. Surv., 55(12):248:1–248:38.

Zhuoran Jin, Pengfei Cao, Hongbang Yuan, Yubo Chen, Jiexin Xu, Huaijun Li, Xiaojian Jiang, Kang Liu, and Jun Zhao. 2024. Cutting off the head ends the conflict: A mechanism for interpreting and mitigating knowledge conflicts in language models. In Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand and virtual meeting, August 11-16, 2024, pages 1193–1215. Association for Computational Linguistics.

Tianjie Ju, Weiwei Sun, Wei Du, Xinwei Yuan, Zhaochun Ren, and Gongshen Liu. 2024. How large language models encode context knowledge?
A layer-wise probing study. In Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation, LREC/COLING 2024, 20-25 May, 2024, Torino, Italy, pages 8235–8246. ELRA and ICCL.

S. Kullback and R. A. Leibler. 1951. On information and sufficiency. The Annals of Mathematical Statistics, 22(1):79–86.

Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur P. Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Ken- ton Lee, Kristina Toutanova, Llion Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: a benchmark for question answering research. Trans. Assoc. Comput. Linguistics, 7:452–466.

Xiang Lisa Li, Ari Holtzman, Daniel Fried, Percy Liang, Jason Eisner, Tatsunori Hashimoto, Luke Zettlemoyer, and Mike Lewis. 2023. Contrastive decoding: Open-ended text generation as optimization. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2023, Toronto, Canada, July 9-14, 2023, pages 12286–12312. Association for Computational Linguistics.

Shayne Longpre, Kartik Perisetla, Anthony Chen, Nikhil Ramesh, Chris DuBois, and Sameer Singh. 2021. Entity-based knowledge conflicts in question answering. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, 2021, pages 7052–7063. Association for Computational Linguistics.

Xin Men, Mingyu Xu, Qingyu Zhang, Bingning Wang, Hongyu Lin, Yaojie Lu, Xianpei Han, and Weipeng Chen. 2024. Shortgpt: Layers in large language models are more redundant than you expect. CoRR, abs/2403.03853.

Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022a. Locating and editing factual associations in GPT. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.

Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022b. Locating and editing factual associations in GPT. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.

nostalgebraist. 2020. Interpreting GPT: the logit lens. AI Alignment Forum.

Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, et al. 2022. In-context learning and induction heads. arXiv preprint arXiv:2209.11895.

Zexuan Qiu, Zijing Ou, Bin Wu, Jingjing Li, Aiwei Liu, and Irwin King. 2024. Entropy-based decoding for retrieval-augmented large language models. CoRR, abs/2406.17519.

Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: 100, 000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016, pages 2383–2392. The Association for Computational Linguistics.

Ori Ram, Yoav Levine, Itay Dalmedigos, Dor Muhlgay, Amnon Shashua, Kevin Leyton-Brown, and Yoav Shoham. 2023. In-context retrieval-augmented language models. Transactions of the Association for Computational Linguistics, 11:1316–1331.

Ruiyang Ren, Yuhao Wang, Yingqi Qu, Wayne Xin Zhao, Jing Liu, Hua Wu, Ji-Rong Wen, and Haifeng Wang. 2025. Investigating the factual knowledge boundary of large language models with retrieval augmentation. In Proceedings of the 31st International Conference on Computational Linguistics, COLING 2025, Abu Dhabi, UAE, January 19-24, 2025, pages 3697–3715. Association for Computational Linguistics.

Dan Shi, Renren Jin, Tianhao Shen, Weilong Dong, Xinwei Wu, and Deyi Xiong. 2024a. IRCAiN: mitigating knowledge conflicts in LLM generation via identifying and reweighting context-aware neurons. CoRR, abs/2406.18406.

Weijia Shi, Xiaochuang Han, Mike Lewis, Yulia Tsvetkov, Luke Zettlemoyer, and Wen-tau Yih. 2024b. Trusting your evidence: Hallucinate less with context-aware decoding. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Short Papers, NAACL 2024, Mexico City, Mexico, June 16-21, 2024, pages 783–791. Association for Computational Linguistics.

Oscar Skean, Md Rifat Arefin, Yann LeCun, and Ravid Shwartz-Ziv. 2024. Does representation matter? exploring intermediate layers in large language models. In NeurIPS Workshop on Machine Learning and Compression.

Zhongxiang Sun, Xiaoxue Zang, Kai Zheng, Yang Song, Jun Xu, Xiao Zhang, Weijie Yu, and Han Li. 2024. Redep: Detecting hallucination in retrieval-augmented generation via mechanistic interpretability. CoRR, abs/2410.11414.

Jian Xie, Kai Zhang, Jiangjie Chen, Renze Lou, and Yu Su. 2024. Adaptive chameleon or stubborn sloth: Revealing the behavior of large language models in knowledge conflicts. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.
Ji Xin, Raphael Tang, Yaoliang Yu, and Jimmy Lin. 2021. Berxit: Early exiting for BERT with better fine-tuning and extension to regression. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, EACL 2021, Online, April 19 - 23, 2021, pages 91–104. Association for Computational Linguistics.

Yilun Xu, Shengjia Zhao, Jiaming Song, Russell Stewart, and Stefano Ermon. 2020. A theory of usable information under computational constraints. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net.

Qinan Yu, Jack Merullo, and Ellie Pavlick. 2023. Characterizing mechanisms for factual recall in language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, EMNLP 2023, Singapore, December 6-10, 2023, pages 9924–9959. Association for Computational Linguistics.

Xiaowei Yuan, Zhao Yang, Yequan Wang, Shengping Liu, Jun Zhao, and Kang Liu. 2024. Discerning and resolving knowledge conflicts through adaptive decoding with contextual information-entropy constraint. In Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand and virtual meeting, August 11-16, 2024, pages 3903–3922. Association for Computational Linguistics.

Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, Yifan Du, Chen Yang, Yushuo Chen, Zhipeng Chen, Jinhaoh Jiang, Ruiyang Ren, Yifan Li, Xinyu Tang, Zikang Liu, Peiyu Liu, Jian-Yun Nie, and Ji-Rong Wen. 2024. A survey of large language models. Preprint, arXiv:2303.18223.

Hanzhang Zhou, Zijian Feng, Zixiao Zhu, Junlang Qian, and Kezhi Mao. 2024. Unibias: Unveiling and mitigating LLM bias through internal attention and FFN manipulation. In Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024.

Wenxuan Zhou, Sheng Zhang, Hoifung Poon, and Muhao Chen. 2023. Context-faithful prompting for large language models. In Findings of the Association for Computational Linguistics: EMNLP 2023, Singapore, December 6-10, 2023, pages 14544–14556. Association for Computational Linguistics.
A  Experimental Settings for CounterFact

A.1 Data Format in Section 2
We use question \( q \) with context \( c \) from COUNTERFACT (Meng et al., 2022a). For a given model, we input the sample data for which the model predicts the correct answer (e.g., "Danielle Darrieux, a native French. The mother tongue of Danielle Darrieux is _"). In this section, we refer to the token predicted by the model for a given input as the answer.

\[
c: \{\text{paraphrased prompt}\} \ \{\text{target true}.\}
q: \{\text{prompt}\}
\]

A.2 Data Format in Section 3
Similarly, we construct the data for computing these two KL divergences based on the CounterFact dataset:

\[
KL_q(l) = \mathrm{KL}[P(h_l \mid q) \| P(h_l)]
KL_c(l) = \mathrm{KL}[P(h_l \mid q, c) \| P(h_l \mid q)]
\]

The term without \( c \) (i.e., \( P(h_l \mid q) \)) is generated by excluding \( c \) from the input.

\[
q: \{\text{prompt}\}
\]

The term without both \( q \) and \( c \) (i.e., \( P(h_l) \)) is derived by providing an empty input.

\[
\{\emptyset\}
\]

B  Logit Lens
The LogitLens is a technique that decodes hidden states \( h^l \) directly into the vocabulary distribution using the LayerNorm and the unembedding matrix of the LLM for interpretability (nostalgiaeraiist, 2020):

\[
\mathrm{LogitLens}\left(h^l\right) = \mathrm{LayerNorm}(h^l)\mathbf{W}_U \tag{19}
\]

The final layer’s residual stream state is then projected into the vocabulary space using the *Unembedding Matrix* \( \mathbf{W}_U \in \mathbb{R}^{d \times |\mathcal{V}|} \) and normalized via the softmax function to produce a probability distribution over the vocabulary, from which a new token is sampled.

This approach has been validated in various studies as an effective method for interpreting LLMs’ weight matrices or hidden states (Yu et al., 2023; Hanna et al., 2023; Zhou et al., 2024).

C  Residual Stream
We interpret transformer decoder-only architecture (also known as GPT-like) through the perspective of the residual stream (Elhage et al., 2021; Ols-son et al., 2022). Due to the residual connections in Transformers, each layer \( l \) takes a hidden state \( h^{l-1} \) as input and adds information obtained from its *Attention Heads* and *Feed-Forward Networks* (FFNs) to the hidden state via the residual connection. In this context, the hidden state acts as a residual stream passed through the layers, with each attention and FFN contributing to the final prediction by adding information to the residual stream, resulting in the *Residual Stream States*. Formally, the hidden state \( h^l \) at layer \( l \) is calculated as:

\[
\begin{align*}
h^l &= h^{l-1} + \mathrm{MHA}(h^{l-1}) + \mathrm{FFN}(a^l) \\
&= h^{l-1} + a^l + m^l
\end{align*}
\]

where \( a^l \) and \( m^l \) are the outputs from the MHA and FFN block in the \( l \)-th layer. Both quantities are dependent on \( h^{l-1} \) and can thus be formulated as functions of it (See Eq. 20).

Then, the hidden state \( h^{l+1} \) at layer \( l + 1 \) is calculated as:

\[
\begin{align*}
h^{l+1} &= h^l + a^{l+1} + m^{l+1} \\
&= h^{l-1} + a^l + m^l + a^{l+1} + m^{l+1} \\
&= h^{l-1} + \sum_{k=l}^{l+1} a^k + \sum_{k=l}^{l+1} m^k
\end{align*}
\]

Consequently, the hidden state \( h^N \) at the final layer \( N (N \geq l) \) can be calculated as:

\[
\begin{align*}
h^N &= h^{N-1} + a^N + m^N \\
&= h^{N-2} + a^{N-1} + m^{N-1} + a^N + m^N \\
&= ... \\
&= h^l + \sum_{k=l+1}^N a^k + \sum_{k=l+1}^N m^k
\end{align*}
\]

where \( s_t \) represents the sum of the contributions from the subsequent layers to the final layer.

The final layer’s residual stream state is then projected into the vocabulary space using the *Unembedding Matrix* \( \mathbf{W}_U \in \mathbb{R}^{d \times |\mathcal{V}|} \). The final output
logits of the LLM can be expressed as:

\[
\text{logits}_N = h^l W_U + \left( \sum_{k=l+1}^N a^k + \sum_{k=l+1}^N m^k \right) W_U \\
= v + u(v)
\] (20)

For analytical simplicity, we ignore the final LayerNorm function following Elhage et al. (2021) and Sun et al. (2024). It adds a fair amount of complexity to consider explicitly, and up to a variable scaling, layer norm can be merged into adjacent weights. Conceptually, \( v \) and \( u(v) \) capture the information encoded in layer \( l \) and later layer \( > l \) respectively.

Finally, the logit would be normalized via the softmax function to produce a probability distribution over the vocabulary, from which a new token is sampled.

\[
P = \frac{e^{v_k + u_k(v_k)}}{\sum_{j \in |Vocab|} e^{v_j + u_j(v_j)}}
\] (21)

D Theoretical Support for Enhancement

D.1 Analysis on the Amplification

Suppose we amplify the hidden states at layer \( l \) by the factor \( \alpha \):

\[
h^l_{\text{modified}} = \alpha h^l
\]

We will analyze how this scaling affects the subsequent computations. Here Let’s take LayerNorm as an example.

At Layer \( l + 1 \). Since LayerNorm is scale-invariant:

\[
h^l_{\text{modified}} = \text{LayerNorm}(\alpha h^l) \\
= \text{LayerNorm}(h^l) = \tilde{h}^l
\]

The scaling by \( \alpha \) has no effect on the output of the first LayerNorm. Therefore, the input to the MHA sublayer remains unchanged:

\[
a^{l+1} = \text{MHA}(\tilde{h}^l)
\]

After the MHA sublayer, the residual connection adds \( a^l \) back to the scaled \( h^l \):

\[
h^{l+1}_{\text{modified}} = h^l_{\text{modified}} + a^{l+1} = \alpha h^l + a^{l+1}
\]

Then the scaled hidden state \( \alpha h^l \) is now part of \( h^{l+1} \), which will be normalized for FFN input.

\[
\tilde{h}^{l+1}_{\text{modified}} = \text{LayerNorm}(h^{l+1}_{\text{modified}})
= \gamma \odot \frac{\alpha h^l + a^l - \mu^{l+1}_{\text{modified}}}{\sigma^{l+1}_{\text{modified}}} + \delta
\]

where

\[
\mu^{l+1}_{\text{modified}} = \frac{1}{D} \sum_{i=1}^D \left( \alpha h^l + a^i \right) = \alpha \mu^l + \mu_a
\]
\[
\sigma^{l+1}_{\text{modified}} = \sqrt{\frac{1}{D} \sum_{i=1}^D \left( \alpha h^l + a^i - \mu^{l+1}_{\text{modified}} \right)^2}
\]

The normalization does not cancel out \( \alpha \) completely because \( a^i \) is not scaled. Therefore, the information in \( a \) is relatively compressed. Then,

\[
m^{l+1}_{\text{modified}} = \text{MLP}(\tilde{h}^{l+1}_{\text{modified}})
\]

The output at layer \( l + 1 \) is:

\[
h^{l+1}_{\text{modified}} = h^l_{\text{modified}} + a^{l+1} + m^{l+1}_{\text{modified}}
= \alpha h^l + a^{l+1} + m^{l+1}_{\text{modified}}
\]

At Layer \( k > l + 1 \). The altered hidden state \( h^{l+1}_{\text{modified}} \) affects all subsequent layers in a similar fashion. And the amplification effect of \( \alpha \) persists due to the residual connections.

The hidden state can be represented recursively:

\[
h^k_{\text{modified}} = \alpha h^l + a^{l+1} + m^{k+1}_{\text{modified}}
+ \sum_{i=l+2}^k (a^i_{\text{modified}} + m^i_{\text{modified}})
\]

Therefore, the amplification effect of \( \alpha \) accumulates through the residual connections and affects all subsequent layers.

At Final Layer \( N \). The logits are computed using the final hidden state \( h^N_{\text{modified}} \):

\[
\text{logits}_{\text{modified}} = h^N_{\text{modified}} W_U
\]

Breaking Down \( h^N_{\text{modified}} \), the logits can be calculated as:

\[
\text{logits}_{\text{modified}} = \alpha h^l W_U + (a^{l+1} + m^{l+1}_{\text{modified}})
+ \sum_{i=l+2}^N (a^i_{\text{modified}} + m^i_{\text{modified}})) W_U
\]

Finally, the softmax probabilities become:

\[
P_{\text{modified}} = \frac{e^{\alpha v_k + u_k^{(A)}(\alpha v)}}{\sum_{j \in |Vocab|} e^{\alpha v_j + u_j^{(A)}(\alpha v)}}
\] (22)

where: \( v = h^L W_U \), and \( u^{(A)}(\cdot) \) includes contributions from the subsequent layers by amplification.
This leads to a proportional change in the logits and alters the softmax probability distribution, potentially affecting the model’s predictions.

In correspondence with Formula 21, the \( \mathcal{V} \)-entropy is derived as follows:
\[
H_{\mathcal{V}_f}(\alpha) \overset{\text{def}}{=} \mathbb{E}[\ln \sum_j e^{\alpha v_j + u_j(\alpha v_j)} - (\alpha v_k + u_k(\alpha v_k))]
\]

D.2 Analysis on the Additional Residual Connection

Suppose we introduce an additional residual connection at layer \( l \), which directly propagates \( h^l \) to \( \alpha \) subsequent layers:

At Layer \( l+1 \). With the inclusion of the new residual connection, the hidden state is modified as follows:
\[
h^{l+1}_{\text{modified}} = (h^l + a^{l+1} + m^{l+1}) + h^l \\
= 2h^l + a^{l+1} + m^{l+1}
\]

At Layer \( k \) where \( l+1 < k \leq l+\alpha \). Due to the cumulative effect of the residual connections, the hidden state at layer \( k \) can be expressed as:
\[
h^k_{\text{modified}} = (k - l + 1)h^l + a^{l+1} + m^{l+1} \\
+ \sum_{i=l+2}^k (a^i_{\text{modified}} + m^i_{\text{modified}})
\]
where \( (k - l + 1) \) represents the number of times the residual connection has been accumulated.

At the Final Layer \( N \). The final logits are computed as:
\[
\begin{align*}
\text{logits}_{\text{modified}} &= h^N_{\text{modified}} W_U \\
&= (\alpha + 1)h^l W_U + (a^{l+1} + m^{l+1}) \\
&+ \sum_{i=l+2}^N (a^i_{\text{modified}} + m^i_{\text{modified}})) W_U
\end{align*}
\]
Similar to the previous deduction (Appendix D.1), the final softmax probability distribution is given by:
\[
P_{\text{modified}} = \frac{e^{(\alpha+1)v_k + u_k^{(R)}((\alpha+1)v)}}{\sum_{j \in |Vocab|} e^{(\alpha+1)v_j + u_j^{(R)}((\alpha+1)v)}}
\]
where \( v = h^{(l)} W_U \). While \( u^{(R)}(\cdot) \) encapsulates the contributions from the subsequent layers, it differs fundamentally from the \( u^{(A)}(\cdot) \) function in the Amplification method, as the underlying modifications to the information flow in these two approaches are inherently distinct.

Compared with Amplification. This analysis reveals that adding cumulative residual connections provides a structured approach to amplifying the influence of intermediate layer representations. While there are subtle differences in how these methods affect subsequent layers, we empirically compare their performances through experiments in Section 4.

E Proof for Proposition 3.1

Proposition. Let \( \alpha \) denote the scaling factor applied to the hidden states at this layer. If \( k = \arg \max_j v_j \), then
\[
\lim_{\alpha \to \infty} H_{\mathcal{V}_f}(\alpha) \approx 0
\]
Proof. First, consider the following decomposition:
\[
\sum_j e^{\alpha v_j + u_j(\alpha v_j)} = e^{\alpha v_k + u_k(\alpha v)} \cdot \\
\left( 1 + \sum_{j \neq k} e^{\alpha(v_j - v_k) + u_j(\alpha v_j) - u_k(\alpha v_k)} \right)
\]
When \( j \neq k, v_j - v_k < 0 \). All terms with \( j \neq k \) exponentially diminish as \( \alpha \) increases\footnote{Since \( \alpha \) approaches zero, \( u_j(\alpha v) - u_k(\alpha v) \) represents the difference between two extremely small quantities. It can be negligible compared to the \( \alpha(v_j - v_k) \).}. Therefore:
\[
\lim_{\alpha \to \infty} \sum_j e^{\alpha v_j + u_j(\alpha v_j)} \approx e^{\alpha v_k + u_k(\alpha v_k)} (1 + \epsilon(\alpha))
\]
where \( \epsilon(\alpha) \to 0 \) as \( \alpha \to \infty \).

Applied to the Formula 9, we have
\[
\begin{align*}
\lim_{\alpha \to \infty} H_{\mathcal{V}_f}(\alpha) &\approx \mathbb{E}\Big[ \alpha v_k + u_k(\alpha v) + \ln (1 + \epsilon(\alpha)) \\
&- (\alpha v_k + u_k(\alpha v)) \Big] \\
&= \mathbb{E}[\ln (1 + \epsilon(\alpha))] \\
&= 0
\end{align*}
\]
Therefore, the result is proven. \( \square \)

F Dataset Details

CounterFact. The CounterFact (Meng et al., 2022a) dataset is derived from the PARAREL dataset (Elazar et al., 2021) and contains knowledge tuples of the kind \( t^c = (s, r, o^c) \), where \( s \) is the subject, \( r \) is the relation and \( o \) is the object. These tuples are constructed using entities listed
in Wikidata. The data are accompanied by hand-written paraphrased prompts for each sample. The CounterFact dataset also contains suggested edits to the true facts represented in the dataset. For this study, the set of counterfactual edits are not used.

NaturalQuestions. NQ (Kwiatkowski et al., 2019) consists of real-world information-seeking queries issued to the Google search engine and their corresponding long answers (gold evidence passage) and short answers (one or more entities). In our study, we employ the long answers as the input context and short answers as the ground truth, and conduct evaluations on the dev set.

NQ-Swap NQ-Swap is based on the NQ dataset, where the objective is to answer questions based on a reliable gold document. To generate NQ-Swap, Longpre et al. (2021) first identify questions in NQ with named entity answers, find the supportive document for each question and then replace the gold answer entity in the document with a random entity. A faithful LM should generate the replaced entity as the answer when given the question and modified document.

SQuAD. The SQuAD (Rajpurkar et al., 2016) 1.1 is a common QA benchmark. It includes questions posed by human annotators on a given Wikipedia paragraph, where the answer to each question is a segment of text (or span) from the paragraph. In our experiments, we conduct experiments on the dev for evaluation.

StrategyQA. StrategyQA (Geva et al., 2021a) is a fact reasoning benchmark that necessitates the implicit question decomposition into reasoning steps. Built around Wikipedia terms, these questions are accompanied by multiple evidence paragraphs. The model is expected to provide a True or False answer. We concatenate question-relevant evidences to form the input context. We adopt the training set for evaluation, considering the volume of data.

F.1 Posteriori judgement for CounterFact

We delineates the process of identifying knowledge boundary of "unknown" and "known" contexts. The evaluation is based on the accuracy of the model’s responses when context is not provided. The scenarios are divided into two categories:

• Unkown: This category refers to instances where the model is unable to provide the correct answer without relying on the provided context. Such cases indicate that the external contextual knowledge represents information not contained within the model’s inherent parametric knowledge.

• Known: This category describes scenarios in which the model can accurately answer a question without requiring its corresponding context. These instances demonstrate that the model has internalized the relevant knowledge, reflecting an alignment between its parametric knowledge and the external contextual information.

G Decoding Strategies

Contrastive Decoding (CD) In our experiments, we employ the distribution \( g(y_t) \) with a certain threshold as a baseline decoding method, referred to as the CD (Li et al., 2023) method. We modify the original object of CD (computes the distribution discrepancy between an small amateur model and an expert larger model) to simulate the form of \( g(y_t) \).

\[
CD = \log p(y_t|x, y < t) - p(y_t|y < t) \\
= \log g(y_t)
\]

The threshold is same as in the original CD method:

\[
\mathcal{V}_{\text{head}}(y_{<t}) =
\left\{ y_t \in \mathcal{V} : p(y_t|y_{<t}) \geq 0.1 \cdot \max_y p(y|y_{<t}) \right\}
\]

Here, we represent the input context as \( x \). CD adopts the object of difference between the output likelihood when inputs are presented with and without input context. It enhances the influence of the context for high-probability words within a crude threshold.

Context-Aware Decoding (CAD) In CAD (Shi et al., 2024b) method, the output probability is a product-of-experts of the original output probability and PMI weighted by \( \alpha = 0.5 \) as follow:

\[
y_t \sim \text{softmax}[(1 + \alpha) \logit_\theta(y_t | c, x, y_{<t}) \\
- \alpha \logit_\theta(y_t | x, y_{<t})]
\]

COntextual Information-Entropy Constraint Decoding (COIECD) First, the contextual contrastive object \( g \) is calculated to quantify the divergence between \( p_1 \) and \( p_2 \):

\[
g(y_t) = \log p_2(y_t) - \log p_1(y_t)
\]
where

\[
p_1(y_t) = p(y_t | \mathbf{x}, \mathbf{y}_{<t}) \\
p_2(y_t) = p(y_t | \mathbf{x}, c, \mathbf{y}_{<t})
\]

The \( g \) is to factor out the model’s inherent memory and favor the contextual knowledge.

The contextual information-entropy constraint is utilized with \( g \) on the output distribution \( \pi \) as:

\[
\log \pi(y_t \mid \mathbf{x}, c, \mathbf{y}_{<t}) \\
= \begin{cases}
\log p_1(y_t) + \alpha \cdot g(y_t) & \text{if } y_t \in \mathcal{C}(\mathbf{y}_{<t}), \\
\log p_2(y_t) + \alpha \cdot g(y_t) & \text{otherwise}.
\end{cases}
\] (24)

where \( \alpha \) is a scaling weight to control the contextual impact. The final decoding strategy can be formalized as:

\[
y_t \sim \operatorname{softmax}[\log \pi(y_t \mid \mathbf{x}, c, \mathbf{y}_{<t})]
\] (25)

In this way, COIECD strikes a balance between the two sources of knowledge to achieve a more effective and holistic decoding strategy.

H Layer Selection by CaLE

Here, we present some models that employ the CaLE method, as shown in Tables 1 and 3, which enhance various layers selected through both supervised and unsupervised identification, as indicated in Table 4. Our findings reveal that nearly all of the selected layers are distributed in the middle to later stages, suggesting that intervening at deeper layers is a more effective choice.

<table>
  <tr>
    <th rowspan="2">Layer selected by CaLE</th>
    <th colspan="2">CounterFact</th>
    <th colspan="2">NQ</th>
    <th colspan="2">NQ-swap</th>
  </tr>
  <tr>
    <th>sup.</th>
    <th>unsup.</th>
    <th>sup.</th>
    <th>unsup.</th>
    <th>sup.</th>
    <th>unsup.</th>
  </tr>
  <tr>
    <td>Llama2-7B</td>
    <td>25</td>
    <td>25</td>
    <td>26</td>
    <td>26</td>
    <td>15</td>
    <td>26</td>
  </tr>
  <tr>
    <td>Llama3-1.8B</td>
    <td>23</td>
    <td>26</td>
    <td>28</td>
    <td>25</td>
    <td>19</td>
    <td>23</td>
  </tr>
  <tr>
    <td>Llama3-2.8B</td>
    <td>23</td>
    <td>23</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
  </tr>
  <tr>
    <td>Mistral-7B</td>
    <td>25</td>
    <td>25</td>
    <td>25</td>
    <td>25</td>
    <td>15</td>
    <td>25</td>
  </tr>
  <tr>
    <td>Gemma2-9B</td>
    <td>-</td>
    <td>-</td>
    <td>32</td>
    <td>39</td>
    <td>29</td>
    <td>25</td>
  </tr>
  <tr>
    <th colspan="2">SQuAD</th>
    <th colspan="2">StrategyQA</th>
  </tr>
  <tr>
    <th>sup.</th>
    <th>unsup.</th>
    <th>sup.</th>
    <th>unsup.</th>
  </tr>
  <tr>
    <td>Llama2-7B</td>
    <td>22</td>
    <td>26</td>
    <td>22</td>
    <td>21</td>
  </tr>
  <tr>
    <td>Llama3-1.8B</td>
    <td>26</td>
    <td>26</td>
    <td>20</td>
    <td>25</td>
  </tr>
  <tr>
    <td>Mistral-7B</td>
    <td>25</td>
    <td>27</td>
    <td>22</td>
    <td>30</td>
  </tr>
  <tr>
    <td>Gemma2-9B</td>
    <td>36</td>
    <td>38</td>
    <td>35</td>
    <td>36</td>
  </tr>
</table>

Table 4: Layer selection of CaLE across different datasets and models. The unsup. and sup. denote the unsupervised and supervised CaLE methods.

Reviewer paper summaries: The paper addresses the challenge of contextual faithfulness in open-source LLMs, particularly in cases where contextual information conflicts with the model’s pre-existing parametric knowledge.
To tackle this issue, the authors investigate how contextual information is processed within the internal layers of LLMs. They introduce CaLE, an intervention mechanism designed to enhance contextual utilization within the model’s internal representations. The study finds that contextual information does not increase monotonically toward the output layer. Instead, it fluctuates across intermediate layers, prompting the authors to propose amplification techniques at specific layers to enrich the final representation.
The paper’s key contributions are:

1. Analyzing information flow in LLMs and showing that contextual information varies across layers, with certain layers exhibiting high contextual representation, followed by a plateau or decline.
2. Introducing CaLE, a method to identify the appropriate context-sensitive layer for intervention, and using that for enhancing the representation of contextual information in the final layers.
Summary of strengths: 1. Novel perspective with strong theoretical foundation: The paper takes a novel approach to improving context-faithfulness by focusing on internal representation dynamics rather than decoding strategies. This work provides new insights into LLM behavior and potential enhancements. The strong theoretical foundation, including formal proofs on minimizing conditional V-usable information, further supports the effectiveness of the proposed method.
2. Robust performance: CaLE consistently surpasses baseline methods across many different datasets and models, 
3. Flexible: CaLE improves context-faithfulness across various decoding strategies and can be combined with other methods for additional gains.
Summary of weaknesses: 1. Need for broader experimentation: The paper lacks sufficient baseline comparisons and dataset diversity. Evaluating CaLE against other intervention techniques, such as Ph3 [1], or [2] would strengthen its empirical validation. Additionally, testing beyond QA datasets—such as summarization or dialogue—would demonstrate its broader applicability to context-faithfulness challenges.
2. Computational efficiency concerns: While the paper focuses on effectiveness, it provides little insight into the computational cost of implementing CaLE during inference. Since the method modifies internal model representations, potential impacts on inference speed and resource usage should be assessed to ensure reproducibility and practical usability.
3. Deeper analysis of layer dynamics: The paper highlights fluctuations in contextual information across layers but does not explore why certain layers retain more context than others. Investigating the architectural factors driving these variations could offer valuable insights into LLM internals and further refine the proposed intervention.
Comments, suggestions and typos: * Please review the grammar in the paper, such as  Line 075:  “a investigation” → “an investigation”  and Line 044: "an unfaithful" instead of "a unfaithful"
* Could CaLE-A and CaLE-R be combined into a hybrid approach to achieve even greater improvements?
Overall assessment scores: 3.5
Metareview score: 3.5
Metareview: This paper addresses the challenge of improving context-faithful generation in LLM, especially in situations where external context conflicts with the model's existing parametric knowledge. The authors propose Context-aware Layer Enhancement (CaLE), a method that enhances the utilization of contextual knowledge by modifying internal representations at optimal layers, rather than relying solely on decoding strategies. 

Empirical results demonstrate that CaLE improves performance in QA tasks, particularly in knowledge conflict scenarios. The authors also respond to reviewer concerns by extending experiments to dialogue and summarization tasks and providing a detailed analysis of computational efficiency.
Summary of reasons to publish: - The paper presents a fresh perspective by focusing on internal representation dynamics instead of post-hoc decoding strategies, offering theoretical insights into how contextual information flows within LLMs.

- CaLE can be integrated with existing decoding strategies and works without retraining the model, making it scalable and applicable in real-world settings.