Skip to main content
QUICK REVIEW

[Paper Review] User-LLM: Efficient LLM Contextualization with User Embeddings

Lin Ning, Luyang Liu|arXiv (Cornell University)|Feb 21, 2024
Natural Language Processing TechniquesComputer Science8 citations
TL;DR

User-LLM embeds multi-modal user interactions into compact embeddings and cross-attends them to LLMs, enabling efficient, long-context personalization without retraining the full LLM.

ABSTRACT

Large language models (LLMs) have achieved remarkable success across various domains, but effectively incorporating complex and potentially noisy user timeline data into LLMs remains a challenge. Current approaches often involve translating user timelines into text descriptions before feeding them to LLMs, which can be inefficient and may not fully capture the nuances of user behavior. Inspired by how LLMs are effectively integrated with images through direct embeddings, we propose User-LLM, a novel framework that leverages user embeddings to directly contextualize LLMs with user history interactions. These embeddings, generated by a user encoder pretrained using self-supervised learning on diverse user interactions, capture latent user behaviors and interests as well as their evolution over time. We integrate these user embeddings with LLMs through cross-attention, enabling LLMs to dynamically adapt their responses based on the context of a user's past actions and preferences. Our approach achieves significant efficiency gains by representing user timelines directly as embeddings, leading to substantial inference speedups of up to 78.1X. Comprehensive experiments on MovieLens, Amazon Review, and Google Local Review datasets demonstrate that User-LLM outperforms text-prompt-based contextualization on tasks requiring deep user understanding, with improvements of up to 16.33%, particularly excelling on long sequences that capture subtle shifts in user behavior. Furthermore, the incorporation of Perceiver layers streamlines the integration between user encoders and LLMs, yielding additional computational savings.

Motivation & Objective

  • Motivate personalized LLMs by leveraging compressed user representations from diverse interactions.
  • Propose a two-stage framework: (1) pretrain a user encoder to produce embeddings, (2) integrate embeddings into LLMs with cross-attention or soft prompts.
  • Demonstrate efficiency and scalability for long sequences and multimodal data across multiple datasets.
  • Compare embedding-based personalization with text-prompt baselines and full finetuning, including parameter-efficient training strategies.

Proposed method

  • Train a Transformer-based autoregressive user encoder on multi-modal user histories to produce dense embeddings per event.
  • Fuse embeddings from two or more modalities into a single sequence of embeddings for the user.
  • Integrate user embeddings with LLMs via cross-attention (or soft prompts) to condition generation and predictions.
  • Improve efficiency with Perceiver layers to compress embeddings and reduce attention load in the LLM.
  • Explore four training strategies: Full finetune, Enc (freeze LLM), LoRA, and Proj (freeze LLM and encoder).
  • Use PaLM-2 XXS as the LLM and a 6-layer, 128-dim transformer as the user encoder; study cross-attention vs. soft-prompt fusion.
Figure 1: Illustration of two different mechanisms to incorporate user interaction history data to LLMs. (1) User history data are expressed in natural language and fed to LLMs via text prompt; (2) User embeddings, distilled from user history data, are used to contextualize LLMs.
Figure 1: Illustration of two different mechanisms to incorporate user interaction history data to LLMs. (1) User history data are expressed in natural language and fed to LLMs via text prompt; (2) User embeddings, distilled from user history data, are used to contextualize LLMs.

Experimental results

Research questions

  • RQ1Can user embeddings distilled from multimodal interactions improve LLM personalization more efficiently than text prompts?
  • RQ2How do cross-attention and soft-prompt fusion compare for integrating user embeddings into LLMs?
  • RQ3What are the efficiency gains (in FLOPs and context length) when using user embeddings and Perceiver compression for long histories?
  • RQ4Do pretrained user encoders generalize well to tasks beyond next-item prediction, such as genre prediction and review generation?
  • RQ5How do different training strategies (Full, Enc, LoRA, Proj) impact performance and parameter efficiency?

Key findings

  • User-LLM outperforms non-LLM baselines on next-item prediction for MovieLens and Google Local Review; Amazon Review favors Bert4Rec, highlighting dataset sparsity effects.
  • Embedding-based context handling enables the LLM to process fixed-length prompts (32 tokens) regardless of input sequence length, with substantial FLOPs reductions (up to 78.1X) compared to text-prompt baselines.
  • Pretrained user encoders provide consistent gains over randomly initialized ones across tasks.
  • Cross-attention fusion generally outperforms soft-prompt fusion, especially in review-generation tasks.
  • Finetuning only the encoder and projection layers (Enc) achieves competitive performance with far fewer trainable parameters than full finetuning, preserving LLM knowledge.
  • Perceiver-based compression reduces embedding tokens (e.g., from 50 to 16) with minimal performance loss, improving inference efficiency.
Figure 2: Overview of User-LLM . Left: Multimodal Autoregressive Transformer encoder pretraining. Right: LLM contextualization with user embeddings. Features from a user’s interaction history are encoded by the Autoregressive User Encoder and then integrated into the language model via cross-attenti
Figure 2: Overview of User-LLM . Left: Multimodal Autoregressive Transformer encoder pretraining. Right: LLM contextualization with user embeddings. Features from a user’s interaction history are encoded by the Autoregressive User Encoder and then integrated into the language model via cross-attenti

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.