Improving RAG for Personalization with Author Features and Contrastive Examples

Mert Yazan, Suzan Verberne, Frederik Situmeang

Abstract

Retrieval-Augmented Generation (RAG) is a common approach for personalizing Large Language Model (LLM) outputs, yet standard implementations often struggle to capture an author's unique stylistic essence, frequently defaulting to keyword mimicry. This paper explores two primary enhancements to the RAG pipeline: the extraction of explicit "Author Features" (AF) and the inclusion of "Contrastive Examples" (CE). By providing models with both high-level stylistic metadata and examples of dissimilar styles to serve as foils, we achieve a 15% relative improvement in performance on personalization benchmarks, often surpassing the efficacy of more computationally intensive fine-tuning methods.

Introduction

Personalizing text generation—ensuring an AI mimics a specific user's voice—is typically approached via two paths: parameter-efficient fine-tuning or RAG. While fine-tuning is resource-heavy, standard RAG often suffers from a "copy-paste" problem, where the model prioritizes specific topics or keywords from retrieved samples rather than the underlying stylistic patterns. This research introduces a method to provide LLMs with a "bird's-eye view" of an author's style without the overhead of custom training.

Methodology

The proposed framework enhances the standard RAG pipeline through two distinct mechanisms designed to sharpen the model's stylistic awareness.

1. Author Features (AF)

Rather than relying solely on raw text samples, the system extracts and injects specific metadata regarding the author's writing habits into the prompt. These features are categorized into:

  • Textual Features: These include the author's top 10 most frequent words, common named entities (people, places), and grammatical dependency patterns.
  • Numerical Features: These include quantitative metrics such as average sentiment, subjectivity scores, and readability indices (e.g., the SMOG index).

2. Contrastive Examples (CE)

To help the model distinguish what a specific style is not, the researchers introduced "hard negatives." The system identifies authors whose styles are most dissimilar to the target author and includes their samples in the prompt. This contrastive approach acts as a stylistic foil, allowing the LLM to better identify and replicate the unique nuances of the target author by seeing them in opposition to a different style.

Experimental Setup

The study utilized Gemma-2 27B as the primary generation engine and Contriever for retrieval. Evaluation was conducted using three subsets of the LaMP (Large Language Models Meet Personalization) benchmark:

  • LaMP-4 (News Headlines): Generating headlines based on article content.
  • LaMP-5 (Academic Titles): Creating titles for research abstracts.
  • LaMP-7 (Tweet Paraphrasing): Rewriting text while maintaining a specific user's social media voice.

Key Results and Analysis

Performance Gains

The combination of Author Features and Contrastive Examples resulted in a 15% relative improvement in Rouge-L scores compared to baseline RAG. Notably, this method allowed the system to surpass top-performing models on the LaMP-4 and LaMP-5 leaderboards, demonstrating that well-structured prompts can outperform specialized fine-tuning when user data is limited.

Textual vs. Numerical Reasoning

A significant finding was the model's preference for textual descriptors over numerical data. While word-based features (frequent words and grammar patterns) significantly boosted performance, numerical features (like sentiment scores) occasionally led to "over-polarization," where the model produced extreme outputs that lacked nuance.

Contextual Sensitivity

The effectiveness of specific features varied by domain. In informal settings like Twitter (LaMP-7), grammatical dependency patterns were the most impactful, increasing scores by over 10%. Conversely, in formal news editing (LaMP-4), specific vocabulary and frequent words proved more critical for stylistic accuracy.

Discussion and Limitations

While the contrastive RAG paradigm is highly efficient—adding virtually zero computational overhead during inference—it faces challenges regarding context window saturation. In datasets with long documents, such as academic abstracts, the inclusion of too many contrastive examples can clutter the context, leading to a loss of focus. Furthermore, the study highlights a persistent weakness in LLMs: the inability to accurately conceptualize abstract numerical differences (e.g., distinguishing between a 0.3 and 0.5 sentiment score) without natural language translation.

Conclusion

By integrating explicit stylistic features and contrastive foils, RAG systems can move beyond simple keyword matching toward true stylistic mimicry. This approach offers a scalable, efficient alternative to fine-tuning for personalized applications, with potential implications for broader tasks such as fact-distinction in general question-answering.

Summary updated

BibTeX
@inproceedings{yazan2025improving,
  author = {Mert Yazan and Suzan Verberne and Frederik Situmeang},
  title = {{Improving RAG for Personalization with Author Features and Contrastive Examples}},
  booktitle = {ECIR},
  year = {2025},
  doi = {10.1007/978-3-031-88714-7\_40},
}
Figure