Reference Trustable Decoding: A Training-Free Augmentation Paradigm for Large Language Models
Authors: Shi Luohe
Yao Yao
Zuchao Li
Lefei Zhang
hai zhao
Venue: NeurIPS 2024 poster (2024)
Keywords: LLM
augmentation
efficient methods
Primary area: natural_language_processing
TL;DR: A new paradigm for fitting LLMs to downstream tasks.

Abstract: Large language models (LLMs) have rapidly advanced and demonstrated impressive capabilities. In-Context Learning (ICL) and Parameter-Efficient Fine-Tuning (PEFT) are currently two mainstream methods for augmenting LLMs to downstream tasks. ICL typically constructs a few-shot learning scenario, either manually or by setting up a Retrieval-Augmented Generation (RAG) system, helping models quickly grasp domain knowledge or question-answering patterns without changing model parameters. However, this approach involves trade-offs, such as slower inference speed and increased space occupancy. PEFT assists the model in adapting to tasks through minimal parameter modifications, but the training process still demands high hardware requirements, even with a small number of parameters involved. To address these challenges, we propose Reference Trustable Decoding (RTD), a paradigm that allows models to quickly adapt to new tasks without fine-tuning, maintaining low inference costs. RTD constructs a reference datastore from the provided training examples and optimizes the LLM's final vocabulary distribution by flexibly selecting suitable references based on the input, resulting in more trustable responses and enabling the model to adapt to downstream tasks at a low cost. Experimental evaluations on various LLMs using different benchmarks demonstrate that RTD establishes a new paradigm for augmenting models to downstream tasks. Furthermore, our method exhibits strong orthogonality with traditional methods, allowing for concurrent usage. Our code can be found at https://github.com/ShiLuohe/ReferenceTrustableDecoding.

Reference Trustable Decoding: A Traening-Free Augmentation Paradigm for Large Language Models
Luohe Shil.t, Yao Yao", Zuchao L Zhang', and Hai Zhao? National Engineering Research Center for Multimedia Software, School of Computer Science, Wuhan University, Wuhan, 430072, P. R. China DDeparmeent of Computer Science and Engineering, Shanghai Jiao Tong University shi shiluohe@whu edu. cn, yaoyao27ssjtu edu, en, zcli-char's whwrlieewhhr..e edu. cn, zhaohai@cs. sjtu. edu.
edu.
STEM
STEM
35.1
10.3
50.5
52.5
26
23:5
40
45
F2:
Humonities
ARC-E
Humanities
ARC-E
+26
14
Other
ARC-C
Other
ARC-E
Figure 1: Performance comparison between default LLM and reference trustable decoding reason- ing tests.
Abstract
Large language models (LLMs) have rapidly advanced and demonstrated impres- sive capabilities. In-Context Learning (ICL) and Parameter- Efficcient Fine-Tume Tuning (PEFT) are eurrently two mainstream methods for augmenting LLMs down- stream tasks. ICL typically constructs a few-shot learning scenario, either manually by setting up Retrieval-Augmented Generation (RAG) system, helping models quickly grasp domain knowledge or anestion-answerrig patterns without changing model parameters. However, this approach involves trade-offs. such as slower in- ference speed and increased space occupancy. PEFT assists the model in adapting tasks through minimal parameter modifications, but the training process still demands high hardware requirements, even with a small number of parameters involved. To address these challenges, we propose Reference Trustable Decod- ing (RTD), a paradigm that allows models to quickly adapt to new tasks without fine-tuning, maintaining low inference costs. RTD constructs a reference datastore from the provided training examples and optimizes the L.M''s final vocabulary distribution by flexibly selecting suitable references based on the input, resulting in more trustable responses and enabling the model adapt to downstream tasks at a low cost. Experimental evaluations on various LLMs using different bench- marks demonstrate that RTD establishes new paradigm for augmenting models
Corresponding author. Equal contribution.
38th Conference on Neural Information Processing Systems (NcurIPS 2024).

---

to downstream tasks. Furthermore, our method exhibits strong orthogonality with traditional methods, allowing for concurrent usage. Our code can be found
Introduction
In the rapidly advancing field of artificial intelligence, Large Language Models (LLMs) have demon- strated substantial progress. With their extensive parameter size, LLMs have acquired emergent abilities [4] and been able tackle diverse and challenging tasks in fields like education [22 and
medicine (38). Despite their immense potential, Large Language Models that have just completed
pre- pre-training often struggle to effectively adapt to downstream tasks. Moreover, the process of adapting the model is typically costly and requires careful execution by experienced individuals. Otherwise. it at best, or at worst, result in a loss of its
could lead to the model generating hallucination 50 28
language capabilities.
In-Context Learning (ICL), as category of methods that do not require parameter adjustments, is one of the mainstream methods for adapting models to downstream tasks. ICL embeds domain patterns, etc., into prompts through few-shot learning 6 prompt engineering [5I], and Retrieval Augmenttd Generation (RAG) [26] methods, leveraging the learning ability of the model itself to provide better answers. As pointed out in Figure 2
knowledge, question-answeriig
ICL focuses on the prompt stage. However, ICL significantly increases the length of the input, consequently increases the space occupied by the KV-Cache required for inference. Further, according to the Roofline model [6). this part of the KV-Cache cannot be parallelized through batch processing, making memory I/O throughput system bottleneck, wasting hardware computing power, and increasing token generation time during the entire inference stage.
Fine-tuning is also used to adapt models downstream tasks. By fine-tuning the pre-trained model based on domain tasks, the model can quickly acquire capabilities within the domain. However, traditional full-parameter fine-tuning often requires a large amount of resources (empirically 8-15 times that of inference), making By freezing most parameters and only modifying a few, methods such as Adapters. P-tuning (27]. LoRA [66] and others 48 36 44 have become mainstream methods for quickly adapting models to downstream tasks. However, fine-tuning methods introduce several hyperparameters, which require high experience from the fine-tuners and the effects are unpredictable. Furthermore, due to the need for hackpropagation, the computation graph must be saved, meaning that even if only a few parameters need to be updated, there will be large amount of additional computation and space requirements (several times that of inference), raising the threshold for methods based on fine-tuning.
Fine-Tune Tuning (PEFT) more popular method.
To address these challenges, we introduce Reference Trustable Decoding (RTD), a novel framework designed to fit LLMs for downstream tasks. Distinct from conventional LM_ LM_Head module, RTD strategically retrieves relevant references from pre-constructed datastore, guided by the final hidden states of the language model. This approach not only enhances the final output distribution by recalculating it with the similarity score of the retrieved references but also allows for the seamless integration of new knowledge or constraints into the response generation process without increasing the input length or using gradient descent.
RTD, distinctively training-free, emphasizes compact input lengths expedite inference. RTD's ef- fectiveness was rigorously tested using varied benchmarks focused on different tasks and Wikipedia- based knowledge injection scenario. On these benchmarks, RTD achieved results comparable to traditional methods like PEFT and ICL, providing significant improvement. Additionally, we com- bined RTD with traditional methods, further enhancing the model's 's capabilities and demonstrating the good orthogonality of RTD with other approaches.
Our contribution includes:
We propose new paradigm, called RTD, for fitting LLMs for downstream tasks. RTD is a training-free method that focused on the decoding stage of large language models (LLMs), as a alternation of LM_Head,, Head. helps LLMs adapt to different tasks with different demands and provide trustable response.
RTD has achieved performance comparable to, or even better than, ICI. and PEFT across different benches, while maintaining the desirable properties of training free and not intro-

---

Auto- Auto- regrresiieeeee decoding
Prompts
Tokens
First hid. states
Last hid. states
Next token
Response
c: (fy42mm4t
A(O)
fn+1
Tokenizer
Embedding
LM ()
LM Hoad
Tokenizor
ICL (few-shot, RAG, etc.)
Fine-tune (Adapters, LoRA, etc.)
RTD (Ours)
The pipeline of LLM inference and the focus of different methods: ICL focuses on the prompt stage, emphasizing the optimization of the model's 's input. Fine-tuning methods optimize the model itself by adjusting its parameters. In contrast, our proposed RTD method targets the decoding stage of the language model. By constructing reference datastore, RTD optimizes the final output distribution without requiring additional training.
Figure 2:
ducing additional input lengths. This demonstrates the potential RTD as a new paradigm for LLMs to adapt downstream tasks. Furthermore, RTD can be seamlessly integrated with other existing methods, such as in-context learning (ICL) and fine-tuning. The combination of RTD, ICL, and fine-tuning has the potential achieve even higher performance.
2 Background and Related Work
In the field of NLPs, Transformer models have gained influence rapidly after it get original proposed in 2017. As larger scaled model been introduced, especially giant ones like GPT3 which has 175 Billion of parameters [9], the training process is getting more and more expensive, hence to fit the LLMs for downstream tasks.
2.1 Fine-tuning
Full Parameter Fine-tuning Full parameter fine-tuning refers to fully optimizing all the parameters of the model during the fine-tuning process. Full parameter fine-tuning has the advantage of allowing the model to adapt more closely to the specific task at hand, as well as injecting more information into the model. However, it also has the disadvantage of being the most computationally expensive and time-consuming, as it requires to manipulate all parameters of the model, with the modern optimizer like Adam [19], 15 times of more extra GPU memory is demanded comparing to inference empirically, resulting a must of multi-GPU server or even cross sever training.
Parameter Efficient Fine-tuning Parameter Efficient Fine-tune (PEFT), for example, LoRA [66] and P-tuning 27). is introduced to make fine-tune more reachable. By freezing most of the model pa- rameters and only let a small amount of them accumulate gradient, the GPU memory and computation resource can be cut down by large margin [1].
However, fine-tuning introduce many tricky syrpe--psrmeetess like learning rate, the process is heavily task related and empirical, even experienced fine-tuner need some trials and error when tuning them. Moreover, even if the number of parameters trained is not large, processes such as backpropagation still need to be carried out. The computation graph generated on long sequences will also occupy large amount of memory, making the threshold for computing power and memory still high, which any method that relies on gradient descent is difficult to avoid.
2.2 In-Context Learning
Few-Shot Learning Few-shot Learning is proved to be a great way for LLMs to gain capability. By appending the true task that LLMs are expecting to response after a couple of existing correct examples, LLMs can gain its reasoning ability
is an Al frame- work for retrieving facts from an external knowledge source to L.LMs, which helps L.LMs correct its hallucination and use latest fact (35). RAG is to cut external knowledge source into multiple chunks,
Retrieval Augmented Generation Retrieval Augmented Generation (RAG) 24

---

then embed and store them in database, then retrieve them at the process of generation to let LLMs get the knowledge it. This technique allowed LLM use extra information while maintaining their parameters untouched. RAG have been used on multiple fields, like coding [26] and question answering 299] And it can be combined with few-shot [8]
The main drawback of ICL methods lies in their growth of the input sequence. Under the quadratic complexity of the Transformer architecture, this implies longer KV-Cache, which not only increases the latency during the pre-fill stage but also adds delay each time token is generated [5] Moreover, unlike model parameters, each instance needs to save its dedicated portion of KV-Cache, leading to memory I/O bottlenecks and computational power waste. Finally, on some smaller models, the irrelevant information that ICL might contain can confuse the model, resulting performance loss.
Reference Trustable Decoding
In this section, begin by presenting the fundamental formulas and concepts to elucidate the workings of Reference Trustable Decoding, followed by an exploration of the multi-head Reference Trustable Decoding method.
3.1 Preliminary
Given an input sentence = {t1, f2, } where t; represents the i-th token and denotes the sentence length, the last token's 's output of the last Transformer block the language model can be represented as:
h = LMC(c)
(1)
In this equation, (2) E Rd the output of the last token from the final, or the 1-th, Transformer block of the language model, where dm denotes the hidden size of the model.
Traditionally, standard decoder-only architecture Transformer usually employs LM, AMad, which is, a fully connected layer, usually includes learnable weight matrix W and no bias, followed by softmax function Softmax(-) to predict the output probability distribution p of the next token from
the last hidden states:
LM_ (eadHeadhhh) Softmax (aaimaxxxWW.. (1)
where is the vocabulary size and W E "=xd...
However, traditional next token prediction does not support incorporating external information and therefore, we introduce reference trustable decoding where we build bypass around the LM_Heel Head, showcased in Figure as the entrance of additional knowledge or guidance.
3.2 Reference Trustable Decoding
3.2.1 Generation of Reference Datastore
In reference trustable decoding, (k, u) E (KC, V). Here, the key lo = L.M(c) represents the last hidden states of the token generated by the LMs from the context c, and the value is the corresponding label y. Mathematically. have:
first build the reference datastore L. which stores key-value pairs
L= (kk, E (K,, V)) {(CM (c) v) (c, E
where D (C. )) is the task dataset with input context C and label set y, and |> refers the number of possible labels. This process is depicted in Figure 3 It's obvious that the computational requirement same as performing forward pass to every content in the task dataset, which aligned with the minimal requirement of the inference stage, denotes the superiority of RTD as gradient-free method.
3.2.2 Decoding Stage
At each decoding round, given the input context e, we first compute 1,() L.((c), which is the input RTD and LM Normalization, and Aggregation, depicted in Figure
LM_ Head. Then we use three stage approach to get the RTD output, Fetch,

---

Reference datastore generation process
Bypass built by RTD
Task Dataset
Inpots
Prompts
Tokenizer, Embedding, (M)(
hid. states
LM Head
P
Next token
P
Cut
Distribution fusion
Labols
R Reference
Values
Keys X
RTD
Datastore
V
Figure Overview of the reference datastore generation and reference trustable decoding process.
Last hid. states
A
Fetch
distances
TopK
Normalization
Distribution
A Aggregation
Distribution
Voy
des
Pay
Distance
Pos
dlg
d2
Reference
Poy
dlg
Scale
Pr
d;
Poy
dly
8g
Rg
Softmex
dx
Top
Temperoture
12
Figure 4: Three stages of reference trustable decoding.
Fetch First, caleulate the distance d' between h() and all the & in the reference datastore L. Otherwise stated, we use the Euclidean distance d' = ||4() k41l2- We then select the top K instances from L which have the smallest distance, and for the j-th (1 < s K) closest (ki, v;), define 0j = i. Then we create set Ln, storing the top K distances and values:
La = ((d6, [o,)] ((1) ko, )o = i for j-th closest (ks, vs)
(4)
Normalization We first scale the d' we got from the previous stage by temperature T. as d' /T The scale operation is introduced to prevent overflow in the following Softmax operation. We take the Softmax of -d" d, guaranteed d valid possibility distribution.
exp( d3
expl-do,/T MT/
d = Softmax(-d')), dj
(5)
Ex expl-d"1
ΣR exp( d',/TT)
We calculate the final reference possibility distribution r = |ri, r2, |r,, by aggregating all dj that satisfies Voy Yi. where E )
Aggregation
Tpy R
Σ
d
Vay =
We denote R(: C) Rd. Y as the function represents all three stages of querying the datastore and building the corresponding reference possibility distribution r. Therefore, we have
R(
Additionally, when |' = v, can merge the distribution p given by LM_Head(-) and given by R(-2) L) with a hyper-parameter A:
d' d P
(8)
which is common fusion method for mixing two distributions 34 23 10
5

---

x
RTD .i1
p(0)
Reference
V
X
Distribation
Reference
spiit
X
RTD H2
y(3
Last hidl states
RTD
X
p(h)
Mage
Last hid. states
spiit
ACLA)
40
A(--))
Distribution
Single hoad RTD
Multi-hadlI RTD
Figure Comparison between RTD and multi-head RTD.
Table Comparison RTD and MH-RTD on Open Book QA.
Method
RTD
MH-RTD
MPT-7B
27.4
30.9
LLaMA2-7B
47.1
52.4
LLaMA2-70B
63.3
65.6
3.3 Multi-head Reference Trustable Decoding
Large language models like LLaMA2-70B (39] or Mistral-7B [1 utilized MHA and GQA mecha- nism [2). implies the potential of splitting a large attention vector into smaller ones. So adapt this method into our RTD process. We define n, of the head count of the LM model, and d, the dimension of the each attention head where dnm = nn d,. with this in mind, we split the reference datastore into nı sub-datastore by head. When decoding, we first split 40 in heads, then query each sub-datastore and merge the result, showcased in Figure Mathematically,
6 = k [d, (i - 1): dn x x],
10000) 10 (dn x (i 1) dn x x1
(9)
c (166) c)](k, E V)}
And denote RMMI. L) as the function of the multi-head RTD query process, have:
ni.
RMH (M (, --==-== TEk
R(hu,0) ((0)
(10)
3.4 Time and Memory Consumption
Time Consumption The time consuming is largely depended on the vector datastore used. For a brute force searching datastore, the time complexity will be O (sg dm) where $c. = [C] size of the datastore. However, for those more powerful database like faiss (20) by Meta, with extra training after the generation of reference datastore, the process which have to be done again the datastore changes, the time consumption can be cut to O (k -dm,, where i is constant related the parameters used to train the database.
For multi-head reference trustable decoding, the performance cost remains the same. The time complexity of each attention-head wise query (d,, sc), the overall query time complexity is O (n d, $g) = O (d sg), which is the time complexity of convention reference trustable decoding processing. The calculation remains the same for trained database, the overall time complexity is O (n- k dr) = O (k dm).
Memory Consumption The use of time can be optimized by utilizing vector database, however the memory consumption cannot shrink easily. We further define the bit cost of the models' dtype, where bạ10a:32 = 4. bılowrie bef1cat18 2, dints 1, dins4 2. The overall memory cost dm, b. sg. Due to the lack lower precision dtype support on CPU, even the base model utilized popular half precision dtype like bfloat16, it still need to be converted into larger ones to be stored. Since all the hidden states have to be saved to calculate precise distanced when rescalled, the memory cost can't 't be reduced significantly by making irrelevant with sc.

---

On the Multi-head RTD side, the memory cost remains the same as the regular RTD takes. The proof same as the Section For instance, reference datastore and head-wise reference datastore with 20, 480 entries with dmm 4096, n = 32 and d,. = 128, stored in float32, takes 320MB of memory and hard disk space.
MH-RTD for Resource Saving As MH-RTD splits long vectors into multiple smaller ones, gives us the opportunity to cut time and memory cost by merging different heads together, directly evict some of them. on average, p heads are merged into one head, then we expect a resource consumption. The time and memory improvement and corresponding performance impact can be find in the tuning Section 4.3
4 Settings and Experiment
We categorize the common downstream tasks of language models into two types: language under- standing and language generation. The former focuses understanding the input information, based on the context and the information stored within the model, and then outputs the answer in the form of few tokens, usually in a very simple form. The latter focuses generating new sentences with complete semantics. We explored the potential of RTD compared to other methods on these two types of tasks. We first compared the effects of RTD and MH-RTD. As shown in Table we found that MH-RTD effectively enhances the capabilities of RTD. Therefore, we default to using the MH-RTD method in the following tests.
4.1 Language Understanding
We tested the language understanding capabilities of RTD on multiple benchmarks. When testing, question without answer be shown to the LLM, then we will gather it's baseline output by LLMs' first output token and our RTD result through searching our reference datastore. À is set to I in this task. How the reference datastore is generated can be fount at appendix B.
Models we used are: LLaMA2-7B and 70B 33, LLaMA3-8B 8. MPT-7B 37 GLM3-6B 47
(7]. Yi-34B. Includes model size from 6B 70B, as most of the major current models are. We use the base version of the model by default. Testing benchmarks are: Massive Multitask Language Understanding (MMLU) [5). A12 Reasoning Challenge (ARC, both Easy (E) and Challenge (C) parts) 4. Reasoning about Physical Commonsense in Natural Language (PIQA) [5]. Open Book Question Answering (OBQA) 30), and Massive Multitask Language Understanding Chinese (CMMLU) (25]. C-MMLU is Chinese benchmark, so only Chinese models, GLM3 and Yi, participated in this benchmark.
The multiple-choice benchmarks we chose is challenging enough in itself and requires strong reasoning ability from the model; moreover, the answer format fixed, which can simultancously detect the ability to follow instructions. Since that most tasks in the traditional NLP field can be quickly converted into tasks of choosing one from several categories, even some generative tasks, so the results on the multiple-choice test can also represent many other tasks.
The performance boost can be found both with or without ICL. Results are in table 2 Besides testing scores, we also record the confused rate of baseline, the proportion of the questions that failed to be answered properly, including output irrelevant text or can't give certain answer, in table 3 Meanwhile RTD is designed to given the L.MMs' decision in a trustable and controllable way. In comparison with fine-tuning methods in table 4 we can notice that RTD can achieve approximate performance improvements as using PEFT methods like LoRA. Although it is still insufficient compared to full-parameter fine-tuning, the latter has a higher cost and has undergone knowledge injection (which is not considered in this part of the experiment). The dataset used for fall-parameter fine-tuning is MMLU-Recall
32 33), and the hyper- papre-parreeters of LoRA can be found in Appendix [D] Moreover, we' ve tested obqa score with different source of reference library. testing the generalization ability of RTD, as shown in Table 5 RTD yields satisfactory results. We've also tested the performance of RTD with different À for language understanding, shown in Table Lastly, we've 've tested the iteration speed of these benchmarks, as shown in Table 7, the efficiency impact of RTD is minimized comparing to ICL.
7

---

Model
Benchmark
Baseline
5-shot ICL
RTD (A)
5-shot RTD (A)
LLaMA2-7B
MMLU
43,8
45.8
45.1 (1.31)
47.2 (2.11)
ARC (E & C)
30.1
65.0
41.4 (11.31)
67.3 (2.31)
PIQA
56.5
62.1
71.4 (14.91)
73.2 (11.11)
Openbook QA
27.8
51.0
(2.61)
53.6 (2.61)
LLaMA2-70B
MMLU
56.7
67.9
56.9 (0.21)
68.5 (0.61)
ARC (E & C)
67.4
91.6
(19.71)
91.7 (0.11)
PIQA OpenbookQA
72.3
85.3
(9.91)
86.6 (1.31)
53.7
84.4
(14.5))))
85.4 (1.01)
LLaMA3-8B
MMLU
47.5
63.9
(9.71)
61.9 (2.00)
ARC (E & C)
71.2
87.3
(12.51)
87.1 (0.21)
PIQA OpenbookQA
69.9
78.9
76.3 (6.41)
80.0 (1.11)
53.3
77.5
71.4(18.11)
78.6 (1.11)
MPT-7B
MMLU
27.4
29.6
30.00.
29.8 (0.21)
ARC & C)
27.5
failed
27.6
30.1
OpenbookQA
29.4
failed
(2.2()
30.4
GLM3-6B
MMLU
41.9
48.6
47.6 (5.71)
49.8 (1.21)
ARC (E & C)
59.1
75.3
75.0 (15.91)
76.5 (1.21)
PIQA
66.8
73.6
75.9 (9.11)
74.5 (0.91)
OpenbookQA
55.1
67.1
64.0 (8.91)
68.8 (1.71)
C-MMLU
48.8
54.5
53.3 (4.51)
54.7 (0.21)
Yi-34B
MMLU
68.6
74.3
70.3 (1.71)
73.3 (1.0L)
ARC (E & C)
93.3
94.0
90.7 (2.61)
94.6 (0.61)
PIQA
88.3
83.5
88.4 (0.11)
87.7 (4.21)
OpenbookQA
83.5
89.8
88.4 (0.91)
88.8 (1.01)
C-MMLU
70.3
81.0
73.9 (3.61)
81.8 (0.81)
Avg
56.41
65.28
63.31
68.88
Table RTD on language understanding benches. Baseline refers zero-shot performance. ICL exceeds MPT-7B's 's 2048 context window, with a 0 score result, recorded as failed in the table.
Table 3: Confused rate.
Table 4: RTD comparing with fine-tune methods.
Model
Llama2-7B
GLM3-6B
Yi-34B
Methods
baseline
LoRA
FT
RTD
Rate
8.6%
1 11.8
0.44%
Score
41.9
42.5
46.31
42.8
4.2 Language Generation
Reasoning with Context Generative tasks are generally subjective and difficult test. We constructed benchmark based on Retrieval-Augee Aug-mmtedme Generation (RAG) and Open Book Question Answering [30 test the potential of RTD areas requires advance reasoning such as knowledge injection. Chain-of-Thoure
42 is a method that encourage the model to provide a step-by-sted analysis before giving the final answer, thereby enhancing the model's capabilities. We compared the performance of the model when introducing references through the ICL method and the RTD method, to determine the effectiveness of the RTD method. The extra knowledge source was Wikipedia. The generation of the datastore can be found in detailed in Appendix [.2] With the results of table 8 can be seen that RTD was indeed helpful in knowledge injection. Besides, the context length is shrunk by lot, thus saves reasoning GPU time and memory consumption. A detailed exploration of why RAG score is lower than baseline can be find in Appendix
Style transfer explore whether the RTD method can used to modify language style the model, we designed style transfer experiment. We used moderately scaled and strongly styled dataset, Tiny- Sha--Shaeeeeeree [21 40), and compared the perplexity (PPI.) of the model on the test set after LoRA and RTD, to measure whether method can help the model change the output style.

---

Table Generalization of RTD.
Table 6: Different À in Language Understanding
Source
OBQA
ARC
MMLU
1
0.8
0.6
0.4
0.2
OBQA
71.4
71.4
71.2
OBQA
71.4
68.0
67.0
66.8
66.6
53.3
Table 7: Efficiency of RTD.
Methods
baseline
RTD
ICL
ICL RTD
Speed(it/s)
25.1
23.6
7.90
7.85
Extra Memory Usage (MB)
0
16
37
52
The results in Table prove that RTD method reduce the perplexity of the model, enabling the model to adapt to the style of different datasets. The hyperparameters of LoRA are in Appendix D
4.3 Influence of Hyper-parameters in RTD
Although our method is quick and efficient, it still introduces several hyper- apper-prrameter.. We hope to explore the relationship between these hyper-paramettess and the final performance of RTD. We conducted series of ablation experiments on L.LaMA2-7B [39] and OBQA (30 to explore the impact of different hyper-parameters. The overall result can be found in Figure 6 If not tuned, sc = 19, 828, À = and T = 750 by default.
on performance and how to quickly determine the optimal
k 1024,
Depicted in Figure 6 (a), RTD's performance improves initially with increasing sg but eventually maxed out and starts oscillating when sc reaches 4096. Generally, larger 8c gives a better performance, but it do get maxed out depends the specific task. Fig showcased RTD's performance consistently improves as increases initially, but eventually reaches a plateau, similiar with the sg. To be denoted is that larger &s could harm efficiency. Figure 6 (c) implies that RTD can only reach it's best performance when T is large enough. Empirically. due to the characteristics of the exponential function, as long as the range of scaled distances d" is kept between 1-2, a sufficiently good effect can be achieved. In RTD, generation tasks. However, does not require high precision, and the range is relatively limited, so good enough effect can be achieved quickly through a few attempts. Empirically speaking, 0.4-0.7 is suitable range for A. Previous studies indicated that by pruning the dimension of attention won't hurt knn algorithm's 's performance [13]. In the case of RTD, showcased in Figure 6 (d), it can be found that the performance won't drop with least 1 heads remained, and the generation speed was boosted as more heads are dropped.
how
an important variable, especially in
5 Conclusions
In this paper, we introduce Reference Trustable Decoding, a novel training-free free method designed to augment Large Language Models in downstream tasks. RTD refines the output distribution by leveraging references retrieved from a specially curated datastore, as a bypass of conventional LM_Head. Our experimental results demonstrate RTD achieved superior performance compared to the In-Context Learning baseline in 21 out of 25 different dataset and model configurations as well as fine-tune based methods. This result highlights the effectiveness of RTD across diverse range of scenarios, underscoring its potential as a robust solution for enhancing language model capabilities in downstream tasks.
Limitations & Future Work
RTD is an efficient and quick method to augment the capabilities of models on specific downstream tasks. However, for some tasks, especially generative tasks, the large reference datastores that are difficult to directly compress may pose challenges for applications. Nevertheless, we believe that there is likely inherent redundancy in such large datastores. We hope to enable machines identify these redundancies while maintaining gradient-free method, in order to achieve efficient fine-tuning,

---

Table 8: Comparison of RTD and RAG using Table 9:
PPL of the fitted model on domain
Wikipedia on LLaMA2-7BB 7B B-Chat.
datasets.
LLaMA2-7B-Cha
Acc
Latency (ms)
Dataset
Baseline
LoRA
RTD
Baseline
39.0
42.5
Tiny-S
1.6982
1.3710
1.4501
Wiki RAG
29.0
200
Wiki RTD
44.4
46.5
7000
7835
73.00
Grene iiii spoed (1960
12
7000
Opatbook
70:00
71.50
17.21
77.00
(A) 52
(6)
(4) Numbers
Figure 6: Hyper-parameters' influence RTD's performance
How to make RTD accomplish tasks with high quality while being space-efficient is our following research direction.
Acknowledgments
We sincerely appreciate the valuable feedback provided by all reviewers during the review process, as well as the efforts the area chairs. This work was supported by the National Natural Science Foundation of China (No. 62306216), the Natural Science Foundation of Hubei Province of China (No. 2023AFB816), the Fundamental Research Funds for the Central Universitics (No. 2042023kf0133)
References
[1] Mistral AI. Mistral 7b, the best 7b model to date, apache 2.0, 2023.
[2] Joshua Ainslie, James Lee- She-Thorp. Michiel de Jong, Yury Zemlyanskiy, Federico Lebrón, and Sumit Sanghai. GQA: training generalized multi-query transformer models from multi-head checkpoints. In Houda Bouamor, Juan Pino, and Kalika Bali, editors, Proceedings of the 2023 Conference Empirical Methods in Natural Language Processing, EMNLP 2023, Singapore, December 6-10, 2023, pages 4895-4901 Association for Computational Linguistics, 2023.
[3] Lucas Bandarkar, Davis Liang, Benjamin Muller, Mikel Artetxe, Satya Narayan Shukla, Donald Husa, Naman Goyal, Abhinandan Krishnan, Luke Zettlemoyer, and Madian Khabsa. The belebele benchmark: parallel reading comprehension dataset in 122 language variants. arXiv preprint arXiv:2308. 16884, 2023.
[4] Sumithra Bhakthavatsalam, Daniel Khashabi, Tushar Khot, Bhavana Dalvi Mishra, Kyle Richardson, Ashish Sabharwal, Carissa Schoenick. Oyvind Tafjord, and Peter Clark. Think you have solved direct-answer question answering? try arc-da, the direct-answer A12 reasoning challenge. CoRR, abs/2102.033155. 2021.
[5] Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. Piqa: Reasoning about physical commonsense in natural language. In Thirty-Fourth AAAI Conference on Artificial Intelligence, 2020.
[6] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert- Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott
10

---

Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 1877-1901. Curran Associates, Inc., 2020.
[7] Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, and Jie Tang. Glm: General language model pretraining with autoregressive blank infilling. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Longg Papers), pages 320-335. 2022.
[8]
Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, Anirudh Goyal, Anthony Hartshomn Aobo Yang, Archi Mitra, Archie Sravankumar, Artem Korenev, Arthur Hinsvark, Arun Rao, Aston Zhang, Aurélien Rodriguez, Austen Gregerson, Ava Spataru, Baptiste Rozière, Bethany Biron, Binh Tang, Bobbie Chern, Charlotte Caucheteux, Chaya Nayak, Chloe Bi, Chris Marra, Chris McConnell, Christian Keller, Christophe Touret, Chunyang Wu, Corinne Wong, Cristian Canton Ferrer, Cyrus Nikolaidis, Damien Allonsius, Daniel Song, Danielle Pintz, Danny Livshits, David Esiobu, Dhruv Choudhary, Dhruv Mahajan, Diego Garcia-Olano, Diego Perino, Dieuwke Hupkes, Egor Lakomkin, Ehab AlBadawy, Elina Lobanova, Emily Dinan, Eric Michael Smith, Filip Radenovic, Frank Zhang, Gabriel Synnaeve. Gabrielle Lee, Georgia Lewis Anderson, Graeme Nail, Grégoire Mialon, Guan Pang. Guillem Cucurell, Hailey Nguyen, Hannah Korevaar, Hu Xu, Hugo Touvron, Iliyan Zarov, Imanol Arrieta Ibarra, Isabel M. Kloumann, Ishan Misra, Ivan Evtimov, Jade Copet, Jaewon Lee, Jan Geffert, Jana Vranes, Jason Park, Jay Mahadeokar, Jeet Shah, Jelmer van der Linde, Jennifer Billock, Jenny Hong, Jenya Lee, Jeremy Fu, Jianfeng Chi, Jianyu Huang. Jiawen Liu, Jie Wang. Jiccao Yu, Joanna Bitton, Joe Spisak, Jongsoo Park, Joseph Rocca, Joshua Johnstun, Joshua Saxe, Junteng Jia, Kalyan Vasuden Alwala, Kartikeya Upasani, Kate Plawiak, Ke Li, Kenneth Heafield, Kevin Stone, and et al. The llama 3 herd of models. CoRR, abs/2207.22173. 2024.
[9] Luciano Floridi and Massimo Chiriatti. Gpt-3: Its nature, scope, limits, and consequences. Minds and Machines, 30:681-694, 2020.
[10] Jiatao Gu, Yong Wang, Kyunghyun Cho, and Victor O.K. Li. Search engine guided neural machine translation. Proceedings of the AAAI Conference on Artificial Intelligence, 32(1), Apr. 2018.
[11] Michael Günther, Jackmin Ong, Isabelle Mohr, Alaeddine Abdessalem, Tanguy Abel, Moham- mad Kalim Akram, Susana Guzman, Georgios Mastrapas. Saba Sturua, Bo Wang, Maximilian Werk, Nan Wang, and Han Xiao. Jina embeddings 2: 8192-token dings for long documents, 2023.
text embed-
[12] Kazuma Hashimoto, Raffaella Buschiazzo, James Bradbury, Teresa Marshall, Richard Socher, and Caiming Xiong. A high-quality multilingual dataset for structured documentation translation. In Proceedings of the Fourth Conference on Machine Translation (Volume 1: Research Papers), pages 116-127, Florence, Italy, August 2019. Association for Computational Linguistics.
[13] Junxian He, Graham Neubig, and Taylor Berg- Kirkpatrick. Efficient nearest neighbor language models. In MMarie-Francin Moens, Xuanjing Huang, Lucia Specia, and Scott Wen-tau Yih, editors, Proceedings of the 2021 Conference Processing, EMNLP 2021, Viruual Event Punta Cana, Dominican Republic, 7-11 November, 2021, pages 5703-5714, 14. Association for Computational Linguistics, 2021.
Empirical Methods in Natural Language
[14] Ruidan He, Linlin Liu, Hai Ye, Qingyu Tan, Bosheng Ding, Liying Cheng, Jia-Wei Low, Lidong Bing, and Luo Si. On the effectiveness of adapter-based tuning for pretrained language model adaptation. In Chengqing Zong, Fei Xia, Wenjie Li, and Roberto Navigli. editors. Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNPP 2021, (Volume I: Long Papers), Virtual Event, August 1-6, 2021, pages 2208 2222. Association for Computational Linguistics, 2021.
[15] Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding, In 9th International
11

---

Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021.
[16] Edward Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang. Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net. 2022.
[17] Yuzhen Huang, Yuzhuo Bai, Zhihao Zhu, Junlei Zhang, Jinghan Zhang, Tangjun Su, Junteng Liu, Chuancheng Lv, Yikai Zhang, Jiayi Lei, Yao Fu, Maosong Sun, and Junxian He. C-eval: multi-level multi- distildiseeiline chinese evaluation suite for foundation models. Advances in Neural Information Processing Systems, 2023.
[18] Gautier Izacard, Patrick S. H. Lewis, Maria Lomeli, Lucas Hosseini, Fabio Petroni, Timo Schick, Jane Dwivedi- Yu, Armand Joulin, Sebastian Riedel, and Edouard Grave. Atlas: Few- shot learning with retrieval augmented language models. J. Mach. Learn. Res., 24:251:1-251:43, 2023.
[19] Imran Khan Mohd Jais, Amelia Ritahani Ismail, and Syed Qamrun Nisa. Adam optimization algorithm for wide and deep neural network. Knowledge Engineering and Data Science, 2(1 2(1):41-46, 2019.
[20] Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3):535-547, 2019.
[21] Andrej Karpathy. char-rnn.
2015.
[22] Enkelejda Kasneci, Kathrin Seßler, Stefan Küchemann, Maria Bannert, Daryna Dementieva, Frank Fischer, Urs Gasser, Georg Groh, Stephan Günnemann, Eyke Hüllermeier, et al. Chatgpt for good? on opportunities and challenges of large language models for education. Learning and individual differences, 103:102274, 2023.
[23] Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. General- ization through memorization: Nearest neighbor language models. In International Conference on Learning Representations, 2020.
[24] Patrick S. H. Lewis. Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. aetrieval-augmentt
generation for ceoweedgeinntnssee NLP tasks. In Hugo Larochelle, Mare' Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurlPS 2020, December 6-12, 2020, virtual, 2020.
[25] Haonan Li, Yixuan Zhang. Fajri Koto, Yifei Yang. Hai Zhao, Yeyun Gong, Nan Duan, and Timothy Baldwin. CMMLU: measuring massive multitask language understanding in chinese. CoRR, abs/2306.09212, 2023.
[26] Shangqing Liu, Yu Chen. Xiaofei Xie, Jing Kai Siow, and Yang Liu. Retrieval- auggented generation for code summarization via hybrid GNN. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021.
[27] Xiao Liu, Kaixuan Ji, Yicheng Fu, Weng Tam, Zhengxiao Du, Zhilin Yang, and Jie Tang. P- tuning: Prompt tuning be comparable to fine-tuning across scales and tasks. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 61-68, 2022.
[28] Xuan Liu, Jie Zhang, Song Guo, Haoyang Shang, Chengxu Yang. and Quanyan Zhu. Exploring prosocial irrationality for LLM agents: A social cognition view. CoRR, abs/2405.14744, 2024.
[29] Yuning Mao, Pengcheng He, Xiaodong Liu, Yelong Shen, Jianfeng Gao, Jiawei Han, and Weizhu Chen. Generation-augmeetted retrieval for open-domain question answering. In Chengqing Zong, Fei Xia, Wenjie Li, and Roberto Navigli, editors, Proceedings of the 59th Annual Meeting
12

---

of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 4089 Association for Computational Linguistics, 2021.
[30] Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? new dataset for open book question answering. In EMNLP, 2018.
[31] Feng Nie, Meixi Chen, Zhirui Zhang, and Xu Cheng. Improving few-shot performance of language models via nearest neighbor calibration. arXiv preprint arXi::2212.02216, 2022.
[32] Liu Peng. llama2-7b-mmlu, 2023.
[33] Liu Peng. Mmlu-recall, employ mmlu (cmmlu) questions as initial seeds to retrieve related articles from multiple training data corpora., 2023.
[34] Abigail See, Peter J. Liu, and Christopher D. Manning. Get to the point: Summarization with pointer-generato networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume I: Long Papers), pages 1073-1083, Vancouver, Canada, July 2017. Association for Computational Linguistics.
[35] Kurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela, and Jason Weston. Retrieval aug- mentation reduces hallucination in conversation. In Marie-Franciin Francine Moens, Xuanjing Huang, Lucia Specia, and Scott Wen-tau Yih, editors, Findings of the Association for Computational Linguistics: EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic. 16-20 November, 2021, pages 3784-3801 -803. Association for Computational Linguistics, 2021.
[36] Weixi Song, Zuchao Li, Lefei Zhang, Hai Zhao, and Bo Du Sparse is enough in fine-tuning pre-trained large language models. In Forty-first International Conference on Machine Learning. ICML. 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024.
[37] MosaicML NLP Team. Introducing mpt-7b: A new standard for open-source, commercially usable Ilms, 2023. Accessed: 2023-05-05.
[38] Arun James Thirunavukarasu, Darren Shu Jeng Ting, Kabilan Elangovan, Laura Gutierrez, Ting Fang Tan, and Daniel Shu Wei Ting, Large language models in medicine. Nature medicine, 1930)199,, 2023.
[39] Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288 2023.
[40] Trelis.
shay-shake tiny- shanesaaeeeeerre 2023.
https: httpss//hugginnfsecccoaaaaattt
[41] Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, Ed H. Chi, Tatsunori Hashimoto, Oriol Vinyals, Perey Liang, Jeff Dean, and William Fedus. Emergent abilities of large language models. Trans. Mach. Learn. Res., 2022, 2022.
[42] Jason Wei and Xuezhi Wang. Chain-of -fhtuught prompting clicits reasoning in large language models. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, editors, Advances in Neural Information Processing Systems, volume 35, pages 24824-24837, Curran Associates, Inc., 2022.
[43] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. Transformers: State-of-the-aat natural language processing. In Qun Liu and David Schlangen, editors, Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 45, Online, October 2020. Association for Computational Linguistics.
13

---

[44] Jun Cheng Yang, Zuchao Li, Shuai Xie, Wei Yu, Shijun Li, and Bo Du. Soft-prompting with graph-of-thone thouhht for multi--oddl representation learning. In Nicoletta Calzolari, Min- Yen Kan. Veronique Hoste, Alessandro Lenci, Sakriani Sakti, and Nianwen Xue, editors, Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLLN) 2024), pages 15024-15036, Torino, Italia, May 2024. ELRA and ICCL.
[45] Yao Yao, Zuchao Li, and Hai Zhao. SirLLM: Streaming infinite retentive LLM. In Lun- Wei Ku, Andre Martins, and Vivek Srikumar, editors, Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume I: Long Papers), pages 2611 1612-2624 Bangkok, Thailand, August 2024. Association for Computational Linguistics.
[46] Gyeong-In Yu, Joo Seong Jeong, Geon-Woo Kim, Soojeong Kim, and Byung-Gon Chun. Orca: A distributed serving system for Transformer-Bi Based generative models. In 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22). pages 521-538, Carlsbad, CA, July 2022. USENIX Association.
[47] Aohan Zeng, Xiao Liu, Zhengxiao Du, Zihan Wang. Hanyu Lai, Ming Ding, Zhuoyi Yang. Yifan Xu, Wendi Zheng, Xiao Xia, Weng Lam Tam, Zixuan Ma, Yufei Xue, Jidong Zhai, Wenguang Chen, Zhiyuan Liu, Peng Zhang, Yuxiao Dong, and Jie Tang. GI.M-130B: an open bilingual pre-trained model. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023.
[48] Hongyi Zhang, Zuchao Li, Ping Wang. and Hai Zhao. Selective prefix tuning for pre-trained language models. In Lun-Wet Ku, Andre Martins, and Vivek Srikumar, editors, Findings of the Association for Computational Linguistics ACL 2024, pages 2806-2813, Bangkok, Thailand and virtual meeting, August 2024. Association for Computational Linguistics.
[49] Yixuan Zhang and Haonan Li. Can large langauge model comprehend ancient chinese? A pre- liminary test on ACLUE. In Adam Anderson, Shai Gordin, Bin Li, Yudong Liu, and Mareo Carlo Passarotti, editors, Proceedings of the Ancient Language Processing Workshop, RANNP 2023, Varna, Bulgaria, 8 September, 2023, pages 80-87. INCOMA Ltd., Shoumen, Bulgaria / ACL, 2023.
[50] Yue Zhang, Yafu I., Leyang Cui, Deng Cai, Lemao Liu, Tingchen Fu, Xinting Huang, Enbo Zhao, Yu Zhang, Yulong Chen, Longyue Wang, Anh Tuan Luu, Wei Bi, Freda Shi, and Shuming Shi. Siren's 's song in the ocean: A survey on hallucination in large language models, 2023.
[51] Yongehao Zhou, Andrei Ioan Muresanu, Ziwen Han, Keiran Paster, Silviu Pitis, Harris Chan, and Jimmy Ba. Large language models are human-level prompt engineers. In The Eleventh International Conference Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023.
14

---

Appendix
A Testing Environments
All testing are done on server with A10 80G SXM. For models with less than 15B parameters, of 8 GPUs are used. For models with more than 15B parameters, 4 of 8 GPUs are used. All testing are carried out under HuggingFace Transformers library 43
B Generation of Reference Datastore
B.1 Benchmark Testing
To generate reference datastores, LLMs are shown to the questions and options in the training split of the benchmarks and we store the attention output. For each question this process is repeated four times cycling through A, B, C, D as the correct value. 3, 500 to 5, 000 question is shown to the LLMs and about 20, 000 (k, 2) entries are generated. To be noted that the reference datastore CMMLU is generated from validation set of C-eval [17]. split zho Hans of belebele B and testing set of ACLUE 49 since there no training split for the benchmark.
B.2
Wikipedia Fact Retrieval
| model, For our reference datastore, we encoded all of the Wikipedia sentences using the Jina which is smaller in both it's parameter count and hidden size, resulting in a faster generation speed and smaller space cost for encoded vector datastore. Every usable sentence in Wikipedia is encoded, meanwhile the sentences from the same page share same value, which is the no. of this page. When testing, we use the same model to encode the question, then we search the most relevant pages in the datastore. be the metric cosine similarity. to retrieve the most relevant pages. In this section, se same as the sentences count of Wikipedia, around 73M. k = 1024. T and À are not applicable here.
With retrieved pages, we generate reference datastore with every sentence in the pages. We first calculate attention representations for every token, whose corresponding value the id of next token, for the last token. Then In this section, 8c is the same as the length of tokenized sequence, 6200 on average, and we use T = 750, k 1024, À 0.4.
this dynamically generated reference datastore for following RTD.
C RAG's Deficiency in Testing
RAG method's shows a decline in performance in Table 8 To explain this, we can further examine the average length of the tokenized sequences of the retrieved context, which is around 6200, showcased in Table I0 This length will hardly increase any inference cost for the RTD method, due to the small sc. but exceeds the pre-training sequence length of LLaMA2-7B--C -hhtt, which is 4096. That is to say, the naive RAG method here will cause sequence length overflow, thereby significantly affecting performance. the overflow happened, then the model's ability cut down significantly.
D LoRA Hyperparamters
See Table [1] For LoRA tuning on MMLU, any question whoes tokenized length exceed 4096 was evicted from both training and testing. The maximum tokenized length of the Siny-Shakespeare dataset is 900.
Table 10: Average length by token in OBQA question answering process, split by sections.
Section
Average Length
Wikipedia Context
6192
Question
84
Response
231
15

---

Table 11: LoRA Hyper-paramette
Hyper-pand prrem--
Value
Batch Size
Epochs
2
Max Seq. Len.
4096
LoRA Target
(Q. K, V, Up. Down, Gate]_pry
LoRA Rank
16
LoRA a
32
LoRA dropout
0.01
Learning Rate
le-5
Optimizer
AdamW
Adma RMS
2e-4
Adam B
(0.9, 0.999)
Adam Weight Decay Scheduler
0.01
Constant LRR
NeurIPS Paper Checklist
1. Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification: Section 3 and section Deffectsseef main claim.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should elearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No NA answer to this question will not be perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
It is fine to include aspirational goals as motivation as long is clear that these goals are not attained by the paper.
2. Limitations
Question:
Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification: Section
Guidelines:
The answer NA means that the paper has limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
The authors encouraged to create separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g. if the approach was only tested on few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
16

---

The authors should reflect on the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, worse outcome might be that reviewers discover limitations that aren't It acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community, Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory Assumptions and Proofs
Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?
Answer: [Yes]
Justification: Our main theoretical result is about efficiencies in section 3.4 in which they were proved.
Guidelines:
The answer NA means that the paper does not include theoretical results. All the theorems, formulas, and proofs in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide short proof sketch provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental Result Reproducibility
Does the paper fully disclose all the information needed to reproduce the main ex- perimental results the paper to the extent that affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?
Question:
Answer: [Yes]
Justification: The detailed description of our experiments and hyper syrer-parameters can be found in section and appendix D
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how replicate the results, access to a hosted model (c.g., in the case
17

---

of a large language model), releasing of a model checkpoint, or other means that are
appropriate to the research performed.
While NeurlPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily new algorithm, the paper should make it clear how to reproduce that algorithm. (b) the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.
(c) If the contribution is new model (e.g., a large language model), then there should either way to access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. the case of closed-source models, may be that access to the model limited in some way (e.g., registered users), but it should be possible for other researchers have some path reproducing or verifying the results.
5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instruc- tions faithfully reproduce the main experimental results, described in supplemental material?
Answer: [Yes]
Justification:
Our main codes can be found in Supplementary Material.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurlPS code and data submission guidelines (httpss:/niis..c))
oon.suiiiisioioooooooooooooo for more details.
While we encourage the release of code and data, we understand that this might not be possible, so "No" an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurlPS code and data submission guidelines (https wtw.oddeuubisssooooiiiiii.
/ //nips. //nips.cc/pullic wttpe//ppwwwgppp//ee/eeeeeeeee/e
for more details.
The authors should provide instructions data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. only subset of experiments are reproducible, they should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing much information possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code permitted.
6. Experimental Setting/eetails
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary understand the results?
Answer: [Yes]
Justification: Discussions of hyper-parameee of our methods can be found in section Guidelines:
The answer NA means that the paper does not include experiments.
18

---

The experimental setting should be presented in the core of the paper to level of detail that is necessary appreciate the results and make sense of them.
The full details can be provided either with the code, in appendix, or as supplemental material.
7. Experiment Statistical Significance
Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Question:
Answer: [No]
Justification:
The experimental results definitive and do not involve any random factors.
Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results accompanied by error bars, confi- dence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.
The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
The assumptions made should be given (e.g.. Normally distributed errors).
should be clear whether the error bar is the standard deviation or the standard error of the mean.
OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that out of range (e.g. negative eтror rates).
If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments Compute Resources
For each experiment, does the paper provide sufficient information the com- puter resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?
Question:
Answer: [Yes]
Justification: All information above are given in section 4 and with specific experiment focused on some of them.
Guidelines:
The answer NA means that the paper does include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported the paper (e.g., preliminary or failed experiments that didn't make it into the paper).
9. Code Of Ethics
Question: Does the research conducted the paper conform, in every respect, with the NeurIPS Code of Ethics
Answer: [Yes]
Justification: [NA]
19

---

Guidelines:
The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.
If the authors answer No, they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g.. there is a special consid- eration due to laws or regulations their jurisdiction).
10. Broader Impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [NA]
Justification: There is no societal impact of the work performed.
Guidelines:
The answer NA means that there is no societal impact of the work performed.
If the authors answer NA or No. they should explain why their work has no societal impact why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (c.g.. deploymeet of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
If there negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms monitor how system learns from feedback over time, improving the efficiency and accessibility of ML).
11. Safeguards
Does the paper describe safeguards that have been put in place for responsible release of data models that have high risk for misuse (c.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification:
The paper poses no such risks.
Guidelines:
The answer NA means that the paper poses no such risks.
Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Licenses for existing assets
20

---

Question: Are the creators or original owners of assets (e.g.. code, data, models), used in the paper. properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes]
Justification: All models and datasets we' ve used have been cited properly in section
Guidelines:
The answer NA means that the paper does not use existing assets.
The authors should cite the original paper that produced the code package or dataset.
The authors should state which version of the asset is used and, if possible, include URL
The name of the license (e.g., CC-BY 4.0) should be included for each asset. For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, wwwpppppppsateeea thcode com/ datasets has curated licenses for some datasets. Their licensing guide can help determine the license dataset.
For existing datasets that are re- re-packaged, both the original license and the license of the derived asset (if has changed) should be provided. If this information is available online, the authors are encouraged to reach out the asset's 's creators.
13. New Assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [Yes]
Justification: Our main codes, assets, updated in Supplementary Material. Guidelines:
The answer NA means that the paper does not release new assets.
Researchers should communicate the details the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset used.
At submission time, remember anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsourcing and Research with Human Subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification:
The paper does not involve crowdsourcing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing research with human subjects.
Including this information the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then much detail as possible should be included the main paper.
According to the NeurIPS Code of Ethics, workers involved in data collection, curation, other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects
21

---

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [NA]
Justification: The paper does not involve crowdsoureing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Depending on the country in which research is conducted, IRB approval (or equivalent)
may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such the institution conducting the review.
22


Reviews:
[{"review_id": "MloVUxPAog", "reviewer": "Reviewer_wxwA", "summary": "Adapting large language models (LLMs) to specific tasks remains costly and complex. In-context learning (ICL) and parameter-efficient fine-tuning (PEFT) still suffer from inference latency and training costs, respectively. To address these problems, this paper proposes Reference Trustable Decoding (RTD), a training-free paradigm for better adapting base LLMs to downstream tasks. RTD is a retrieval-based framework that creates a reference datastore from task datasets, storing key-value pairs of hidden states and corresponding labels. During inference, RTD retrieves the most relevant references based on the hidden states of the input and then aggregates them with model logits to compute the final output distribution. Experimental results demonstrate that RTD effectively adapts mainstream LLMs for natural language understanding (NLU) and natural language generation (NLG) benchmarks, outperforming ICL approaches.", "questions": "In NLU tasks, why is the value of $\\lambda$ set to 1? Under this setting, the distribution of the output tokens entirely comes from RTD, without integrating the outputs from the LM head itself. Lines 268-269 also mention that the value of $\\lambda$ empirically ranges between 0.4-0.7. Setting it to 1 might require some justification or explanation in the paper.", "limitations": "The authors have included Limitation section after conclusion.", "rating": 5, "confidence": 3, "soundness": 2, "presentation": 2, "contribution": 2, "strengths": "1. **Efficient Adaptation:** The proposed RTD method integrates external knowledge and constraints to adjust outputs without increasing input length or using gradient descent.\n2. **Orthogonality:** As a plug-and-play decoding paradigm, RTD can be flexibly integrated with existing techniques such as ICL and fine-tuning.\n3. **Significance:** The paper demonstrates the excellent performance of the RTD method on multiple benchmarks, surpassing ICL methods and baselines. The RTD method is particularly meaningful in scenarios requiring rapid iteration of content or controllable generation.", "weaknesses": "1. **Related Work:** As an RTD method based on retrieval, the experiment sections should discuss and compare it with similar studies such as kNN-LM [1] (which also is cited in the paper) and other retrieval-based decoding methods.\n2. **Generalization Analysis:** The proposed method relies on the construction of a reference datastore, however, the discussion on out-of-domain inputs is still lacking. This poses a potential risk to the generalization of RTD method.\n3. **Hyperparameter Challenges:** Ablation experiments show that the effectiveness of RTD relies on adjusting several hyperparameters, which may hinder the method's scalability. In practical use, applying the RTD method to new models and tasks may require additional hyperparameter searches on a held-out validation set.\n4. **Trustable Decoding Association:** The discussion in the paper may not be strongly associated with \"Trustable Decoding\" [2]. Utilizing a reference datastore provides transparent reference data for base model decoding, achieving in-domain controllable generation. However, the core argument of the paper still emphasizes efficiently transferring base LLMs using training-free methods.\n5. **Typos:**\n   - Line 242: \"Detailed\" should be \"detail.\"\n\nReferences:\n\n[1] Khandelwal, U., Levy, O., Jurafsky, D., Zettlemoyer, L., & Lewis, M. (2020). Generalization through Memorization: Nearest Neighbor Language Models. In International Conference on Learning Representations.  \n\n[2] Liu, Y., Yao, Y., Ton, J. F., Zhang, X., Cheng, R. G. H., Klochkov, Y., ... & Li, H. (2023). Trustworthy LLMs: A survey and guideline for evaluating large language models' alignment. arXiv preprint arXiv:2308.05374.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely appreciate your thorough reading of our paper. The time you’ve invested in our work is truly invaluable to us. Your endorsement of the efficiency, orthogonality, and practical significance of our proposed RTD method means a great deal, and we are genuinely grateful for your recognition.\n\nAdditionally, we thank you for pointing out the limitations and constraints of RTD. Such constructive feedback is immensely helpful in improving our paper.\n\n### Weakness\n\n1. **Lack of comparison with other retrieval-based decoding methods:**\n  The reason we didn’t compare with retrieval methods lies in two factors. First, other retrieval-based methods typically rely on an gigantic reference datastore. For instance, in the original paper of $k$NN-LM, over 1 billion entries were used, which significantly exceeds the data volume typically employed in our RTD method (usually less than 1 million). This disparity makes direct comparisons a lower reference value, especially given RTD’s focus on efficiency. Second, running a complete $k$NN-LM requires substantial hardware resources, often involving massive CPU memory and potentially distributed cluster deployments. Unfortunately, we lack the necessary resources to fully replicate knn-LM’s performance.\n\n2. **Lack of generalization analysis:**\n  Thank you for your suggestion. We want to emphasize that RTD’s core objective is to efficiently augment LLMs within specific domains. However, exploring cross-domain generalization is indeed a promising avenue. We plan to supplement our paper with cross-domain tests within the NLU field, given the structural similarities across different benchmarks. Preliminary exploration suggests that our RTD method exhibits some cross-domain generalization capability, particularly when task formats are similar. As soon as detailed testing is complete, we’ll promptly share the results. Our first batch of result are as follows, we tested the reference datastore generate from different benchmarks on OBQA.\n\n  |Datasore source|OBQA|ARC|MMLU|\n  |-|-|-|-|\n  |score|$71.4$|$71.4$|$71.2$|\n\n3. **Requirement on additional hyperparameter searches:**\n  Our method introduces a certain number of hyperparameters, and determining the optimal hyperparameters does indeed pose new challenges for RTD. However, in Section 4.3 of our paper, we extensively discuss the impact of hyperparameters on performance. Our experiments reveal that RTD is relatively insensitive to hyperparameters, and performance trends are quite evident as hyperparameters vary. Therefore, while identifying an optimal set of hyperparameters still requires some experimentation, finding a satisfactory set is relatively simple and straightforward.\n\n4. **Lacks association with trustable decoding:**\n  Thank you for your suggestion. Our proposed RTD method fundamentally targets the *LM_Head* within the entire LLM network. Since the *LM_Head* is the final layer of the LLM, our method essentially operates on a relatively shallow portion of a deep neural network. This design choice allows us to employ more interpretable methods compared to traditional gradient-based optimization.\n  For example, if during RTD deployment, we observe unexpected model behavior or undesirable outputs, we can rectify these issues by inspecting the data within the Reference Datastore. The data in the Reference Datastore is traceable, meaning we can identify which specific example led to an error and easily remove it. In contrast, achieving a similar process with gradient-based methods, such as gradient descent, would be extremely challenging, if possible at all.\n  We will supplement relevant content in the next version to address this issue and further clarify the association with \"Trustable Decoding.\"\n\n5. **Typos:**\n  We are sorry that there are some typos in our paper, we will correct them immediately. Thank you for your careful reading.\n\n### Questions\n\n- **The explainaion of setting $\\lambda$ to 1:** \n  In RTD, we introduce a hyperparameter $λ$ to blend the results from RTD and those from the base model. The rationale behind this choice is that we typically don’t want to completely discard information from the base model. By doing so, we avoid the risk of RTD inadvertently causing a regression in overall system performance, ensuring greater robustness. In the specific case you mentioned, which pertains to NLU tasks, the relatively constrained format allows RTD to perform well on the task itself while enhancing performance. In such scenarios, we believe that additional information from the base model is unnecessary. Furthermore, setting $λ$ to $1$ avoids costly vocabulary operations, conserving computational resources, especially crucial for large-vocabulary modern models like llama3-8b, where the *LM_head* constitutes 6.6% of the model parameters (0.53B out of 8.03B). We appreciate your perspective, and indeed, the setting of $λ$ still worth exploration for this task. We will conduct an additional experiment to present the influence of $λ$. We will provide more detailed discussion in the next version.\n  Our result of tuning $\\lambda$ on LLaMA3-8B, OBQA are as follows:\n\n  |$\\lambda$|$1$|$0.8$|$0.6$|$0.4$|$0.2$|$0$|\n  |-|-|-|-|-|-|-|\n  |score|$71.4$|$68.0$|$67.0$|$66.8$|$66.6$|$53.3$|\n\n\nAllow us to express our gratitude once again for your diligent reading of our paper. Your suggestions are valuable and can definitely help us to improve our paper. If you have any further insights or questions, please share them with us.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "bCfqyUv4xK", "reviewer": "Reviewer_vZ3x", "summary": "The paper introduces Reference Trustable Decoding (RTD), a novel framework that allows large language models to adapt to new tasks without the need for fine-tuning. RTD constructs a reference datastore from training examples and optimizes the LLM’s final vocabulary distribution by selecting suitable references based on the input. This results in more reliable responses and low-cost adaptation to downstream tasks. The paper includes experimental evaluations demonstrating RTD's effectiveness across various benchmarks and tasks, highlighting its potential as a new paradigm for augmenting LLMs.", "questions": "1. How does RTD compare with other state-of-the-art methods in terms of computational efficiency and scalability, especially for larger datasets or more complex tasks?\n2. Can the authors provide more details on how RTD might be integrated into existing systems or workflows where LLMs are already deployed?\n3. The paper mentions the potential for RTD to be combined with other methods like ICL and fine-tuning. Are there specific strategies or best practices for such integration?", "limitations": "1. The paper acknowledges the challenge of compressing large reference datastores but does not offer solutions or workarounds for this limitation.\n2. The scope of the experiments could be expanded to include a broader range of tasks, especially those that are more generative in nature.\n3. While the paper discusses the performance of RTD in a controlled setting, it does not address how well these results might generalize to other domains or tasks outside the tested benchmarks.\n4. The paper does not provide a detailed discussion on the ethical considerations or societal impacts of deploying LLMs with enhanced capabilities through RTD, which could be important for responsible AI development.", "rating": 4, "confidence": 3, "soundness": 3, "presentation": 2, "contribution": 2, "strengths": "1. The paper presents a unique and training-free method for augmenting LLMs, which is a significant contribution to the field.\n2. The methodology is clearly explained, and the figures provided help in visualizing the RTD process.\n3. Comprehensive experimental evaluations are conducted, demonstrating the effectiveness of RTD across different tasks and benchmarks.\n4. The paper discusses the orthogonality of RTD with traditional methods, indicating its potential for combined usage and enhanced performance.\n5. The authors provide a thorough analysis of the hyper-parameters involved in RTD and their impact on performance.", "weaknesses": "1. While the paper discusses the efficiency of RTD, it does not provide a direct comparison with other methods in terms of computational resources or scalability.\n2. The paper could benefit from a more detailed discussion on the potential applications of RTD in real-world scenarios.\n3. The experimental section, although comprehensive, might have benefited from additional benchmarks, particularly those that test the generative capabilities of LLMs further.\n4. The paper mentions the inability to compress large reference datastores as a challenge; however, it does not provide insights or potential solutions to this issue.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely appreciate the time you’ve spent on our paper. Thank you for recognizing our approach, experiments, and writing. The following is our response regarding the weaknesses, questions, and limitations, you raised. We aim to clarify any potential misunderstandings and indicate the direction of modifications for our paper.\n\n### Weakness\n\n1. **Comparison with other methods:**\n  In the second section of our paper, we discussed the comparison between our approach and other methods in terms of efficiency and capability. However, we plan to supplement a small table to provide a concise and quick overview. The table would look like this:\n\n   | Methods | Training Cost | Inference Cost | Capability |\n   |-|-|-|-|\n   | No Method | Low | Low | Low |\n   | RTD (Ours) | Minimum | Minimum | Moderate |\n   | PEFT | High | Low | Moderate |\n   | ICL | Low | High | Moderate |\n   | FFT | Gigantic | Low | Best |\n\n   And we've also tested the inference efficiency of RTD and it's counterparts.\n\n   | Methods | Speed (it/s) |\n   |-|-|\n   | RTD | $23.6$ |\n   | PEFT | $25.1$ |\n   | ICL | $7.9$ |\n\n2. **Real-world application:**\n  In our experiments, we utilized highly challenging and widely used datasets that are derived from real-world scenarios, such as MMLU which covers 57 subjects across STEM, the humanities, the social sciences, and tests both world knowledge and problem-solving ability. This makes the benchmark more challenging and more similar to how we evaluate humans. We will provide more detailed case studies in future versions of the paper.\n\n3. **Additional generative benchmarks:**\n  In section 4.2, we tested different LLM generation tasks, including reasoning with context and style transfer tasks. For example, we used a Retrieval-Augmented Generation (RAG) benchmark to evaluate knowledge injection and the ability to provide step-by-step reasoning using Chain-of-Thought prompting. Additionally, we conducted style transfer experiments using the Tiny-Shakespeare dataset to measure the model's ability to adapt to different language styles.\n  In our revised version, we will include additional examples of RTD-generated instances to support the effectiveness of the RTD method.\n\n4. **Solutions of large datastores:**\n  While we acknowledge the importance of compressing large reference datastores, this particular challenge falls outside the primary scope of our current research. Our main focus was on introducing the reference trustable framework (RTD), which aims to better integrate and utilize reference datastores.\n  Besides, in Sections 3.4 and 4.3 of our paper, we discussed a resource-saving approach by reducing the number of utilized heads, which can partially solve this.\n  We see this limitation as an opportunity for future research rather than a weakness of our current work. We believe RTD provides a solid foundation for further exploration into effective compression techniques. We appreciate your insight and will consider discussing potential approaches in future works.\n\n### Questions\n\n1. **Larger and more complex tasks:**\n  We would like to emphasize that the dataset used in our experiments in Section 4, such as *MMLU*, is already a large-scale and challenging benchmark commonly used for testing. Its complexity and difficulty level are significant.\n\n2. **Integrated into existing systems:**\n  This aspect was indeed underrepresented in our paper, and we agree that it deserves further elaboration. For instance, when using LLM for text screening, a small set of screening cases can be used to generate a Reference Datastore. By combining this with RTD, we can replace the original ICL portion, thereby increasing screening efficiency and reducing overall computational load. Additionally, analyzing screening results can help reverse-engineer potential issues in the Reference Datastore, highlighting the “Trustable” feature of RTD.\n\n3. **Combine methods**\n  In Table 2, we have conducted experiments combining RTD with other methods, demonstrating that generally, the more methods we combine, the better the overall performance tends to be. However, such improvements often come with additional computational resource requirements, necessitating a trade-off between performance and cost.\n  **The best integration strategy needs to be determined based on the specific use case**. The core contribution of RTD lies in providing a method to augment model capabilities without imposing **excessive additional computation**, thus opening up new possibilities for model enhancement under limited resources.\n\n### Limitations\n\n1. **Large datastores:**\n  See weakness #4\n\n2. **Generative testings:**\n  See weakness #3\n\n3. **Settings generalization:**\n  RTD has been tested on two types of tasks: language understanding and language generation, across a total of **seven different benchmarks** and **six models**. We believe this extensive evaluation effectively demonstrates RTD's ability to generalize to various domains and tasks.\n\n4. **Responsible AI development:**\n  We propose RTD as a model enhancement method, which will have similar societal effects as other existing methods and won’t introduce any additional issues for discussion. We will emphasize this point more clearly in future versions of the paper.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "YLMS4VTnEx", "reviewer": "Reviewer_tphZ", "summary": "This paper proposes Reference Trustable Decoding (RTD), a new paradigm that allows models to adapt to new tasks without fine-tuning and has lower inference costs compared to in-context learning (ICL). RTD uses the last-hidden states of the input sample to retrieve similar samples in the training examples and optimizes the LLM’s final vocabulary distribution using these examples’ last-hidden states. Experimental results on various LLMs show RTD can effectively adapt LLM and it can be used together with ICL method to further boost task performance.", "questions": "See my questions in “Weaknesses”.", "limitations": "Yes. It is discussed in \"Limitations & Future Work\".", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "1. The proposed method is well-motivated, addressing the weaknesses of ICL and fine-tuning in model adaptation. The paper is also clearly written, with Figure 2 providing a clear comparison of RTD and baseline methods.\n2. The experimental results on multiple task setups showcase the effectiveness of the RTD in adapting the model. Also, the proposed method can be used together with traditional methods to further boost performance.\n3. Compared to RAG or ICL, RTD selects relevant examples based on the similarity in the final hidden state space. Many existing techniques for vector database can be used to boost the efficiency of RTD.", "weaknesses": "1. The description of using RTD in language generation task is unclear. When generating a sequence of multiple tokens in an autoregressive way, how does the retrieved sample adapt the vocabulary distribution after the first token? Also, it is unclear what the constructed “benchmark based on RAG and Open Book Question Answering” in Section 4.2 is.\n2. The performance gain of RTD seems to be unstable as Table 2 shows on some datasets, RTD is much worse than 5-shot ICL. The paper lacks discussion on what tasks is RTD suitable to use.\n3. The paper should have a part clearly describe the baseline methods in comparison. How are the 5 examples selected in “5-shot ICL”? I think this is quite important, as some previous works use similarity in the sentence embedding space to select in-context examples to adapt the model via ICL. Given the proposed method mainly leverage the last hidden state space, more careful comparison and discussion can help understand whether it’s more helpful to leverage the last hidden state space.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely appreciate your willingness to thoroughly read our paper. The time you’ve invested in our work is truly invaluable to us. Your recognition of our method’s clear motivation, extensive experiments, and ease of optimization is an honor. Additionally, we thank you for pointing out the shortcomings in our paper. We highly value your feedback, and these suggestions will undoubtedly contribute to refining our work.\n\n### Weakness\n\n1. **How RTD behave when auto-regressive decoding:**\n    Regarding RTD, it follows the traditional autoregressive decoding pattern, where the generation of subsequent tokens is handled in the same manner as the first token. Specifically, after generating a token, it is appended to the input sequence, and the new last hidden states are used to perform another round of RTD for the next token. We will provide more detailed explanations in future versions of the paper to clarify these points.\n\n2. **What is the benchmark based on RAG and Open Book Question Answering:**\n  For benchmark based on RAG and Open Book Question Answering, we add two components to the original QA setup to test whether RTD could inject new knowledge into LLMs: \n\n    1. Source of New Knowledge: \n      We chose Wikipedia articles, and the filter the relevant pages out using a RAG system.\n    2. Process of Knowledge Injection: \n      Since RTD operates at the token level, and Wikipedia articles do not directly contain options like A, B, C, and D, we need a process where the model generates an analysis of the question. During this generation process, RTD injects new knowledge. So we adopted a CoT  decoding approach for this purpose.\n\n   We will provide more detailed descriptions in the revised version.\n\n3. **The unstable performance of RTD in some dataset:**\n  In the NLU experiments, whether it’s fine-tuning, ICL, or our RTD approach, the core goal is not merely injecting more knowledge into the model but rather guiding the model to better utilize its existing knowledge. Essentially, any optimization method is constrained by the upper limit of the model’s knowledge capacity. Breaking through this limit is not feasible given the current computational budget. Even if these methods are orthogonal, when the model has already touched or approaching this upper limit, further improvement in capability becomes restricted. In some cases, fluctuations due to errors may occur. Our primary experiments have demonstrated two key points:\n\n    1. RTD alone significantly enhances model performance\n    2. RTD has the potential to complement methods like ICL\n       However, when ICL is already sufficient to reach the theoretical upper limit, combining it with RTD may unavoidably introduce performance variations due to error factors.\n\n   We will add more detailed analysis in the next version.\n\n4. **Detailed description to baseline:**\n  Thank you for your suggestion. We will provide a more detailed discussion in future version. For most benchmarks, specific example data is already prepared for constructing ICL. For instance, in the case of the MMLU benchmark, the *dev* subset provides five sample questions for each question category. This is why we chose to use a 5-shot setup. For benchmarks that do not have corresponding sections explicitly designed for ICL, we randomly sample five questions from the provided training data to create a 5-shot setup. Both the test group and the control group use the same set of questions to ensure experimental fairness.\n\n5. **Discussion about the Last Hidden Space:**\n  For last hidden space, our modification target lies within the *LM_Head*, and the Last Hidden State serves as the input to the *LM_Head*. The *LM_Head* represents the final layer of the entire LLM network, which means that our method essentially operates on a relatively shallow portion of a deep neural network. This design choice provides us with an opportunity to employ richer methods compared to a single gradient descent approach. Additionally, it allows us to maintain a “training free” approach. In fact, the core of our paper lies in exploring the optimization of the model using the Last Hidden State. Our ultimate goal is not only to bypass the *LM_Head* but also to delve further into the properties of this specific region. Notably, in some newer models like llama3-8b, the *LM_head* constitutes a substantial portion of the model parameters (6.6% or 0.53B out of 8.03B), yet it has received relatively little attention.\n\nFinally, we would like to express our gratitude for the time you’ve spent reviewing our paper again. Your suggestions have been highly relevant to the content and have significantly contributed to improving the paper. If you have any further questions or additional feedback, please feel free to reach out, and we will promptly respond.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Meta-review: This paper proposes Reference Trustable Decoding (RTD), a training-free paradigm for better adapting base LLMs to downstream tasks. RTD is a retrieval-based framework that creates a reference datastore from task datasets, storing key-value pairs of hidden states and corresponding labels. During inference, RTD retrieves the most relevant references based on the hidden states of the input and then aggregates them with model logits to compute the final output distribution. Experimental results demonstrate that RTD effectively adapts mainstream LLMs for natural language understanding (NLU) and natural language generation (NLG) benchmarks, outperforming ICL approaches.

The paper demonstrates good performance of RTD on multiple benchmarks, surpassing ICL methods and baselines. RTD is particularly meaningful in scenarios requiring rapid iteration of content or controllable generation. The methodology is clearly explained, and the figures provided help in visualizing the RTD process. The paper discusses the orthogonality of RTD with traditional methods, indicating its potential for combined usage and enhanced performance. The authors provide a thorough analysis of the hyper-parameters involved in RTD and their impact on performance.

Many of the weaknesses have been addressed by the authors in the rebuttal period and we would like to encourage the authors to include the results in the next revision of their paper. Related work regarding kNN-LM (e.g. [1]) should be more discussed in the paper. One of the last remaining questions is how RTD performs on out-of-distribution tasks. 

[1] https://aclanthology.org/2023.acl-long.859/
Decision: Accept (poster)