User Embedding Model for Personalized Language Prompting (2024)

Abstract: Modeling long user histories plays a pivotal role in enhancing recommendation systems, allowing to capture users’ evolving preferences, resulting in more precise and personalized recommendations. In this study, we tackle the challenges of modeling long user histories for preference understanding in natural language. Specifically, we introduce a new User Embedding Module (UEM) that efficiently processes user history in free-form text by compressing and representing them as embeddings, to use them as soft prompts to a language model (LM). Our experiments demonstrate the superior capability of this approach in handling significantly longer histories compared to conventional text-based methods, yielding substantial improvements in predictive performance. Models trained using our approach exhibit substantial enhancements, with up to 0.21 and 0.25 F1 points improvement over the text-based prompting baselines. The main contribution of this research is to demonstrate the ability to bias language models via user signals.

## introduction in recent years, large language models (llms) have proven their versatility in various language tasks, from translation to reasoning @xcite . scaling up models and data has played a crucial role in unlocking their potential @xcite @xcite . llms have also been adapted for conversational tasks, instruction following, and reasoning using techniques like instruction-tuning @xcite @xcite , rlhf @xcite , and chain-of-thought @xcite . trained on extensive internet data, these llms excel in generalization. they can quickly adapt to new tasks with in-context learning and are capable of not only answering questions but also reasoning about their responses. recent research has predominantly concentrated on examining smaller segments of user history by selecting representative samples from a users' history @xcite . @xcite uses learned gist tokens to compress prompts while @xcite uses prompt rewriting based on entries retrieved from a users' profile. this leads to the critical question how can we effectively utilize longer user histories? to achieve this, we employ an embedding-based technique to compress the user's entire history, creating a sequence of representative user embedding tokens. this embedded representation enhances our ability to comprehend user preferences and subsequently generate predictions that align more closely with their interests. further, since the user embedding module (uem) module is co-trained with the lm, the representations are learned in-context for the specific tasks. our research demonstrates the advantages of this approach, particularly in its capacity to incorporate longer user history into lms, resulting in more robust user preference understanding. compared to the naive approach of concatenating user history and incurring o(n 2 ) compute cost for self-attention, our approach demonstrates a cheap way to incorporate history metadata as an embedding thus dramatically reducing the required compute. as a result longer user histories can be easily incorporated within lms. our empirical findings demonstrate the ability of our approach to accommodate significantly larger histories compared to traditional text-based methods, resulting in improved predictive performance. ## approach following text-to-text approach of t5 @xcite , we frame all tasks as text generation conditioned on the input. formally, given a sequence of query input tokens denoted as x, we model the probability of output y as p r θ (y |x), where θ represents the weights of the model. prior studies have established two primary prompting strategies: text-based prompting, where textual instructions are prepended to the input @xcite @xcite , and soft-prompting, which adds a set of train-able tokens as a prefix to the input tokens of the models @xcite . prior soft-prompting uses a fixed task-specific softprompt to achieve parameter-efficient fine-tuning for various language tasks, maximizing the likelihood p r θ (y |[k; x]), with k trainable tokens. we extend this idea to personalization. more specifically, using the user embedding module (uem), we generate a personalised soft-prompt conditioned on the users' history. this setup aims to maximize the likelihood of the label y, given p r θ (y |[p r u em (u ); x]), where p r u em (u ) are the soft prompts generated by the uem based on user history u and prefixed to the query input x. in our task definition, u corresponds to the movie metadata, x represents the task instruction, and y represents genre preferences. overall, given a task instruction x, the lm embeds these tokens to a matrix x @xmath0, where n represents the token count and e represents the embedding dimension of the lm. the textual user history following @xcite , we also incorporate 'k' task-level soft prompts, denoted as p @xmath1. both the user and task prompts are concatenated with the input embedding, resulting in a unified embedding matrix, represented as [p e ; p r u em (u ); x e ] ∈ r (k+p+n)×e . this composite embedding flows through the lm, maximizing the probability of y, and concurrently updating all parameters within both model components. the model is illustrated in figure 1 . evaluation. although the task is framed in a textto-text format, the model's output can be processed by a verbalizer to extract the genres. while conventional metrics like bleu @xcite , rouge @xcite , and comet @xcite are used for evaluating generative text, they lack granularity in understanding the task performance. however, given the straightforward genre extraction by the verbalizer, we treat the task as a multilabel classification problem and present weighted precision, recall and f1 scores across all labels 3 . our initial findings indicate that these scores offer a more interpretable assessment, both at the genre level and for the overall task evaluation, compared to token-level metrics. ## related work ## conclusion & future work in this study, we addressed several critical challenges in modeling user history for preference understanding. we introduced a user embedding module that processed user history as freeform text, generating token embeddings for each history item. this approach greatly simplified user history tracking and enabled the incorporation of longer user histories into the language model, and allowed their representations to be learned in context. our empirical results demonstrated the capability of this approach to handle significantly larger histories efficiently compared to traditional text-based approaches, resulting in improved predictive performance. for future work, we would like to explore more parameter efficient approaches like lora @xcite for finetuning lms with uem, which would improve both training and serving for these models. this approach can be easily extended to multimodal signals using modal specific embeddings and tying them together with uem, and we plan to explore this direction for future work.