Personalized Retrieval-Augmented Generation (RAG) relies on accurately selecting user-relevant documents. In practice, existing RAG approaches often suffer from high retrieval costs and overlook that collaborative signals from similar users can enhance personalized generation for the current user. We propose ClusterRAG, a Cluster-Based Collaborative Filtering for Personalized Retrieval-Augmented Generation. ClusterRAG represents users through their profile documents, organizes users into semantically coherent clusters using density-based clustering, and performs retrieval at both the cluster and document levels via cluster-level similarity and fine-grained ranking. Extensive experiments on the LaMP benchmark demonstrate that jointly leveraging the target user's profile and profiles from top similar users consistently yields the best performance across diverse tasks. Further analysis shows that ClusterRAG integrates seamlessly with different dense retrievers and rankers, and remains effective when paired with both fine-tuned and zero-shot language models.
Figures & tables
Figure 1: Overview of the ClusterRAG framework.
Task
#users
#train
#dev
#test
LaMP-1
6542
6542
1500
1500
LaMP-2
929
5073
1410
1557
LaMP-3
20000
20000
2500
2500
LaMP-4
1643
12500
1500
1800
LaMP-5
14682
14682
1500
1500
LaMP-7
13437
13437
1498
1500
Table 1: Statistics of the LaMP benchmark with time-based data split.
Models
LaMP-1
LaMP-2
LaMP-3
LaMP-4
LaMP-5
LaMP-7
Acc. ↑
F1 ↑
Acc. ↑
F1 ↑
MAE ↓
RMSE ↓
R-1 ↑
R-L ↑
R-1 ↑
R-L ↑
R-1 ↑
R-L ↑
vanillaRAG
0.630
0.630
0.520
0.440
0.371
0.709
0.171
0.154
0.462
0.413
0.310
0.273
LaMP-IPA
0.674
0.664
0.570
0.522
0.289
0.608
0.175
0.169
0.472
0.423
0.508
0.457
ROPG
0.644
0.322
0.468
0.031
0.346
0.692
0.184
0.163
0.464
0.396
0.353
0.288
CFRAG
0.633
0.327
0.534
0.036
0.354
0.707
0.162
0.141
0.473
0.425
0.375
0.306
ClusterRAG-C
0.674 ∗
0.673 ∗
0.644
0.607
0.284
0.624
0.179
0.157
0.480 ∗
0.430 ∗
0.507
0.454
Table 2: Comparison of the performance of ClusterRAG with baselines on the LaMP benchmark. Best results are shown in bold and second-best in underlined ; boldface indicates statistically significant improvements over the second-best ( p<0.05 ). The symbol ∗ denotes the second-best ClusterRAG variant.
Retrievers
LaMP-1
LaMP-2
LaMP-7
Acc. ↑
F1 ↑
Acc. ↑
F1 ↑
R-1 ↑
R-L ↑
Random
0.640
0.639
0.609
0.608
0.500
0.449
Recency
0.659
0.650
0.618
0.610
0.507
0.456
BM25
0.662
0.658
0.629
0.621
0.510
0.460
Contriever
0.681
0.681
0.649
0.623
0.511
0.459
BGE
0.684
0.682
0.658
0.613
0.509
0.461
Table 3: Comparison of the performance of ClusterRAG under different retrievers on LaMP-(1,2,7).
Figure 2: Retrivers’ ROGUE-1 scores on LaMP-5.
LLMs
LaMP-1
LaMP-2
LaMP-5
Acc. ↑
F1 ↑
Acc. ↑
F1 ↑
R-1 ↑
R-L ↑
nFlan
0.546
0.540
0.451
0.448
0.431
0.398
pFlan
0.648
0.647
0.601
0.601
0.484
0.432
nQwen2
0.602
0.600
0.521
0.521
0.457
0.419
pQwen2
0.639
0.635
0.610
0.606
0.488
0.447
Table 4: Performance comparison of ClusterRAG using different LLMs on LaMP-(1,2,5).
Derivatives
LaMP-3
LaMP-7
MAE ↓
RMSE ↓
R-1 ↑
R-L ↑
w/o user clustering
0.320
0.637
0.458
0.371
w/o intra-cluster sim
0.329
0.639
0.501
0.442
w/o doc ranking
0.331
0.642
0.462
0.413
Centroids only
0.400
0.643
0.472
0.438
k -means
0.291
0.610
0.502
0.453
Table 5: Ablation study of ClusterRAG on LaMP-(3,7).
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Task
#users
#train
#dev
#test
Input Length
Output Length
#Profile Size
#classes
LaMP-1
6542
6542
1500
1500
51.43 ± 5.70
–
84.15 ± 47.54
2
LaMP-2
929
5073
1410
1557
92.39 ± 21.95
–
86.76 ± 189.52
15
LaMP-3
20000
20000
2500
2500
128.18 ± 146.25
–
185.40 ± 129.30
5
LaMP-4
1643
12500
1500
1800
29.97 ± 12.09
10.07 ± 3.10
204.59 ± 250.75
–
LaMP-5
14682
14682
1500
1500
162.34 ± 65.63
9.71 ± 3.21
87.88 ± 53.63
–
LaMP-7
13437
13437
1498
1500
29.72 ± 7.01
16.96 ± 5.67
15.71 ± 14.86
–
Appendix
Table 6: Detailed statistics of the LaMP benchmark with time-based data split.
Hyperparameter
Tested values
Learning rate
5 ×10−5 , 3×10−3 , 10−3 , 10−4
Weight decay
5 ×10−6 , 10 -4 , 10−3
Warm-up ratio
0.05 to 0.10
Batch size
8, 16, 32, 64
Epochs
10, 20 30, 50, 70, 100
Max seq length
64, 128, 256, 512
Appendix
Table 7: Hyperparameter tuning grid used for training and optimizing ClusterRAG.
k value
LaMP-1
LaMP-2
LaMP-3
LaMP-4
LaMP-5
LaMP-7
Acc. ↑
F1 ↑
Acc. ↑
F1 ↑
MAE ↓
RMSE ↓
R-1 ↑
R-L ↑
R-1 ↑
R-L ↑
R-1 ↑
R-L ↑
1
0.690
0.690
0.661
0.620
0.270
0.594
0.190
0.176
0.490
0.440
0.521
0.470
2
0.692
0.697
0.665
0.631
0.269
0.582
0.193
0.179
0.496
0.444
0.524
0.469
3
0.700
0.700
0.668
0.642
0.270
0.595
0.196
0.180
0.495
0.445
0.528
0.468
4
0.690
0.688
0.660
0.621
0.272
0.595
0.192
0.178
0.497
0.441
0.523
0.469
5
0.689
0.690
0.658
0.619
0.273
0.596
0.191
0.177
0.492
0.438
0.521
0.467
Appendix
Table 8: Effect of the number of similar users ( k ) on ClusterRAG performance in hybrid mode across LaMP tasks.
m value
LaMP-1
LaMP-2
LaMP-3
LaMP-4
LaMP-5
LaMP-7
Acc. ↑
F1 ↑
Acc. ↑
F1 ↑
MAE ↓
RMSE ↓
R-1 ↑
R-L ↑
R-1 ↑
R-L ↑
R-1 ↑
R-L ↑
1
0.674
0.673
0.648
0.612
0.289
0.608
0.182
0.166
0.480
0.431
0.515
0.464
2
0.690
0.690
0.661
0.620
0.270
0.594
0.190
0.176
0.490
0.440
0.521
0.470
3
0.691
0.691
0.665
0.632
0.269
0.591
0.191
0.178
0.501
0.465
0.528
0.474
4
0.693
0.692
0.669
0.639
0.268
0.590
0.196
0.179
0.510
0.471
0.530
0.473
5
0.695
0.695
0.675
0.650
0.267
0.586
0.198
0.180
0.512
0.473
0.533
0.475
Appendix
Table 9: Effect of the number of retrieved profile documents ( m ) on ClusterRAG performance in hybrid mode across LaMP tasks.
Task
HDBSCAN Score
k -means Score
LaMP-1
0.601
0.389
LaMP-2
0.535
0.326
LaMP-3
0.551
0.328
LaMP-4
0.570
0.274
LaMP-5
0.562
0.347
LaMP-7
0.537
0.323
Appendix
Table 10: Silhouette scores of user clusters produced by ClusterRAG using HDBSCAN and k -means on the LaMP benchmark.
User Query:
Movie description : When the Davison family comes under attack during their wedding anniversary getaway, the gang of mysterious killers soon learns that one of their victims harbors a secret talent for fighting back.
Gold Output: Violence
Target User Profile:
(1) Movie tag : “twist ending”, Movie description : “Soon after his insufferably arrogant father wins the Nobel Prize for chemistry, Barkley Michaelson is kidnapped by Thaddeus James, a young genius who claims to be Barkley’s illegitimate half-brother. Motivated not so much by money as revenge, Thaddeus tries to convince Barkley to help him carry out a multimillion-dollar extortion plot against their patriarch.”
(2) Movie tag : “action”, Movie description : “The Bride unwaveringly continues on her roaring rampage of revenge against the band of assassins who had tried to kill her and her unborn child. She visits each of her former associates one-by-one, checking off the victims on her Death List Five until there’s nothing left to do …but kill Bill.”
(3) Movie tag : “action”, Movie description : “NYPD cop John McClane’s plan to reconcile with his estranged wife is thrown for a serious loop when, minutes after he arrives at her office, the entire building is overtaken by a group of terrorists. With little help from the LAPD, wisecracking McClane sets out to single-handedly rescue the hostages and bring the bad guys down.”
Appendix
Table 11: A case study illustrating how ClusterRAG leverages user profile and similar-user information for personalized RAG.