# Reinforced Prompt Personalization for Recommendation with Large Language Models

대규모 언어 모델을 활용한 추천을 위한 강화 학습 기반 프롬프트 개인화

Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He · arXiv · 2024년 7월 24일

- **연구 문제** 추천용 LLM 프롬프트가 모든 사용자에게 같은 고정 템플릿을 쓰면 사용자별 취향 차이를 놓쳐 성능이 떨어질 수 있습니다.
- **연구 방법** RPP는 프롬프트를 네 패턴의 문장으로 나누고, 패턴별 Actor-Critic 에이전트가 사용자별 문장을 골라 LLM 순위 출력의 NDCG를 보상으로 학습합니다.
- **주요 결과** LLaMa2-7B-chat을 고정한 ML-1M, Games, Lastfm 순위 실험에서 RPP와 RPP+는 수동 프롬프트와 열거 기준선보다 높은 NDCG를 보고했습니다. 이 결과는 실험한 데이터셋과 LLM 설정 범위에서 읽어야 합니다.

## 과제별 고정 프롬프트의 한계

대규모 언어 모델(LLM)을 추천에 쓸 때 기존 연구는 주로 과제별 고정 프롬프트를 사용합니다. 이 방식은 평점 예측이나 순위 매기기 같은 과제마다 하나의 템플릿을 정하고, 그 템플릿을 모든 사용자에게 똑같이 적용합니다. 원문은 이를 task-wise prompting이라고 부르며, 사용자마다 다른 관심사와 이력의 길이를 반영하지 못해 추천 정확도를 떨어뜨릴 수 있다고 주장합니다. 예를 들어 어떤 사용자는 최근 두 편의 영화만으로 취향이 드러나지만, 다른 사용자는 열 편의 이력을 보아야 취향이 드러납니다. 고정된 길이의 이력을 지시하는 프롬프트는 이런 차이를 놓칩니다.

또한 원문은 LLM의 성능이 프롬프트 표현에 민감하다는 선행 연구를 인용합니다. 따라서 이 논문은 사용자별로 프롬프트를 맞추는 instance-wise prompting을 문제로 설정합니다. 다만 사용자별 프롬프트를 사람이 직접 만들거나 휴리스틱으로 짜면 비용이 크고, 지도 학습은 최적 프롬프트의 정답 레이블이 없어 신뢰하기 어렵다고 원문은 설명합니다.

## 문장 단위 행동 선택으로 프롬프트 구성하기

RPP는 프롬프트를 역할 지정(role-playing), 이력 기록(history records), 추론 지침(reasoning guidance), 출력 형식(output format)의 네 패턴으로 나눕니다. 각 패턴마다 여러 문장 후보를 행동 집합으로 두고, 패턴별 에이전트가 그중 하나의 문장을 고릅니다. 선택된 네 문장을 이어 붙이면 사용자별 프롬프트 p\_t가 됩니다. 토큰 단위로 어휘를 탐색하지 않고 문장 단위로 탐색하므로 탐색 공간을 줄이는 것이 핵심입니다.

이 과정은 마르코프 결정 과정(MDP)으로 정식화됩니다. 상태 s\_t는 현재 프롬프트와 LLM의 순위 출력 o\_t로 구성되며, 사용자 초기 상태 s\_0는 LightGCN 같은 전통 추천 모델에서 얻은 사용자와 항목의 ID 기반 임베딩으로 만듭니다. 상태의 프롬프트는 BERT로, 순위 출력은 GRU로 인코딩한 뒤 더합니다. 보상은 LLM의 순위 출력에 대한 NDCG@M으로 정의되며, 원문에서 M은 후보 수이고 실험에서는 10으로 설정되었습니다. 즉 보상 r\_t = NDCG@M(o\_t)이며, 미래 보상의 할인합과 가치 함수를 이용해 Actor와 Critic을 학습합니다.

## 패턴별 에이전트와 학습 절차

RPP는 네 개의 Advantage Actor-Critic 에이전트를 사용하며, 이를 중앙 학습·분산 실행(CTDE) 패러다임으로 묶습니다. 각 에이전트는 자신의 패턴에 해당하는 행동 집합에서 행동을 고르는 정책 네트워크를 가지고, 모든 에이전트가 같은 전역 상태에 접근합니다. 원문은 패턴마다 필요한 전문성이 다르므로 에이전트를 나눈다고 설명합니다.

![Figure 2: The framework of our proposed RPP/RPP+. MARL serves as the core component to personalize instance-wise prompts with four distinct patterns, using cor…](https://refivu.com/papers/27afc2ea-b641-4b86-8888-206972777f90/figures/figure-d1e084ec4431720977527277bf3222ae.png?thumb=512)

**Fig. 2** . The framework of our proposed RPP/RPP+. MARL serves as the core component to personalize instance-wise prompts with four distinct patterns, using corresponding agents. It is trained iteratively to maximize rewards based on the outputs of the frozen LLM-based recommender. Once trained, MARL can select optimal actions from four patterns to generate personalized prompts for each user based on their data, effectively prompting the LLM-based recommender for tailored recommendations. In addition to RPP, the “Refine” block is designed for RPP+ to enhance the flexibility and quality of the selected actions, utilizing other LLMs to dynamically refine the selected actions before prompting the LLM-based recommender.

[원문](https://arxiv.org/abs/2407.17115v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He · Reinforced Prompt Personalization for Recommendation with Large Language Models · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.

학습 중에는 생성된 프롬프트가 고정된 LLM 추천기에 입력되고, 그 출력으로부터 계산된 NDCG가 보상이 됩니다. 원문 알고리즘에 따르면 각 반복에서 네 에이전트가 행동과 가치를 산출한 뒤 프롬프트를 만들고, LLM 출력을 받아 상태와 보상을 갱신하고 나서 Actor와 Critic 파라미터를 갱신합니다. RPP+는 여기에 refine 블록을 더해, 선택된 행동 문장을 다른 LLM으로 정제한 뒤 프롬프트를 구성합니다. 따라서 RPP+는 반복마다 추가 LLM 호출 비용을 지불합니다.

## 검증 설정과 전체 비교

주요 실험은 MovieLens-1M, Games, Lastfm의 세 데이터셋에서 순위 과제로 수행되었습니다. 주 실험의 frozen LLM은 LLaMa2-7B-chat이며, 평가 지표는 NDCG@1, NDCG@5, NDCG@10입니다. 비교 대상은 Pop, BPRMF, LightGCN, SASRec 같은 전통 추천 모델, BM25, VQ-Rec, UniSRec 같은 few-shot 방법, 그리고 수동 프롬프트, 열거(Enumeration), GRIPS 같은 프롬프트 기반 방법입니다. 원문은 RPP와 RPP+ 결과를 최소 다섯 번 반복한 평균과 표준편차로 보고합니다.

![Table 1: Statistics of datasets](https://refivu.com/papers/27afc2ea-b641-4b86-8888-206972777f90/figures/figure-8373ff7327644810d277dd12198f2764.png?thumb=512)

**Table 1** . Statistics of datasets.

[원문](https://arxiv.org/abs/2407.17115v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He · Reinforced Prompt Personalization for Recommendation with Large Language Models · 원문 그림 인용 · 원본 PDF 11쪽에서 그림 영역을 추출했습니다.

표 2에서 RPP는 ML-1M의 N@10에서 0.87±0.02를 기록했고, RPP+는 같은 지표에서 0.87±0.01을 기록했습니다. 원문은 과제별 프롬프트 기준인 Enumeration 대비 개선을 Improvement로 표시하며, RPP는 ML-1M에서 SASRec 대비 NDCG@1에서 0.14 개선되었다고 설명합니다. 이 결과는 LLaMa2-7B-chat을 고정한 설정에서 얻은 것입니다.

![Table 2: Performance comparison of our framework on LLaMa2-7B-chat with baselines across diverse datasets. The results of the best-performing baseline are deno…](https://refivu.com/papers/27afc2ea-b641-4b86-8888-206972777f90/figures/figure-f18d55e9379f3a1b7915f68c6741b936.png?thumb=512)

**Table 2** . Performance comparison of our framework on LLaMa2-7B-chat with baselines across diverse datasets. The results of the best-performing baseline are denoted with an underline. The results of our method which outperform other prompt-based methods are indicated with↑, while those that surpass the best-performing baseline are highlighted in red. The performance improvement of RPP/RPP+ compared with the best-performing task-wise prompting method (i.e., Enumeration) is listed in the “improvement”.

[원문](https://arxiv.org/abs/2407.17115v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He · Reinforced Prompt Personalization for Recommendation with Large Language Models · 원문 그림 인용 · 원본 PDF 13쪽에서 그림 영역을 추출했습니다.

## 여러 frozen LLM에서의 일반화

원문은 RPP/RPP+의 일반화를 확인하기 위해 LLaMa2-7B-chat, ChatGPT(GPT-3.5-turbo API, 온도 0.2), Alpaca를 비교합니다. Alpaca는 LLaMa2-7B를 기반으로 LoRA를 사용해 순위 과제의 지시 데이터로 미세 조정된 모델로, 원문은 이를 고정된 LLM으로 취급합니다. 따라서 이 실험에서 fine-tuning은 Alpaca를 준비하는 단계이며, RPP 자체의 프롬프트 학습과 구분됩니다.

표 4에서 원문은 RPP가 Lastfm에서 Enumeration보다 LLaMa2-7B-chat, ChatGPT, Alpaca에서 NDCG@10을 각각 0.48, 0.24, 0.53 더 높게 기록했다고 보고합니다. 저자들은 ChatGPT에서 향상 폭이 작은 이유를 프롬프트에 대한 강건성 때문일 수 있다고 해석합니다. 이 해석은 저자의 가설이며, 원문이 그 원인을 직접 실험으로 확인한 것은 아닙니다.

![Table 4: Performance of RPP and RPP+ on diverse frozen LLMs. The results of our framework which outperform other prompt-based baselines are indicated with↑, an…](https://refivu.com/papers/27afc2ea-b641-4b86-8888-206972777f90/figures/figure-2ed5e7b6c1d84d2bd24fa8ecc16df8e2.png?thumb=512)

**Table 4** . Performance of RPP and RPP+ on diverse frozen LLMs. The results of our framework which outperform other prompt-based baselines are indicated with↑, and the best-performing methods are highlighted in red. L, C, and A denote LLMs of LLaMa2-7B-chat, ChatGPT, and Alpaca, respectively.

[원문](https://arxiv.org/abs/2407.17115v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He · Reinforced Prompt Personalization for Recommendation with Large Language Models · 원문 그림 인용 · 원본 PDF 14쪽에서 그림 영역을 추출했습니다.

## 패턴별 개인화의 기여

절제 실험은 네 패턴 중 하나만 개인화하고 나머지는 고정하는 변형을 비교합니다. 원문은 이를 RPP와 RPP+ 각각에 대해 수행하며, 표 5와 표 6, 그림 3에 결과를 정리합니다. 원문은 reasoning guidance 패턴을 개인화하는 것이 다른 패턴보다 가장 큰 이득을 준다고 보고합니다. 저자들은 이를 추천의 해석 가능성과 사용자 선호 분석의 효과로 해석합니다.

![Table 5: Ablation study on the respective impacts of four patterns on RPP](https://refivu.com/papers/27afc2ea-b641-4b86-8888-206972777f90/figures/figure-3445c58788b76f15e6c0ff5c0b73f0aa.png?thumb=512)

**Table 5** . Ablation study on the respective impacts of four patterns on RPP.

[원문](https://arxiv.org/abs/2407.17115v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He · Reinforced Prompt Personalization for Recommendation with Large Language Models · 원문 그림 인용 · 원본 PDF 15쪽에서 그림 영역을 추출했습니다.

또한 원문은 역할 지정과 출력 형식의 개인화도 성능을 높이며, 이는 LLM이 프롬프트 표현에 민감하다는 사실과 맞는다고 설명합니다. 여기서 확인되는 것은 각 패턴을 유지하는 효용이며, 개별 패턴 제거가 모든 상황에서 성능을 낮춘다는 보편적 인과 증명은 아닙니다.

![Figure 3: The performance comparison between prompt-based methods and RPP/RPP+ with different patterns. “Manual”, “Enum”, and “GRIPS” represent the baseline pr…](https://refivu.com/papers/27afc2ea-b641-4b86-8888-206972777f90/figures/figure-829c231423751d943301db26dddd03f6.png?thumb=512)

**Fig. 3** . The performance comparison between prompt-based methods and RPP/RPP+ with different patterns. “Manual”, “Enum”, and “GRIPS” represent the baseline prompt-based methods. “RPP-Ro”, “RPP-Hi”, “RPP-Re”, and “RPP-Ou” are the 4 variations of RPP/RPP+ on “role-playing”, “history records”, “reasoning guidance”, and “output format” patterns, respectively.

[원문](https://arxiv.org/abs/2407.17115v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He · Reinforced Prompt Personalization for Recommendation with Large Language Models · 원문 그림 인용 · 원본 PDF 17쪽에서 그림 영역을 추출했습니다.

## 계산 비용과 적용 한계

원문은 RPP/RPP+가 반복 과정에서 LLM 호출을 필요로 하므로 일정 수준의 계산 자원이 필요하다고 밝힙니다. 또한 행동 집합을 설계하는 초기 단계에 사람의 개입이 일부 필요하다고 명시합니다. RPP+의 정제 단계는 성능을 조금 높일 수 있지만, 원문은 그 향상이 0.00에서 0.06 범위로 크지 않다고 보고하며 추가 LLM 정제 비용과 비교해야 한다고 설명합니다.

원문은 이 방법이 특정 데이터셋, 특정 frozen LLM, 특정 순위 과제에서 평가되었다고 제시합니다. 따라서 이 논문의 결과는 실험한 세 데이터셋과 LLM 설정 범위 안에서 읽어야 하며, 다른 과제나 모델에 대한 일반적 성능은 이 논문에서 확인되지 않았습니다.

## 논문 정보

- **저자**: Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2024년 7월 24일
- **등록일**: 2026년 11월 6일
- **수정일**: 2025년 2월 3일
- **버전**: v2
- **arXiv**: 2407.17115
- **분류**: cs.IR
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2407.17115v2) · [원문 PDF ↗](https://arxiv.org/pdf/2407.17115v2)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Designing effective prompts can empower LLMs to understand user preferences and provide recommendations with intent comprehension and knowledge utilization capabilities. Nevertheless, recent studies predominantly concentrate on task-wise prompting, developing fixed prompt templates shared across all users in a given recommendation task (e.g., rating or ranking). Although convenient, task-wise prompting overlooks individual user differences, leading to inaccurate analysis of user interests. In this work, we introduce the concept of instance-wise prompting, aiming at personalizing discrete prompts for individual users. Toward this end, we propose Reinforced Prompt Personalization (RPP) to realize it automatically. To improve efficiency and quality, RPP personalizes prompts at the sentence level rather than searching in the vast vocabulary word-by-word. Specifically, RPP breaks down the prompt into four patterns, tailoring patterns based on multi-agent and combining them. Then the personalized prompts interact with LLMs (environment) iteratively, to boost LLMs' recommending performance (reward). In addition to RPP, to improve the scalability of action space, our proposal of RPP+ dynamically refines the selected actions with LLMs throughout the iterative process. Extensive experiments on various datasets demonstrate the superiority of RPP/RPP+ over traditional recommender models, few-shot methods, and other prompt-based methods, underscoring the significance of instance-wise prompting in LLMs for recommendation. Our code is available at https://github.com/maowenyu-11/RPP.

## 원문 인용

Wenyu Mao, Jiancan Wu, Weijian Chen, Chongming Gao, Xiang Wang, Xiangnan He (2024). Reinforced Prompt Personalization for Recommendation with Large Language Models. arXiv:2407.17115v2. https://arxiv.org/abs/2407.17115v2

**BibTeX**

```
@misc{mao2024reinforced,
  title = {{Reinforced Prompt Personalization for Recommendation with Large Language Models}},
  author = {Wenyu Mao and Jiancan Wu and Weijian Chen and Chongming Gao and Xiang Wang and Xiangnan He},
  year = {2024},
  eprint = {2407.17115},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.17115v2}
}
```

## 이 논문의 용어

- [LoRA](https://refivu.com/terms/84da7a415b66-low-rank-adaptation-lora)
- [BERT](https://refivu.com/terms/45b639a1d317-bert)
- [Markov Decision Process](https://refivu.com/terms/5d622f56f22a-markov-decision-process)
- [ChatGPT](https://refivu.com/terms/96047648490a-chatgpt)
- [GRU](https://refivu.com/terms/911a73dfeb1f-gru)
- [Alpaca](https://refivu.com/terms/acd615a4ec0a-alpaca)
- [MRR](https://refivu.com/terms/3d251a2fd6a5-mrr)
- [MARL](https://refivu.com/terms/19d9f28e4c66-marl)
- [advantage actor-critic](https://refivu.com/terms/f395e3a3105a-advantage-actor-critic)
- [Normalized Discounted Cumulative Gain (NDCG)](https://refivu.com/terms/610b4eb465c4-normalized-discounted-cumulative-gain-ndcg)
- [SASRec](https://refivu.com/terms/482e2658027a-sasrec)
- [centralized training with decentralized execution](https://refivu.com/terms/64bb64ca7486-centralized-training-with-decentralized-execution)
- [LastFM](https://refivu.com/terms/e1fcc6d35e09-lastfm)
- [Llama2-7B-chat](https://refivu.com/terms/5eb353d36991-llama2-7b-chat)
- [MovieLens-1M](https://refivu.com/terms/f0b4540c496c-movielens-1m)

## 다른 논문 해설

- [Six Fallacies in Substituting Large Language Models for Human Participants](https://refivu.com/papers/bb0ec81c-502c-4c66-a26c-df852f429e31-six-fallacies-in-substituting-large-language-models-for.md)
- [An Evaluation of Estimative Uncertainty in Large Language Models](https://refivu.com/papers/0d144c86-50c2-4aaf-9bd1-8e8267322414-an-evaluation-of-estimative-uncertainty-in-large-language.md)
- [Neural-Symbolic Reasoning over Knowledge Graphs: A Survey from a Query Perspective](https://refivu.com/papers/2cb7aa05-57a6-4b7b-a866-31b731a266e3-neural-symbolic-reasoning-over-knowledge-graphs-a-survey.md)
- [LM4OPT: Unveiling the Potential of Large Language Models in Formulating Mathematical Optimization Problems](https://refivu.com/papers/e3faa29c-1a8c-4fee-ad1f-d7419f8d27d3-lm4opt-unveiling-the-potential-of-large-language-models.md)
- [Improving Image Captioning Descriptiveness by Ranking and LLM-based Fusion](https://refivu.com/papers/5a680b78-e0b1-4e51-abd2-03f537eb32a8-improving-image-captioning-descriptiveness-by-ranking-and.md)
- [Benchmarking Large Language Models for Handwritten Text Recognition](https://refivu.com/papers/ee660aba-9003-47fb-9ce3-3e89b7a41331-benchmarking-large-language-models-for-handwritten-text.md)
- [Masked Vision-Language Transformer in Fashion](https://refivu.com/papers/39eccadd-3753-47c1-9ac7-d525054ba0a4-masked-vision-language-transformer-in-fashion.md)
- [Artificial intelligence contribution to translation industry: looking back and forward](https://refivu.com/papers/bb8c5e97-6b4d-4494-8e95-7693f7754127-artificial-intelligence-contribution-to-translation-industry.md)
- [MSCoTDet: Language-driven Multi-modal Fusion for Improved Multispectral Pedestrian Detection](https://refivu.com/papers/a6c84909-767e-4c21-96d6-b2c2bf9a60ab-mscotdet-language-driven-multi-modal-fusion-for-improved.md)
- [How can voting mechanisms improve the robustness and generalizability of toponym disambiguation?](https://refivu.com/papers/a7f985d4-b48e-45bf-a161-9f846cdf21b1-how-can-voting-mechanisms-improve-the-robustness-and.md)
- [Kencorpus: A Kenyan Language Corpus of Swahili, Dholuo and Luhya for Natural Language Processing Tasks](https://refivu.com/papers/63ecaace-b12e-4c8f-8421-3ed079f7ba82-kencorpus-a-kenyan-language-corpus-of-swahili-dholuo.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/27afc2ea-b641-4b86-8888-206972777f90-reinforced-prompt-personalization-for-recommendation-with)
