Table of Contents
Fetching ...

MemWeaver: A Hierarchical Memory from Textual Interactive Behaviors for Personalized Generation

Shuo Yu, Mingyue Cheng, Daoyu Wang, Qi Liu, Zirui Liu, Ze Guo, Xiaoyu Tao

TL;DR

This work addresses deep personalization from rich textual histories by introducing MemWeaver, a hierarchical memory framework that combines a behavioral memory of concrete actions with a cognitive memory of long-term preferences to guide generation. A context-aware memory graph enables semantic- and time-aware retrieval via a memory-guided generation process, formalized with $ \hat{y} = \arg\max_{y'} p(y' \mid q, \mathcal{M}^{\mathrm{behavior}}_u, \mathcal{M}^{\mathrm{cog}}_u; \theta)$ and a behavioral-edge score $ S(u\rightarrow v)=\left( \frac{e_q \cdot e_v}{\|e_q\|\|e_v\|} \right)^{\alpha} R(v) C(u,v)$. An incremental updating strategy ensures scalable maintenance of memory as new data arrive. Experiments on the LaMP benchmark show MemWeaver achieves state-of-the-art results across twelve metrics, with ablations confirming the complementary roles of behavioral and cognitive memories and the importance of semantic and temporal connections. The approach offers a practical, scalable path to deeply personalized generation in real-world systems.

Abstract

The primary form of user-internet engagement is shifting from leveraging implicit feedback signals, such as browsing and clicks, to harnessing the rich explicit feedback provided by textual interactive behaviors. This shift unlocks a rich source of user textual history, presenting a profound opportunity for a deeper form of personalization. However, prevailing approaches offer only a shallow form of personalization, as they treat user history as a flat list of texts for retrieval and fail to model the rich temporal and semantic structures reflecting dynamic nature of user interests. In this work, we propose \textbf{MemWeaver}, a framework that weaves the user's entire textual history into a hierarchical memory to power deeply personalized generation. The core innovation of our memory lies in its ability to capture both the temporal evolution of interests and the semantic relationships between different activities. To achieve this, MemWeaver builds two complementary memory components that both integrate temporal and semantic information, but at different levels of abstraction: behavioral memory, which captures specific user actions, and cognitive memory, which represents long-term preferences. This dual-component memory serves as a unified representation of the user, allowing large language models (LLMs) to reason over both concrete behaviors and abstracted traits. Experiments on the Language Model Personalization (LaMP) benchmark validate the efficacy of MemWeaver. Our code is available\footnote{https://github.com/fishsure/MemWeaver}.

MemWeaver: A Hierarchical Memory from Textual Interactive Behaviors for Personalized Generation

TL;DR

This work addresses deep personalization from rich textual histories by introducing MemWeaver, a hierarchical memory framework that combines a behavioral memory of concrete actions with a cognitive memory of long-term preferences to guide generation. A context-aware memory graph enables semantic- and time-aware retrieval via a memory-guided generation process, formalized with and a behavioral-edge score . An incremental updating strategy ensures scalable maintenance of memory as new data arrive. Experiments on the LaMP benchmark show MemWeaver achieves state-of-the-art results across twelve metrics, with ablations confirming the complementary roles of behavioral and cognitive memories and the importance of semantic and temporal connections. The approach offers a practical, scalable path to deeply personalized generation in real-world systems.

Abstract

The primary form of user-internet engagement is shifting from leveraging implicit feedback signals, such as browsing and clicks, to harnessing the rich explicit feedback provided by textual interactive behaviors. This shift unlocks a rich source of user textual history, presenting a profound opportunity for a deeper form of personalization. However, prevailing approaches offer only a shallow form of personalization, as they treat user history as a flat list of texts for retrieval and fail to model the rich temporal and semantic structures reflecting dynamic nature of user interests. In this work, we propose \textbf{MemWeaver}, a framework that weaves the user's entire textual history into a hierarchical memory to power deeply personalized generation. The core innovation of our memory lies in its ability to capture both the temporal evolution of interests and the semantic relationships between different activities. To achieve this, MemWeaver builds two complementary memory components that both integrate temporal and semantic information, but at different levels of abstraction: behavioral memory, which captures specific user actions, and cognitive memory, which represents long-term preferences. This dual-component memory serves as a unified representation of the user, allowing large language models (LLMs) to reason over both concrete behaviors and abstracted traits. Experiments on the Language Model Personalization (LaMP) benchmark validate the efficacy of MemWeaver. Our code is available\footnote{https://github.com/fishsure/MemWeaver}.

Paper Structure

This paper contains 48 sections, 4 equations, 8 figures, 6 tables.

Figures (8)

  • Figure 1: The diagram illustrates a key paradigm shift in user modeling, moving from leveraging implicit feedback signals like clicks to harnessing the rich, explicit feedback provided by user textual interactions.
  • Figure 2: An overview of the MemWeaver framework. MemWeaver builds a dual memory from user history logs: a cognitive memory for evolving preferences and a behavioral memory for capturing specific user behavior. Both memories are then structured into a comprehensive prompt to guide an LLM for personalized generation.
  • Figure 3: Proportion of semantic and temporal edges in the behavioral memory across different LaMP datasets.
  • Figure 4: An illustrative case study of MemWeaver. The framework transforms user history into a dual behavioral and cognitive memory, enabling an LLM to produce a personalized response that is far superior to the generic, memory-less baseline.
  • Figure 5: Comparison of memory update strategies in terms of accuracy and efficiency.
  • ...and 3 more figures