Bar = 100% of the judged snapshot for that domain. Current HF Hit@10 is shown beside each domain.
The six experiments below answer two practical questions. First, can training use the same valid IDs, fixed-CoT candidate lists and intent branches that appear at evaluation? Second, can the reward give useful partial credit while keeping exact match as the main objective? Each experiment changes one thing and states what result would make it worth keeping.
</think>, Stage-3 rollouts can emit any token sequence and receive a 0.1 bonus if the three SID codes happen to form a real catalog item. Evaluation never faces this problem because decoding is constrained to legal SID paths.At evaluation, the model must return legal SIDs, one CoT produces all ten candidates, and the ten candidates are judged as a ranked list. Training currently does none of those three things. The experiments below fix each difference separately.
After </think>, the training sampler can write any tokens. The reward code reads the first three SID tokens and adds 0.1 if they form a real catalog item. Evaluation is simpler: its prefix tree blocks every invalid SID before it can be generated.
Sample the CoT exactly as in the current baseline. After </think>, use the catalog trie and repeatedly choose the highest-scoring legal next token until one complete SID is produced. Each CoT still produces exactly one answer. Once every answer is valid by construction, remove the 0.1 validity bonus.
The CoT remains a stochastic rollout, but the SID is selected by deterministic search rather than sampled from the policy. The greedy SID tokens are therefore not ordinary on-policy GRPO actions. If they are included in the loss, describe the update as search-guided or reward-weighted training rather than claiming that group normalization or importance sampling makes constrained greedy search unbiased.
If invalid outputs are common, constrained generation should remove wasted rollouts and increase useful reward variation per generated token without lowering Hit@10/NDCG@10. If invalid outputs are already rare, remove the unnecessary bonus but do not expect this change alone to improve recommendation quality.
For every rollout, calculate_reward returns 0, 0.25, 0.5 or 1.0 from the candidate's shared SID prefix with the target, plus the validity bonus. GRPO subtracts the mean score of the 16 responses, so the final advantage is relative. But the raw reward for one candidate is unchanged whether the other 15 are duplicates, useful alternatives or completely unrelated.
For one prompt, sample K CoTs and stop each one at </think>. For every fixed CoT c_m, run beam search with width B to produce one ranked list S_m. Compute one overall score R_m for that B-item list. The GRPO group therefore contains K CoTs and K list scores—not K × B candidate rollouts.
Normalize the K list scores for the same prompt: A_m = (R_m − mean(R_1…R_K)) / (std(R_1…R_K) + ε). Apply A_m once to the sampled tokens of CoT c_m. The B beam candidates are used only to evaluate that CoT; they do not receive separate GRPO advantages.
The stochastic GRPO actions are the K sampled CoTs. Beam search is a deterministic procedure that maps each fixed CoT to a ranked item list. Because beam tokens are not included in the policy loss, they do not need candidate-level leave-one-out rewards or on-policy log-probability correction.
ray_trainer.py, generate K CoTs for each prompt and stop them at </think>. Keep the current prompt-level uid for GRPO grouping and give every CoT its own cot_uid.original prompt + frozen CoT, call the existing beam helper in vllm_rollout_spmd.py with beam width B. Return the ranked SID list and beam scores as metadata rather than as B training responses.BatchRewardManager to compute one list reward from each beam and return exactly K scalar rewards. Keep only the sampled CoT tokens in the actor loss mask.Use three terms on the same 0–1 scale: R(S_m) = α · ExactNDCG@B + β · SoftRel@B − γ · Redundancy@B, with α largest so exact target ranking remains the primary objective. Rank the B candidates in their beam order before computing every term.
r, the score is 1 / log2(r + 1); if it is absent, the score is 0. Earlier exact hits receive more reward.g_i ∈ [0,1]: exact match is 1, sensible alternatives receive partial credit, and unrelated items receive 0. Discount lower ranks and take the weighted average Σ_i g_i / log2(i+1) ÷ Σ_i 1 / log2(i+1). The denominator is fixed, so an all-bad list remains near 0.g_i ≥ τ, measure pairwise collisions at the full-SID, Code-1+2 and Code-1 levels, then average them: Σ_b n_b(n_b−1) / [n(n−1)]. A score of 0 means no collisions; 1 means all candidates collapse to the same item or branch. Use 0 when fewer than two candidates pass the threshold.For a pilot, give one frozen LLM the interaction history, ground-truth target and the entire B-item beam in a single call. Ask it to assign anchored 0–1 scores for target-need satisfaction: exact target is fixed at 1, a genuine substitute can receive high partial credit, a merely related item receives less, and an unrelated item receives 0. Use those values to compute SoftRel@B. Do not use a purely relative ranking: when all candidates are bad, the least bad one still needs an absolute score near zero.
CoTs that produce stronger beams should receive higher GRPO advantages, and the final beam should improve target-branch coverage or exact ranking metrics. If the K CoTs usually receive the same list score, this setup provides too little comparative signal.
In 72%–81% of misses, no beam item has the target's Code-1 prefix. The earlier 'interest coverage gap' analysis also shows that mentioning an interest is not the same as selecting it or assigning it a beam slot.
Start from the original baseline rather than from A1 or A2. After the CoT, require the model to output a short ranked list of structured interests before it outputs an item SID. Train that ranking against the target category or SID prefix. During evaluation, allocate the existing ten slots across the selected interests. Do not add A2's fixed-CoT list reward; A3 asks only whether explicit interest selection improves branch coverage.
The target branch should appear more often without filling the list with irrelevant branches. The expected sequence is simple: the model selects the right interest more often, the beam covers that branch more often, and exact ranking then improves.
Exact match should remain the highest reward. The question is whether training can also learn from three weaker signals: how predictable the target is, whether the CoT chose the right interest, and whether a non-exact item is still a sensible recommendation.
Across the three domains, 23%–35% of examples fall into the two lowest levels on a five-level predictability scale. These labels mean the judge found little or no evidence for the target in the observed history. In Video Games, those 1,398 examples produce only 7 of the current baseline's 616 hits.
Early training should make faster progress when most sampled examples can produce different rewards across their rollouts. Harder examples can be added later, after the policy has learned enough to reach their target branches more often.
The predictability model and the candidate reward model may share an encoder, but they answer different questions and need separate heads. The predictability head sees (history, target) and estimates how much evidence the history contains for that target; it controls sampling weight or rollout budget. The reward head sees (history, target, candidate) and estimates whether that particular candidate is a sensible non-exact recommendation. A predictable target does not make an arbitrary candidate good, so the predictability score itself must not be reused as the item reward.
At the same rollout-token budget, training should produce more groups with useful reward differences and later improve level-3 and novel targets. If gains appear only on high-predictability exact repeats, the curriculum taught copying rather than broader preference.
In the judged snapshots, CoTs that identify the target interest have 2.4×–11.6× as high Hit@10. On Video Games, the gap is 13.6% versus 5.6%. This is correlation, but it identifies a promising process signal for a controlled reward experiment.
Let a frozen scorer compare the interest inferred by the reasoning with the interest behind the ground-truth item and output s_intent ∈ [0,1]. A clear match receives a score near 1, a related but incomplete interest receives partial credit, and a generic or wrong interest receives 0. Add it to the current item reward as R = min(1, R_item + λ_intent · s_intent), with λ_intent small enough that exact item match remains the strongest signal.
s_intent reward at matched compute.The progressive reward should create useful differences between otherwise unsuccessful rollouts and eventually improve exact metrics, especially at predictability levels 3 and 4. If only the scorer's own alignment score improves while Hit@10 stays unchanged, better reasoning is not reaching candidate generation.
Among predictable misses, 79%–89% contain a substitute, same-category item or complement according to the judge. The existing prefix reward recognises only candidates encoded near the target in the SID tree; it cannot tell whether a candidate outside that branch is a useful alternative or merely unrelated.
A candidate makes sense when, given the user's history, it is a defensible next recommendation and captures the same interest or need as the ground-truth target. A genuine substitute, product variant or natural same-series continuation can qualify. Sharing only a broad category, brand or popularity prior is not enough.
Let a frozen reward model output p_sense = P(makes_sense | history, target, candidate). Use the piecewise item reward 1 for an exact SID match; λ · p_sense for a non-exact candidate only when p_sense ≥ τ; and 0 otherwise, with 0 < λ < 1. Exact match bypasses the learned model and can never be outscored. This p_sense is also the candidate gain g_i used by A2's SoftRel@B.
max(prefix_reward, λ · p_sense). Sweep λ and τ on held-out training data rather than the test split.The extra reward should create useful differences between non-exact candidates and improve final Hit@10/NDCG@10 while exact match remains dominant. If only the reward model's own score improves, lower λ, raise τ, or stop using that score as a training objective.
Begin with one logging-only run. Use those measurements to decide which experiment is worth the compute, and do not combine several reward and rollout changes before their individual effects are known.
</think>, and how much the 0.1 bonus varies
inside each group. If invalid output is rare, A1 is cleanup rather than the main experiment.