Source-linked AI summary
MR.Rec: Synergizing Memory and Reasoning for Personalized Recommendation Assistant with LLMs
Jiani Huang, Xingchen Zou, Lianghao Xia, Qing Li
TL;DR
LLM-based recommendation assistants face challenges in personalization and reasoning, including limited context windows and constrained memory exploration. MR.Rec combines hierarchical external memory, reasoning-enhanced retrieval, and reinforcement learning; experiments report consistent outperformance of state-of-the-art baselines in personalization and reasoning capability.
Problem
LLM-based recommendation assistants have limited ability to retain user preferences and reason effectively, while context windows and irrelevant information constrain personalization.
Source: §1 · pp. 1–2Method
MR.Rec combines hierarchical RAG memory, reasoning-enhanced retrieval, and reinforcement learning to train adaptive memory use and reasoning refinement.
Source: §1 · p. 2, §3.1 · p. 3Results
Takeaways & Limitations
MR.Rec is presented as a step toward intelligent, user-centered recommendation assistants.
Source: §5 · p. 8
Abstract
from arXiv · showhide
The application of Large Language Models (LLMs) in recommender systems faces key challenges in delivering deep personalization and intelligent reasoning, especially for interactive scenarios. Current methods are often constrained by limited context windows and single-turn reasoning, hindering their ability to capture dynamic user preferences and proactively reason over recommendation contexts. To address these limitations, we propose MR.Rec, a novel framework that synergizes memory and reasoning for LLM-based recommendations. To achieve personalization, we develop a comprehensive Retrieval-Augmented Generation (RAG) system that efficiently indexes and retrieves relevant external memory to enhance LLM personalization capabilities. Furthermore, to enable the synergy between memory and reasoning, our RAG system goes beyond conventional query-based retrieval by integrating reasoning enhanced memory retrieval. Finally, we design a reinforcement learning framework that trains the LLM to autonomously learn effective strategies for both memory utilization and reasoning refinement. By combining dynamic memory retrieval with adaptive reasoning, this approach ensures more accurate, context-aware, and highly personalized recommendations. Extensive experiments demonstrate that MR.Rec significantly outperforms state-of-the-art baselines across multiple metrics, validating its efficacy in delivering intelligent and personalized recommendations. We will release code and data upon paper notification.
1 Introduction
The introduction motivates MR.Rec as a way to combine persistent, relevant user memory with multi-step reasoning for personalized recommendation assistants. It presents hierarchical retrieval and reinforcement learning as the framework’s core components and reports that MR.Rec outperforms state-of-the-art baselines.
1 Introduction
- Conversational recommendation assistants must interpret natural-language requests, whereas traditional recommenders rely on interaction signals and cannot interpret such inputs.Source: §1 · p. 1
- LLM-based personalization methods may be constrained by context windows and can supply irrelevant or noisy information that distracts recommendation generation.Source: §1 · pp. 1–2
- Existing reasoning methods generally limit LLMs to pre-defined prompt information, without actively exploring useful memories for the current recommendation.The introduction argues this decoupling restricts shallow reasoning and coherent use of stored memory.Source: §1 · p. 2
- MR.Rec combines hierarchical external memory, reasoning-enhanced retrieval, and reinforcement learning for adaptive memory use and reasoning refinement.Local memory captures user-specific information at multiple granularities, while global memory aggregates cross-user knowledge.Source: §1 · p. 2
- MR.Rec outperforms state-of-the-art baselines, supporting its efficacy for intelligent, personalized recommendations.Source: §1 · p. 2
2 Preliminary
The preliminary section defines recommendation memory as a structured representation of interaction histories and frames recommendation as reasoning over a query and memory before retrieving items. It also characterizes reasoning as a trajectory from query understanding through memory analysis to recommendation justification.
2 Preliminary
- A memory function transforms each user’s interaction history into structured memory, such as embeddings, textual summaries, or hybrid structures for retrieval.Source: §2 · p. 2
- Recommendation reasoning is framed as a trajectory from query understanding through memory analysis to a justified final recommendation.Source: §2 · p. 2
- The system uses the query and memory to generate an ideal item profile, retrieves top-k items by metadata similarity, and jointly optimizes memory use and reasoning parameters.Source: §2 · p. 2
3 Methodology
MR.Rec combines hierarchical external memory, reasoning-guided retrieval and reinforcement learning to support personalized recommendation. Its method uses local and cross-user memories, iteratively retrieves relevant information, and trains the model to refine memory use and reasoning.
3.1 Memory Indexing for RAG Recommender
- Hierarchical RAG indexes external recommendation memory to address context limits, noisy histories, and the need for both user-specific and cross-user knowledge.The framework organizes this information into complementary memory structures for retrieval.Source: §3.1 · p. 3
3.1.1 User-specific Local Memory.
- Local memory organizes user histories into behavior records, category-specific preference patterns, and a cross-category profile, then chunks summaries for selective retrieval.Raw histories can exceed context windows, obscure long-term preferences, and include behavior irrelevant to the current recommendation.Source: §3.1.1 · p. 3
3.1.2 Cross-User Global Memory.
- Cross-user global memory captures shared decision factors by organizing scenario-level recommendation experiences, with unchosen items providing contrasts for identifying decision criteria.The paper gives baby-product factors such as safety certifications, ergonomic design, and age-appropriate features as an example.Source: §3.1.2 · pp. 3–4
3.2.1 Reasoning-enhanced Memory Retrieval.
- Reasoning-enhanced retrieval uses global memory to infer unstated preference aspects, then uses those aspects to select relevant segments from the user’s local memory.This is intended to address the limits of static retrieval based only on surface-level query similarity.Source: §3.2.1 · p. 4
3.2.2 Retrieval-Augmented Item Generation.
- The LLM integrates the query, inferred aspects, and retrieved memories to generate an ideal item profile aligned with the query and personalized preferences.The framework treats local and global memory as active resources that evolve with reasoning.Source: §3.2.2 · p. 4
3.2.3 Enhancing Reasoning with Memory Retrieval.
- Unlike static chain-of-thought or prompt-based inference, the method interleaves reasoning and memory retrieval so the LLM can explore relevant information during inference.The LLM iteratively identifies preference dimensions and retrieves entries to refine its understanding; this process can be jointly optimized.Source: §3.2.3 · p. 4
3.3 Reinforcement Learning for Memory-synergized Reasoning
- Multi-turn reinforcement learning trains the LLM through iterative interactions and verifiable feedback, using format, recommendation-quality, and memory-utilization rewards.The recommendation reward combines nDCG@1000, which mitigates reward sparsity, and nDCG@100, which emphasizes fine-grained ranking among top candidates; retrieved memory tokens are masked during advantage estimation.Source: §3.3 · pp. 4–5
4 Experiments
The experiments assess MR.Rec against recommendation baselines, test its memory and RL components, and examine memory effectiveness, efficiency, and configuration sensitivity. Results favor dynamic, reasoning-enhanced memory and RL tuning, with a case study illustrating personalized retrieval.
4.1.1 Datasets.
- Experiments use simplified Amazon-C4 queries, compare general and recommendation-tuned models under three memory settings, and evaluate ranking metrics.Prior work spans interaction histories, user profiles, and CoT or GRPO reasoning; MR.Rec combines hierarchical memory with reasoning-enhanced retrieval.Source: §4.1.1 · p. 5, §4.1.2 · p. 5, §4.1.3 · p. 5
4.2 Overall Performance (RQ1)
- MR.Rec consistently outperforms baselines with and without memory, while dynamic retrieval with reasoning provides gains across scenarios.The comparison covers averages across 28 product categories.Source: §4.2 · pp. 5–6, Table 1 · p. 6
4.3.1 Effect of Key Components.
- Removing local or global memory harms performance, and removing RL tuning hurts more; combining Behavior Records, Preference Patterns, and User Profile performs best.Any one local-memory component improves over removing the full local-memory mechanism.Source: §4.3.1 · p. 6, §4.3.2 · p. 6, Figure 3 · p. 6
4.4 Memory Effectiveness Study (RQ3)
- Both memory types aid ideal-profile generation; Local Memory scores higher under LLM-judged MRC despite modest heuristic overlap, while Global Memory has stronger heuristic MRC.MPC measures support for generating ideal item profiles; MRC measures contribution to the final correct recommendation.Source: §4.4 · pp. 6–7, Table 3 · p. 7
4.5 Efficiency Study (RQ4)
- 95.43 tokens yields 0.299 R@100/100 tokens, the highest R@100; global-memory indexing uses roughly 1/1000 the tokens of local-memory indexing.Indexing takes 0.07s per local entry and 0.06s per global entry.Source: §4.5 · p. 7, Table 4 · p. 7
4.6.1 Impact of LLM Backbones.
- Instruct starts with memory and format rewards; Base learns formatting and improves Recall@100 but remains near-zero on memory reward, relying on direct recommendations.Both backbones undergo MR.Rec’s RL tuning, but only Instruct had prior instruction tuning and RLHF.Source: Figure 4 · p. 7, §4.6.1 · p. 7
4.6.2 Impact of Base Retrievers.
- Qwen3-Embedding-0.6B performs best, while BM25 lags dense retrievers; retrieval differences widen at higher k, and k=3 balances memory coverage against noise.Larger k can add noise and extend the context window, potentially degrading performance.Source: §4.6.2 · p. 7, §4.6.3 · pp. 7–8, Figure 5 · p. 7
4.7 Case Study
- For a post-winter cap query, MR.Rec retrieves leather and adjustable-item preferences and recommends a leather patch adjustable snapback matching the ground truth.GPT-4o instead gives a generic response focused on seasonal suitability.Source: §4.7 · p. 8, Figure 7 · p. 8
5 Conclusion
MR.Rec combines RAG-based external memory with reinforcement learning to support memory use and multi-step reasoning in recommendation. Experiments on multiple benchmark datasets show consistent outperformance of state-of-the-art baselines in personalization and reasoning capability.
5 Conclusion
- MR.Rec combines RAG-based external memory with reinforcement learning to select useful preferences and experiences during multi-step recommendation reasoning.The framework has the LLM explore and select information from retrieved memory.Source: §5 · p. 8
- Across multiple benchmark datasets, MR.Rec consistently outperforms state-of-the-art baselines in personalization and reasoning capability.Source: §5 · p. 8
- The paper presents MR.Rec as a step toward intelligent, user-centered recommendation assistants.Source: §5 · p. 8
Prompt Template for Pre-processing Queries
The preprocessing prompt rewrites detailed product requests as casual questions retaining one core item and use case. The example removes brand and model specifics while preserving the request for a reliable, smoothly playing external Blu-ray drive.
Prompt Template for Pre-processing Queries
- The prompt retains one core item and use case while deleting other details, including brand, specifications, and price.Source: Prompt Template for Pre-processing… · p. 10
- It asks for a single natural, conversational sentence that restates the request.Source: Prompt Template for Pre-processing… · p. 10
- The Blu-ray example preserves the need for reliable reading and smooth playback while omitting the Pioneer model and other detailed context.Source: Prompt Template for Pre-processing… · p. 10
A Dataset
The authors preprocess Amazon-C4 queries to better resemble concise, high-level requests that rely on prior interactions or stored memories. They mask overly specific details, retain core intent and constraints, and apply the procedure to a sampled subset.
A Dataset
- Amazon-C4 contains ChatGPT-synthesized user queries derived from product review text, often with fine-grained product details uncommon in real-world utterances.Source: A Dataset · p. 10
- Preprocessing masks brand names, identifiers, serial numbers, and verbatim review excerpts while preserving product category, coarse price band, and primary use case.GPT-o3-mini produces concise, naturalistic rewrites that retain original intent and constraints.Source: A Dataset · p. 10
- Because API resources were limited, the authors randomly sampled 6,096 Amazon-C4 queries for preprocessing.The processed dataset is described as computationally manageable while retaining characteristics needed for the experiments.Source: A Dataset · p. 10
B.1 Environment
The appendix reports the experimental computing environment and the query-expansion prompt used for LLM-based baselines. The prompt expands customer queries with semantically relevant information for dense retrieval, while leaving them unchanged when expansion is unnecessary.
B.1 Environment
- Experiments used four NVIDIA A800 (80GB) GPUs, PyTorch 2.6.0, Transformers 4.48.0, VeRL's GRPO implementation, and SgLang 0.4.6 for inference acceleration.Source: §B.1 · p. 10
B.2 Prompts for LLM-based Baselines
- All baselines except BLAIR are LLM-based.Source: §B.2 · p. 10
- The baseline prompt asks an LLM to expand a customer query with semantically relevant information for dense retrieval, or return it unchanged if expansion is unnecessary.Source: §B.2 · p. 10
B.3 Details for Our Method
The implementation uses one retrieval encoder for both memory and item retrieval, alongside specified reinforcement-learning and trajectory-generation settings.
- Qwen3-Embedding-0.6B encodes both memory retrieval and item retrieval.Source: §B.3 · p. 10
- The reinforcement-learning learning rate is set to 1e5 with a batch size of 256.Source: §B.3 · p. 10
- Trajectory generation uses group size G = 5 and rollout temperature 1.0.Source: §B.3 · p. 10
C Prompts Used in Our Method
The prompts describe how MR.Rec constructs global and user-specific memories, then uses retrieved memories to reason about recommendations. They also specify how preference patterns and user profiles are extracted and summarized.
C.1.1 Cross-User Global Memory
- Global-memory construction samples multi-user histories and uses queries, purchased items, metadata, and similar unchosen items to infer additional recommendation aspects.The prompts ask the LLM to analyze the query, purchase, and negative items for aspects beyond the explicit request.Source: §C.1.1 · pp. 10–11
- The prompts distinguish general category-level factors from subcategory-specific factors and request structured aspect descriptions.Examples include budget and brand at category level, and product features or trade-offs at subcategory level.Source: §C.1.1 · p. 11
- Extracted knowledge from multiple users is aggregated into a concise, coherent summary of common recommendation considerations for the scenario.Source: §C.1.1 · p. 11
C.1.2 User-specific Local Memory
- User-specific local memory progresses from Behavior Records to Preference Patterns and then a distilled User Profile.Preference Patterns capture recurring behaviors, interests, and implicit constraints from scenario-specific histories; profiles consolidate preferences across scenarios.Source: §C.1.2 · p. 11
C.2 Prompts for LLM-based Recommendation
- The global-memory consolidation prompt merges overlapping aspects, standardizes names, and de-duplicates descriptions into a compact JSON mapping.Source: §C.2 · p. 12
- For recommendation, the LLM uses query-relevant global memory to guide retrieval of local memories, then reasons over the query and retrieved memories to form an ideal item profile.The prompt returns the ideal item profile and useful memory IDs; retrieved memory is then used for personalized recommendations.Source: §C.2 · pp. 11–12
- The Preference Patterns prompt summarizes consistent preferences from a user’s category-specific purchased items, metadata, and reviews without fabricating unsupported information.Source: §C.2 · p. 12
- The User Profile prompt infers an overall profile from preference patterns across categories or aspects, while restricting it to supported traits and tendencies.Source: §C.2 · p. 12