Skip to content
Code

Recommendation agents · Reinforcement learning

SimRec

Learning to Search, Ask, and Recommend from Simulated Interaction

One tool-integrated policy decides when to retrieve, inspect, ask, and recommend, trained end to end with GRPO against a task-anchored simulated shopper.

Preprint · arXiv:2611.15426

The idea

Don’t script the recommender’s workflow. Train the whole interaction against a simulated shopper.

Typical recommender agent

A hand-written workflow

  1. search
  2. inspect
  3. recommend

The order of retrieval, inspection, clarification, and recommendation is fixed in advance.

SimRec

A learned interaction policy

  • search_products
  • get_item_details
  • get_user_preference
  • ask the shopper
  • recommend

At every turn one policy picks the next action, and it can revise after a rejection.

Recommendation agents can retrieve products, inspect their attributes, ask a shopper for clarification, and revise after rejection. In many systems the order of these actions is a hand-written workflow. SimRec trains the complete, tool-integrated interaction policy with GRPO: a task-anchored simulated shopper gives feedback during the interaction, and a trajectory-level reward credits natural retrieval, grounded tool use, and the final recommendation.

Method

One episode, from first request to policy update.

The agent searches, inspects, and asks; the shopper rejects and the agent revises; then GRPO learns from complete multi-turn trajectories.

simrec · episode replay

User tokens Rec tokens Observation Recommend

Multi-turn interaction

Rec agent UserSim agent
  1. Shopper · request

    I’m looking for a smart LED bulb.

  2. Rec · search search_products(query="smart LED bulb")
  3. Observation

    Ranked Top-100 results; the Top-20 are visible.

    • RGB colour smart LED bulb, item BX1MMKHTBX1MMKHT
    • Warm filament smart bulbFilament
    • Two-pack smart bulb box2-pack
    • LED light stripLight strip
    • +16more
  4. Rec · inspect get_item_details(item_id="BX1MMKHT")
  5. Observation
    RGB colour smart LED bulb, item BX1MMKHT

    Full grounded metadata: BX1MMKHT

    title
    brand
    price
  6. Rec · preference get_user_preference()
  7. Observation

    “The user prefers high-quality …”

  8. Rec · clarify

    asks the shopper a clarification question

  9. Shopper

    clarifies the request

  10. Rec · recommend
    RGB colour smart LED bulb, item BX1MMKHT recommended_item_id: … not in target set
  11. Shopper · feedback

    “No, I need dedicated white LEDs.”

  12. Rec · update & re-plan

    search again, inspect, consult preferences, or ask

  13. Rec · recommend
    Dedicated cool-white smart LED bulb recommended_item_id: … ✓ in target set
This trajectory as tokens

Recommendation tool suite

Product search search_products

SparseDenseHybrid
Retrieval index Product corpus title · brand · price

Item details get_item_details

Full grounded metadata for a selected product.

User preference get_user_preference

One-sentence preference profile Interaction history target removed, summarized once

The simulator sees the current need, recent dialogue, and the latest action, never the target item or the preference profile.

Task-aligned RL training

Rollouts of one task G = 8

outlined = optimized tokens; faded tokens are masked out. Observations are never optimized.

Trajectory reward

  • Rrecfinal Hit@1 and natural retrieval NDCG
  • Rtoolvalid search, inspection, and preference calls
  • Rfmtrecommendation formatting
  • −redundant queries, unnecessarily long interactions

Group-relative advantage: each rollout’s reward is compared with the others for the same task.

Policy update

Reference model frozen
KL penaltycoef 1e-3
Policy model trained
The recommendation agent interacts with a user simulator and external tools, while task-aligned GRPO optimizes complete multi-turn trajectories. The episode is the illustrative example from the paper figure.
Paper figure SimRec multi-turn interaction, recommendation tool suite, and task-aligned GRPO training overview

How it works

One policy chooses every action. Nothing fixes the order.

Each task contains an initial shopping request, a current task need, a target set used only by the environment, and optionally a history-derived preference summary. At each step the recommender sees the dialogue and prior tool results, then chooses one action.

A recommendation can be rejected. The agent may then search again, inspect a candidate, consult the preference tool, or ask a clarification question before revising its decision.

  • Candidate discoverysearch_products

    Ranked Top-100 catalog results; the Top-20 are visible by default.

  • Candidate verificationget_item_details

    Full grounded metadata for a selected product.

  • Long-term preferenceget_user_preference

    A precomputed, one-sentence preference summary when available.

  • Need clarificationshopper-facing question

    A direct simulator response.

  • Decisionstructured recommendation

    Environment success check and simulated shopper feedback.

User simulation

A shopper anchored to the task, not the answer

The simulator receives the current shopping need, recent dialogue, and latest agent action. It does not receive the target item ID or the preference profile. After a rejected recommendation it names one or two missing requirements without naming the target; the environment checks success on its own.

  • External (default): an OpenAI-compatible LLM endpoint.
  • Self-play: one model alternates shopper and recommender roles with role-specific prompts.

Trajectory reward

Credit the whole interaction, not one turn

GRPO jointly optimizes the final Hit@1, natural retrieval NDCG, valid tool use, and recommendation formatting, while penalizing redundant queries and unnecessarily long interactions.

  • Qwen3-4B policy, Qwen3 Dense retrieval, eight GRPO rollouts.
  • Learning rate 5e-7, clipping 0.2, KL coefficient 1e-3.

Training-only target injection

Help exploration, never inflate the metric

When natural retrieval misses the target, it may be inserted into the visible candidate list, only during training and only after two shopper turns. Natural, unmodified retrieval results always determine the retrieval reward and every evaluation metric; injection is disabled at evaluation.

Preference profiles

Long-term history, reduced to one sentence

For Amazon C4, histories are deduplicated, ordered in time, filtered to remove the task target, and summarized once by an LLM before rollout. The preference tool sees only that sentence, never the raw history.

Results

Better retrieval and recommendations, on both datasets.

All methods use Qwen3-4B under the paper’s evaluation protocol. Retrieval metrics are instance-weighted percentages from the best non-redundant, natural Top-100 search in a session; Hit@1 asks whether the final recommendation belongs to the target set. Target injection is disabled in every evaluation run.

Main results (%)

Qwen3 Dense retrieval unless labelled BM25. Pick a metric tile to chart it.

Full table
DatasetMethodNDCG@100Recall@100Hit@1

Every interaction component contributes

On Amazon C4, removing preference access, item inspection, or multi-turn feedback each lowers both retrieval and recommendation quality.

Component ablations on Amazon C4 (%)

Change relative to full SimRec in parentheses.

Takeaways

What the trained agent tells us.

Give the agent the tools and a shopper to talk to, reward the whole conversation, and it learns when to search, when to ask, and when to recommend.

  1. 1

    The workflow is learned, not written.

    At inference the policy is given no tool-use order. It learns to retrieve, inspect candidates, consult preferences when useful, and revise after feedback.

    32.23 → 35.42NDCG@100 on ESCI, Qwen3-4B base → SimRec-4B

  2. 2

    Inspecting items pays off at decision time.

    Without the item-detail tool, the final recommendation suffers most of all ablations on Amazon C4.

    9.75 → 6.04Hit@1 on Amazon C4, full SimRec → without item details

  3. 3

    Feedback is a training signal, not just a dialogue turn.

    Removing multi-turn feedback, so the agent cannot be rejected and revise, lowers both retrieval quality and Hit@1.

    22.14 → 24.72NDCG@100 on Amazon C4, without → with multi-turn feedback

  4. 4

    An external shopper trains a better recommender than self-play.

    Self-play needs no simulator endpoint, but on both datasets the external simulator gives the stronger policy.

    24.72 vs 19.77NDCG@100 on Amazon C4, external simulator vs self-play

  5. 5

    The retriever under the tool still matters.

    The same agent with a BM25 index scores far below the dense default on both datasets: learned tool use does not make up for a weaker retriever.

    35.42 vs 24.02NDCG@100 on ESCI, Qwen3 Dense vs BM25

Code

Train a recommendation agent with SimRec.

Interaction environment, user simulator (external or self-play), tool runtime, GRPO reward, and dataset preparation for ESCI and Amazon C4, built on verl. The release contains no datasets, user histories, weights, indexes, or API keys; see the data preparation guide.

View on GitHub ↗
Train & evaluatebash
# Qwen3-4B, eight GRPO rollouts, external shopper
$ cp configs/train.env.example configs/train.env
$ export SIMREC_USER_LLM_API_KEY=...
$ CONFIG_FILE=configs/train.env bash scripts/train_simrec.sh

# Held-out evaluation (target injection off)
$ EVAL_MODEL_PATH=checkpoints/exported/model \
  CONFIG_FILE=configs/train.env \
  bash evaluation/evaluate_simrec.sh

Citation

@article{zhang2026simrec,
  title   = {SimRec: Learning to Search, Ask, and Recommend from Simulated Interaction},
  author  = {Zhang, Yaxin and Wu, Xingyu and Yan, Yuchen and Dai, Yuqin and Zhao, Hong and Shen, Lixing and Chen, Zhan and Shao, Jian and Shen, Yongliang},
  journal = {arXiv preprint arXiv:2611.15426},
  year    = {2026}
}