<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Learn LLM</title>
<link>https://learn-llm.com/</link>
<atom:link href="https://learn-llm.com/feed.xml" rel="self" type="application/rss+xml"/>
<description>Paper deep dives and a weekly digest on LLM agents, recommender systems and reinforcement learning, by Shawn.</description>
<language>en</language>
<item>
<title>Raw tokens fell 39–60%. The bill went up 14–36%.</title>
<link>https://learn-llm.com/p/raw-tokens-fell-3960-the-bill-went/</link>
<guid isPermaLink="true">https://learn-llm.com/p/raw-tokens-fell-3960-the-bill-went/</guid>
<pubDate>Thu, 22 Oct 2026 12:00:00 GMT</pubDate>
<description>A public 945-run Claude Code benchmark, re-priced with Claude Code's own costUSD: /compact and subagents look cheaper in tokens and cost more in dollars.</description>
<category>Large Language Models</category><category>LLM Agents</category>
<content:encoded><![CDATA[<p>Last week <a href="https://x.com/0xKense1/status/2111105138290987198" rel="noopener">Kensei</a> published something rare: 945 headless Claude Code runs, interleaved arms, three repetitions per question, and <a href="https://github.com/kenseii1/claude-code-limits-tests" rel="noopener">every raw log on GitHub</a>. The article compared <code>/compact</code>, <code>/clear</code> and “just keep going” by counting tokens, and found what everyone expects: <code>/compact</code> cuts tokens by 39–60%.</p><p>I ran the same logs through the <code>costUSD</code> that Claude Code itself writes into each result. The ranking flips.</p><h2>The table</h2><p>Three follow-up questions after forking a session at N = 5, 15 or 30 turns, Sonnet 5.5, 1-hour cache TTL, three reps each. Cost is what Claude Code billed, per call, from its own <code>modelUsage</code>.</p><figure><img src="https://learn-llm.com/media/raw-tokens-fell-3960-the-bill-went/d94dd1921e10.png" alt="Raw tokens versus billed cost for keep going, /clear and /compact after 5, 15 and 30 turns" loading="lazy"></figure><p>The <code>/compact</code> row includes the compaction call itself, which is where the money goes.</p><h2>Why fewer tokens cost more</h2><p>Three prices are in play, and raw token counts treat them as one.</p><ul><li><p><strong>Carrying context is almost free.</strong> A cache read is 0.1× the input price. The 155k context at N = 30 costs about 3 cents per model call to carry.</p></li><li><p><strong>The summary is written at the most expensive price.</strong> <code>/compact</code> makes the model write a summary at the output price (5×), then writes the new prefix into a 1-hour cache at 2×. At N = 30 that one call is $0.071, more than twice what it saved over the next three questions ($0.027).</p></li><li><p><strong>The summary forgets what was open.</strong> The follow-ups after <code>/compact</code> re-read files the old context already held, so the per-question cost after compaction ($0.066–0.071) is barely under the uncompacted one ($0.074–0.080). Divide the compaction fee by that small gap and you get the break-even column: seven or eight more questions before <code>/compact</code> has paid for itself.</p></li></ul><p><code>/clear</code> wins at N ≥ 15 because it pays neither the summary nor the re-reads of a half-remembered context. It just starts over, and a fresh start on this task was cheap.</p><h2>The subagent result is the same story</h2><figure><img src="https://learn-llm.com/media/raw-tokens-fell-3960-the-bill-went/c97bd865c376.png" alt="Raw tokens versus billed cost for a subagent versus the main thread" loading="lazy"></figure><p>A subagent starts with a cold cache and writes its own prefix. That is the $0.052 → $0.093 jump on the main call. In exchange the parent’s context stays lighter, which saves about $0.002 per follow-up question. Twenty follow-ups to pay back one delegation.</p><h2>Two things the logs show that the article did not look for</h2><p>I also ran <a href="https://github.com/shangliy/kvleak" rel="noopener">kvleak</a> over the raw logs, which prices every cache miss in a transcript.</p><p><strong>An 8 h 36 m pause inside two 30-turn chains.</strong> Rate limiting paused the runs between turn 28 (08:07 UTC) and turn 29 (16:43 UTC). Turn 29 rebuilt 142k tokens of context at the write price: $0.629 for one call, against $0.092 for the call before it. The session still reports a 95.9% cache hit rate. On Sonnet 5.5 with a 1-hour cache, one miss costs as much as nineteen hits of the same context, and the hit rate cannot see it.</p><p><strong>$14 of the $79 benchmark bill was the cache-write premium on prefixes nothing read back.</strong> Every <code>claude -p</code> run writes its prefix into the 1-hour cache, paying 2× instead of the plain 1×, then exits. The 5-minute cache charges 1.25×, so for one-shot harnesses <code>CLAUDE_CODE_PROMPT_CACHE_TTL=5m</code> cuts that premium by three quarters, to about $3.50.</p><h2>What to do with this</h2><ol><li><p><strong>Do not compact small contexts.</strong> At 51k of context <code>/compact</code> never paid back here; at 107k it took about seven more questions. Claude Code’s auto-compact fires near the window limit, which is usually right; the mistake is manual <code>/compact</code> as hygiene.</p></li><li><p><strong>If you will ask fewer than seven more questions, </strong><code>/clear</code><strong> beats </strong><code>/compact</code><strong>.</strong> Or just keep going. Carrying is cheap.</p></li><li><p><strong>Delegate for isolation or parallelism, not for savings.</strong> A subagent costs a cold start.</p></li><li><p><strong>Set the 5-minute TTL on batch runs.</strong> <code>CLAUDE_CODE_PROMPT_CACHE_TTL=5m</code> for anything that exits right after its answer.</p></li><li><p><strong>Count dollars, not tokens.</strong> Three prices, three orders of magnitude between a cache read and a summary. Any tool that reports “tokens saved” is reporting the cheapest line on the bill.</p></li></ol><h2>Caveats</h2><p>Sonnet 5.5 only; three reps per cell, so single-digit percentages are noise; one codebase; the follow-up questions were short and answerable, which favours <code>/clear</code>. A long agentic task that needs the history would move the break-even. The compaction fee and the cold-start jump are not noise, they are the price list.</p><h2>Reproduce it</h2><p>Dataset: <a href="https://github.com/kenseii1/claude-code-limits-tests" rel="noopener">kenseii1/claude-code-limits-tests</a> (<code>runs/session/*.json</code>, <code>runs/subagent*/*.json</code>). Each log carries a <code>tok</code> block with the per-call delta of <code>costUSD</code> (<code>--resume</code> makes the raw <code>total_cost_usd</code> cumulative; the harness already subtracts the previous call).</p><pre><code>&lt;code&gt;&lt;code&gt;import json, glob, re, collections, statistics as st
R = &quot;claude-code-limits-tests/runs&quot;
for N in (&quot;N05&quot;, &quot;N15&quot;, &quot;N30&quot;):
    rows = {}
    for arm in (&quot;continue&quot;, &quot;clear&quot;, &quot;compact&quot;):
        per_rep = collections.defaultdict(float)
        for f in glob.glob(f&quot;{R}/session/{N}-{arm}-*q*-r*.json&quot;):
            rep = re.search(r&quot;-r(\d+)\.json$&quot;, f).group(1)
            per_rep[rep] += json.load(open(f))[&quot;tok&quot;][&quot;cost&quot;]
        rows[arm] = st.mean(per_rep.values())
    rows[&quot;compact&quot;] += st.mean(json.load(open(f))[&quot;tok&quot;][&quot;cost&quot;]
                               for f in glob.glob(f&quot;{R}/session/{N}-compactcmd-*.json&quot;))
    base = rows[&quot;continue&quot;]
    print(N, {a: f&quot;{c:.4f} ({(c/base-1)*100:+.0f}%)&quot; for a, c in rows.items()})&lt;/code&gt;&lt;/code&gt;</code></pre><p>The miss pricing: <code>uvx kvleak --path claude-code-limits-tests/runs</code>, then <code>uvx kvleak session 600996ac --path …</code> for the 8-hour pause.</p><p>An interactive version, with the token-versus-dollar charts, is on the <a href="https://shangliy.github.io/kvleak/blog/tokens-are-not-dollars/" rel="noopener">kvleak blog</a>.</p>
]]></content:encoded>
</item>
<item>
<title>Harness²: What an Agent Can Learn by Changing Its Harness</title>
<link>https://learn-llm.com/p/harness-what-an-agent-can-learn-by/</link>
<guid isPermaLink="true">https://learn-llm.com/p/harness-what-an-agent-can-learn-by/</guid>
<pubDate>Mon, 19 Oct 2026 12:00:00 GMT</pubDate>
<description>Propose, probe, compose: how a frozen model adapts its tools and instructions, and why better-looking execution is not proof of correctness.</description>
<category>Large Language Models</category><category>Recommender Systems</category><category>LLM Agents</category>
<content:encoded><![CDATA[<p>An agent can fail because it has no procedure for checking an output file, forgets a constraint halfway through a task, or delegates work without checking what comes back. Those failures suggest changes to the system around the model: add a validation script, revise a tool instruction, or change how subagents report their results.</p><p>Harness² makes that surrounding system editable during task execution. It runs alternative harnesses on the same task, examines what changed, and retains experience that can guide later edits. The executor’s model weights stay fixed. [1]</p><p>The difficult part is deciding which edits deserve to survive. A cleaner trajectory can still produce a wrong answer. Harness²’s execution comparisons provide evidence about behavior, but the system does not receive the task’s ground-truth grade while adapting. That distinction determines how I would evaluate it.</p><h2>The editable object is larger than a prompt</h2><p>The project exposes eight harness components: system prompt, guardrails, memory, tool guidance, subagents, skills, scripts, and plugins. Together, they shape which context the model receives, how it calls tools, what it delegates, and what happens inside the execution loop. [1]</p><p>These components can solve different kinds of problems. A prompt can remind an agent to inspect an artifact. A script can perform a repeatable check. A skill can describe a domain procedure. A subagent configuration can change who performs an independent review.</p><p>Consider a spreadsheet task. If an agent returns a workbook without checking its formulas, a harness edit could require reopening the saved file and checking calculated cells. That is a hypothetical example of a useful intervention, not a reproduced Harness² result. The important question is whether executing the edited harness reveals that the check actually happened and affected the deliverable.</p><p>The released code separates the main responsibilities. `core/recursion.py` schedules proposal, probe, and composition work. `core/context.py` assembles the evidence available to the editor. `core/library.py` stores reusable harnesses and experience, while `core/selection.py` handles output selection and adoption. The <a href="https://github.com/google-research/harness2/tree/1cfe254e8d25b15f37048c3730134686abe60335" rel="noopener">official repository</a> documents these implementation details; the paper supplies the experimental claims. [1]</p><h2>Compare executions before composing an edit</h2><p>A basic Harness² step has three parts.</p><p><strong>Propose.</strong> First run the current harness to obtain a reference trajectory and deliverable. An editor then proposes two candidate harnesses. One addresses a deficiency that might recur across domains, such as planning or delegation. The other addresses the current domain’s procedures and constraints. These are executable edits to harness components. [1]</p><p><strong>Probe.</strong> Run both candidates on the same task under matched model and environment configurations. Compare their trajectories and deliverables with the reference. Did the proposed check execute? Did it expose a missing input? Did the new instruction cause the agent to spend its budget on an irrelevant detour?</p><p><strong>Compose.</strong> Read the candidate diffs and execution evidence, then form a successor harness. Composition can merge changes, revise conflicts, select one candidate, or preserve the current harness. Execute that successor as well. The result includes the revised harness, its actual execution, and the observations used to justify the changes. [1]</p><figure><img src="https://learn-llm.com/media/harness-what-an-agent-can-learn-by/1fde66952d35.png" alt="" loading="lazy"></figure><p><em>Figure 3 from Harness². The left side adapts the execution harness for one task through proposals, probes and composition. The right side records supported experience for future tasks; it does not update the executor’s model weights. Source: <a href="https://arxiv.org/abs/2610.14224" rel="noopener">arXiv:2610.14224</a>, CC BY 4.0.</em></p><p>Read the figure from left to right. The candidate probes are the point where a proposed improvement is exposed to execution. The return path matters too: experience changes how future harness edits are made. It does not mean the next task automatically inherits everything that happened on this one.</p><p>This design gives composition more information than a free-form request to “improve the prompt.” It still leaves a causal ambiguity. Agent executions vary. If a candidate performs better once, the harness change may have helped, or the executor may simply have taken a more fortunate path. The paper explicitly identifies stochasticity and shared model biases as limits on these behavioral contrasts. [1]</p><h2>A library carries lessons across tasks, not a permanently mutated agent</h2><p>After a task, a separate reflection step inspects the improvement record. The library retains an adopted executable harness together with an `EXPERIENCE.md` entry describing the applicable situation, lesson, and evidence. If the evidence is insufficient, reflection need not add an entry. [1]</p><p>The next task starts from the common base execution harness. Earlier components can be reused or adapted during proposal, guided by the library. They are not unconditionally installed as the new default.</p><p>That reset is useful. A procedure that helps generate a legal document may be irrelevant to a coding task. Even within a domain, a successful edit may depend on a particular file format or tool. Storing the conditions under which an edit helped gives a future editor something more useful than a generic instruction to “be careful.”</p><p>There are therefore two changing objects: the execution harness being tested on the current task, and the improvement library that informs later refinement. The improvement process does not freely rewrite every part of itself. In the paper’s formulation, model weights, stage instructions, and the decision rule stay fixed while the library evolves. [1]</p><h2>The recursion budget buys width or depth</h2><p>The budget parameter <em>k</em> controls two different schedules.</p><p>Parallel recursion collects <em>k</em> base executions, proposes <em>k</em> invariant and <em>k</em> domain-specific candidates, probes them, and performs <em>k</em> independent compositions using the shared candidate pool. It increases the width of a population update.</p><p>Sequential recursion begins with the base evidence and chains <em>k</em> refinement steps. Each step can use the preceding harness and accumulated execution history. It increases the depth of refinement. At <em>k=1</em>, both reduce to the basic contrastive step. [1]</p><figure><img src="https://learn-llm.com/media/harness-what-an-agent-can-learn-by/03d70a12bea2.png" alt="" loading="lazy"></figure><p><em>Figure 4 from Harness². Parallel recursion explores candidate edits and compositions across a shared pool. Sequential recursion carries the revised harness and accumulated evidence into the following step. Equal k does not imply equal wall-clock latency. Source: <a href="https://arxiv.org/abs/2610.14224" rel="noopener">arXiv:2610.14224</a>, CC BY 4.0.</em></p><p>The paper’s implementation schedules <em>4k</em> executor rollouts and <em>3k</em> improvement stages, including the base executions. At <em>k=1</em>, that is four executor rollouts plus three improvement stages. At <em>k=5</em>, it is twenty rollouts plus fifteen improvement stages, before accounting for selection and post-task reflection. Individual sessions may contain many model calls.</p><p>For <em>k&gt;1</em>, a selector compares anonymized deliverables with the request and source materials. It returns an existing output; it does not synthesize a fresh answer. Adoption here means “chosen by the selector,” not “verified correct.” [1]</p><p>Parallel execution may reduce elapsed time when enough workers are available. It does not remove the computation or API charges. A deployment decision needs total tokens, cost, and latency across the whole pipeline.</p><h2>What the reported results establish</h2><p>The paper evaluates frozen Gemini 3.5 Flash and GLM-5 executors under OpenCode and Codex, giving four model and initial-harness configurations. Claude Opus 4.8 is the default harness editor. The main results report means and standard deviations over three task streams with shuffled task order. [1]</p><p>The test scope is specific:</p><ul><li><p>WorkBuddy-Bench uses 40 Code, 35 Web, and 25 Office test tasks. Its task scores combine deterministic checks with model-based judging.</p></li><li><p>JobBench reports 34 held-out professional tasks, scored against weighted rubrics.</p></li><li><p>LAB reports 100 held-out legal tasks. Its Partial metric is a per-criterion pass rate from a model judge, not a binary measure of legally correct deliverables.</p></li></ul><p>For one concrete configuration, Gemini 3.5 Flash with OpenCode on WorkBuddy-Bench, Table 1 reports the following macro-average across the three domains: [1]</p><p>Setting · Reported average score</p><p>Base harness · 72.4, SD 0.9</p><p>Harness², k = 1 · 77.5, SD 2.5</p><p>Harness², parallel k = 5 · 80.8, derived from the reported +3.3 change in mean</p><p>The single-step gain is 5.1 score points. The larger budget adds 3.3 more. The recursion row reports a change in mean, so I have not attached an invented standard deviation to the derived 80.8.</p><p>The largest one-step gains across the reported configurations are 11.5 WorkBuddy-Bench points, 4.5 JobBench points, and 11.8 percentage points on LAB Partial. Those are different metrics and configurations. They should not be combined into a single “percent improvement.” Harness² also does not lead every metric: Meta-Harness is ahead on LAB Partial for Gemini under Codex before the extra recursion budget. [1]</p><p>Ablations provide some evidence for the design choices. For Gemini/OpenCode at <em>k=1</em>, removing the library reduces WorkBuddy average from 77.5 to 74.4 and JobBench from 36.0 to 34.2. Removing composition yields 75.9 and 34.1 respectively. Those results support the usefulness of these components in that setup; they do not show that every retained lesson transfers.</p><h2>How this relates to reflective memory</h2><p>Reflexion supplies a useful earlier comparison. Its Actor generates actions, an Evaluator supplies feedback, and a Self-Reflection component turns experience into text retained in episodic memory. Later trials receive those reflections without updating the actor’s weights. Its feedback can include tests or environment signals, so it should not be described as universally label-free. [2]</p><p>Agentic Context Engineering, or ACE, organizes context adaptation through a Generator, Reflector, and Curator. It emphasizes structured incremental updates to a playbook so useful detail is not lost through repeated rewriting. I see it as a relevant comparison for maintaining experience, not as evidence that Harness²’s full workflow works. [3]</p><p>Harness² extends the editable surface to an executable harness and tests proposed edits through new executions. It also retains experience about the refinement process. The practical distinction is what persists: a reflection about a failed attempt, an evolving context playbook, or executable components accompanied by observations about when they helped.</p><p>For a related deployment question, <a href="https://learn-llm.com/p/search-agents-need-better-decision/">my SearchJev analysis</a> considers when an agent should delegate or stop. Harness² adds a prior decision: whether to spend more computation changing the agent’s operating procedure at all.</p><h2>The limits I would test before deployment</h2><p><strong>Behavioral improvement is not correctness feedback.</strong> The improver sees trajectories and deliverables, while benchmark graders evaluate the results separately. A convincing explanation or a more complete-looking document can still be wrong. The absence of ground-truth feedback during adaptation is a constraint, not a guarantee that evaluation is unnecessary. [1]</p><p><strong>Public evaluation material can leak into execution.</strong> The release’s <a href="https://github.com/google-research/harness2/blob/1cfe254e8d25b15f37048c3730134686abe60335/docs/EXPERIMENTS.md#web-access" rel="noopener">experiment guide</a> warns that JobBench rubrics are public and reports a validation rollout downloading its task’s rubric. The release does not restrict network access by default. This is a documented evaluation-hygiene risk; it does not by itself establish that the paper’s reported scores are contaminated.</p><p><strong>Executor steps do not measure pipeline cost.</strong> A shorter selected trajectory can coexist with a larger total bill because proposals, probes, composition, selection, and reflection all consume resources. I would not infer cost savings from a reduction in reported executor turns.</p><p><strong>Editable guardrails need an external boundary.</strong> Guardrails are among the harness components the framework can edit. In a production system, permission policy, secrets, network egress, and deployment approval should remain outside the editable experiment. That is my deployment recommendation, not a feature I have verified in the release.</p><p>The repository is Apache-2.0, but benchmark materials have separate terms. Its local deterministic demo can illustrate both recursion schedules without model credentials. That demonstration would test orchestration, not reproduce the paper’s model-backed benchmark gains. I have not run either here.</p><h2>An equal-cost experiment would decide whether I would use it</h2><p>I would begin with a small, non-production task stream with independently checkable deliverables. Compare a fixed harness, repeated execution with output selection, Harness² without persistent experience, and Harness² with its online library. Match total model spending across arms, including the editor and reflector.</p><p>Keep task order, available tools, source documents, and evaluation access controlled. Record library growth, artifact correctness, regressions, total dollars, and wall-clock time. A useful edit should improve the deliverable under an independent check, not merely make the trajectory easier for another model to praise.</p><p>Then test transfer on tasks the library has not seen. Include a deliberately mismatched library from another domain to measure whether experience helps because it is relevant or merely because it adds instructions.</p><p>The outcome I would care about is a measured advantage over equal-cost retries, with a library that helps on later tasks without accumulating regressions. That would justify using Harness² as a harness-engineering process. Until then, the code and paper offer a concrete way to investigate how much agent reliability can be improved outside the model weights.</p><h2>References</h2><p><a href="https://arxiv.org/abs/2610.14224" rel="noopener">[1] Harness²: Recursive Agent Harnessing for an Open World</a></p><p><a href="https://arxiv.org/abs/2303.11366" rel="noopener">[2] Reflexion: Language Agents with Verbal Reinforcement Learning</a></p><p><a href="https://arxiv.org/abs/2510.04618" rel="noopener">[3] Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models</a></p>
]]></content:encoded>
</item>
<item>
<title>Reachability Is Not Ranking: Finite Beams, Continuous Queries, and One TIGER-Style Baseline</title>
<link>https://learn-llm.com/p/reachability-is-not-ranking-finite/</link>
<guid isPermaLink="true">https://learn-llm.com/p/reachability-is-not-ranking-finite/</guid>
<pubDate>Sun, 18 Oct 2026 12:00:00 GMT</pubDate>
<description>A close read of continuous-query generation for generative recommendation, and why &quot;can the target be found?&quot; and &quot;is it ranked well?&quot; need separate measurements.</description>
<category>Recommender Systems</category><category>Generative Recommendation</category>
<content:encoded><![CDATA[<h2>The problem: two questions hidden inside one Recall number</h2><p><a href="https://learn-llm.com/p/a-semantic-tokenizer-cannot-be-judged/">Our earlier post on FLASH</a> argued that you can’t judge a semantic tokenizer on its own; you have to judge it together with the decoder and the search procedure. This post follows from that. The new paper, <em>Beyond Semantic IDs: Finite-Beam Reachability and Continuous-Query Generation in Generative Recommendation</em> [1], takes the search procedure as its subject.</p><p>Semantic-ID (SID) recommenders in the line of <a href="https://arxiv.org/abs/2305.05065" rel="noopener">TIGER</a> [2] turn each item into a short sequence of discrete codes. A sequence model is then trained to emit the next item’s codes, and inference runs beam search over valid code prefixes. A beam is finite. Even when the held-out item has a valid and almost unique code, its path can be pruned before it reaches the returned list. In that case no downstream ranker can recover the item.</p><p>The authors of [1] separate four quantities that people often blur together:</p><ul><li><p><strong>Unique-code assignment</strong>: does each item get its own code?</p></li><li><p><strong>Target-conditioned beam support</strong>: for a given user, does the held-out target appear anywhere in the returned list of size B?</p></li><li><p><strong>Catalog-wide scoreability</strong>: can the model assign a score to every item at all?</p></li><li><p><strong>Union-of-output coverage</strong>: across all users, what fraction of the catalog shows up in at least one top-K list?</p></li></ul><p>The paper’s main claim is that these are different things. In its closer T5/RQ-VAE-style reproduction on Amazon Beauty, 99.48% of generated sequences are valid SIDs, yet the union of top-100 outputs covers only 44.0% ± 13.7% of the catalog. Coverage is 14.0% for the rarest quartile and 88.7% for the most popular [1]. Valid codes don’t buy reachability.</p><p>My aim here is to keep two questions apart all the way through: <strong>can the target be reached</strong> under a finite search budget, and <strong>how well is it ranked</strong> once it can be. The paper’s numbers answer the two differently.</p><h2>Mechanism</h2><h3>The SID interface being replaced</h3><p>Let <em>ℐ</em> be a catalog of <em>N</em> items. User <em>u</em> has a chronological history <em>sᵤ = (i₁, …, iₜ)</em>, and the task is to retrieve <em>iₜ₊₁</em>. An SID system maps item <em>i</em> to a code sequence <em>zᵢ = (z_i,1, …, z_i,L)</em> and trains an autoregressive model. In the standard left-to-right factorization:</p><div class="math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">p</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.044em;">z</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.044em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3.1304em;vertical-align:-1.3021em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8283em;"><span style="top:-1.8479em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">ℓ</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∏</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">L</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.3021em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">p</span><span class="mord"><span class="delimsizing size1">(</span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.044em;">z</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.044em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mord mtight">ℓ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∣</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.2em;vertical-align:-0.35em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.044em;">z</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.044em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mpunct mtight">,</span><span class="mrel mtight">&lt;</span><span class="mord mtight">ℓ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="delimsizing size1">)</span></span></span></span></span></span></div><p>Here <em>L</em> is the code length and <em>z_i,&lt;ℓ</em> is the prefix decoded so far. Beam search keeps only the highest-scoring prefixes at each level, so whether an item gets through depends on its whole path surviving every pruning step.</p><p>In TIGER [2], the codes come from an RQ-VAE over content embeddings. A residual <em>r₀</em> is matched to its nearest codeword <em>e_c₀</em> in the level-0 codebook. The residual <em>r₁ = r₀ - e_c₀</em> is then quantized at the next level, and so on:</p><div class="math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">c</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.5021em;vertical-align:-0.7521em;"></span><span class="mop">ar<span style="margin-right:0.0139em;">g</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.6679em;"><span style="top:-2.3479em;margin-left:0em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span><span class="mop">min</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.7521em;"><span></span></span></span></span></span><span class="mopen">∥</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">r</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.3461em;vertical-align:-0.3013em;"></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.0448em;"><span style="top:-2.3987em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0315em;">k</span></span></span><span style="top:-3.2198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathnormal mtight">d</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3013em;"><span></span></span></span></span></span></span><span class="mclose">∥</span><span class="mpunct">,</span><span class="mspace" style="margin-right:2em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">r</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">d</span><span class="mbin mtight">+</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">r</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.2909em;vertical-align:-0.3529em;"></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight">c</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.3488em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1512em;"><span></span></span></span></span></span></span></span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathnormal mtight">d</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3529em;"><span></span></span></span></span></span></span></span></span></span></span></div><p>Here <em>d</em> indexes the level, <em>e^(d)ₖ</em> is the <em>k</em>-th codeword at level <em>d</em>, and <em>c_d</em> is the selected code. The reported setup uses Sentence-T5 embeddings, three levels of 256 codewords each, and a fourth code to break collisions [2].</p><p>To make the support quantity concrete, I’ll write the paper’s verbal definition as a formula. This is my notation, not an equation from [1]:</p><div class="math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathrm">TargetSupport@</span></span><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.7159em;vertical-align:-1.3944em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∣</span><span class="mord"><span class="mord mathcal" style="margin-right:0.0993em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:-0.0993em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">test</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord">∣</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.05em;"><span style="top:-1.8557em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">u</span><span class="mrel mtight">∈</span><span class="mord mtight"><span class="mord mathcal mtight" style="margin-right:0.0993em;">U</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2963em;"><span style="top:-2.357em;margin-left:-0.0993em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">test</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.143em;"><span></span></span></span></span></span></span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.3944em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mord"><span class="delimsizing size1">[</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">i</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.7387em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">∗</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.2em;vertical-align:-0.35em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">O</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0502em;">B</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal">u</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="delimsizing size1">]</span></span></span></span></span></span></div><p><em>O_B(u)</em> is the deduplicated, history-filtered list of <em>B</em> items returned for user <em>u</em>, and <em>i^*ᵤ</em> is that user’s held-out target. For a fixed checkpoint and budget, this is the highest Recall that any reranker working only on <em>O_B(u)</em> can reach. The paper is explicit that this ceiling depends on the budget, not on the architecture: raising <em>B</em> raises it [1].</p><h3>CQG-Single: one continuous query</h3><p>Both proposed methods share a frozen item matrix <em>E ∈ ℝ^N × d</em>. Each row <em>eᵢ</em> is an L2-normalized item vector, and in the main experiments it comes from a two-layer SASRec pretrained with BPR (<em>d = 64</em>). A generator <em>f_θ</em> maps user context <em>cᵤ</em> (history, plus demographics where available) to a single query:</p><div class="math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0278em;">θ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">c</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mpunct">,</span><span class="mspace" style="margin-right:2em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathrm">score</span></span><span class="mopen">(</span><span class="mord mathnormal">u</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">i</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.1461em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-2.453em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">⊤</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span></div><p>Top-K comes from exact dense scoring or approximate nearest-neighbor (ANN) search. There is no codebook, no code-to-item lookup, and no beam. Every encoded item can be scored by construction. As the authors point out, that doesn’t mean every item will actually show up in a finite top-K [1].</p><h3>CQG-AR: autoregression without a token vocabulary</h3><p>CQG-AR keeps step-by-step decoding but emits continuous residuals instead of tokens:</p><div class="math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8444em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">ℓ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">ϕ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">c</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord">Δ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mrel mtight">&lt;</span><span class="mord mtight">ℓ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1774em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mpunct">,</span><span class="mspace" style="margin-right:2em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord">Δ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">ℓ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.185em;vertical-align:-0.247em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1389em;">W</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">A</span><span class="mord mathnormal mtight" style="margin-right:0.0077em;">R</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">ℓ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:2em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal">e</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1944em;"><span class="mord">^</span></span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mtight">ℓ</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.288em;vertical-align:-0.35em;"></span><span class="mord"><span class="mord mathrm">norm</span></span><span class="mord"><span class="delimsizing size1">(</span></span><span class="mord"><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6944em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord mathnormal">e</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1944em;"><span class="mord">^</span></span></span></span></span></span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-2.453em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">u</span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mtight">ℓ</span><span class="mbin mtight">−</span><span class="mord mtight">1</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.247em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.2em;vertical-align:-0.35em;"></span><span class="mord"><span class="mord">Δ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">ℓ</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="delimsizing size1">)</span></span></span></span></span></span></div><p>with <em>ê⁽⁰⁾ᵤ = 0</em>. <em>D_φ</em> is a causal Transformer decoder, <em>W_AR</em> projects the hidden state into item space, and only the final query <em>ê^(L)ᵤ</em> (with <em>L = 3</em>, to match three SID levels) is used for retrieval. The two variants form a controlled pair. CQG-Single removes both the vocabulary and serial decoding. CQG-AR removes only the vocabulary.</p><h3>Training objective</h3><p>The primary loss is cross-entropy over the full catalog with temperature <em>τ= 0.07</em>:</p><div class="math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathcal">L</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0715em;">C</span><span class="mord mathnormal mtight" style="margin-right:0.0576em;">E</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3.1522em;vertical-align:-1.307em;"></span><span class="mord">−</span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathnormal" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0502em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">batch</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.836em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8452em;"><span style="top:-1.8479em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">b</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3169em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0502em;">B</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.3488em;margin-left:-0.0502em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight"><span class="mord text mtight"><span class="mord mtight">batch</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.1512em;"><span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.3021em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.0139em;">g</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.5404em;"><span style="top:-2.1288em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mop"><span class="mop op-symbol small-op" style="position:relative;top:0em;">∑</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9812em;"><span style="top:-2.4003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.2029em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.109em;">N</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.4358em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">exp</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8309em;"><span style="top:-2.3987em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">b</span></span></span><span style="top:-3.0448em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">⊤</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3013em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.1132em;">τ</span><span class="mclose">)</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.6913em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mop">exp</span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8491em;"><span style="top:-2.4169em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">b</span></span></span><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">⊤</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2831em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal">e</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8115em;"><span style="top:-2.3987em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">b</span></span></span><span style="top:-3.1031em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">+</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.3013em;"><span></span></span></span></span></span></span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.1132em;">τ</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.307em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></div><p><em>q_b</em> is the generated query for example <em>b</em> and <em>e_b⁺</em> is the target item’s embedding. Every item appears in the denominator of every update, which costs <em>O(N)</em> per step [1]. This matters later: the continuous models see the whole catalog during training, while the SID decoder gets token-level supervision.</p><h2>Scoped results</h2><p><strong>Setup.</strong> The datasets are ML-1M (6,040 users, 3,416 items), Amazon Beauty (22,363 / 12,101), and Amazon Sports (21,519 / 10,693, a processed split that the authors say differs from the usual 5-core split). Evaluation is leave-one-out, with history items excluded from ranking. The comparator labeled “TIGER” is <strong>the authors’ own hierarchical-k-means SID model built on the same frozen SASRec embeddings</strong>, decoded with valid-prefix constraints. It is not the published TIGER system, which uses an RQ-VAE over Sentence-T5 content embeddings. The authors state that this baseline is weaker than published SID systems [1].</p><p><strong>Ranking quality (Table 3 of [1]).</strong> Values are the mean over seeds 42–48 on ML-1M and 42–44 on Beauty and Sports.</p><p>Method · Trainable params · ML-1M R@10 · ML-1M N@10 · Beauty R@10 · Sports R@10</p><p>SASRec (full-rank, 1 checkpoint) · 0.32–0.88M · 0.2797 · 0.1535 · 0.0558 · 0.0390</p><p>TIGER-style SID · 5.78M · 0.2996 · 0.1739 · 0.0477 · 0.0236</p><p>CQG-Single · 3.2M · 0.3104 · 0.1822 · 0.0605 · 0.0363</p><p>CQG-AR (L=3) · 5.62M · 0.2976 · 0.1735 · 0.0571 · 0.0355</p><p>CQG-Single beats the TIGER-style model in all seven ML-1M runs. The mean paired gain in R@10 is 0.0107 (about 1.1 percentage points), with a 95% paired t-interval of [0.0021, 0.0193] and an exact sign-flip p = .0156. It uses 55.3% as many trainable parameters. CQG-AR roughly ties on ML-1M and is higher on both Amazon sets. On Beauty, the training-run intervals for the three models overlap. On Sports, both continuous models’ intervals lie above the TIGER-style interval [1]. Full-rank SASRec is still the best of all on Sports. Removing the beam doesn’t automatically produce a better ranker.</p><p><strong>Reachability (Table 2 and §6 of [1]).</strong> This is the result I think matters most. On ML-1M seed 42, with returned-list sizes matched, TargetInOutput@100 is <strong>66.7% for TIGER-style, 67.3% for CQG-Single and 66.4% for CQG-AR</strong>. In other words, the method with no beam reaches only 0.6 percentage points more targets than the beam-search model, and CQG-AR reaches fewer. About a third of held-out targets are missing from every method’s top-100. At this budget the reachability ceiling is a ceiling on retrieval quality in general, not something specific to SIDs. Separately, raising TIGER’s list from 100 to 200 lifts its support from 66.7% to 76.3% (seven-seed means 0.6667 and 0.7593).</p><p><strong>Coverage and popularity.</strong> Union-of-output coverage (Table 4 of [1]) depends on the dataset:</p><ul><li><p><strong>Beauty:</strong> CQG covers much more of the catalog (89.5% vs 74.4% at top-10).</p></li><li><p><strong>ML-1M:</strong> the methods are nearly tied (97.6% vs 97.0% at top-100).</p></li><li><p><strong>Sports:</strong> it reverses. TIGER-style covers 94.0% at top-10 against CQG-Single’s 63.1%.</p></li></ul><p>Across popularity quartile × depth cells on ML-1M, CQG-Single leads in 38 of 48. It wins every Q2–Q3 cell, while TIGER-style keeps some rare-item (Q1) advantages at shallow depths. That diagnostic uses a separately selected checkpoint, and Beauty doesn’t reproduce the rare-item pattern [1].</p><p><strong>Ablations.</strong> On ML-1M, the CQG-AR depth sweep from L = 1 to 4 moves R@10 only between 0.2909 and 0.2944, and the trend isn’t monotonic. Training CQG-AR with 256 sampled negatives instead of the full softmax drops R@10 from 0.2982 to 0.2895. So seeing the whole catalog during training explains <em>part</em> of the gap, by the authors’ own account [1].</p><p><strong>Cost scope.</strong> The reported cost evidence is the parameter counts and the <em>O(N)</em> per-step training cost. Latency, memory, ANN behavior and index-update cost are not measured [1].</p><h2>How it relates to the other two papers</h2><h3>TIGER [2]: the foundation, and not the baseline</h3><p>TIGER introduced the interface that [1] analyzes: RQ-VAE semantic IDs, a Transformer encoder–decoder, and beam search over IDs. It already flagged the right concerns. Invalid IDs made up roughly 0.1–1.6% of top-10 predictions, and the suggested fixes were a wider beam plus filtering. The authors also noted that autoregressive beam decoding can cost more than ANN retrieval [2]. What it didn’t measure was whether valid targets survive the beam, and [1] fills that gap.</p><p>TIGER is <em>not</em> the comparator in [1]. For context, published TIGER reports Beauty Recall@10 of 0.0648 [2]. That is numerically above both the TIGER-style 0.0477 and CQG-Single’s 0.0605 in [1]. The Beauty user and item counts match, but the item representation (content vs collaborative embeddings), quantizer, filtering and evaluation pipeline all differ, so this isn’t a matched comparison in either direction. The only safe reading is the one the authors give: within one shared frozen item space, continuous queries beat one hierarchical-k-means SID implementation.</p><h3>FLASH [3]: discrete IDs without a beam</h3><p><a href="https://arxiv.org/abs/2610.07402" rel="noopener">FLASH</a> [3] is the useful contrast, because it removes beam search while <em>keeping</em> discrete IDs. Each item’s frozen LLM text embedding <em>xᵢ</em> is hashed at code position <em>j</em> using <em>B = ⌈log₂ M ⌉</em> Gaussian hyperplanes <em>r_j,b</em>:</p><div class="math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.4578em;vertical-align:-0.413em;"></span><span class="mord"><span class="mord mathnormal">c</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.0448em;"><span style="top:-2.4231em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span><span style="top:-3.2198em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathnormal mtight">i</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.413em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3.1304em;vertical-align:-1.3021em;"></span><span class="mord"><span class="delimsizing size2">(</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8283em;"><span style="top:-1.8479em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">b</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0502em;">B</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.3021em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">1</span><span class="mopen">[</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8252em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0278em;">r</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span><span class="mpunct mtight">,</span><span class="mord mathnormal mtight">b</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">&gt;</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.8em;vertical-align:-0.65em;"></span><span class="mord">0</span><span class="mclose">]</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">b</span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mord"><span class="delimsizing size2">)</span></span><span class="mspace" style="margin-right:0.0556em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin"><span class="mord"><span class="mord mathrm">mod</span></span></span><span class="mspace" style="margin-right:0.0556em;"></span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.7667em;vertical-align:-0.0833em;"></span><span class="mord mathnormal" style="margin-right:0.109em;">M</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span></span></div><p><em>M</em> is the codebook size (a power of two) and <em>m</em> is the number of positions. Separate heads predict all positions in parallel, and inference scores <em>every</em> item from cached per-position distributions:</p><div class="math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1324em;vertical-align:-0.1944em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1.288em;vertical-align:-0.35em;"></span><span class="mord"><span class="mord mathrm">softmax</span></span><span class="mord"><span class="delimsizing size1">(</span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0576em;">E</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1076em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">h</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mclose">)</span><span class="mord">/</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.1132em;">τ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1132em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="delimsizing size1">)</span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:2em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathrm">score</span></span><span class="mopen">(</span><span class="mord mathnormal">i</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3.0652em;vertical-align:-1.4138em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.6514em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">m</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">lo<span style="margin-right:0.0139em;">g</span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0359em;">q</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-2.453em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight">c</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3281em;"><span style="top:-2.357em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2819em;"><span></span></span></span></span></span></span></span></span></span><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathnormal mtight" style="margin-right:0.0572em;">j</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.4443em;"><span></span></span></span></span></span></span></span></span></span></span></div><p>The total cost is <em>O(mMd + Nm)</em> [3]. Here <em>hₜ₋₁</em> is the final history state, <em>E^(j)</em> is the position-<em>j</em> code-embedding table, and <em>fⱼ</em> is head <em>j</em>. The product over positions is a modeling factorization, not a claim that the codes are statistically independent. FLASH also adds an alignment loss <em>-(1)/(|S|)Σ_i ∈ Scos(zᵢ, φ(xᵢ))</em> that ties learned item representations back to the projected LLM embedding.</p><p>For reachability, this means the finite-beam ceiling belongs to <strong>beam decoding</strong>, not to discrete IDs as such. A SID model scored across the whole catalog can score every item just as CQG can. The paper’s title, “Beyond Semantic IDs,” therefore claims more than its experiments isolate. The paired CQG design separates <em>autoregression</em> from <em>a discrete vocabulary</em>. It does not separate <em>a discrete vocabulary</em> from <em>beam search</em>. FLASH’s own numbers (for example, Beauty R@10 of 0.0832 under protocols adapted from TIGER and RPG [3]) come from a different setup and can’t be ranked against [1].</p><h2>What the evaluation does not show</h2><ul><li><p><strong>Superiority over strong SID systems.</strong> There is one TIGER-style comparator, built on k-means over SASRec embeddings. Published TIGER, LETTER and EAGER appear only as context. The closer RQ-VAE reproduction is a coverage diagnostic, and the authors note that its ranking accuracy is below the reference implementation [1].</p></li><li><p><strong>That the ranking gain comes from removing the beam.</strong> At a matched list of 100, support differs by 0.6 points, while R@10 differs by about 1.1 points. The sampled-negative control shows that full-catalog training accounts for part of the gap. The gain is real for this setup. The <em>mechanism</em> isn’t settled.</p></li><li><p><strong>A compute-matched search comparison.</strong> Beam width, returned-list size and FLOPs are not traded off against each other on a single curve. List size alone moves TIGER-style support by about 9.6 points.</p></li><li><p><strong>Scale or serving cost.</strong> ML-1M has 3,416 items, so exact scoring is trivial there. There are no latency, memory or ANN-recall-loss numbers, and no billion-item training. The <em>O(N)</em> softmax is evaluated only at these sizes.</p></li><li><p><strong>Updatability and cold start.</strong> The item space is a frozen SASRec table. A brand-new item has no collaborative embedding until something produces one, so the claim that the output dimensionality doesn’t change as items are added doesn’t answer how new items are represented. Cold-item accuracy is listed as unmeasured [1].</p></li><li><p><strong>Causal popularity effects.</strong> The quartile analysis is observational, depends on the checkpoint, and doesn’t fully replicate across datasets.</p></li></ul><h2>One concrete experiment</h2><p>Run a <strong>2 × 2 factorial on a shared item space</strong>, with output type crossed with search procedure:</p><p>1. <strong>Arms.</strong> (a) RQ-VAE SID with beam search; (b) the same SID checkpoint scored across the whole catalog by teacher-forcing every valid code path, so each item gets an exact sequence log-probability. At these catalog sizes, a trie-batched pass is feasible; a FLASH-style parallel SID is the cheaper variant; (c) CQG-Single with exact top-K; (d) CQG-Single with production ANN at a fixed recall target.</p><p>2. <strong>Controls.</strong> Use the same backbone width and the same item embedding source (run once with content embeddings and once with collaborative ones). Use the same training-time catalog visibility: either full softmax for every arm, or 256 sampled negatives for every arm.</p><p>3. <strong>Budget axis.</strong> Sweep returned-list size B ∈ {50, 100, 200, 500} and record p50/p99 latency and accelerator-seconds per 1,000 users at each point. Compare arms at <strong>matched latency</strong>, not only at matched B.</p><p>4. <strong>Report three numbers separately.</strong> Report TargetSupport@B (reachability), Recall/NDCG@10 <em>conditional on the target being reachable</em> (ranking), and catalog coverage by popularity quartile. Include paired intervals over at least five seeds.</p><p>5. <strong>Decision rule for deployment.</strong> In a shadow run, feed each arm’s top-B into the existing production ranker. Ship the continuous-query retriever only if it raises the ranker’s achievable recall at equal p99 latency. If arm (b) closes most of the gap with (c), the fix is to change the SID search procedure, not to remove the IDs.</p><p>If (a) → (b) captures most of the support gain while (b) → (c) captures most of the conditional-ranking gain, then reachability and ranking quality have been separated, which neither [1] nor [3] does on its own.</p><h2>References</h2><p><a href="https://arxiv.org/abs/2610.12977" rel="noopener">[1] Beyond Semantic IDs: Finite-Beam Reachability and Continuous-Query Generation in Generative Recommendation</a></p><p><a href="https://arxiv.org/abs/2305.05065" rel="noopener">[2] Recommender Systems with Generative Retrieval</a></p><p><a href="https://arxiv.org/abs/2610.07402" rel="noopener">[3] Rethinking Semantic ID Construction for Generative Recommendation: SimHash with Parallel Decoding and Semantic Alignment</a></p>
]]></content:encoded>
</item>
<item>
<title>A Semantic Tokenizer Cannot Be Judged Without Its Decoder</title>
<link>https://learn-llm.com/p/a-semantic-tokenizer-cannot-be-judged/</link>
<guid isPermaLink="true">https://learn-llm.com/p/a-semantic-tokenizer-cannot-be-judged/</guid>
<pubDate>Sat, 17 Oct 2026 12:00:00 GMT</pubDate>
<description>FLASH, SimHash, and the hidden assumptions in generative recommendation</description>
<category>Recommender Systems</category><category>Generative Recommendation</category>
<content:encoded><![CDATA[<p>A weak result for an item tokenizer can mean several things: the codes discarded useful information, the predictor imposed the wrong structure, or the training objective failed to preserve what mattered. Changing the tokenizer alone cannot identify which explanation is responsible.</p><p><a href="https://arxiv.org/abs/2610.07402" rel="noopener">FLASH</a> revisits SimHash through that lens. The paper combines training-free hashing, parallel code prediction, and semantic alignment. The useful contribution is a co-design argument: item representation, decoder, and objective should be evaluated together.</p><h2>1. What “training-free” actually covers</h2><p>FLASH first computes fixed text embeddings from item metadata. At each semantic-ID position, random hyperplanes turn an embedding’s projection signs into a discrete code. Those hyperplanes are shared across items and remain fixed, so the tokenizer does not require fitting a quantization model. [7]</p><p>A compact way to express the hashing step is:</p><pre><code>&lt;code&gt;&lt;code&gt;b_{j,k}(i)=\mathbf{1}[a_{j,k}^{\mathsf T}x_i\geq0],
\qquad
c_j(i)=1+\sum_{k=0}^{K-1}2^k b_{j,k}(i).&lt;/code&gt;&lt;/code&gt;</code></pre><p>Here <code>x_i</code> is the text embedding, <code>j</code> identifies a code position, and its <code>K</code> sign bits index one of <code>M=2^K</code> entries. This is a restatement of the paper’s encoding, not a new algorithm.</p><p>The recommendation model still trains. Its code embeddings, history model, prediction heads, and alignment projection are learned. Computing the original item embeddings also costs something. “Training-free tokenizer” therefore should not become “training-free recommender” or “free item ingestion.”</p><p>There is an important statistical nuance. Independently sampled projections do not prove that code values are statistically independent across real items. Codes all depend on the same item vector. The relevant architectural observation is that their positions have no intrinsic residual or left-to-right ordering.</p><h2>2. Why parallel prediction is a plausible match</h2><p><a href="https://arxiv.org/abs/2305.05065" rel="noopener">TIGER</a> assigns semantic codeword tuples to items and autoregressively predicts the next item’s identifier from user history. [8] FLASH asks whether imposing that same sequential prediction structure on unordered hash codes is helpful.</p><p>Its predictor factorizes the target-ID probability across code positions and uses a dedicated prediction head for each position. All heads share the history representation and predict simultaneously. [7]</p><pre><code>&lt;code&gt;&lt;code&gt;p(c_1,\ldots,c_m\mid h)
\approx\prod_{j=1}^{m}p_j(c_j\mid h).&lt;/code&gt;&lt;/code&gt;</code></pre><p>This is a modeling assumption. It removes sequential dependencies in the output heads; it does not imply that the underlying joint distribution truly factorizes. The shared history state can influence every head, but the predictor does not condition later code predictions on earlier generated code values.</p><p>The paper’s preliminary experiment is useful because it changes the predictor. Replacing autoregressive decoding with parallel decoding improves SimHash-based recommendation, while leaving a residual gap that motivates semantic grounding. [7]</p><p>That supports compatibility as one explanation for the earlier gap. It does not prove that autoregression is always inappropriate for every learned or hashed identifier.</p><h2>3. Recovering a semantic training signal</h2><p>A hard code preserves only part of the original embedding information. FLASH adds a separate constraint on the learned item representation.</p><p>A trainable linear projection maps the frozen text embedding into the recommendation representation space. The alignment objective minimizes negative cosine similarity between this projected embedding and the learned representation of each input item: [7]</p><pre><code>&lt;code&gt;&lt;code&gt;L_{\mathrm{align}}=-\frac{1}{|S|}\sum_{i\in S}
\cos\big(z_i,\phi(x_i)\big),
\qquad
L=L_{\mathrm{rec}}+\lambda_{\mathrm{align}}L_{\mathrm{align}}.&lt;/code&gt;&lt;/code&gt;</code></pre><p>The two objectives supervise different properties. Recommendation loss trains next-item code prediction; alignment encourages the representation to retain information from the text embedding. Better content geometry alone does not establish better modeling of user preferences.</p><p>That is where <a href="https://arxiv.org/abs/2405.07314" rel="noopener">LETTER</a> makes a useful comparison. Its learnable item tokenization explicitly incorporates hierarchical semantics, collaborative information, and code-assignment diversity. [9] FLASH and LETTER differ in more than whether a quantizer is trained. A fair comparison should expose which gains come from collaborative signals, decoding, alignment, or the item encoder.</p><h2>4. Parallel prediction still has a catalog term</h2><p>At inference, FLASH computes a probability vector <code>q^{(j)}</code> for each code position once. A valid catalog item’s score is the sum of its code-position log probabilities: [7]</p><pre><code>&lt;code&gt;&lt;code&gt;\mathrm{score}(i)=\sum_{j=1}^{m}\log q^{(j)}_{c_j(i)}.&lt;/code&gt;&lt;/code&gt;</code></pre><p>The paper gives the resulting cost as:</p><pre><code>&lt;code&gt;&lt;code&gt;O(mMd+Nm),&lt;/code&gt;&lt;/code&gt;</code></pre><p>where <code>m</code> is the number of code positions, <code>M</code> their vocabulary size, <code>d</code> the representation dimension, and <code>N</code> the number of candidate items.</p><p>The <code>Nm</code> gather-and-sum term remains. The predictor avoids evaluating all possible code combinations, but scoring every catalog item is not independent of catalog size. Removing repeated dense item interactions and removing the catalog scan are different optimizations.</p><p>This also clarifies candidate validity: evaluating IDs already attached to real catalog items avoids interpreting arbitrary combinations as products. It does not solve stock availability, policy eligibility, or index freshness. Those constraints still belong in the serving system.</p><h2>5. The controlled tokenizer comparison is more informative than the headline</h2><p>On four Amazon review categories, FLASH reports the best results across the displayed Recall and NDCG metrics, with relative NDCG@5 improvements from 5.51% to 14.46% over the best baseline. [7]</p><p>Table 2 asks a narrower question: what happens when tokenizers use a shared parallel-prediction and alignment pipeline? SimHash becomes competitive with learned quantizers. On Beauty, its NDCG@10 is 0.0489 versus 0.0498 for OPQ; on CDs, 0.0446 versus 0.0455. It leads those compared tokenizers on Toys and Sports in that table. [7]</p><p>Those mixed results are useful. They suggest the full FLASH pipeline’s gains should not be attributed to hashing universally dominating learned quantization.</p><p>The measured SimHash tokenization times range from about 0.056 to 0.461 seconds on CPU. The table measures RQ-VAE and RQ-KMeans on GPU, while other methods use CPU. [7] These figures concern code construction from precomputed embeddings in the evaluated datasets, not total ingestion, model training, or online service latency. Hardware and scope belong next to the speed claim.</p><p>The paper also reports strong cold-start results when target items are withheld from training, and identifies text-embedding quality, hash collisions, public-benchmark scope, and missing non-text modalities as limitations. [7] That setting is valuable but does not cover every meaning of cold start, such as new users, distribution shifts, or unseen product domains.</p><h2>6. The reproducibility counterweight</h2><p><a href="https://arxiv.org/abs/2609.24430" rel="noopener">What Makes a Good Semantic ID for Generative Recommendation?</a> reports that no SID design wins universally under its unified evaluation, balanced codebook utilization is insufficient to select the best recommender, and increasing code length or model size does not reliably improve quality. [10]</p><p>This is not a direct replication of FLASH. It does challenge the habit of selecting a tokenizer from reconstruction, utilization, or a single benchmark alone.</p><p>A useful evaluation would cross tokenizer choice with autoregressive versus parallel prediction and alignment on versus off. Keep the item embeddings, history backbone, time split, tuning budget, and target-item protocol fixed. Report both matched-code configurations and matched-cost configurations, since longer codes can increase representation capacity while changing serving cost.</p><p>For a growing catalog, I would additionally record collisions, newly ingested-item ranking, cache refresh time, and agreement between the item eligibility snapshot and scored results. These are proposed measurements, not results already established by FLASH.</p><h2>What to take into a production experiment</h2><p>Start with the simplest representation–predictor combination that makes a meaningful comparison. A fast hash baseline under an incompatible decoder is an unfair test of hashing. A stronger predictor with extra semantic supervision is also not evidence that the hash alone caused the improvement.</p><p>FLASH supplies a concrete way to separate those effects. The deployment question is whether that separation produces a better quality–cost trade-off on the catalog and behavior distribution you actually serve.</p><h2>References</h2><p><a href="https://arxiv.org/pdf/2610.07402" rel="noopener">[7] Rethinking Semantic ID Construction for Generative Recommendation: SimHash with Parallel Decoding and Semantic Alignment</a></p><p><a href="https://arxiv.org/abs/2305.05065" rel="noopener">[8] Recommender Systems with Generative Retrieval</a></p><p><a href="https://arxiv.org/abs/2405.07314" rel="noopener">[9] Learnable Item Tokenization for Generative Recommendation</a></p><p><a href="https://arxiv.org/abs/2609.24430" rel="noopener">[10] What Makes a Good Semantic ID for Generative Recommendation? A Reproducibility Study</a></p>
]]></content:encoded>
</item>
<item>
<title>Knowing When to Intervene: Six Papers on RL, Search Agents, and RAG</title>
<link>https://learn-llm.com/p/knowing-when-to-intervene-six-papers/</link>
<guid isPermaLink="true">https://learn-llm.com/p/knowing-when-to-intervene-six-papers/</guid>
<pubDate>Sat, 17 Oct 2026 12:00:00 GMT</pubDate>
<description>RL, Agents &amp; Applications · Issue 002 · arXiv submissions from October 5–9, 2026</description>
<category>Reinforcement Learning</category><category>Retrieval-Augmented Generation</category><category>LLM Agents</category>
<content:encoded><![CDATA[<p>A pattern runs through these papers. A retriever decides whether to diversify. A search agent decides which evidence to show itself. An optimizer decides which part of a RAG pipeline failed before changing it. In each case the strong default is often right, and a method is judged by how well it knows when to depart from it.</p><p>This column covers six recent papers on reinforcement learning, search agents, and RAG applications. The companion column on LLMs and recommender systems is <a href="https://learn-llm.com/p/what-a-recommender-can-reach-remember/">What a Recommender Can Reach, Remember, and Afford</a>. The numbers below are the authors’ reported results on their own benchmarks.</p><h2>In this column</h2><p><strong>RL methods</strong></p><p>1. Explanatory World Models: credit assignment from explanations</p><p>2. RELER: reinforcement learning in embedding space</p><p><strong>Search agents</strong></p><p>3. T-Search: an open agentic retriever</p><p>4. Programmatic Search Agents: control over evidence, not just queries</p><p><strong>RAG in practice</strong></p><p>5. Relevance versus diversity: diversify only when the pool is redundant</p><p>6. Agentic AutoRAG: diagnosis-driven pipeline tuning</p><h2>RL methods</h2><h3>1. Explanatory World Models: credit assignment from explanations</h3><p><a href="https://arxiv.org/abs/2610.13504" rel="noopener">Beyond Temporal Proximity: Explanatory World Models for Credit Assignment in Reinforcement Learning</a></p><p>Explanatory World Models use a frontier language model to explain which earlier events plausibly caused a delayed outcome, then apply a conservative hierarchical operator that redistributes reward while preserving the undiscounted episode return. The authors test explanation types inspired by actual causation, explanatory simplicity, and hard-to-vary explanations. [1]</p><p>Evaluation spans Crafter and WordCraft, the KuaiRand sequential-recommendation benchmark, and offline evaluation of an industry-scale generative recommender, where it improves Recall and behavioral proxies. [1]</p><p>Return conservation guarantees the redistribution does not change what the episode was worth. It does not guarantee the explanation assigned credit to the right step. For recommendation, where exposure bias shapes which items could have caused an outcome, that gap matters. The industry evidence is offline.</p><h3>2. RELER: reinforcement learning in embedding space</h3><p><a href="https://arxiv.org/abs/2610.07731" rel="noopener">Learning to Retrieve via Reinforcement Learning in Embedding Space</a></p><p>RELER treats retrieval as a policy over embeddings. It samples unit-length query and document vectors from von Mises–Fisher distributions centered on encoder outputs, scores the outcomes, and updates the encoder with REINFORCE and a leave-one-out baseline. Conditional-mean projection reduces sampling noise while preserving the policy gradient’s expectation. [2]</p><p>Post-training BGE-M3 and Qwen3-Embedding with RELER gives higher average nDCG@10 on BRIGHT than InfoNCE and LambdaLoss. In RAG experiments across seven QA datasets, only the query encoder is adapted while the index and generator stay fixed. [2]</p><p>The fixed-index design is clean for attribution and convenient for deployment, because no re-embedding of the corpus is needed. It also means the reported gains do not tell us what happens when document embeddings are trained too.</p><h2>Search agents</h2><h3>3. T-Search: an open agentic retriever</h3><p><a href="https://arxiv.org/abs/2610.06782" rel="noopener">T-Search: An Open Agentic Retriever and Playground for Hard Multi-Step Search</a></p><p>T-Search runs bounded multi-round search over a fixed corpus and returns ranked evidence chunks with short justifications, leaving answer generation to a separate model. Built on Qwen3.6-35B-A3B, it is trained with adversarially filtered synthetic tasks, round-sliced SFT, and GSPO with a recall reward. [3]</p><p>Across seven English and Russian benchmarks with gold evidence, it reports 56.0 Recall@10 with one rollout and 61.3 with three fused rollouts, 14.4 points above its base model for the single rollout. The model, harness, demo, and three benchmarks, including the native-Russian TRuST, are released. [3]</p><p>Separating retrieval from answering makes the reward checkable: recall against gold evidence. The trade-off is that recall rewards finding evidence, not deciding when enough has been found — the sufficiency question <a href="https://learn-llm.com/p/search-agents-need-better-decision/">SearchJev</a> targets.</p><h3>4. Programmatic Search Agents: control over evidence, not just queries</h3><p><a href="https://arxiv.org/abs/2610.06689" rel="noopener">Programmatic Search Agents: Extending Agentic Search Beyond Query Reformulation</a></p><p>The authors argue that rewriting queries is not enough control: a fixed search interface can retrieve a supporting passage without ever showing it to the agent. Their Programmatic Search Agent runs executable operations over retrieved candidates in a persistent workspace and chooses which evidence to present. [4]</p><p>Across five backbones without task-specific training, it raises macro-averaged task success over a query-based agent by 4.00 and 7.56 points on InfoSeek-Eval and BrowseComp-Plus, while within-backbone final-step token use falls by 28.3% and 33.9%. [4]</p><p>The token saving is measured at the final step. Programs that filter and deduplicate candidates also cost tokens to write and run, so total cost per question is the comparison to ask for.</p><h2>RAG in practice</h2><h3>5. Relevance versus diversity: diversify only when the pool is redundant</h3><p><a href="https://arxiv.org/abs/2610.09412" rel="noopener">Finding the Right Balance: Relevance and Diversity in LLM Retrieval</a></p><p>With injected near-duplicates and overlapping chunks, diversification hurts relevance, evidence coverage, and answer quality on clean pools, but can help multi-evidence questions when redundancy makes nearest-neighbor retrieval return repeats. The proposed rule diversifies only when the effective number of distinct documents in the top-k falls below the query’s evidence requirement, and defaults to plain nearest-neighbor retrieval otherwise. [5]</p><p>This is the cleanest statement of the column’s theme. Diversity is not a universal objective; it is an intervention with a trigger condition. The rule depends on knowing how many pieces of evidence a query needs, which is itself an estimate in production.</p><h3>6. Agentic AutoRAG: diagnosis-driven pipeline tuning</h3><p><a href="https://arxiv.org/abs/2610.08452" rel="noopener">Agentic AutoRAG: RAG Pipeline Optimization through Reasoning-Driven Agents</a></p><p>After each trial, a Diagnoser labels failed questions as retrieval or generation failures, and a Proposer uses that diagnosis plus model rankings and pricing to pick the next RAG configuration, tracing an accuracy–cost Pareto frontier on a frozen exam. [6]</p><p>On a real healthcare corpus it reports 77% median exam accuracy versus 71.5% for the strongest baseline at about 58% of that baseline’s cost per query. [6]</p><p>Accuracy here is judged by an LLM on an exam drawn from the corpus. Diagnosis-guided search is a sensible idea; how well the exam predicts production questions is the open variable.</p><h2>One experiment to try</h2><p><strong>Does a learned “when to intervene” signal transfer across tasks?</strong></p><p>The diversity rule decides when to diversify, SearchJev decides when to escalate, and the <a href="https://learn-llm.com/p/when-should-a-personal-agent-override/">personal-agent mediation paper</a> decides when to override a ranking. Each reports gains against a strong default on its own benchmark. A shared evaluation would hold the default fixed and plot the same curve for every method: fraction of cases changed against net benefit, with harms counted separately from gains.</p><p>If the curves look alike, “knowing when to act” may be a reusable component. If they differ sharply, each trigger is task-specific and has to be calibrated where it is deployed.</p><h2>References</h2><p><a href="https://arxiv.org/abs/2610.13504" rel="noopener">[1] Beyond Temporal Proximity: Explanatory World Models for Credit Assignment in Reinforcement Learning</a></p><p><a href="https://arxiv.org/abs/2610.07731" rel="noopener">[2] Learning to Retrieve via Reinforcement Learning in Embedding Space</a></p><p><a href="https://arxiv.org/abs/2610.06782" rel="noopener">[3] T-Search: An Open Agentic Retriever and Playground for Hard Multi-Step Search</a></p><p><a href="https://arxiv.org/abs/2610.06689" rel="noopener">[4] Programmatic Search Agents: Extending Agentic Search Beyond Query Reformulation</a></p><p><a href="https://arxiv.org/abs/2610.09412" rel="noopener">[5] Finding the Right Balance: Relevance and Diversity in LLM Retrieval</a></p><p><a href="https://arxiv.org/abs/2610.08452" rel="noopener">[6] Agentic AutoRAG: RAG Pipeline Optimization through Reasoning-Driven Agents</a></p>
]]></content:encoded>
</item>
<item>
<title>Search Agents Need Better Decision Boundaries, Not Just Bigger Models</title>
<link>https://learn-llm.com/p/search-agents-need-better-decision/</link>
<guid isPermaLink="true">https://learn-llm.com/p/search-agents-need-better-decision/</guid>
<pubDate>Sat, 17 Oct 2026 12:00:00 GMT</pubDate>
<description>SearchJev, calibrated delegation, and the cost of deciding when to stop</description>
<category>Large Language Models</category><category>LLM Agents</category>
<content:encoded><![CDATA[<p>A search agent can spend substantial computation deciding whether to keep searching. Passage relevance, evidence sufficiency, and answer support are small outputs with large consequences: a premature stop can miss the decisive source, while an unnecessary search can add cost without improving the answer.</p><p><a href="https://arxiv.org/abs/2610.05107" rel="noopener">SearchJev</a> asks whether these recurring decisions need the same generative model used for planning and writing. Its answer is a specialized, schema-conditioned decision model, with uncertain cases delegated to a larger model. The interesting question is how that delegation behaves when confidence stops being reliable.</p><h2>1. Score the decision instead of generating its serialization</h2><p>SearchJev receives a search state, a decision question, and a finite set of legal options. Each option is associated with a distinct single-token label. It reads the causal LM’s vocabulary logits at the first output position and normalizes only the logits of those labels. [1]</p><p>For legal options <code>V_f</code>, the readout is:</p><pre><code>&lt;code&gt;&lt;code&gt;p_f(v)=\frac{\exp(\ell_f(v))}{\sum_{u\in V_f}\exp(\ell_f(u))}.&lt;/code&gt;&lt;/code&gt;</code></pre><p>An option description can be long; the label assigned to it must be one token. The controller maps the selected label back to a structured decision. This avoids generating a JSON object token by token and then parsing it.</p><p>That does not make the input free to process. The backbone still processes the supplied search state. The saving targets sequential output generation and decision serialization, not all the computation in a search pipeline. Open-ended query writing remains a different operation.</p><p>In the dual-system agent, System 2 retains planning, query generation, and final-answer composition. SearchJev handles bounded judgments, and a search controller converts resolved decisions into actions. [1]</p><p>This is a useful design boundary: use a constrained predictor when the output space is enumerable, and keep generation where the task genuinely requires it. If the legal schema excludes the action the agent needs, confident selection among the remaining options will not repair the schema.</p><h2>2. Why an option probability is not automatically confidence</h2><p>Soft-Label Learning for Calibrated Decisions, or SLCD, learns from target distributions rather than forcing every example into a certain one-hot label. Its weighted objective combines cross-entropy with a Brier term, followed by held-out temperature fitting. [1]</p><p>Writing the target distribution as <code>t_f</code>, the objective is:</p><pre><code>&lt;code&gt;&lt;code&gt;L_f=w_f\left[-\sum_v t_f(v)\log p_f(v)
+\lambda_B\sum_v\big(p_f(v)-t_f(v)\big)^2\right].&lt;/code&gt;&lt;/code&gt;</code></pre><p>The implementation permutes unordered options to reduce position bias, downweights selected weaker supervision sources, and fits temperatures by output type. Positive temperature scaling preserves option order while changing probability sharpness. [1]</p><p>The connection to <a href="https://arxiv.org/abs/1706.04599" rel="noopener">Guo et al.’s calibration study</a> is direct: accurate classifiers can be poorly calibrated, and temperature scaling can improve probability estimates without changing their predicted class. [2] SearchJev adds decision-specific training and typed calibration; its contribution should not be reduced to applying one temperature to an ordinary classifier.</p><p>There is a further limitation in the loss itself. A proper scoring rule encourages agreement with the target distribution. If those targets encode an imperfect teacher’s judgment, learning them faithfully does not establish that the resulting probabilities describe real-world correctness. Calibration against labels and calibration against the user’s eventual task outcome are separate questions.</p><h2>3. Delegation is a risk–coverage problem</h2><p>SearchJev accepts a local decision when its maximum calibrated option probability exceeds a threshold <code>\delta</code>; otherwise, System 2 resolves the same bounded question. [1]</p><p>This connects to <a href="https://arxiv.org/abs/1705.08500" rel="noopener">selective classification</a>: a predictor can trade coverage for lower risk by rejecting cases it should not handle. [3] In an agent, rejection becomes escalation rather than simply withholding a classification.</p><p>A practical analysis would plot:</p><p>• <strong>Coverage:</strong> the fraction of decisions accepted from the small model.</p><p>• <strong>Selective risk:</strong> error among those accepted decisions.</p><p>• <strong>Escalation cost:</strong> extra calls, latency, and tokens paid for rejected decisions.</p><p>• <strong>Task quality:</strong> whether the final answer is correct and supported.</p><p>These are suggested deployment measurements, not guarantees supplied by SearchJev. Selective-classification results do not transfer automatically to a changing agent environment.</p><p>The threshold also need not be the same for every decision. A false relevance judgment might add a distracting passage; a false sufficiency judgment might end the search before essential evidence is found. Equal confidence can have unequal downstream costs. Comparing per-type thresholds with a single global threshold would test whether that asymmetry matters.</p><h2>4. What the experiments establish</h2><p>The paper evaluates 0.8B and 4B models against same-size Qwen3.5 autoregressive JSON baselines. It reports roughly 5.2–5.3 times faster local decisions and mean in-distribution ECE reductions of 74.4% and 40.7%, respectively. [1]</p><p>For the agent experiment, the authors sample 100 BrowseComp-Plus questions, run each agent once per question, use Qwen3.5-27B as System 2, and retrieve with BM25. Table 4 reports: [1]</p><p>Agent · Answer accuracy · Median active time, seconds · Output tokens, thousands</p><p>System 2 only · 45% · 4,080 · 73.7</p><p>SearchJev-0.8B + System 2 · 46% · 868 · 15.5</p><p>SearchJev-4B + System 2 · 54% · 1,102 · 22.1</p><p>The 4B configuration offers a different quality–cost point from the 0.8B configuration. It is more accurate in this sample but slower and more token-intensive. These are median active-search measurements under the paper’s setup, not a universal latency reduction or a p99 serving guarantee. One run on 100 questions also does not establish stability across repeated trajectories.</p><p>The harder result is the transfer test. On held-out datasets, decision performance transfers more consistently than calibration. Verification accuracy declines for the 4B model relative to its same-size autoregressive baseline, and calibration gains vary by decision family. [1]</p><p>A system can retain useful rankings of options while becoming unreliable about how certain it is. That distinction matters precisely because the controller uses confidence to decide when to escalate.</p><h2>5. How this differs from training a search policy</h2><p><a href="https://arxiv.org/abs/2210.03629" rel="noopener">ReAct</a> interleaves reasoning with actions that obtain information or interact with an environment. [4] SearchJev changes the division of labor inside such a loop rather than eliminating the loop.</p><p><a href="https://arxiv.org/abs/2503.09516" rel="noopener">Search-R1</a> uses reinforcement learning to optimize search-using reasoning trajectories, including query generation and the use of retrieved information. [5] SearchJev’s local probability-learning objective is not that trajectory-level RL objective. A trained search policy and a calibrated decision module could be complementary, but their integration would require its own evaluation.</p><p>The cost motivation is real, but comparisons must stay scoped. A separate <a href="https://arxiv.org/abs/2610.05750" rel="noopener">agentic retrieval study</a> reports 107.4 seconds per query versus 0.67 seconds for standard retrieval, with substantial token consumption. [6] That is a different pipeline and benchmark. It motivates studying repeated decision overhead; it does not establish that SearchJev would remove those costs in that system.</p><h2>6. A deployment test that would change my confidence</h2><p>I would freeze the retriever, corpus snapshot, System-2 model, query prompts, and evidence budget, then compare a full-generative controller with SearchJev controllers across several thresholds. The experiment should charge input processing, escalation, retrieval, retries, and final synthesis.</p><p>The diagnostic interventions would include incomplete evidence, contradictory passages, option-order permutations, and changes in language or source domain. These are proposed tests. Their purpose is to distinguish useful uncertainty from confidence that merely tracks familiar formatting.</p><p>The key outcome would be a quality–cost frontier with uncertainty intervals, broken down by decision type. If the local model remains fast but accepts premature-stop decisions with high confidence, its calibration average can hide the most expensive failure. If it instead escalates those cases while handling routine judgments cheaply, the architectural separation has earned its place.</p><h2>References</h2><p><a href="https://arxiv.org/pdf/2610.05107" rel="noopener">[1] SearchJev: A Fast and Calibrated System-1 Model for Search Agents</a></p><p><a href="https://arxiv.org/abs/1706.04599" rel="noopener">[2] On Calibration of Modern Neural Networks</a></p><p><a href="https://arxiv.org/abs/1705.08500" rel="noopener">[3] Selective Classification for Deep Neural Networks</a></p><p><a href="https://arxiv.org/abs/2210.03629" rel="noopener">[4] ReAct: Synergizing Reasoning and Acting in Language Models</a></p><p><a href="https://arxiv.org/abs/2503.09516" rel="noopener">[5] Search-R1: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learning</a></p><p><a href="https://arxiv.org/abs/2610.05750" rel="noopener">[6] Beyond Semantic Similarity: Performance and Costs of Agentic Retrieval for Complex Tasks</a></p>
]]></content:encoded>
</item>
<item>
<title>What a Recommender Can Reach, Remember, and Afford</title>
<link>https://learn-llm.com/p/what-a-recommender-can-reach-remember/</link>
<guid isPermaLink="true">https://learn-llm.com/p/what-a-recommender-can-reach-remember/</guid>
<pubDate>Sat, 17 Oct 2026 12:00:00 GMT</pubDate>
<description>LLMs &amp; Recommender Systems · Issue 002 · arXiv submissions from October 4–9, 2026</description>
<category>Recommender Systems</category><category>LLM Agents</category><category>Generative Recommendation</category>
<content:encoded><![CDATA[<p>Seven recent papers on LLMs and recommender systems, and three questions that connect them. Can the decoder actually reach the right item? What should the system remember about a user, and who gets to change the list? And what does it cost to train over a full catalog?</p><p>The companion column on RL, agents, and applications is <a href="https://learn-llm.com/p/knowing-when-to-intervene-six-papers/">Knowing When to Intervene: Six Papers on RL, Search Agents, and RAG</a>. The numbers below are the authors’ reported results on their own benchmarks.</p><h2>In this column</h2><p><strong>Reach</strong></p><p>1. Beyond Semantic IDs: can the decoder reach the item?</p><p>2. ICE-Fuse: context read from interaction images</p><p><strong>Remember and revise</strong></p><p>3. MATE: separate memories for recurring and recent taste</p><p>4. INTEGER: generative recommenders that hold a conversation</p><p>5. Personal-agent mediation: rescue versus harm</p><p><strong>Data and cost</strong></p><p>6. Evidence Before Sampling: which unobserved items are real negatives?</p><p>7. CutBCE: BCE over an 876k-item catalog without dense logits</p><h2>Reach</h2><h3>1. Beyond Semantic IDs: can the decoder reach the item?</h3><p><a href="https://arxiv.org/abs/2610.12977" rel="noopener">Beyond Semantic IDs: Finite-Beam Reachability and Continuous-Query Generation in Generative Recommendation</a></p><p>The paper separates two properties that are easy to conflate in semantic-ID recommenders: whether an item is scoreable at all, and whether finite-width beam search actually puts a held-out target into the returned list. It proposes CQG-Single, which generates one continuous retrieval query, and CQG-AR, which generates continuous residual updates autoregressively; both score every encoded item through dense or approximate-nearest-neighbor retrieval. [1]</p><p>Under a unified protocol with valid-prefix constrained decoding, CQG-Single beats a TIGER-style baseline in all seven runs with 55.3% as many trainable parameters, and extra continuous refinement depth does not monotonically help. [1]</p><p>This is a natural sequel to <a href="https://learn-llm.com/p/a-semantic-tokenizer-cannot-be-judged/">our FLASH deep dive</a>. FLASH asked whether the decoder matches the code structure; this paper asks whether the decoder’s search budget can reach the right codes. The comparison is against one TIGER-style baseline, so it does not establish that continuous queries beat every semantic-ID design.</p><h3>2. ICE-Fuse: context read from interaction images</h3><p><a href="https://arxiv.org/abs/2610.08407" rel="noopener">Seeing the Context: Enhancing Recommender Systems with Image-Derived Contextual Signals</a></p><p>Most recommenders use images to enrich item or user representations. This paper instead uses a vision-language model to extract physical, social, and modal context from interaction images, and ICE-Fuse integrates those categories into a context-aware recommender. [2]</p><p>On TripAdvisor with Review-aware Graph Contrastive Learning, image-derived context does not beat established signals on its own but improves results when combined with them; semantic analysis suggests image and review context capture different aspects of an interaction. [2]</p><p>The negative result on its own is useful to report. Evidence comes from one dataset and one recommender, so complementarity is a hypothesis to test elsewhere.</p><h2>Remember and revise</h2><h3>3. MATE: separate memories for recurring and recent taste</h3><p><a href="https://arxiv.org/abs/2610.06050" rel="noopener">MATE: Adaptive Long- and Short-Term User Memory for LLM-Based Recommendation</a></p><p>MATE checks each new interaction for support from historical behavior and consistency with recent interactions, then uses that temporal evidence to update separate long-term and short-term user memories. A recent-context representation controls how much each memory contributes to the representation used for recommendation. [3]</p><p>During online adaptation the shared model is frozen and only the two user memories are updated. On MovieLens-10M, Amazon Luxury Beauty, and KuaiRec it reports a 7.0–13.2% improvement in mean NDCG@10 over the strongest external baseline. [3]</p><p>Freezing the model and updating only memory is an attractive serving pattern: per-user state changes, shared weights do not. That also bounds what the experiments show. The online results test memory adaptation, not continual learning of the model itself.</p><h3>4. INTEGER: generative recommenders that hold a conversation</h3><p><a href="https://arxiv.org/abs/2610.08136" rel="noopener">Adapting Generative Recommenders for Multi-Turn Interaction</a></p><p>INTEGER extends a generative recommender to multi-turn dialogue with a learned routing token that decides when to recommend, history re-anchoring that conditions on both past behavior and the conversation, and behavioral replay with instruction rehearsal to limit forgetting. [4]</p><p>On Amazon Beauty and Toys it matches or exceeds the strongest baselines in accuracy with competitive conversation quality, reporting a 13.3% Hit@10 gain on Beauty. The authors note that rejected items are replaced through an intent-agnostic mechanism, leaving attribute-aware feedback to future work. [4]</p><p>The routing token is a learned decision about when to act. Two product categories are a narrow base, and an intent-agnostic replacement means “not this one” and “something cheaper” are handled the same way.</p><h3>5. Personal-agent mediation: rescue versus harm</h3><p><a href="https://arxiv.org/abs/2610.07588" rel="noopener">Personal-Agent Mediated Recommendation with Cross-Platform User History</a></p><p>A platform ranks candidates with local data; a user-authorized personal agent revises the slate using cross-platform history. The authors decompose the change in hit rate into rescues minus harmful overrides, and propose PAMO, which reallocates RL advantage toward rationales that depend on cross-platform history under a value floor. [5]</p><p>We covered it in detail in <a href="https://learn-llm.com/p/when-should-a-personal-agent-override/">When Should a Personal Agent Override Your Recommender?</a>. The short version: PAMO beats matched GRPO on HR@10 and NDCG@10 across all five test sets, mostly by making fewer harmful overrides rather than more rescues. [5]</p><p>MATE, INTEGER, and PAMO all keep a strong model fixed and change something around it: user memory, the decision to recommend, or the final slate. That separation makes each easier to deploy and harder to evaluate in isolation.</p><h2>Data and cost</h2><h3>6. Evidence Before Sampling: which unobserved items are real negatives?</h3><p><a href="https://arxiv.org/abs/2610.07708" rel="noopener">Evidence Before Sampling: Interpretable Implicit Negative Candidate Discovery for Recommendation</a></p><p>An unobserved user–item pair does not by itself show disinterest. This paper mines observed behavior into symbolic rules, scores them for support, informativeness, and product relevance, ranks the retained rules by evidence, and uses an LLM to interpret them against business objectives and domain knowledge. [6]</p><p>Candidate-quality evaluations on an industrial B2B task and three public datasets report higher precision than the evaluated baselines. In the industrial task, symbolic selection improves downstream test PR-AUC by 12.5% over random selection at four negatives per positive. [6]</p><p>The downstream comparison is against random negatives, not hard-negative or popularity-based samplers used in production. The more durable idea is the evaluation split: judging whether a negative candidate is valid separately from whether it improves the downstream model. [6]</p><h3>7. CutBCE: BCE over an 876k-item catalog without dense logits</h3><p><a href="https://arxiv.org/abs/2610.05559" rel="noopener">Cut Binary Cross Entropy: Efficient Large-Vocabulary Loss and Gradient Kernels for Sequential Recommendation</a></p><p>Multi-label BCE over a large catalog normally materializes a dense batch × sequence × vocabulary logits tensor in high-bandwidth memory. CutBCE computes the exact loss and gradient by fusing dense background-loss evaluation with sparse target corrections, using a custom vector-Jacobian product and a Pallas TPU backward kernel that computes logit tiles on-chip. [7]</p><p>Training multi-label SASRec on Yambda-50M with 876k items across 8 TPU chips, it reports 65.7% lower peak HBM and 225.9% faster training with comparable accuracy. [7]</p><p>This is a systems paper, and its gains are on specific TPU hardware. It matters for modeling because full-catalog losses are often avoided for memory reasons and replaced with sampled losses. Cheaper exact losses widen what can be tested.</p><h2>One experiment to try</h2><p><strong>Separate reachability from ranking.</strong></p><p>For a held-out target, record two things: whether it enters the candidate set the model can return at all, and where it ranks if it does. Run that for a semantic-ID decoder at several beam widths, a continuous-query generator at several ANN budgets, and a dense retriever, all at matched serving cost.</p><p>If most misses are unreachable targets, the fix is search budget or output representation. If most are reachable but ranked low, the fix is the scoring model. A single Recall@K number cannot tell the two apart.</p><h2>References</h2><p><a href="https://arxiv.org/abs/2610.12977" rel="noopener">[1] Beyond Semantic IDs: Finite-Beam Reachability and Continuous-Query Generation in Generative Recommendation</a></p><p><a href="https://arxiv.org/abs/2610.08407" rel="noopener">[2] Seeing the Context: Enhancing Recommender Systems with Image-Derived Contextual Signals</a></p><p><a href="https://arxiv.org/abs/2610.06050" rel="noopener">[3] MATE: Adaptive Long- and Short-Term User Memory for LLM-Based Recommendation</a></p><p><a href="https://arxiv.org/abs/2610.08136" rel="noopener">[4] Adapting Generative Recommenders for Multi-Turn Interaction</a></p><p><a href="https://arxiv.org/pdf/2610.07588" rel="noopener">[5] Personal-Agent Mediated Recommendation with Cross-Platform User History</a></p><p><a href="https://arxiv.org/abs/2610.07708" rel="noopener">[6] Evidence Before Sampling: Interpretable Implicit Negative Candidate Discovery for Recommendation</a></p><p><a href="https://arxiv.org/abs/2610.05559" rel="noopener">[7] Cut Binary Cross Entropy: Efficient Large-Vocabulary Loss and Gradient Kernels for Sequential Recommendation</a></p>
]]></content:encoded>
</item>
<item>
<title>When Should a Personal Agent Override Your Recommender?</title>
<link>https://learn-llm.com/p/when-should-a-personal-agent-override/</link>
<guid isPermaLink="true">https://learn-llm.com/p/when-should-a-personal-agent-override/</guid>
<pubDate>Sat, 17 Oct 2026 12:00:00 GMT</pubDate>
<description>Personal-agent mediation, rescue–harm accounting, and why outcome rewards are not enough</description>
<category>Reinforcement Learning</category><category>Recommender Systems</category><category>LLM Agents</category>
<content:encoded><![CDATA[<p>A recommendation platform knows things about you that no assistant can see: what millions of similar users clicked after the item you just bought. A personal agent can know things the platform cannot: what you read, watched, or played somewhere else. When both exist, someone has to decide whose evidence wins.</p><p><a href="https://arxiv.org/abs/2610.07588" rel="noopener">Personal-Agent Mediated Recommendation with Cross-Platform User History</a> turns that question into a learning problem. A platform produces a ranking; a user-authorized agent sees that ranking plus cross-platform history and outputs the final slate. The useful contribution is not that an LLM can rerank. It is the accounting: every change the agent makes is either a rescue or a harm relative to a strong default.</p><h2>1. The task: mediation, not reranking from scratch</h2><p>The platform returns a candidate set, its full ranking over that set, and item metadata. The agent receives that proposal together with within-platform and cross-platform history, writes a visible rationale, then outputs an ordered top-K slate. It does not see platform scores, population interactions, or model state, and the platform never sees the cross-platform history. [1]</p><p>That two-sided asymmetry is the whole point. Because returning the platform’s own slate is always valid, the authors frame the problem as selective mediation rather than ranking from scratch. [1]</p><p>For a single held-out target <code>Y</code>, the paper measures the agent’s effect against the platform slate <code>P</code>:</p><pre><code>&lt;code&gt;&lt;code&gt;\Delta(S;P,Y)=U(S,Y)-U(P,Y).&lt;/code&gt;&lt;/code&gt;</code></pre><p>With top-K inclusion as the utility, every episode falls into one of four cells: preserved hit, rescue, harmful override, or mutual miss. The platform-relative hit-rate change decomposes exactly as the rescue probability minus the harmful-override probability. [1]</p><pre><code>&lt;code&gt;&lt;code&gt;\Delta \mathrm{HR}@K=\Pr(\text{rescue})-\Pr(\text{harmful override}).&lt;/code&gt;&lt;/code&gt;</code></pre><p>This identity is simple, and it is the part I would carry into any product that lets an assistant edit a ranked list. An average HR@10 hides whether the agent won by fixing misses or lost by breaking hits. Reporting both terms makes that visible.</p><h2>2. Why access to more history does not solve it</h2><p>The base Qwen3-4B-Instruct agent falls below the platform on all five test sets, with harmful overrides exceeding rescues throughout. Among proprietary reference models, Haiku roughly matches the platform, while Sonnet and Opus improve HR@10 on all five datasets but still make non-negligible harmful overrides. [1]</p><p>The platform here is deliberately not a strawman. It is a target-platform SASRec ranking over 50 candidates, then reranked by Claude Sonnet 4.6 using only within-platform history, and frozen for every agent condition. [1] SASRec is a self-attention sequential recommender that focuses predictions on relevant items in a user’s action history. [2]</p><p>So the agent faces an expert default. Overriding it should require specific evidence, and the experiments show that general model capability alone does not deliver that discipline.</p><h2>3. PAMO: who gets credit for a correct override?</h2><p>Outcome-only RL rewards a correct slate regardless of why it was correct. The authors point out that a successful correction may genuinely rely on cross-platform history or may come from generic reranking, and outcome rewards cannot tell the two apart. [1]</p><p>Personal Attribution Mediation Optimization (PAMO) adds a second signal. For each sampled response, it scores the same visible rationale twice — once with full history and once with cross-platform history masked — and uses the length-normalized log-likelihood ratio as a personal mediation support score. [1]</p><pre><code>&lt;code&gt;&lt;code&gt;c_g=\frac{1}{|R_g|}\log\frac{\bar\pi_\theta(R_g\mid B,H)}{\bar\pi_\theta(R_g\mid B,H^-)}.&lt;/code&gt;&lt;/code&gt;</code></pre><p>The authors are explicit that this score is model-relative: it measures how much a rationale depends on the cross-platform history, not whether that history is correct or useful. [1] That is an important limit. A rationale can lean heavily on irrelevant cross-platform records.</p><h3>Advantage reallocation with a value floor</h3><p>PAMO decomposes single-target NDCG into nested top-k cutoffs, computes GRPO-style group-relative advantages at each cutoff, and modifies advantages only for rollouts whose cutoff outcome disagrees with the platform. [1] The group-relative baseline itself comes from GRPO, introduced in DeepSeekMath as a PPO variant that reduces memory use. [3]</p><p>Within each disagreement set, PAMO tilts the fixed advantage mass toward high-support responses, subject to a constraint. The reallocated weights must keep at least the average direction-aligned NDCG magnitude of the uniform allocation, which the authors call the value floor; the solution takes an exponential-family form with a dual coefficient for that constraint. [1]</p><pre><code>&lt;code&gt;&lt;code&gt;w^\star_{g,k}\propto\exp\!\left(\eta c_g+\lambda_k v_{g,k}\right),\quad \lambda_k\ge 0.&lt;/code&gt;&lt;/code&gt;</code></pre><p>The floor matters because support alone is not quality. Without the value floor, the support-only variant performs below the κ = 0 baseline across tested support strengths, while full PAMO improves HR@10 and NDCG@10. [1] History dependence is useful only after it is tied back to ranking value.</p><p>The theory shows that the reallocation preserves cutoff-level advantage mass and follows a locally optimal first-order direction within a fixed rollout group; the authors note it does not imply global optimality of the policy or a guaranteed held-out improvement. [1] I read the theorem as a design justification for the update rule, not as an accuracy guarantee.</p><p>PAMO adds one teacher-forced scoring pass during training, no additional rollouts, and no inference-time component. [1] The deployed agent costs the same to run as the GRPO-trained one.</p><h2>4. What the results show</h2><p>All trainable agents share one setup. They use a Qwen3-4B-Instruct backbone; GRPO and PAMO start from the same SFT checkpoint and share data, rollout and update budgets, differing only in advantage reallocation. At test time each model produces one response per episode. [1]</p><p>HR@10, rescue, and harmful-override rates at K = 10 (percent):</p><p>Test set · Platform · GRPO · PAMO · GRPO rescue / harm · PAMO rescue / harm</p><p>Movie · 56.0 · 61.2 · 62.2 · 9.2 / 3.9 · 10.3 / 4.0</p><p>Toy · 47.7 · 53.4 · 54.8 · 11.2 / 5.6 · 11.9 / 4.8</p><p>Grocery (unseen) · 45.0 · 48.8 · 50.6 · 8.4 / 4.7 · 10.0 / 4.5</p><p>Beauty (unseen) · 48.6 · 51.2 · 51.7 · 8.9 / 6.3 · 8.6 / 5.5</p><p>OpenPlay (real, test-only) · 40.8 · 47.4 · 47.9 · 13.8 / 7.1 · 13.2 / 6.0</p><p>These figures come from Tables 2 and 3. PAMO improves HR@10 and NDCG@10 over GRPO on all five datasets with similar mean intervention, and lowers harmful overrides on four of them. [1]</p><p>The pattern is more specific than “PAMO rescues more.” On Beauty and OpenPlay, PAMO rescues slightly less than GRPO; its gain comes from fewer harmful overrides. On Movie, harm is marginally higher while rescues rise. The improvement is a better balance, not a uniform win on both terms.</p><p>The OpenPlay gap is small at HR@10 (47.9 vs. 47.4) but larger at the top of the list. On OpenPlay, PAMO’s NDCG@10 is 0.284 versus 0.267 for GRPO, with H@3 of 26.2 versus 22.2. [1] For an interface that shows three items, that is the number that matters.</p><p>The masking test addresses the obvious objection that the agent is just a better reranker. Re-evaluating each model with only cross-platform records masked — same candidates, same platform proposal — lowers HR@10 and NDCG@10 for every evaluated model in the five-dataset macro average. [1]</p><figure><img src="https://learn-llm.com/media/when-should-a-personal-agent-override/465084fa0fce.png" alt="" loading="lazy"></figure><p><em>Figure 2 of the paper: HR@10 and NDCG@10 averaged over the five test sets, with cross-platform history masked (open markers) and with full context (filled markers). The dashed line is the platform baseline. Source: <a href="https://arxiv.org/abs/2610.07588" rel="noopener">arXiv:2610.07588</a>, CC BY 4.0.</em></p><h2>5. Where the evidence is thinner than the headline</h2><p><strong>Sampled candidates.</strong> Each episode ranks the held-out target plus 49 popularity-sampled negatives. [1] Krichene and Rendle show that sampled ranking metrics can be inconsistent with exact metrics and may not preserve relative comparisons between recommenders, even in expectation. [4] The paper’s relative comparisons are cleaner than most because every method sees identical candidates, but absolute HR@10 on 50 items should not be read as full-catalog performance.</p><p><strong>Proxy platforms.</strong> Four of the five environments treat Amazon product categories as proxy platforms, and the authors acknowledge these are not independent services. [1] The real cross-platform test links Steam, Nintendo, and Xbox activity for a 645-user cohort used only for external testing. [1] That external test is the strongest evidence in the paper, and also the smallest.</p><p><strong>Point estimates.</strong> The main tables report one test-time response per episode. I did not find seed variation or confidence intervals for the five-dataset comparison, so sub-point differences, such as Beauty HR@10, deserve caution.</p><p><strong>Rationale faithfulness.</strong> The authors annotate 900 PAMO rescues with Claude Sonnet 4.6 and report cross-platform context as the primary driver in 72%, with 25% incidental. [1] That analysis reads the agent’s own rationales. A rationale that cites Led Zeppelin records can still be a post-hoc story for a decision the model would have made anyway. The support score has the same dependency: it scores the rationale text, not the slate.</p><p><strong>Position anchoring.</strong> The agent sees candidates relabeled by platform rank. LLM rankers can be biased by item positions and popularity in prompts. [5] Some deference may be positional rather than evidential. That does not invalidate the comparison, since every agent sees the same order, but it is a confound to test.</p><p><strong>Availability.</strong> The authors say MediateRec will be released upon internal approval [1], so the results cannot yet be reproduced externally.</p><h2>6. The experiment I would add before trusting an agent with my feed</h2><p>Masking cross-platform history shows the information matters. It does not show that <em>this user’s</em> information matters. I would add a mismatched-history control: give the agent another user’s cross-platform history with the same length and category mix. If performance stays near the full-history level, the agent is exploiting generic extra text. If it drops toward or below the masked condition, the gain is user-specific.</p><p>Second, I would break down harm by history length and source overlap. A user with two cross-platform records and one with forty are not the same risk. The agent should defer more often when evidence is sparse, and rescue-harm curves conditioned on history size would show whether it does.</p><p>Third, a deployment should treat deferral as the default and override as a decision with a cost. The paper’s identity already provides the metric. A production system could cap harmful overrides at a fixed rate on a held-out set, then maximize rescues under that constraint — the same risk-coverage framing that applies to search-agent escalation.</p><p>The broader point is architectural. Once users bring their own agents, platform rankings become proposals rather than final answers. The paper provides a clear way to score that negotiation: count what the agent fixed, count what it broke, and train it to tell the difference.</p><h2>References</h2><p><a href="https://arxiv.org/pdf/2610.07588" rel="noopener">[1] Personal-Agent Mediated Recommendation with Cross-Platform User History</a></p><p><a href="https://arxiv.org/abs/1808.09781" rel="noopener">[2] Self-Attentive Sequential Recommendation</a></p><p><a href="https://arxiv.org/abs/2402.03300" rel="noopener">[3] DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models</a></p><p><a href="https://dl.acm.org/doi/10.1145/3394486.3403226" rel="noopener">[4] On Sampled Metrics for Item Recommendation (KDD 2020)</a></p><p><a href="https://arxiv.org/abs/2305.08845" rel="noopener">[5] Large Language Models are Zero-Shot Rankers for Recommender Systems</a></p>
]]></content:encoded>
</item>
<item>
<title>语义 ID 如何兼顾记忆与泛化，Agent 怎样学会修正？</title>
<link>https://learn-llm.com/p/id-agent/</link>
<guid isPermaLink="true">https://learn-llm.com/p/id-agent/</guid>
<pubDate>Mon, 12 Oct 2026 12:00:00 GMT</pubDate>
<description>第 001 期｜AI 研究与应用周报</description>
<category>Reinforcement Learning</category><category>Recommender Systems</category><category>LLM Agents</category><category>Generative Recommendation</category>
<content:encoded><![CDATA[<p>本期试刊精选包含四个解读条目、五篇论文，关注生成式推荐、召排信息边界、推理预算与多轮反馈。这些工作跨越不同发表时间，不代表均为本周新研究。</p><p><a href="https://learn-llm.com/p/semantic-ids-reasoning-budgets-and/">阅读英文版</a></p><h2>本期目录</h2><p><strong>LLM 与推荐系统</strong><br>1. TIGER：用 Semantic ID 生成推荐候选<br>2. LIFT 与 LIME：信息边界与计算复用</p><p><strong>RL 与 Agent</strong><br>3. OThink-R1：通过混合训练数据学习快慢思考<br>4. UFO：通过多轮强化学习利用失败反馈</p><h2>一、LLM 与推荐系统</h2><h3>1. TIGER：用 Semantic ID 生成推荐候选</h3><p><em>Recommender Systems with Generative Retrieval</em> 将推荐检索表述为生成物品标识：每个物品由具有语义意义的码字元组表示，序列到序列 Transformer 根据用户交互历史，自回归预测下一个物品的 Semantic ID。</p><p>论文摘要报告在所测试数据集上优于对照方法，并报告对没有历史交互的物品有更好的检索表现。这里的结论对应论文的任务与实验设置，不能外推成所有冷启动场景都会改善。</p><p>编辑建议：除了推荐指标，还应检查编码冲突、合法物品映射、目录增量更新与服务成本。语义编码的共享有助于迁移，但量化层级不能仅凭示意图就解释为人工类目树。以上是后续评估问题，不是本次独立验证的实验结论。</p><p><a href="https://arxiv.org/abs/2305.05065" rel="noopener">Paper: Recommender Systems with Generative Retrieval — arXiv:2305.05065</a></p><h3>2. LIFT 与 LIME：信息边界与计算复用</h3><p>LIFT 将每次交互拆为有序的 Request、Item、Context、Action 状态，并按因果序列建模。召回读取 Request 状态，排序读取 Context 状态，让两项任务共享历史建模，同时保留阶段各自的信息边界。摘要介绍了 Role-Conditioned Attention 和 Pre-LN Bias，并报告 ML-20M 与 Taobao 上的联合评测。</p><p>LIME 处理长历史、大候选集与模型规模带来的计算成本。低秩 Link Embeddings 解耦用户和候选交互，使注意力权重能够预计算；LIME-XOR 将历史长度相关的注意力复杂度从平方降为线性。摘要报告在大候选集或长序列的测试设置中约十倍推理加速，同时达到与强 Transformer 基线接近的效果。这不是任意业务的通用加速保证。</p><p>编辑建议：LIFT 的部署首先要检查事件时间和特征可见性；LIME 则应计入缓存构建、刷新和失效成本。两项方法解决不同问题，不能只按某个提升百分比排序。部署前应在一致预算下联合测量质量、尾时延、缓存新鲜度和回退率。</p><p><a href="https://arxiv.org/abs/2610.10556" rel="noopener">Paper: LIFT: A Lifecycle-aware Interaction Factorization Transformer for Unified Retrieval and Ranking — arXiv:2610.10556</a></p><p><a href="https://arxiv.org/abs/2510.18239" rel="noopener">Paper: LIME: Link-based User-item Interaction Modeling with Decoupled XOR Attention for Efficient Test Time Scaling — arXiv:2510.18239</a></p><h2>二、RL 与 Agent</h2><h3>3. OThink-R1：通过混合训练数据学习快慢思考</h3><p>OThink-R1 面向推理效率与准确率的权衡。论文使用辅助 LLM judge 识别必要与冗余推理，再构造混合微调数据：裁剪冗余推理得到快思考样本，保留完整推理得到慢思考样本。模型经微调后，根据问题特点自主选择思考模式。</p><p>Judge 在这里参与训练数据构造，不能据此声称每次线上推理都必须调用外部 judge。摘要报告在数学与问答基准上减少推理 Token，同时维持有竞争力的准确率。</p><p>编辑建议：按任务难度检查计算节约与错误率，不只看平均 Token 数。这个条目介绍的是混合数据微调，不把它误标为一个已验证成功的 RL 算法。</p><p><a href="https://arxiv.org/abs/2506.02397" rel="noopener">Paper: OThink-R1: Intrinsic Fast/Slow Thinking Mode Switching for Over-Reasoning Mitigation — arXiv:2506.02397</a></p><h3>4. UFO：通过多轮强化学习利用失败反馈</h3><p><em>A Simple “Try Again” Can Elicit Multi-Turn LLM Reasoning</em> 讨论单轮强化学习后的模型为何可能在多轮交互中重复错误答案。其 Unary Feedback as Observation（UFO）方法在多轮 RL 中，将错误回答后的简短负面反馈作为观察，训练模型利用交互历史修正答案。</p><p>摘要报告保留单轮表现并改善多轮推理，还介绍了鼓励更少回合完成任务和不同推理尝试的奖励设计。具体奖励公式和实验设置尚未独立核查，因此不在这里补充未核验细节。</p><p>编辑建议：同时测量最终成功率、重复答案比例、总计算成本与错误恢复能力。这是训练方法，不意味着对任何现成模型反复说“再试一次”都会获得相同收益。</p><p><a href="https://arxiv.org/abs/2507.14295" rel="noopener">Paper: A Simple “Try Again” Can Elicit Multi-Turn LLM Reasoning — arXiv:2507.14295</a></p><h2>本期一个实验问题</h2><p><strong>知识库问答增加结构化输出和引用检查后，能否减少无依据的回答？</strong></p><p>这是编辑提出的待实施实验，不是上面五篇论文报告的结果。固定资料库、问题集、模型与检索证据，对比自由文本、带引用 schema、schema 加引用与证据校验三个条件。观察引用存在性、证据支持度、正确率、拒答率、延迟和 Token 成本。</p><p>格式正确不代表事实正确；检索漏掉必要证据时，引用检查也无法补回知识，应单独记录检索失败。</p>
]]></content:encoded>
</item>
<item>
<title>Semantic IDs, Reasoning Budgets, and Agents That Learn to Revise</title>
<link>https://learn-llm.com/p/semantic-ids-reasoning-budgets-and/</link>
<guid isPermaLink="true">https://learn-llm.com/p/semantic-ids-reasoning-budgets-and/</guid>
<pubDate>Mon, 12 Oct 2026 12:00:00 GMT</pubDate>
<description>Issue 001 | AI Research &amp; Applications Weekly</description>
<category>Reinforcement Learning</category><category>Recommender Systems</category><category>LLM Agents</category><category>Generative Recommendation</category>
<content:encoded><![CDATA[<p>This revised pilot issue covers four entries and five papers on generative recommendation, information boundaries, reasoning budgets, and multi-turn feedback. The papers span different publication dates; they are not all new this week.</p><p><a href="https://learn-llm.com/p/id-agent/">Read the Chinese edition</a>.</p><h2>In this issue</h2><p><strong>LLMs &amp; recommender systems</strong><br>1. TIGER: generating recommendation candidates with semantic IDs<br>2. LIFT and LIME: information boundaries and reusable computation</p><p><strong>RL &amp; agents</strong><br>3. OThink-R1: learning fast/slow thinking from hybrid training data<br>4. UFO: using failure feedback in multi-turn reinforcement learning</p><h2>I. LLMs &amp; recommender systems</h2><h3>1. TIGER: generating recommendation candidates with semantic IDs</h3><p><em>Recommender Systems with Generative Retrieval</em> formulates retrieval as identifier generation. Each item is represented by a semantically meaningful tuple of codewords. A sequence-to-sequence Transformer learns to autoregressively predict the next item’s semantic ID from the user’s interaction history.</p><p>The abstract reports improvements over evaluated baselines and better retrieval for items with no prior interaction history. These claims concern the paper’s tested tasks and settings, not a guarantee across all cold-start scenarios.</p><p>Editorial suggestion: examine code collisions, valid-item mapping, catalog updates, and serving cost alongside recommendation quality. Code sharing may support transfer, but quantization levels should not be assumed to form a human-readable category tree. These are evaluation questions, not independently verified findings from this issue.</p><p><a href="https://arxiv.org/abs/2305.05065" rel="noopener">Paper: Recommender Systems with Generative Retrieval — arXiv:2305.05065</a></p><h3>2. LIFT and LIME: information boundaries and reusable computation</h3><p>LIFT decomposes interactions into ordered Request, Item, Context, and Action states, modeled as a causal sequence. Retrieval reads the Request state and ranking reads the Context state, sharing history modeling while retaining stage-specific information. The abstract describes Role-Conditioned Attention and Pre-LN Bias and reports joint evaluations on ML-20M and Taobao.</p><p>LIME addresses the cost of long histories, large candidate sets, and larger models. Low-rank Link Embeddings decouple user and candidate interactions, enabling attention-weight precomputation. LIME-XOR reduces history-length attention complexity from quadratic to linear. The abstract reports roughly tenfold inference acceleration in evaluated large-candidate or long-sequence settings, with near-parity to strong Transformer baselines. This is not a universal serving-speed guarantee.</p><p>Editorial suggestion: check event timing and feature availability for LIFT, and include cache construction, refresh, and miss handling for LIME. They solve different problems. Compare quality, tail latency, cache freshness, and fallback rates under consistent budgets rather than ranking methods by a single improvement percentage.</p><p><a href="https://arxiv.org/abs/2610.10556" rel="noopener">Paper: LIFT: A Lifecycle-aware Interaction Factorization Transformer for Unified Retrieval and Ranking — arXiv:2610.10556</a></p><p><a href="https://arxiv.org/abs/2510.18239" rel="noopener">Paper: LIME: Link-based User-item Interaction Modeling with Decoupled XOR Attention for Efficient Test Time Scaling — arXiv:2510.18239</a></p><h2>II. RL &amp; agents</h2><h3>3. OThink-R1: learning fast/slow thinking from hybrid training data</h3><p>OThink-R1 addresses the trade-off between reasoning efficiency and accuracy. An auxiliary LLM judge identifies essential and redundant reasoning, helping construct hybrid fine-tuning data: redundant reasoning is pruned for fast-thinking examples, while full reasoning is retained for slow-thinking examples. After fine-tuning, the model selects its mode based on the problem.</p><p>The judge participates in training-data construction. This does not establish that every inference-time decision requires an external judge. The abstract reports reduced reasoning-token use with competitive accuracy on mathematics and question-answering benchmarks.</p><p>Editorial suggestion: measure computation savings and errors across task difficulty, rather than reporting only mean token counts. This entry concerns hybrid-data fine-tuning and should not be labeled a successfully verified RL algorithm.</p><p><a href="https://arxiv.org/abs/2506.02397" rel="noopener">Paper: OThink-R1: Intrinsic Fast/Slow Thinking Mode Switching for Over-Reasoning Mitigation — arXiv:2506.02397</a></p><h3>4. UFO: using failure feedback in multi-turn reinforcement learning</h3><p><em>A Simple “Try Again” Can Elicit Multi-Turn LLM Reasoning</em> examines how models trained with single-turn RL can repeat incorrect answers during multi-turn interactions. Unary Feedback as Observation (UFO) incorporates brief negative feedback after incorrect answers as observations during multi-turn RL, training models to revise using interaction history.</p><p>The abstract reports retaining single-turn performance while improving multi-turn reasoning. It also describes reward designs that encourage fewer turns and diverse reasoning attempts. Exact reward formulas and experimental settings have not been independently checked, so unverified details are not added here.</p><p>Editorial suggestion: evaluate final success, answer repetition, total computation, and error recovery together. This is a training method; repeatedly telling an arbitrary existing model to “try again” does not imply the same gains.</p><p><a href="https://arxiv.org/abs/2507.14295" rel="noopener">Paper: A Simple “Try Again” Can Elicit Multi-Turn LLM Reasoning — arXiv:2507.14295</a></p><h2>An experiment to try</h2><p><strong>Can structured outputs and citation checks reduce unsupported answers in a knowledge-base assistant?</strong></p><p>This is an editorial proposal, not an experiment reported by the five papers above. Hold the corpus, question set, model, and retrieved evidence fixed. Compare free-form answers, answers using a citation schema, and the same schema with citation and evidence checks. Measure citation existence, evidential support, accuracy, abstention, latency, and token cost.</p><p>Valid formatting does not establish factual accuracy. Citation checks cannot recover evidence that retrieval missed, so retrieval failures should be recorded separately.</p>
]]></content:encoded>
</item>
<item>
<title>Build your own ChatGPT from scratch in Python numpy</title>
<link>https://learn-llm.com/2024/09/08/build-your-own-chatgpt-from-scratch-in-python-numpy/</link>
<guid isPermaLink="true">https://learn-llm.com/2024/09/08/build-your-own-chatgpt-from-scratch-in-python-numpy/</guid>
<pubDate>Sun, 08 Sep 2024 12:00:00 GMT</pubDate>
<description>Generative Pre-trained Transformers, or GPTs, represent a significant leap forward in natural language processing technology. These models, especially notable ones like OpenAI’s GPT-3, are celebrated for producing text…</description>
<category>Learning LLMs</category>
<content:encoded><![CDATA[<p>Generative Pre-trained Transformers, or GPTs, represent a significant leap forward in natural language processing technology. These models, especially notable ones like OpenAI’s GPT-3, are celebrated for producing text that is not only fluent but also contextually aware, marking a new era in our engagement with AI-driven language models. But constructing a GPT model involves what specific processes? We shall explore the intricacies of Transformer technology and outline the steps to assemble a GPT from the ground up using Python and NumPy.</p>

<p>GPTs are distinguished by their vast network size, with some housing billions of parameters and being honed on wide-ranging datasets. This immense size equips them to handle diverse linguistic tasks, ranging from composing emails to distilling intricate ideas into accessible language.</p>

<p>In embarking on the journey to craft a GPT model using Python and NumPy, it’s crucial to grasp the architecture’s underlying elements and their synergy, particularly within the sphere of NLP. We will delve into these fundamental concepts and offer an in-depth breakdown of each aspect to forge an exhaustive tutorial.</p>

<h2>Step 1: Setting Up the Environment</h2>

<p>First, clone the necessary repository and set up the environment:</p>

<p><a href="https://github.com/jaymody/picoGPT" rel="noopener">GitHub — jaymody/picoGPT: An unnecessarily tiny implementation of GPT-2 in NumPy.</a></p>

<pre><code>import numpy as np
import sys
!git clone https://github.com/jaymody/picoGPT.git
# Pretrained weights are from https://github.com/jaymody/picoGPT
sys.path.append('./picoGPT')</code></pre>

<h2>Step 2: Defining Basic Functions</h2>

<p>The building blocks of our GPT are functions like GELU (Gaussian Error Linear Unit), linear layers, softmax, and layer_norm mechanisms:</p>

<pre><code>def gelu(x):
    # GELU activation function applies a non-linear activation to the input 'x'
    # It's used to introduce nonlinearity in the model and helps with learning complex patterns
    return 0.5 * x * (1 + np.tanh(np.sqrt(2 / np.pi) 
                                  * (x + 0.044715 * x**3)))
def linear(x, w, b):
    # Linear transformation function that computes the weighted sum of the inputs 'x' plus a bias 'b'
    # 'w' are the weights and 'b' is the bias term, this is a basic building block of neural networks
    return x @ w + b

def softmax(x):
    exp_x = np.exp(x - np.max(x, axis=-1, keepdims=True))
    return exp_x / np.sum(exp_x, axis=-1, keepdims=True)

def ffn(x, c_fc, c_proj):
    a = gelu(linear(x, **c_fc))
    x = linear(a, **c_proj)
    return x

def layer_norm(x, g, b, eps: float = 1e-5):
    # Feedforward network function that applies a GELU activation after a linear transformation
    # followed by another linear transformation
    # It's a sequence of operations commonly used in transformers
    mean = np.mean(x, axis=-1, keepdims=True)
    variance = np.var(x, axis=-1, keepdims=True)
    x = (x - mean) / np.sqrt(variance + eps)
    return g * x + b</code></pre>

<h2>2.1 GELU vs other activefunction</h2>

<figure><img src="https://learn-llm.com/media/build-your-own-chatgpt-from-scratch-in-python-numpy/6d25531252a0.png" alt="" loading="lazy"><figcaption>Figure 2 from the GELU paper</figcaption></figure>

<p>GPT employs GELU (Gaussian Error Linear Unit) as its activation function due to its superior performance demonstrated in practice. GELU is a relatively new type of activation function introduced by Hendrycks and Gimpel in 2016. It incorporates characteristics of the ReLU (Rectified Linear Unit) and the probability distribution properties of the normal distribution. The specific expression for the GELU function is:</p>

<p>Some advantages of GELU include:</p>

<ul>
<li>Non-saturating: GELU provides non-linear activation, but unlike ReLU, it is not entirely saturated for negative values, which helps with the flow of gradients and reduces the problem of vanishing gradients.</li>

<li>Smooth Gradients: Due to its smooth nature, GELU can provide continuous gradients, which contributes to stability and performance during the training process.</li>

<li>Probabilistic Interpretation: Since it emulates the “gating” of input values (i.e., the probabilistic weight of the input value x), it introduces a degree of natural randomness, which can help with regularization of the model and potentially improve its generalization ability.</li>

<li>Empirical Performance: GELU has shown better performance than other activation functions across various tasks and benchmarks. Particularly in NLP tasks, the combination of GELU with the Transformer model has proven to be highly effective.</li>
</ul>

<h2>2.2 Softmax implementation</h2>

<p>We can observe that there are certain differences between the softmax function’s theoretical formula and its implementation in code.</p>

<figure><img src="https://learn-llm.com/media/build-your-own-chatgpt-from-scratch-in-python-numpy/9863955a43f1.png" alt="" loading="lazy"></figure>

<p>Modifications have been made to the softmax computation within the code, primarily to enhance numerical stability.</p>

<pre><code>def softmax(x):
    exp_x = np.exp(x - np.max(x, axis=-1, keepdims=True))
    return exp_x / np.sum(exp_x, axis=-1, keepdims=True)</code></pre>

<ul>
<li><strong>Overflow</strong> and Underflow: <strong>Direct computation of </strong><code><strong>exp(x_i)</strong></code><strong> can be problematic because the exponentiation can result in very large</strong> numbers for moderate values of <code>x_i</code> (overflow) or very small numbers for large negative values of <code>x_i</code> (underflow), leading to numerical instability. Subtracting the max value <code>np.max(x)</code> from each element in <code>x</code> before exponentiation helps to mitigate this risk because the largest value in the adjusted vector will be 0, which, when exponentiated, equals 1. This subtraction makes the largest of the <code>exp</code> values 1, preventing overflow in the numerator and denominator.</li>

<li>Numerical Stability: By normalizing the values (shifting the inputs to a smaller range), the softmax function becomes more numerically stable. Without this step, the computation of <code>exp(x_i)</code> for large <code>x_i</code> could result in an infinite value in floating-point arithmetic, which would lead to NaN values during division.</li>

<li>Efficiency: The use of <code>axis=-1</code> and <code>keepdims=True</code> allows the function to be applied to multi-dimensional arrays and maintain their shape, which is useful when computing softmax across certain dimensions (like batches of data or different features) in more complex models.</li>
</ul>

<h2>2.3 LayerNorm vs BatchNorm</h2>

<p>Layer Normalization (LayerNorm) and Batch Normalization (BatchNorm) are both techniques used to stabilize and accelerate the training of deep neural networks, but they work in slightly different ways and are used in different contexts.</p>

<figure><img src="https://learn-llm.com/media/build-your-own-chatgpt-from-scratch-in-python-numpy/8f3c088709d5.png" alt="" loading="lazy"><figcaption>Figure 3 from&nbsp;<a href="https://www.kaggle.com/code/halflingwizard/how-does-layer-normalization-work" rel="noopener">https://www.kaggle.com/code/halflingwizard/how-does-layer-normalization-work</a></figcaption></figure>

<p>Here’s a comparison:</p>

<p>Batch Normalization (BatchNorm):</p>

<ul>
<li>Normalizes the output of a previous activation layer by subtracting the batch mean and dividing by the batch standard deviation (hence the name “batch” normalization).</li>

<li>The normalization is done over the <code>batch</code> dimension, i.e., for each feature, BN computes the mean and variance over the batch of data.</li>

<li>It is typically applied to the inputs of the activation function in a layer.</li>

<li>BatchNorm has parameters (scale and shift) that are learnable during training. It requires a sufficiently large batch size to work well since the statistics are computed over the batch.</li>

<li>It can lead to significant improvements in convergence for convolutional neural networks (CNNs) and fully connected layers.</li>
</ul>

<p>Layer Normalization (LayerNorm):</p>

<ul>
<li>Normalizes the inputs across the features instead of the batch. For each data point in the batch, LayerNorm computes the mean and variance used for normalization across the features.</li>

<li>It is particularly useful in recurrent neural networks (RNNs) and Transformer models, where the batch size can often be one, or the sequence length can vary.</li>

<li>LayerNorm also has learnable parameters (gain and bias) that can be adjusted during training. Since LayerNorm does not rely on the batch dimension, it behaves consistently during training and inference.</li>

<li>It has been found to be more effective than BatchNorm in sequence models where the temporal dynamic is important, as it normalizes across the features at each time step.</li>
</ul>

<p>In summary, BatchNorm is effective for tasks where the batch size is large and consistent, and it’s commonly used in CNNs. LayerNorm, on the other hand, is more suited to sequence models like RNNs and Transformers because it doesn’t depend on batch statistics and therefore can handle variable sequence lengths and smaller batch sizes.</p>

<h2>Step 3: Implementing Multi-Head Attention and Feed-Forward Networks</h2>

<p>Multi-head attention and feed-forward networks are crucial for the model:</p>

<pre><code>def attention(q, k, v, mask):
    s = q @ k.T
    s = s / np.sqrt(q.shape[-1]) + mask
    p = softmax(s)
    o = p @ v
    return o

# Multi-head attention
def mha(x, c_attn, c_proj, n_head):
    x = linear(x, **c_attn)
    qkv = np.split(x, 3, axis=-1)
    qkv_heads = list(map(lambda x : np.split(x, n_head, axis=-1), qkv))
    
    causal_mask = (1 - np.tri(x.shape[0], dtype=x.dtype)) * -1e10
    out_heads = [attention(q,k,v, causal_mask) for q, k, v in zip(*qkv_heads)]
    x = np.hstack(out_heads)
    x = linear(x, **c_proj)
    return x</code></pre>

<p>The foundation of GPT lies in the Transformer model, a type of deep learning model designed to handle sequential data like text.</p>

<figure><img src="https://learn-llm.com/media/build-your-own-chatgpt-from-scratch-in-python-numpy/66a867ca1685.png" alt="" loading="lazy"><figcaption>Figure 4 from&nbsp;<a href="https://jalammar.github.io/illustrated-transformer/" rel="noopener">https://jalammar.github.io/illustrated-transformer/</a></figcaption></figure>

<p><strong>Self-attention Mechanism</strong>: This allows the model to weigh the importance of different words in a sentence, providing a dynamic understanding of textual context.</p>

<figure><img src="https://learn-llm.com/media/build-your-own-chatgpt-from-scratch-in-python-numpy/d3638250d468.png" alt="" loading="lazy"><figcaption>Figure 5 from&nbsp;<a href="https://zhuanlan.zhihu.com/p/365550383" rel="noopener">https://zhuanlan.zhihu.com/p/365550383</a></figcaption></figure>

<p>Imagine you’re reading a complex novel, and in each sentence, some words are more important to the meaning than others. For instance, in the sentence “The cat sat on the mat,” words like “cat” and “mat” are more crucial to understanding the sentence than “the” or “on.” Self-attention in a neural network works similarly. It helps the model to focus more on certain words (or parts of the input) when trying to understand or generate text.</p>

<p>In essence, self-attention is like a smart, dynamic highlighter that helps AI models determine which words in a sentence are the most important for understanding the meaning and context, much like how we focus on certain words while reading or listening to make sense of the information.</p>

<p>Here, for each word, we have&nbsp;<em>k</em>,&nbsp;<em>v</em>,&nbsp;<em>q</em>;&nbsp;<em>k</em>&nbsp;and&nbsp;<em>v</em>&nbsp;represent the associations between them. In the self-attention mechanism, “K,” “Q,” and “V” stand for “Key,” “Query,” and “Value,” respectively. These terms come from the field of information retrieval and are used to help the model determine how much attention to give to a given input, such as a word or phrase. Here’s how they work:</p>

<ul>
<li>Query: The query represents the current word or item being considered, which can be thought of as a search query looking for other related information.</li>

<li>Key: The key corresponds to the representation of all other words or items in the database, which can be imagined as index keywords used by the query to find matching items.</li>

<li>Value: Once a query finds a matching item through a key, the associated value is used to calculate a new representation of the input word or item. The value contains the actual information you want to retain in the output of the attention mechanism.</li>
</ul>

<p>In the self-attention mechanism, each input element, such as a word, is transformed into representations of query, key, and value. The model allocates attention scores by calculating the compatibility between the query and all keys, typically done by taking their dot product and then applying the softmax function to ensure that all attention scores add up to 1. These scores are then used to weight the corresponding values, resulting in the final output representation of each input element. This output captures the context information of all elements in the input sequence.</p>

<figure><img src="https://learn-llm.com/media/build-your-own-chatgpt-from-scratch-in-python-numpy/c8c3b0c886e9.png" alt="" loading="lazy"><figcaption>Figure 6from&nbsp;<a href="http://jalammar.github.io/illustrated-transformer/" rel="noopener">http://jalammar.github.io/illustrated-transformer/</a></figcaption></figure>

<p>In fact, matrix operations are used in the implementation:</p>

<ul>
<li>Efficiency: Matrix operations can efficiently utilize modern hardware architectures, especially GPUs (Graphics Processing Units) and TPUs (Tensor Processing Units), which are designed for large-scale parallel computations. Converting the calculations of the attention mechanism into matrix operations can significantly speed up training and inference processes.</li>

<li>Batch Processing: Matrix operations allow us to process multiple data samples simultaneously, known as batch processing. This means that the network can learn from multiple examples at once, making more effective use of computational resources.</li>

<li>Vectorization: Matrix and vectorized computations reduce the number of necessary iterations, eliminating the need for explicit loops for each operation. This not only simplifies the complexity of writing code but also reduces computation time.</li>
</ul>

<h2>Step 4: Building the Transformer Blocks</h2>

<p>Each transformer block in GPT consists of multi-head attention and feed-forward networks, along with layer normalization:</p>

<figure><img src="https://learn-llm.com/media/build-your-own-chatgpt-from-scratch-in-python-numpy/f3034c470737.png" alt="" loading="lazy"><figcaption>Figure 7 from Attention is All You Need Paper (where h is number of heads)</figcaption></figure>

<pre><code>def transformer_block(x, mlp, attn, ln_1, ln_2, n_head):
    x = x + mha(layer_norm(x, **ln_1), **attn, n_head=n_head)
    x = x + ffn(layer_norm(x, **ln_2), **mlp)
    return x</code></pre>

<h2>Step 5: Assembling the GPT Model</h2>

<p>Now, we assemble these components to create the GPT model:</p>

<p>GPT is built upon the Transformer architecture, focusing on the decoder part for text generation.</p>

<ul>
<li>Decoder Blocks: These are the building blocks of GPT. Each block includes a self-attention layer followed by a feed-forward neural network.</li>

<li>Layer Normalization and Skip Connections: These components help in stabilizing the learning process and enabling the training of deep networks.</li>
</ul>

<pre><code>def gpt2(inputs, wte, wpe, blocks, ln_f, n_head):
    x = wte[inputs] + wpe[range(len(inputs))]
    for block in blocks:
        x = transformer_block(x, **block, n_head=n_head)
    x = layer_norm(x, **ln_f)
    return x @ wte.T</code></pre>

<h2>Step 6: Generating Text</h2>

<p>The process of generating text in GPT involves predicting the next word in a sequence given the previous words.</p>

<ul>
<li>Tokenization: The input text is broken into tokens (words or subwords) which are then converted into numerical representations.</li>

<li>Predictive Modeling: The model predicts the next token based on the previous tokens, using its learned understanding of language patterns.</li>
</ul>

<p>To generate text, we use the model to predict the next token in a sequence iteratively:</p>

<pre><code>def generate(inputs, params, n_head, n_tokens_to_generate):
    from tqdm import tqdm
    
    for _ in tqdm(range(n_tokens_to_generate), &quot;generating&quot;):
        logits = gpt2(inputs, **params, n_head=n_head)
        next_id = np.argmax(logits[-1])
        inputs.append(int(next_id))
    return inputs[len(inputs) - n_tokens_to_generate :]</code></pre>

<h2>Step 7: Running the Model</h2>

<p>Finally, we create a function to run our model with a given prompt:</p>

<pre><code>def main(prompt: str, n_tokens_to_generate: int = 40, 
         model_size: str = &quot;124M&quot;, models_dir: str = &quot;models&quot;):
    from utils import load_encoder_hparams_and_params
    encoder, hparams, params = load_encoder_hparams_and_params(model_size, models_dir)
    input_ids = encoder.encode(prompt)
    
    assert len(input_ids) + n_tokens_to_generate &lt; hparams[&quot;n_ctx&quot;]
    
    output_ids = generate(input_ids, params, hparams[&quot;n_head&quot;], n_tokens_to_generate)
    
    output_text = encoder.decode(output_ids)
    return output_text</code></pre>

<pre><code>main(&quot;What is LLM?&quot;)</code></pre>

<pre><code>2023-10-25 22:49:45.842762: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Fetching checkpoint: 1.00kb [00:00, 6.07Mb/s]                                                       
Fetching encoder.json: 1.04Mb [00:00, 3.13Mb/s]                                                     
Fetching hparams.json: 1.00kb [00:00, 4.89Mb/s]                                                     
Fetching model.ckpt.data-00000-of-00001: 498Mb [00:22, 22.0Mb/s]                                    
Fetching model.ckpt.index: 6.00kb [00:00, 7.37Mb/s]                                                 
Fetching model.ckpt.meta: 472kb [00:00, 1.95Mb/s]                                                   
Fetching vocab.bpe: 457kb [00:00, 1.90Mb/s]                                                         
generating: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [00:02&lt;00:00, 13.49it/s]</code></pre>

<p>Now you can find you own GPT works~</p>

<pre><code>'\n\nLLM is a programming language that is designed to be used in a variety of applications. It is a programming language that is designed to be used in a variety of applications. It is a'</code></pre>

<figure><img src="https://learn-llm.com/media/build-your-own-chatgpt-from-scratch-in-python-numpy/bc4f87cbc8fe.png" alt="" loading="lazy"></figure>

<h2>Conclusions</h2>

<p>In conclusion, constructing your own Generative Pre-trained Transformer (GPT) from scratch is a challenging yet incredibly rewarding endeavor that underscores the remarkable capabilities of Python and NumPy in the realm of natural language processing. Throughout this article, we have navigated the foundational elements of GPT architecture, from understanding the intricacies of self-attention and position encoding to grappling with the complexities of large-scale model training. The process reveals not just the technicalities of building a state-of-the-art language model but also illuminates the nuances of machine learning workflows and the importance of computational efficiency. Armed with the insights and methodologies discussed, one is well-equipped to embark on the journey of creating a custom GPT model, tailored to unique tasks and capable of pushing the boundaries of what we expect from AI in language understanding and generation. Whether for academic exploration, industry innovation, or personal projects, the knowledge to build a GPT model from scratch in Python using NumPy is a powerful tool in any developer’s arsenal.</p>
]]></content:encoded>
</item>
<item>
<title>From Zero to Hero: A Deep Dive into Andrej Karpathy’s Neural Networks Course</title>
<link>https://learn-llm.com/2024/09/08/from-zero-to-hero-a-deep-dive-into-andrej-karpathys-neural-networks-course/</link>
<guid isPermaLink="true">https://learn-llm.com/2024/09/08/from-zero-to-hero-a-deep-dive-into-andrej-karpathys-neural-networks-course/</guid>
<pubDate>Sun, 08 Sep 2024 12:00:00 GMT</pubDate>
<description>Artificial Intelligence (AI) is rapidly evolving, and for those eager to dive into the world of neural networks and machine learning, there’s no better place to start than Andrej Karpathy’s “Zero to Hero” course. This…</description>
<category>Learning LLMs</category>
<content:encoded><![CDATA[<p>Artificial Intelligence (AI) is rapidly evolving, and for those eager to dive into the world of neural networks and machine learning, there’s no better place to start than Andrej Karpathy&#8217;s “Zero to Hero” course. This online series, offered by one of the leading minds in the AI community, aims to take you from a complete beginner to someone proficient in understanding and implementing neural networks from scratch. Let&#8217;s explore what makes this course stand out and how it can help you achieve your AI aspirations.</p>

<h4>Who is Andrej Karpathy?</h4>

<p>Before we delve into the course itself, it’s important to understand who Andrej Karpathy is. Karpathy is a prominent AI researcher, educator, and practitioner. Formerly the Director of AI at Tesla, he played a pivotal role in developing the company’s self-driving technology. Prior to Tesla, he was a founding member of OpenAI, where he contributed significantly to AI research. Karpathy is widely recognized for his expertise in deep learning, and his approachable, clear style of teaching has made complex topics accessible to countless learners worldwide.</p>

<h4>What is the &#8220;Zero to Hero&#8221; Course?</h4>

<p>&#8220;Zero to Hero&#8221; is an open online course designed to teach you neural networks from the ground up. Whether you&#8217;re new to the field or have some background in programming and mathematics, this course offers a structured, practical approach to mastering neural networks and deep learning.</p>

<p>The course is structured as a series of lectures, each carefully designed to build upon the previous ones. It focuses on teaching the fundamental concepts of deep learning, such as how neural networks work, how they can be built from scratch, and how to optimize them to achieve high accuracy in various tasks.</p>

<h4>Key Features of the &#8220;Zero to Hero&#8221; Course</h4>

<ol>
<li><strong>Practical, Hands-on Learning</strong>: Unlike many theoretical courses that bombard you with heavy mathematics, &#8220;Zero to Hero&#8221; adopts a practical approach. You will learn by coding neural networks from scratch, which helps solidify the underlying concepts and provides a clear understanding of how everything works under the hood.</li>

<li><strong>Python and PyTorch Focused</strong>: The course utilizes Python, one of the most popular programming languages for AI, along with PyTorch, a leading deep learning framework. Karpathy guides you through every step of coding neural networks in PyTorch, from simple perceptrons to complex deep learning models. This practical experience is invaluable, as it enables you to start building your own AI models almost immediately.</li>

<li><strong>Accessible to All</strong>: One of the course’s biggest strengths is its accessibility. You don’t need an advanced degree in mathematics or computer science to get started. Karpathy breaks down complex concepts into digestible pieces and gradually introduces more advanced topics. This makes it ideal for anyone, whether you’re a student, a developer transitioning into AI, or just an enthusiast.</li>

<li><strong>Free and Open Access</strong>: True to the spirit of open education, &#8220;Zero to Hero&#8221; is completely free and available to anyone with an internet connection. All the materials, including lecture videos, code, and assignments, are available on <a href="https://karpathy.ai/zero-to-hero.html" rel="noopener">Karpathy&#8217;s website</a>. This accessibility makes high-quality education available to a global audience, allowing people from all walks of life to learn and explore AI.</li>

<li><strong>Community and Support</strong>: The course also encourages a strong community of learners. Engaging with peers through forums, GitHub repositories, and social media provides support and motivation, which is crucial for mastering complex topics like deep learning.</li>
</ol>

<h4>What Will You Learn?</h4>

<p>Here’s a snapshot of what you will learn through the &#8220;Zero to Hero&#8221; course:</p>

<ul>
<li><strong>Foundations of Neural Networks</strong>: Understanding how neurons and layers work, the basics of forward and backward propagation, and the mathematics behind neural networks.</li>

<li><strong>Deep Learning Techniques</strong>: Learn various architectures, such as convolutional neural networks (CNNs) for image recognition and recurrent neural networks (RNNs) for sequence data.</li>

<li><strong>Optimization and Training</strong>: Techniques to optimize the learning process, including gradient descent, loss functions, regularization, and more.</li>

<li><strong>Practical Implementation</strong>: Building neural networks from scratch in Python and PyTorch, and understanding every component that makes them work.</li>

<li><strong>Advanced Topics</strong>: Dive into more sophisticated topics like transfer learning, generative models, and reinforcement learning as you progress through the course.</li>
</ul>

<h4>Why Take This Course?</h4>

<ol>
<li><strong>Learn from a Thought Leader</strong>: Andrej Karpathy is renowned for his deep understanding of AI and his ability to explain complex concepts simply and effectively. Learning directly from an expert in the field provides a unique perspective and a deeper understanding of the subject.</li>

<li><strong>Hands-On Approach</strong>: The course emphasizes building models from scratch, which helps reinforce your understanding and gives you the skills to tackle real-world problems. By the end of the course, you’ll have a solid foundation in neural networks and the confidence to build your own AI models.</li>

<li><strong>No Prerequisites Required</strong>: Unlike many other AI courses that require a strong background in mathematics or computer science, &#8220;Zero to Hero&#8221; is designed for everyone. Whether you’re just starting out or looking to expand your knowledge, this course is a great fit.</li>

<li><strong>Flexible and Free</strong>: The course is self-paced and available online, allowing you to learn at your own speed and according to your schedule. Plus, it’s completely free, which removes the financial barrier often associated with quality education.</li>
</ol>

<h4>How to Get Started</h4>

<p>To get started with the “Zero to Hero” course, simply visit <a href="https://karpathy.ai/zero-to-hero.html" rel="noopener">Karpathy’s course page</a>. All you need is a computer with an internet connection, a basic understanding of programming in Python, and a curiosity to learn. Start by watching the introductory videos, setting up your development environment, and following along with the exercises. Engage with the community, share your progress, and don’t hesitate to ask questions.</p>

<h4>Final Thoughts</h4>

<p>Andrej Karpathy’s “Zero to Hero” course is a fantastic opportunity for anyone interested in neural networks and deep learning. Its practical, hands-on approach, combined with the expertise of a renowned AI leader, makes it an invaluable resource for beginners and seasoned practitioners alike. So, if you’re looking to make your mark in the world of AI, this is the perfect place to start.</p>

<p>Happy learning, and here’s to becoming an AI hero!</p>
]]></content:encoded>
</item>
</channel>
</rss>
