Introduction
Endowing chatbots with a consistent persona is essential for creating engaging and human-like conversational experiences. However, achieving this consistency remains a significant challenge in natural language processing. Early research focused on "explicit personas," where models were provided with manually curated user traits or profile sentences. While effective in controlled settings, these methods are difficult to scale and often fail to capture the nuanced conversational styles inherent in real-world interactions.
Recent advancements have shifted toward "implicit personas," which dynamically extract a user's profile from their past conversation history. Despite their potential, these methods face two primary bottlenecks:
- Retrieval Efficiency: Models often rely on simple heuristics, such as selecting the most recent messages or using out-of-domain retrievers, which frequently miss the most relevant personal context.
- Information Fusion: Integrating retrieved history into the generation process often relies on discrete text prompts or logit manipulation, which can fail to fully leverage the capabilities of large pre-trained language models.
To address these issues, we present RECAP (Retrieval-Enhanced Context-Aware Prefix Encoder), a novel framework that optimizes both the retrieval of persona-relevant history and its integration into the response generation process.
Methodology
RECAP decomposes the personalized generation task into two specialized modules: the Retrieval Module (RE) and the Context-Aware Prefix Encoder (CAP).
Retrieval Module (RE)
Unlike standard retrievers that query history based solely on the current dialogue context, RE employs a hierarchical transformer to predict the dense representation of the upcoming response. It then retrieves past user responses that best align with this predicted representation. The framework supports two distinct types of representations:
- Semantic: Focuses on content and topical relevance using Sentence-BERT.
- Style: Focuses on content-independent writing characteristics, such as punctuation habits and casing.
Context-Aware Prefix Encoder (CAP)
To fuse the retrieved history into the generator, CAP utilizes a two-step cross-attention mechanism. The model first attends to the current dialogue context and subsequently to the retrieved historical responses. This process compresses the relevant persona information into a continuous, fixed-length "prefix" vector. This prefix is then prepended to the hidden states of a pre-trained DialoGPT decoder, guiding the generation without requiring updates to the core model weights.
Experimental Setup
The performance of RECAP was evaluated using three diverse datasets:
- Pushshift Reddit Dataset: The primary training and evaluation corpus, partitioned by user to test the model's ability to generalize to unseen individuals.
- PANDORA Dataset: Used to evaluate how well generated text reflects self-reported personal traits (Age, Gender, MBTI personality types).
- Domain-Controlled Dataset: Utilized for Contrastive Authorship Verification (CAV) to determine if the model successfully mimics specific writing styles.
Key Results
RECAP significantly outperforms state-of-the-art baselines, including MSP (a hierarchical refiner model) and DHAP, across both automatic and human metrics.
Quantitative Performance
- General Quality: The
RECAP-semanticvariant achieved superior results in token-overlap and learning-based scores, reaching a BLEU-1 of 15.12 and a BERTScore of 0.4617, compared to MSP’s 12.95 and 0.4307, respectively. - Persona Consistency: The
RECAP-stylevariant proved most effective at mimicking user-specific traits, achieving a CAV accuracy of 64.14%. - Trait Prediction: Classifiers trained on the PANDORA dataset were more accurate at identifying the true traits of a user when analyzing responses generated by RECAP than those from baseline models.
Human Evaluation
Human annotators consistently ranked RECAP-semantic highest for fluency and coherency, while RECAP-style was preferred for its ability to maintain persona consistency.
Discussion and Insights
Our findings suggest that predictive retrieval is significantly more effective than context-only retrieval because it fetches history that informs the specific intent of the upcoming turn. Furthermore, the use of continuous prefixes via CAP acts as a "soft prompt," guiding the pre-trained decoder more smoothly than raw text tokens.
We also observed a clear trade-off between style and semantics: semantic retrieval excels at topical relevance, while style retrieval captures the unique "voice" of the user.
Limitations and Future Work
Currently, the hierarchical transformer retriever is trained from scratch on a relatively small dataset due to compute constraints. Pre-training this module on a larger corpus could further enhance performance. Additionally, while we experimented with a "mixed" fusion model, future work will focus on developing split encoders to better process and preserve the distinct signals provided by style and semantic retrievers simultaneously.
Conclusion
RECAP introduces a robust framework for personalized dialogue generation by combining predictive retrieval with context-aware prefix tuning. By effectively bridging the gap between historical context and generative modeling, RECAP moves us closer to chatbots that are not only fluent but also consistently aligned with a user's unique identity.
Summary updated