Source-linked AI summary

RPTune: Learned Context Curation for LLM Catalog Search

Chuxuan Hu, Hejie Cui, Norman Huang, Shubham Kumar Bharti, Wang-Chiew Tan, Sercan Ö. Arık

arXiv:2610.00964v1cs.IRcs.CLcs.LG

TL;DR

SMB catalogs often fit in long-context LLMs, but models may not use those contexts effectively. RPTune learns to order and prune catalog products, then post-trains LLMs on curated contexts with synthetic, catalog-grounded supervision. Across evaluated merchants and models, curation improved search accuracy by up to 31.4 points, with post-training adding 10.3 points on average for gemma-4-E4B-it.

  • Problem

    For SMB catalogs that fit in long-context LLMs, the paper asks how to curate catalog contexts and adapt LLMs for product selection, since fitting the catalog alone does not ensure effective use.

    Source: §1 · pp. 1–2
  • Method

    RPTune combines a learned encoder–reorganizer curator, trained with downstream LLM feedback, with LLM post-training on curated catalogs using synthetic catalog-grounded supervision.

    Source: §1 · p. 2
  • Results

    14.0 percentage points on average and up to 31.4 points: context curation improved accuracy across 8 frontier LLMs and 7 merchants, while post-training added 10.3 points on average for gemma-4-E4B-it.

    Source: §1 · p. 2
  • Takeaways & Limitations

    Across 700 complex conversational queries, RPTune improved search accuracy for all 9 evaluated proprietary and open-weight LLMs.

    Source: §6 · p. 11

    The setting assumes single-turn queries and catalogs that fit in the LLM context window alongside the query and instructions.

    Source: §2 · p. 3

Abstract

from arXiv · show

For small merchant businesses (SMBs) whose catalogs fit within a long-context LLM, full-catalog prompting offers a compelling alternative to multi-stage retrieval designed primarily for large marketplaces with millions of items. However, fitting the full catalog into the context window does not ensure that the model can use it effectively, since LLMs do not exploit long contexts uniformly. We therefore study in-context catalog search through two complementary questions: (1) how to curate and present catalogs to the LLM, and (2) how to adapt the LLM for product selection on curated contexts. We propose RPTune, an end-to-end framework that couples learned catalog curation with LLM post-training using automatically generated, catalog-grounded supervision. An encoder-reorganizer curator orders and prunes products guided by downstream LLM feedback, while the resulting curated catalogs in turn improve the effectiveness of LLM post-training with a context-relative reward. We evaluate RPTune on 7 real merchants spanning distinct retail verticals, using 100 complex conversational queries per merchant. RPTune consistently improves search accuracy across both proprietary and open-weight LLMs, with context curation yielding gains of up to 31.4 percentage points and post-training adding a further 10.3 points on average.

1. Introduction

SMBs often lack the scale, teams, and behavioral data assumed by marketplace retrieval systems, while many catalogs fit in long-context LLMs. RPTune learns to curate those contexts and post-trains LLMs, improving accuracy across the evaluated merchants and models.

1. Introduction

  • SMBs are widespread online, but conventional multi-stage retrieval was developed chiefly for large marketplaces with millions of items, dedicated ML teams, and abundant behavioral signals.The paper argues these assumptions do not hold for SMBs, making such pipelines unnecessarily complex and costly for their catalog scales.Source: §1 · p. 1
  • Among 56 Shopify storefronts analyzed, 92.9% of catalogs fit within 1M tokens, and full-catalog LLM search outperformed prior retrieval approaches by up to 20 percentage points.The median catalog size was 51K tokens.Source: §1 · p. 1
  • Fitting a full catalog into an LLM context is not enough: catalog ordering and length affect how effectively models use context, and the LLM itself may need adaptation.Prior work cited in the passage reports that relevant information in the middle of a long context may be used less effectively than information near its beginning or end (Liu et al., 2023).Source: §1 · p. 2
  • RPTune combines an encoder–reorganizer curator with LLM post-training, using synthetic catalog-grounded supervision that requires no merchant-provided relevance labels.The curator prunes and orders products into compact, position-aware contexts, with its reorganizer trained using downstream LLM feedback.Source: §1 · p. 2
  • 14.0 percentage points on average and up to 31.4 points: RPTune curation improved accuracy across 8 frontier LLMs and all 7 merchants, with post-training adding 10.3 points on average for gemma-4-E4B-it.Evaluation used 100 complex conversational queries per merchant.Source: §1 · p. 2

2. Problem: In-context Catalog Search

The paper formulates in-context catalog search as selecting a product variant from one merchant’s catalog for a natural-language query using catalog metadata. Its example illustrates how conversational requests combine hard constraints, flexible preferences, and contextual cues, while the setting assumes the catalog fits in the LLM context.

2. Problem: In-context Catalog Search

  • The Beauty Bakerie example combines explicit product requirements with flexible weight and price preferences, contextual cues, and possible trade-offs when no variant satisfies every request.The query specifies color, finish, wear performance, vegan and cruelty-free attributes, and uses “ideally” and “hoping” for weight and price.Source: §2 · p. 3
  • Beauty Bakerie’s roughly 100 variants fit in fewer than 40K tokens, allowing the LLM to reason over the full catalog and select a matching product.The setting focuses on catalogs that fit alongside the query and instructions within the LLM’s context window.Source: §2 · p. 3
  • The task is to select the best-matching variant from a single merchant’s catalog for a single-turn natural-language query, using available catalog metadata.The catalog is the only merchant-provided data source required, including for training; merchant relevance labels and user-behavior logs are not needed.Source: §2 · p. 3

3. Method: RPTune

RPTune couples a query-dependent catalog curator with a downstream LLM: the curator selects and positions products for inference, while sequential synthetic-data training adapts the encoder, reorganizer, and LLM.

3.1. RPTune Inference Workflow

  • At inference, the encoder maps the query and products to normalized dense representations, which the reorganizer uses to construct a compact context for downstream LLM product selection.The reorganizer determines both which products to retain and where to place them.Source: §3.1 · pp. 3–4
  • The reorganizer retains a query-dependent subset and orders products by context priority, combining semantic matching with a learned task-specific adjustment to determine selection and placement.It places higher-priority products closer to the final generation prompt.Source: §3.1 · pp. 3–4

3.2. RPTune Training Workflow

  • Synthetic query–product pairs and catalog-wide graded relevance scores provide the training data, with queries generated for each catalog variant.The query–product pairs target variants, while relevance scoring captures partial matches and near-substitutes across the catalog.Source: §3.2 · p. 4
  • The encoder is trained with a ranking objective that increases each query’s similarity to its paired product relative to in-batch negative products.The encoder is intended to place queries near matching products in a shared semantic space.Source: §3.2 · p. 4
  • With the encoder and LLM frozen, the reorganizer learns from LLM selections weighted by group-relative advantages, updating product scores that govern context inclusion and positioning.The training aggregates multiple query groups so minibatches include informative groups with learning signals; invalid outputs contribute to group statistics but are excluded from the loss.Source: §3.2 · pp. 4–5
  • After curator training, RPTune freezes the curator and post-trains the LLM on curated catalogs using a context-relative reward for selecting the most relevant available product.Selecting a product absent from the curated catalog receives -1, while selecting the highest-relevance product available in that context receives +1, even if the globally best product was omitted.Source: §3.2 · p. 5

4. Experiments

Experiments use seven real-world SMBs across retail verticals, with 100 complex conversational queries per merchant. They test full-catalog prompting, RPTune’s curation and post-training, generalization, and design ablations.

4.2. Main Results

  • Full-catalog prompting beats every retrieval-based baseline by at least 9.0 EM points, with 8-second latency that is faster than or comparable to retrieval methods.Source: §4.2 · p. 7
  • Across 9 frozen LLM backbones, curation improves EM by 13.5 points and FR by 10.1 points on average, while reducing latency by 28% on average.EM and FR increase across all 63 backbone–merchant combinations; Table 2 summarizes results on seven SMBs.Source: §4.2 · p. 7, Table 2 · p. 8
  • Post-training raises EM from 10.7% to 31.0% over the raw backbone, adding 10.3 EM and 9.3 FR points beyond inference-time curation alone.Performance increases monotonically across all seven merchants from raw backbone through encoder-only, full curator, and post-training.Source: §4.2 · p. 7

4.3. Generalizability Test

  • As Beauty Bakerie’s catalog doubles, post-trained RPTune’s relative EM decline is 14.7% versus the baseline’s 29.5%; gains persist for new and original products and across unseen merchants.At double the initial catalog size, gains are 35.0 EM and 19.2 FR over baseline; all 7 × 7 merchant train/evaluation combinations improve both metrics, despite mean pairwise Jaccard similarity of 0.146.Source: §4.3 · pp. 7–8, Figure 3 · p. 9

4.4. Ablation Analysis

  • GRPO is strongest among tested post-training objectives, while curated-context training improves EM on both raw and curated evaluation contexts; C/C maximizes EM and cuts latency 35% versus R/R.On Beauty Bakerie, replacing the context-relative reward with either continuous or global top-1 reward lowers EM by 10 points.Source: §4.4 · p. 9, Figure 4 · p. 10, Figure 5 · p. 10
  • RPTune’s 25% retention budget yields 77.1% average context recall, over 3× random selection; on Beauty Bakerie, EM and FR peak at 25% retention.At 50% retention, average recall reaches 90.7%; larger budgets add marginal recall but lower accuracy and raise latency.Source: §4.4 · p. 9, Figure 6 · p. 10
  • Across tested catalog layouts, RPTune-curated layouts gain 16.8 EM points while cutting latency by 32%; ascending order performs best, followed by U-shaped.The comparison includes random, native, and reversed-native full catalogs and ascending, descending, U-shaped, and shuffled retained-item layouts.Source: §4.4 · pp. 9–10, Figure 7 · p. 10
  • With gemma frozen, a supervised listwise reorganizer reaches 16.4% average EM, 4.3 points below RPTune’s LLM-feedback reorganizer, which scores higher on all seven merchants.Source: §4.4 · p. 10

5. Related Work

Prior work addresses large-marketplace search through retrieval and context-construction methods, while RPTune builds on LLM post-training for in-context product search. The section positions in-context product search as more promising for SMBs.

Retrieval and context construction

LLM post-training

  • DPO learns from preferred and dispreferred responses, and IRPO (Wu et al., 2025) extends this to ranked candidate lists.Reinforcement learning methods (Shao et al., 2024; Yu et al., 2025) have also improved LLM performance on complex reasoning tasks; RPTune post-trains for in-context product search on curated catalogs.Source: §5 · p. 11

6. Conclusion

RPTune is an SMB-focused in-context catalog search framework trained entirely via synthetic supervision. Its curation and post-training pipeline improves search accuracy across evaluated proprietary and open-weight LLMs.

6. Conclusion

  • RPTune significantly improves search accuracy for all 9 evaluated proprietary and open-weight LLMs across 700 complex conversational queries from 7 real-world merchants.The framework uses downstream LLM feedback to curate compact, position-aware catalog contexts, which subsequently enhance LLM post-training for product selection.Source: §6 · p. 11

A.1. Training Data Generation

The appendix describes synthetic query–product pair generation and catalog-wide graded relevance scoring. These labels are designed to differ from the complex product-selection task used in in-context search.

Query–Product Pair Generation

  • For each catalog variant, a frontier LLM generates 10 diverse search queries that target it, spanning user intents and combinations of product features.The queries are short, natural 1–2 sentence requests combining features such as price, taxonomy tags, size, or product type.Source: §A.1 · p. 14
  • The generated dataset Dpair contains 10n realistic queries, each paired with its target variant.The example query targets the Cherry Flambé Matte Lip Whip variant: “fiery red liquid matte lipstick for date night”.Source: §A.1 · p. 14

Catalog-Wide Relevance Scoring

  • Because one positive per query is too coarse, an LLM relevance judge assigns a graded score to every catalog variant for each query.The resulting Drel is a dense relevance distribution, and the target product used for query generation need not receive a score of 1.0.Source: §A.1 · p. 14
  • Scoring processes 10 product records per call and carries forward a running score dictionary so the judge can revise earlier scores for a globally consistent ranking.This procedure assigns graded query–product relevance rather than selecting one best product; its synthetic queries are shorter and simpler than the complex, multi-constraint real-world queries.Source: §A.1 · p. 14

A.2. Training Curves

The reorganizer-training diagnostics report rising selected-product relevance and mostly informative training signals.

A.2. Training Curves

  • Training uses 16 rollouts per query and minibatches of 128 queries.Figure 8 tracks the frozen LLM’s average selected-product relevance score, which increases steadily during training.Source: §A.2 · p. 14, Figure 8 · p. 14
  • At least 44 query groups per optimizer update have non-zero advantages, while invalid outputs occur at a 0.83% rate.Groups where different selected products receive identical relevance scores account for 6.2% of query groups; the authors characterize the training signal as well-defined and informative.Source: §A.2 · p. 14

A.3. Evaluation Data

The evaluation data are built from real SMB catalogs and synthetic conversational queries, then filtered and checked through model and human review. The evaluation is single-turn, and robustness tests examine both model-assigned labels and consensus-based filtering.

Evaluation data construction

  • The seven storefronts use Shopify’s public product endpoint, and synthetic query generation withholds individual product records to discourage queries tailored to specific descriptions.The generation prompt uses merchant background, an About Us screenshot, and aggregate catalog feature distributions to elicit multi-constraint queries.Source: §A.3 · p. 15

Query refinement

  • The labeler makes 10 recommendations over shuffled catalog orders; moderate-consensus queries are retained, while low- or high-consensus queries are revised or excluded.Consensus is the maximum number of trials selecting the same variant; ties are retained as candidate labels, and refinement converges in about three rounds on average.Source: §A.3 · p. 15

Human verification

  • Pilot queries require expert approval, and post-generation audits review a 10% sample of standard queries plus all tied cases; disagreements receive panel review.Pairs lacking full expert consensus are discarded, with a 9.6% overall rejection rate.Source: §A.3 · p. 16

Evaluation scope

  • The evaluation covers single-turn queries; multi-turn evaluation is left to future work, although the authors describe adapting the curator at each turn using accumulated constraints.Source: §A.3 · p. 16

Validity of model-assigned labels

  • Because gemini-3.1-pro assigns reference labels, they may favor Gemini-family backbones; the authors also audit labels with independent LLM judges and blinded human checks.Source: §A.3 · p. 16
  • Judges accepted reference labels for 64.9% of queries, versus 1.1% for BM25 distractors and 0% for random items, while 1.85 variants per query were acceptable on average.Pairwise agreement between judges on the best variant ranged from 36.4% to 46.1%.Source: §A.3 · p. 17

Evaluation robustness to consensus-based filtering

  • 87.8 EM and 94.6 FR for RPTune, versus raw Gemma’s 33.9 EM and 72.0 FR, on 100 high-consensus Beauty Bakerie queries; these gains indicate consensus filtering does not bias evaluation toward order-insensitive methods.The corresponding main-set raw Gemma scores were 15.2 EM and 64.5 FR.Source: §A.3 · p. 17

A.4. Models and Baselines

The evaluation compares RPTune’s curator and post-training against retrieval, ranking, and compression alternatives across several LLM families. Frozen-backbone comparisons isolate curation, while additional objectives and infrastructure are specified for post-training and execution.

Backbones

  • Nine LLM backbones from multiple model families are evaluated, including proprietary models and open-weight gemma-4-E4B-it.Source: §A.4 · p. 17

Context curation baselines

  • With downstream weights frozen, RPTune curation retaining the top-ranked 25% of variants is compared against shuffled full-catalog prompting and three alternative selectors.The alternatives are EmbeddingGemma 300M, Gemini Embedding 2, and Jina Reranker 3.5; each retains the same 25% budget.Source: §A.4 · p. 17

Retrieval, ranking, and compression baselines

  • Retrieval and ranking baselines include Gemini Embedding 2 and Jina Reranker 3.5 in RAG, RAG-Fusion, TourRank, and LongLLMLingua context compression.The LLM-based configurations share gemini-3.7-flash as their backbone.Source: §A.4 · pp. 17–18

Post-training objectives

  • GRPO is compared with DPO and IRPO using the same synthetic catalog-grounded data and backbone, with one epoch for GRPO and three for DPO and IRPO.Source: §A.4 · p. 18

Setups

  • Proprietary and MaaS models use APIs or Vertex AI endpoints, while H100 GPUs support Gemma training and evaluation and curator training and evaluation.Source: §A.4 · p. 18

A.5. Feature Reward Definitions

The appendices define a feature-based reward, document merchant-wise outcomes and recurring errors, and examine catalog growth and ablations. They also compare LLM-in-the-loop reorganizer training with a supervised alternative.

A.5. Feature Reward Definitions

  • Feature reward scores selected products through weighted feature comparisons, including categorical equality, numeric attributes, tags, and target-normalized description overlap.Description overlap uses body-text bigrams, falls back to unigrams when the target has no bigrams, and does not penalize extra text or tags on the selected product.Source: §A.5 · pp. 18–19
  • Feature reward gives partial credit for near matches that exact match scores as zero.In the example, the selected brush overlaps on some attributes and two of the target’s 43 description bigrams, yielding 0.047 body reward despite an exact-match score of zero.Source: §A.5 · p. 19

A.6. Full Merchant-wise Results

  • Table 2 reports per-merchant exact match and averaged EM, feature reward, and latency; Table 3 gives the corresponding merchant-level breakdown.Averaging each metric across the seven merchants reproduces Table 2’s Average column, except for the supervised-reorganizer ablation row.Source: §A.6 · p. 19, Table 3 · p. 20

A.7. Failure Analysis

  • Error trials average 0.63 FR, with invalid IDs at 0.1%; recurring mistakes include wrong variants and near-identical sibling products.Wrong-variant errors account for 8.1% of errors overall and 27.2% on PF; examples include detergent packs meeting hard constraints and lipsticks distinguished by shade wording.Source: §A.7 · pp. 19–21

A.8. Catalog-Increase Protocol

  • The catalog-increase experiment removes half of Beauty Bakerie’s products, then restores them cumulatively without retraining while keeping the 100-query evaluation set fixed.For queries whose reference products were withheld, substitute references are established against the reduced catalog and revert when the original products return.Source: §A.8 · p. 21, Table 4 · p. 21
  • New-product results at 10–40% injection are indicative only because those groups contain just 4–7 queries; the trend is more meaningful from roughly 50%.The Total column retains a constant denominator across the sweep.Source: §A.8 · p. 21

A.9. Feature-Reward Views of the Ablations

  • Figure 9’s feature-reward view tracks exact match throughout the ablations and shows gains from curated training at a fixed evaluation context.Its panels cover post-training objectives, pruning budget, context layouts, and curation quadrants.Source: §A.9 · p. 22, Figure 9 · p. 22

A.10. Supervised Reorganizer Objective

  • RPTune’s LLM-in-the-loop reorganizer reaches 20.7% EM and 65.1% FR, exceeding the supervised reorganizer by 4.3 EM and 4.9 FR points on average.The supervised reorganizer matches the encoder-only curator at 16.4% EM, while RPTune’s reorganizer improves over the encoder on all seven merchants.Source: §A.10 · p. 23
Loading 2610.00964v1…