OxygenREC: An Instruction-Following Generative Framework for E-commerce Recommendation

28 minread-scoreDeep dives
Contents · 7 sections1A running example2Overall architecture3Mechanisms4Results5Limitations6How to try it7Verdict

OxygenREC is worth a close read for teams building generative recommenders, because it turns a goal many teams share into concrete steps: let LLM reasoning shape recommendations without making a single LLM call online. The paper comes from a large e-commerce platform's recommendation team. An LLM runs near-line, writes the user's likely intent as a text instruction, and the instruction is encoded into an embedding and cached. The online encoder–decoder model only reads that embedding, uses it to pick relevant items from long-term history, and lets it steer the step-by-step generation of Semantic IDs. One model serves the homepage, channel feeds, the add-to-cart overlay and the checkout page, told apart by a scenario instruction. One caveat up front: during training, real instruction text exists only in search data (the rewritten query stands in for it), and recommendation scenarios are trained with a learnable default embedding. Online, those same scenarios read instructions written by the near-line LLM. The paper never measures this gap on its own.

The core idea in one sentence: move slow reasoning near-line, compress its output into one token for fast generation, and use the same token to tell scenarios apart.

Key numbers:

  • Against per-scenario SFT models, the unified model has higher HR@1 in all six scenarios, e.g. 6.39% → 15.39% in scenario 1. The SFT baseline is weak, though: 1.12% HR@1 in scenario 3.
  • In post-training, the proposed SA-GCPO beats GRPO: HR@1 23.85% → 25.58%, HR@10 62.15% → 65.95%.
  • In online A/B tests, order volume rose in all six scenarios, by up to +8.03% in a channel feed, so the gain is not just clicks. Latency stays at 50–80 ms, which is low enough for homepage traffic.

1. A running example

This is an illustration, not paper data. Wang lives in a northern city; it is a week before the winter solstice. He recently typed "wine gi" (a truncated query) and added a phone to his cart. Now he taps a phone case on the homepage and lands in a channel feed.

  • Near-line: one LLM writes "winter solstice, north, dumpling-related food" from time and place; the rewrite model expands "wine gi" into "wine gift box"; the intent model writes "buying phone accessories, because a new phone was just added to cart". An adapter text-encoder service turns them into an embedding near-line, stored under his user ID in a low-latency KV store such as Redis.
  • Online request: the scenario ("channel feed") and the trigger item (the phone case) are fused into a scenario instruction, and the reasoning-instruction embedding is read from the KV store.
  • The model uses the instruction to pick the K most relevant items from his thousands of past interactions (say, a charging cable and a screen protector). These go into the encoder with his profile and short-term behaviour. The decoder starts from BOS plus the instruction token and generates a 3-level Semantic ID.

2. Overall architecture

OxygenREC overall architecture (paper Figure 2). (a) The encoder–decoder backbone: the encoder reads user info, IGR-filtered related history and recent actions; the decoder places the instruction token after BOS and generates sid0, sid1, sid2. (b) Item Semantic IDs: text and image features fused by Q-Former and MLP, quantised with RQ-KMeans. (c) Near-line LLMs produce reasoning instructions and query rewrites. (d) Multi-scenario post-training maps format, ranking, relevance and diversity rewards with per-scenario weights.
OxygenREC overall architecture (paper Figure 2). (a) The encoder–decoder backbone: the encoder reads user info, IGR-filtered related history and recent actions; the decoder places the instruction token after BOS and generates sid0, sid1, sid2. (b) Item Semantic IDs: text and image features fused by Q-Former and MLP, quantised with RQ-KMeans. (c) Near-line LLMs produce reasoning instructions and query rewrites. (d) Multi-scenario post-training maps format, ranking, relevance and diversity rewards with per-scenario weights.

There are four parts: item Semantic IDs, near-line reasoning instructions, instruction-conditioned encoder–decoder pre-training, and multi-scenario RL post-training. Serving runs on the xLLM inference engine with beam size 256–512, and a Trie constrains decoding to IDs that exist in the current scenario's item pool.

3. Mechanisms

3.1 Item Semantic IDs

Generation outputs items token by token, so items must first become discrete codes, and code quality decides whether items sharing a prefix are similar. Text features (Qwen3) and image features (CLIP) are fused by Q-Former and an MLP into a 256-dimensional embedding, trained contrastively with positives from three sources: query-to-item associations, behavioural co-occurrence pairs mined with Swing, and semantic peers under the same query and category. RQ-KMeans then quantises it into 3 levels of 8192 codes. That gives combinations, far more than the catalogue, so what matters is how evenly codes are used. Collision is measured by counting items under each full 3-level code and taking the 99.9th percentile (P999) of that distribution: 35 for V4, 419 for the text-only V1. Coverage counts joint code paths, so the level-3 denominator is ; V2 (MiniCPM-V-8B encoding text and images, trained only on Swing co-occurrence pairs) reaches only 0.013% there, which the authors read as partial collapse of the deeper codebooks. V4 is the Qwen3+CLIP version with three positive sources; the extra signals mainly improve code balance and category purity. Purity is computed per code as the share of its dominant level-1 category, averaged over codes; V4 reaches 92.80%. The authors also claim over 30% relative HR@1 gain over a OneRec-style design, without a full table.

3.2 Near-line reasoning instructions

A model that only sees behaviour struggles with rare combinations like "solstice + north", and calling an LLM online is too slow. Three branches run in parallel. The time/place/profile branch uses the JoyAI LLM and caches outputs by a time–location–persona triple. Query rewriting uses an SFT Qwen3-0.6B with a 95.33% human pass rate, above DeepSeek-R1's 88.67%. Intent reasoning is another Qwen3-0.6B, trained on labels built by Qwen3-32B (cleaning behaviour sequences) and DeepSeek-R1 (writing rationales), with 72% usability in human evaluation. Instructions are fully recomputed daily for all daily active users; high-value actions trigger incremental updates merged within a roughly 5-minute window.

Reasoning-instruction pipeline (paper Figure 3). The top branch turns time, place and profile signals into holiday and season instructions, the middle branch turns the behaviour sequence into intent instructions, and both are written to the instruction store; the bottom LLM_QR rewrites recent queries. All outputs are merged into final instructions and reasons.
Reasoning-instruction pipeline (paper Figure 3). The top branch turns time, place and profile signals into holiday and season instructions, the middle branch turns the behaviour sequence into intent instructions, and both are written to the instruction store; the bottom LLM_QR rewrites recent queries. All outputs are merged into final instructions and reasons.

A 72% usability rate means about one intent instruction in four is unusable. The online results come only from full-system A/B tests, with no arm that turns near-line instructions off.

3.3 Where the instruction token goes

The scenario instruction is scenario info plus an optional trigger item; the reasoning instruction is the text instruction projected through an adapter. Together they form one token placed right after BOS. On fusion the paper says only that scenario and trigger features are combined and projected into a unified representation; the projection network, and whether is projected with or added separately, are not described. In Table 5, no instruction gives HR@1 2.78% and right-of-BOS gives 3.53%, a 27% relative gain; replacing BOS gives 3.30%, which means keeping BOS works better than replacing it. Fusing scenario and trigger into one token (3.60%) is slightly better than two tokens (3.53%). Placement differences are about 0.2 points; most of the gain comes from having the token at all. These ablations use a data subset, so the absolute numbers are not comparable with Table 4.

3.4 IGR and the Q2I loss

Long histories hold thousands of mostly irrelevant items. The query comes from a projection of two concatenated parts. One is the scenario-plus-trigger embedding. The other is the reasoning-instruction text vector, so scenario, trigger and near-line intent all shape the history filter. Online, that vector is the embedding precomputed near-line and read from the KV store. The paper calls that service an adapter text encoder, while the formula uses the encoder shared with item titles; it does not say whether they are the same model, or how they would be aligned if not. My suggestion, not the paper's, is to run the training encoder near-line. When recommendation data uses the default instruction embedding, is driven mainly by scenario and trigger. Items are item-ID embedding, side features and title-text vector, concatenated and passed through a second projection ; the target's text encoder is trainable, the history's is frozen, and the same , trained through the target branch, projects history items. Whether history projections are cached online is not stated. A Q2I loss raises the dot product of and the target , plus variance and decorrelation terms against collapse. At inference, IGR (Instruction-Guided Retrieval) takes the top-K history items by dot product (the method section describes this step only at inference time, not how training-time history is chosen); the history branch gets no gradient. Total loss is behaviour-weighted NTP (purchase > cart > click) plus times Q2I. With , a cable at scores 0.9 and a down jacket at scores 0.1, so K=1 keeps the cable. In Table 7, HR@1 goes 3.76% → 4.02% with IGR → 4.19% with Q2I added, so IGR helps alone and works best once Q2I aligns the two spaces.

3.5 Post-training with SA-GCPO

Real feedback is sparse, so the authors build synthetic data: historical profiles plus policy-generated candidates, scored by the unified list-wise ranking model. Rewards are a scenario-weighted sum: format penalises invalid Semantic IDs, relevance checks closeness to the query in Q2I space, ranking is the ranking model's score for GMV or conversion, and diversity scores the generated group, with no detail on features or formula. The ranking service returns one score per candidate given the item and user features (list-wise describes how its training samples are organised); the exact reward formulas and weights are not given. SA-GCPO changes GRPO in two ways: a positive advantage is set to 0 when the sample's reward is below the reward of the item the user actually interacted with, (the paper only defines it as the reward of the group's target item). Second, with the per-token probability ratio on each Semantic ID token, a sigmoid soft gate replaces PPO-style hard clipping, and multiplies the gated advantage in the objective. With , its gradient weight peaks at 1 when () and decays as drifts, with separate temperatures for positive and negative advantages. With rewards 0.2, 0.4, 0.6, 0.8 (mean 0.5) and , the 0.6 sample loses its positive update and only 0.8 is reinforced. Table 10 shows +1.45 HR@1 over GSPO, but Table 11's matching setting reports 25.48% rather than 25.58%, and the temperature variants differ by under 0.2 points.

4. Results

ExperimentComparisonResult
Scale (Table 4)0.1B → 0.7B → 3.0BHR@10 13.17% → 16.33% → 16.99%
Instruction token (Table 6)none → fusedHR@1 2.78% → 3.60%
IGR (Table 7)base → IGR+Q2IHR@1 3.76% → 4.19%
Unified model (Table 8, scen. 6)per-scenario SFT → unifiedHR@1 5.29% → 25.75%
Masked trigger (Table 9)real → defaultHR@1 6.34% → 1.96%
Online A/B, scenario 5production → OxygenRECorders +4.28%, GMV +11.80%

Scaling stalls between 0.7B and 1.6B (both activate 2 experts) and resumes at 3.0B, where a 16-layer decoder lowers NTP loss again and HR@10 reaches 16.99%. Masking the trigger hurts badly, so the decoder does use it, but Table 9's "scenario 3" column (20.75%) matches Table 8's scenario 2, not its scenario 3 (17.24%). Only scenario 3 fully replaced retrieval and pre-ranking online.

5. Limitations

  1. Train–serve gap for instructions: recommendation scenarios train on a default embedding but read LLM text online, and there is no with/without ablation, so the LLM's contribution is not measured.
  2. Weak baselines and inconsistent tables: per-scenario SFT sits near 1% HR@1 in places, the text says five scenarios while tables show six, and Tables 8/9 and 10/11 disagree.
  3. Undisclosed cost: training used 128 H800s at 40% MFU, but daily LLM cost for all active users and KV size are not reported.

6. How to try it

  1. Add only the scenario instruction first: fuse scenario ID and trigger item into one token after BOS, and compare one model per scenario against one shared model.
  2. Train Q2I and IGR with rewritten search queries as instructions, check history filtering on search traffic, and tune K.
  3. Generate intent instructions offline with a small model, audit usability by hand, then run the missing ablation: the same users with and without instructions.
  4. In post-training, first copy the cheapest rule, zeroing positive advantages below the real item's reward, before adopting the soft gate.

7. Verdict

AspectRating
Problem importanceHigh: multi-scenario unification and low-latency LLM reasoning are central
NoveltyMedium: mostly known parts; instruction token plus IGR is the new combination
EvidenceMedium-low: full online A/B, but no instruction ablation and inconsistent tables
Engineering costHigh: near-line LLMs, KV store, custom inference engine, ranking model as reward
Worth tryingScenario token and IGR first; near-line LLM instructions after your own ablation

How did this read for you?

One tap, no sign-in; tap again to undo. Only anonymous counts are kept, never who you are.

Related papersMore from Paper Daily

  1. Generative · 2026-10-24UniRec: A Unified Expressive-Aligned Generative Recommendation Framework for E-commerceGenerative recommendation generates a product's semantic IDs layer by layer, and before the first layer it has seen no product-side information at all; this is its gap with discriminative ranking models. When a discriminative model scores a candidate it sees the product's category, shop and brand directly and crosses them with user features. UniRec has the model first generate the product's categ…
  2. Generative · 2026-11-09RedMall: Generative Recommendation for Large-Scale E-commerceGenerative retrieval outputs a Semantic ID (SID), but several products can share one SID, and which of them are finally retrieved directly affects online gains. RedMall is a generative model for e-commerce recommendation and ad retrieval. Besides changes to the architecture and training objectives, such as treating items that were shown but not clicked as negatives, it handles this step explicitl…
  3. Generative · 2026-11-02UGR: Unified Generative Ranking for Heterogeneous E-commerce RecommendationTaobao's generative ranking framework UGR has one generative model directly produce the screen the user finally sees. The roughly one thousand organic, ad and other-business candidates of a request go to the model together, and it generates the final list item by item, instead of each business ranking its own items and a blending stage stitching them together. That stitching step is the old probl…

Discussion

Add experiment details, reproduction notes or a different take. Requires a GitHub sign-in.

Loading the discussion…