RECAP: Retrieval-Enhanced Context-Aware Prefix Encoder for Personalized Dialogue Response Generation

Shuai Liu, Hyundong Cho, Marjorie Freedman, Xuezhe Ma, Jonathan May

Introduction

In the pursuit of creating human-like AI, maintaining a consistent persona remains a significant challenge. Chatbots often struggle with long-term engagement because they lack a stable identity, frequently shifting their tone or background throughout a conversation. To address this, researchers from the University of Southern California’s Information Sciences Institute have developed RECAP (Retrieval-Enhanced Context-Aware Prefix Encoder). This framework enables chatbots to maintain a consistent "vibe" and memory by leveraging a user's specific conversational history.

The Personalization Challenge

Personalizing dialogue systems typically follows two paths: explicit personas or implicit profiles. Explicit personas (e.g., "You are a marathon runner") are often brittle and difficult to scale. Implicit profiles, derived from chat history, are more natural but present technical hurdles in retrieval—identifying relevant past messages—and fusion—integrating that history into the generation process without overwhelming the model.

Methodology: The RECAP Framework

RECAP addresses these challenges through a dual-module architecture consisting of a Retrieval Module (RE) and a Context-Aware Prefix Encoder (CAP).

1. The Retrieval Module (RE)

Unlike simple recency-based retrieval, RECAP employs a hierarchical transformer retriever. It analyzes the current context to predict the ideal response's semantics (meaning) and style (expression). It then searches the user's history for past messages that align with this prediction, allowing the model to adapt its tone based on the situation—for instance, pulling "helpful" history when providing advice.

2. The Context-Aware Prefix Encoder (CAP)

The CAP module handles the fusion of retrieved history into the response generator. Rather than concatenating raw text to the input, RECAP utilizes prefix-tuning. The retrieved history is encoded into "virtual tokens" or continuous vectors that are prepended to the internal layers of a transformer decoder (such as DialoGPT). This internal guidance ensures the persona strongly influences the generation process while maintaining high efficiency.

The architecture of the Context-Aware Prefix (CAP) encoder, showing how retrieved history is fused into the generation process.

Experimental Setup

The researchers evaluated RECAP using two diverse datasets:

  • Reddit (Pushshift.io): A large-scale dataset of English conversations, partitioned by user to test the model's ability to generalize to unseen individuals.
  • PANDORA: A dataset focused on personality traits, including Age, Gender, and MBTI types, used to assess the model's capacity to emulate specific demographic and psychological profiles.

Key Results

RECAP was benchmarked against several baselines, including the previous state-of-the-art model, MSP. The results demonstrated RECAP's superiority across multiple dimensions.

Quantitative results comparing RECAP variants against state-of-the-art baselines across multiple metrics and datasets.

Automatic Metrics and Personality Matching

As shown in the results table, RECAP achieved the lowest Perplexity (PPL), indicating superior fluency, and the highest scores in BLEURT and ROUGE-L. On the PANDORA dataset, RECAP significantly outperformed baselines in generating text that matched the target user's age, gender, and MBTI type, as verified by independent classifiers.

Style vs. Semantics

A key finding was the importance of stylistic retrieval. Models optimized for style (RECAP-style) were particularly effective at mimicking user-specific habits, such as punctuation and contractions. The "soft fusion" provided by the prefix encoder allowed the model to be guided by history without being distracted by it, preserving overall coherence.

Conclusion

RECAP represents a significant advancement in personalized dialogue generation. By combining sophisticated retrieval with internal prefix-tuning, it creates chatbots that are not only more fluent but also more consistent with a user's established persona. Future work will focus on scaling the retriever's pre-training and optimizing the computational costs associated with real-time retrieval-augmented generation.

Summary updated

BibTeX
@inproceedings{liu2023recap,
  author = {Shuai Liu and Hyundong Cho and Marjorie Freedman and Xuezhe Ma and Jonathan May},
  title = {{RECAP: Retrieval-Enhanced Context-Aware Prefix Encoder for Personalized Dialogue Response Generation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.468},
}
Figure