Repository navigation
Seed images: evaluate retraining the LTR with image pages, and a per-list image cap - #626
Open
daoudclarke wants to merge 2 commits into
Open
daoudclarke wants to merge 2 commits into
daoudclarke wants to merge 2 commits into
Conversation
…image cap ltr_retrain.py cross-validates four arms over the LLM-labelled queries (today's recipe and the image rows, each with an overall and a relevance label) and scores each on an image-free test pool too, then runs standard search's ranker on the en-gb queries over production's pages with the images overlaid, with and without a cap, for the holistic judge. The relevance-labelled image arm is best on cross-validation, costs web ranking nothing and never ranks an image first; a cap of 2 beats no cap. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pair each image arm with its own no-image twin, say the retrain-vs-today run doesn't separate model from cap, call the en-gb overlay an upper bound, and spell out what the serving-time store lookup must cover. Match TinyIndex.retrieve on term-less documents and keep the first copy of a repeated image, as the training rows do. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
daoudclarke
added a commit
that referenced
this pull request
Nov 11, 2026
…per list The model is #626's images_relevance arm: the deployed recipe plus the image rows, on the relevance >= 2 label (sha256 ea9ab57c...aa83). Cross-validation put it at +0.006 pass-3 NDCG@10 over today's recipe, and the holistic judge preferred a cap of 2 images per list to a cap of 1 or none. ImageCapRanker drops every Commons file page after the first MAX_IMAGES_PER_RESULT_LIST from the final order, after the LTR and MMR, so web results move up. Combined Search's ranker gets the same cap for consistency. Merge with or after PR 9's serving-time store lookup: the model scores Commons file pages higher than today's, and only that lookup keeps unchecked crawled ones out. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
daoudclarke
added a commit
that referenced
this pull request
Nov 11, 2026
…per list The model is #626's images_relevance arm: the deployed recipe plus the image rows, on the relevance >= 2 label (sha256 ea9ab57c...aa83). Cross-validation put it at +0.006 pass-3 NDCG@10 over today's recipe, and the holistic judge preferred a cap of 2 images per list to a cap of 1 or none. ImageCapRanker drops every Commons file page after the first MAX_IMAGES_PER_RESULT_LIST from the final order, after the LTR and MMR, so web results move up. Combined Search's ranker gets the same cap for consistency. Merge with or after PR 9's serving-time store lookup: the model scores Commons file pages higher than today's, and only that lookup keeps unchecked crawled ones out. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From Claude:
Stack: PR 8 of the #610 plan, the evaluation half. It builds on #621 (
seed-images-ltr-data). It ships no model and changes no production ranking code. The model file and the per-list image cap go in a separate production PR.What changed
mwmbl/rankeval/seed_images/ltr_retrain.pyruns AGENTS.md's two evaluation steps over Seed images: LTR training rows for Commons image pages #621's dataset.cvcross-validates four arms over the 849 LLM-labelled queries, in five folds by query, on pass-3 NDCG@10. The arms are today's recipe and today's recipe plus the image rows, each trained with theoverall ≥ 6label and with arelevance ≥ 2label. Every arm is scored on the whole test fold, on the fold with its image rows removed, and with relevance as the gain.train,searchandbatchesproduce the holistic run.searchputs the en-gb queries through standard search's ranker (LTR + MMR), over production's own pages with images overlaid the way Seed images: LTR training rows for Commons image pages #621 overlays them, and with an optional per-list image cap.seed-search-images-eval.md, in the new section "Retraining the LTR with image pages", and in the Summary.Why
Standard search's LTR has never seen an image page. Before images are indexed, we need to know whether retraining it with image rows helps, whether those rows cost web ranking anything, and how many images one list should show.
Results
Cross-validation. Each difference is paired by query against
today, which is the deployed recipe retrained in each fold. The deployed model itself was trained on all of these queries, so its own row is in-sample.is_imagefeature is needed, because the existing URL and domain features already separate image pages. Adding one would have changed the Rust feature set.Holistic (Haiku 4.5, both orders, en-gb queries, production-sized pages).
Recommendation: the
images_relevancemodel with at most 2 images per list.Flag for the production PR
A crawled Commons file page that Jev never checked has the same URL pattern as an approved image (
https://commons.wikimedia.org/wiki/File:…), so the model and the cap treat it as an image. Any learned boost for images must therefore ship together with PR 9's serving-time store lookup, which drops every Commons file-page URL that isn't approved in the store. The lookup should canonicalise the URL first, covering http, mobile,index.php?title=File:and encoded variants. It will also drop the crawled Commons file pages that are served today.Verification
make checkpasses.make testpasses (1977 passed). The new tests are intest/test_seed_images_ltr_retrain.py.TinyIndex.retrievehandles them.Raised, not fixed:
devdata/seed_images/is untracked but not gitignored, and it holds data keyed by query.Part of #610
🤖 Generated with Claude Code