Adapting LLM Predictions in In-Context Learning with Data Priors (2024)

Abstract: In-Context Learning (ICL) has enabled Large Language Models (LLMs) to excel as general-purpose models in zero and few-shot task settings. However, since LLMs are often not trained on the downstream tasks, they lack crucial contextual knowledge from the data distributions, which limits their task adaptability.This paper explores using data priors to automatically customize prompts in ICL. We extract these priors in a dataset-agnostic way basedon historical information, enabling LLMs to personalize their output towards users or tasks at inference time. We find that they improve LLM’s output by injecting latent dataset-specific information for the task of rating prediction. Throughout a series of experiments, we show replicable results across LLMs and datasets on what information and methods are most effective for adapting ICL outputs with priors. Our findings offer a systematic approach to customizing prompts with additional information in a privacy-friendly manner, requiring only aggregated data that is computationally efficient.

## introduction the field of nlp has progressed significantly towards generalizing to unseen tasks and inputs with pre-trained large language models (llms). with in-context learning (icl) @xcite , models are conditioned with task instructions and a few examples to generate text predictions, without task-specific training in zero and few-shot settings @xcite . thus, llms are increasingly used as all-purpose models for tasks beyond text generation, such as classification and regression @xcite . icl enables the personalization of llm outputs by incorporating relevant context in the prompt, without fine-tuning individual models @xcite . recent approaches focus on retrieving and incorporating relevant information in the prompt @xcite or building personal user profiles @xcite @xcite . however, these methods have challenges, such as identifying relevant information, impracticality of fine-tuning models or parameters for each user, computational constraints with large prompts, and avoiding over-personalization (i.e., profiling). in this paper, we focus on knowledge personalization @xcite of outputs based on historical data (i.e., previous interactions with the system), and argue that llms benefit from explicitly providing information about the data distribution in icl prompts. we initially experiment with the use of data priors as supplementary context in prompts for rating prediction, automatically synthesized based on previous behavior, e.g., "consider that this product is rated on average with a 4". secondly, we probe llms with modifications of these priors to analyze their benefits and limitations. we find that llms leverage this information to adapt to the input and calibrate their predictions within ranges that align with the underlying dataset distribution. our findings also indicate that llms are generally resilient to inaccurate priors, and that their benefits are more significant when task demonstrations are absent from the prompts, potentially benefiting resource-constrained scenarios. data priors offer a computationally efficient alternative to methods that depend on large volumes of data, retrieval algorithms or fine-tuned lms. our contributions in this paper are as follows: previous nlp personalization efforts have focused on creating user-specific representations @xcite by inferring user attributes @xcite or personas @xcite from narratives @xcite or public reviews @xcite . these representations are then used to condition the input and generate more personalized outputs @xcite @xcite . while these approaches target user-specific adaptation (e.g., chatty vs. terse @xcite ), we propose adapting to users or other elements by leveraging the data distribution, without training user-specific modules (e.g., userspecific vectors @xcite ), which require substantial computational resources. ## contextual data priors this section explores how including priors into prompts enhances llm adaptation and predictions. data priors represent population characteristics (e.g., averages) and thus can be leveraged to personalize outputs beyond users (e.g., products). ## limitations our work has several limitations: 1) we only investigate the task of rating review prediction, which has a numeric output and thus allows to calculate averages to use as priors. further investigation would be required as to determine whether there is task-agnostic context that we can consistently extract to improve icl in other domains, i.e., classification. 2) we use subsets of two large datasets, but these categories could be biased or provide limited transferable evidence of the benefits of priors. we aimed to balance dataset size versus reproducibility, as larger subsets would be more difficult to evaluate. our work contributes an initial step into understanding how context in the prompt, different from task demonstrations, could be useful across models and datasets in icl. 3) we use models of different sizes that we think are representative of the icl research field, from a small 1.5b parameter model, lamini-gpt, to a large llm with 20b parameters, alexatm. however, we were not able to test all models that may also be relevant, such as gpt-4/chatgpt (openai, 2023), llama 2 @xcite or opt-iml @xcite . 4) we did not test whether retrieving optimal demonstrations rather than randomly choosing them, had any effects on the benefits of data priors. instead, this paper focused on exploring complementary information in the prompts that could be useful when a retriever is not practical or in data-scarce settings. finally, 5) we did not exhaustively test alternative priors, e.g., random numbers. we use personalized priors for users/objects as a way of adapting to the input and providing some useful information. we discuss alternative data priors in appendix c and why they were not included, but ultimately leave the study of alternative data priors for future work as this may be dataset-dependent.