<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jan Schachtschabel on Medium]]></title>
        <description><![CDATA[Stories by Jan Schachtschabel on Medium]]></description>
        <link>https://medium.com/@janschachtschabel?source=rss-3386824bcabe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*k4H7JL4k9wH5HOzc</url>
            <title>Stories by Jan Schachtschabel on Medium</title>
            <link>https://medium.com/@janschachtschabel?source=rss-3386824bcabe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 22:38:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@janschachtschabel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[LLM-as-a-Judge: Everything Passed, and That Was the Problem]]></title>
            <link>https://medium.com/@janschachtschabel/llm-as-a-judge-everything-passed-and-that-was-the-problem-4bfc622a94a4?source=rss-3386824bcabe------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bfc622a94a4</guid>
            <category><![CDATA[llm-as-a-judge]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[ai-evaluation]]></category>
            <dc:creator><![CDATA[Jan Schachtschabel]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 06:43:44 GMT</pubDate>
            <atom:updated>2026-07-25T06:43:44.121Z</atom:updated>
            <content:encoded><![CDATA[<p><em>What these judges are actually good at — and the checks that stop them quietly agreeing with themselves.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2LlyUnDPUZvesrvw-T12A.png" /><figcaption>LLM-AS-A-JUDGE</figcaption></figure><p>Somewhere in your organisation there is a pile of text nobody has read.</p><p>Product descriptions. Support macros. Dataset documentation. Course summaries. Help-centre articles. Tens of thousands of short items, written by a rotating cast of people over several years, against standards that changed twice along the way. You know some of it is stale, some of it is wrong, and most of it is fine. You don’t know which is which, and reading it all would cost a year of somebody’s life.</p><p>So you ask a model to read it instead. You write a rubric — is it accurate, is it clear, is it relevant, is it the right length — and you point a language model at the pile.</p><p>The first run comes back beautifully. Scores cluster high. Almost everything meets the bar.</p><p>That is the moment to stop, because there are two explanations and only one of them is good news. Either the catalogue really is in decent shape, or you have just built a very fast, very confident machine for saying yes.</p><p>Telling those apart is the entire discipline.</p><h3>The setup is simple. The trap is in the setup.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wfOg2VV4JAtnvtonRMDNyw.png" /><figcaption>LLM judge</figcaption></figure><p>An LLM judge has four moving parts: the text being evaluated, a rubric, a model prompted to apply that rubric, and a verdict — a score, usually with a written rationale. There are three common shapes. <strong>Pointwise</strong> scoring rates one item in isolation. <strong>Pairwise</strong> comparison picks a winner between two. <strong>Reference-based</strong> grading compares a candidate against a known-good answer.</p><p>The technique went mainstream on the back of one finding. The MT-Bench work from Zheng and colleagues in 2023 reported that GPT-4 agreed with human evaluators roughly 80% of the time — about the rate at which two human annotators agree with each other. If a model can approximate human judgment at human-level consistency, the case for replacing annotation queues with API calls looks settled.</p><p>That finding is real, and everything below assumes it. But it arrived with conditions attached, and production pipelines rarely preserve them. The research since has been considerably less reassuring — and, usefully, specific enough to act on.</p><h3>Six ways a judge lies to you</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TwqwXTp-itRPA6cQdLqb9g.png" /><figcaption>Six ways a judge lies to you</figcaption></figure><p>None of these announce themselves. The score comes back looking exactly the same either way.</p><p><strong>Position bias.</strong> In pairwise comparison, whichever candidate appears first wins more often than it should. This has been studied systematically enough that it is now a standard control: present A-then-B and B-then-A, and count only the verdicts that survive the swap. Everything else is coin-flipping with extra steps.</p><p><strong>Length priors.</strong> Longer, more elaborate answers tend to read as better answers regardless of what the rubric says. Interestingly, a large-scale 2026 audit found verbosity effects were small in its cohort under a single tightly specified pairwise rubric — which is not a reason to relax, but a reason to measure. The size of this bias depends on how you wrote your rubric, and you don’t know how you wrote your rubric until you test it.</p><p><strong>Self-preference.</strong> Models rate output from their own family more generously. The sharper version of this problem is <em>preference leakage</em>: when the model that generated your data is related to the model judging it, the contamination is both pervasive and much harder to detect than ordinary position or length effects. The mitigation is blunt and non-negotiable — the generator and the judge never come from the same family.</p><p><strong>Leniency.</strong> This is the one that produces the opening scene of this article. A rubric built entirely from positive criteria drifts toward “met”. The model tries to make sense of the text in front of it, finds a charitable reading, and ticks the box. Recent rubric work found exactly this: consistent positive bias across criterion types, correctable by adding criteria that can <em>fail</em> — explicit penalties for anti-patterns rather than only rewards for virtues.</p><p><strong>Domain gap.</strong> Fluency is cheap to assess. Subject-matter correctness is not. A judge with no grounding in the actual material will reward confident, well-structured wrongness and penalise correct-but-awkward expertise, and it will do so with a rationale that sounds entirely reasonable. Agreement with experts drops noticeably in specialised fields — which is an argument for screening, not for final decisions.</p><p><strong>Drift.</strong> Model versions change. Prompts get edited. Someone tightens the rubric. Any of these silently breaks comparability with last quarter’s numbers, and nothing in your dashboard will tell you.</p><h3>Your agreement number is inflated</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yj8auTUmk2x5PyxBnzCHYQ.png" /><figcaption>agreement number</figcaption></figure><p>Here is the most consequential and least glamorous point in this article.</p><p>Almost every judge benchmark leads with raw agreement — the percentage of items where the judge and the human landed on the same verdict. Raw agreement is also the metric that a <em>shared</em> bias inflates most. If your judge waves through 90% of items and your reviewers wave through 85%, the two of you will agree constantly, and almost none of that agreement is evidence of anything.</p><p>Chance-corrected agreement — Cohen’s κ — discounts the agreement you would expect from two lenient raters answering independently. The gap between the two numbers is not a rounding error. A systematic 2026 evaluation across a large cohort of judges, including then-current frontier models, found this deflation to be universal, in the region of 33 to 41 percentage points on MT-Bench. The same study found judge rankings shifting by up to fourteen positions depending on which benchmark you evaluate them on, and documented production judges with excellent test-retest reliability that were nonetheless badly position-biased. A judge can be perfectly reproducible and perfectly wrong.</p><p>So: build a gold set of somewhere between 100 and 300 items drawn from your actual content distribution, labelled by people who know the domain — not generalist annotators, because the difference there is large. Report both numbers. Lead with κ.</p><p>Two findings on rubric design follow directly. Binary criteria — met or unmet — produce the strongest inter-rater reliability; broad numeric scales invite central-tendency clustering and poor calibration. And a 2025 rubric benchmark for research agents found that moving from three-way to binary grading raised human–judge agreement by roughly twenty points, concluding that partial credit added ambiguity without adding discriminative power.</p><p>If your rubric currently scores things from 0 to 10, that is almost certainly worse than a set of binary questions or a three-to-five point scale with concrete behavioural anchors.</p><h3>The judge likes writing that sounds like the judge</h3><p>Now for the part that specifically bites the generation use case.</p><p>The obvious next step after scoring a catalogue is rewriting it. Generate improved descriptions, score old against new, ship the winners. And this works: generated text usually does score better.</p><p>Of course it does. A 2026 study on automatically generated dataset descriptions was refreshingly direct about the risk in its own method — the judge may systematically prefer LLM-style writing over publisher-authored metadata, even in cases where a human reviewer would rate the human-written version higher. When your generator and your evaluator share a training distribution, “the new version scores better” and “the new version is better” are different claims.</p><p>Blind human comparison is the correction, and it’s cheap. Show reviewers two anonymised versions, ask which they’d publish, ask <em>why</em>.</p><p>But read the reasons, not just the counts. In my experience — and this shows up consistently in write-ups of these tests — when human reviewers prefer generated text, they prefer it for scannability, consistent structure, and a clear statement of who the item is for. Those are genuine wins, and they are wins in <em>presentation</em>. Meanwhile the same reviewers describe a subset of generated text as generic: technically unobjectionable, specifically useless, recognisably machine-shaped.</p><p>A preference test tells you which text reads better. It does not tell you which text is true. Run factual correctness as a separate check, against the source material, with a rubric that has nothing to do with style.</p><h3>Almost none of this research is about your language</h3><p>If you work in English, skip this section. If you don’t, it may be the most important one.</p><p>A comprehensive multilingual study covering five model families, five tasks and 25 languages found that judges struggle to reach consistent verdicts across languages, with average Fleiss’ κ landing around 0.3 — and that neither multilingual training data nor larger model scale reliably fixed it. Consistency tracked resource availability: European languages held up reasonably, low-resource languages fell apart. A 2026 multilingual judge benchmark found the same pattern, and noted that raw accuracy understates the gap that bias-penalised reliability metrics expose.</p><p>There is one genuinely counterintuitive practical finding here. A 2026 empirical study across high-, mid- and low-resource languages found that keeping the evaluation rubric and instructions in <strong>English</strong> produced more consistent judgments across target languages than translating the rubric — translating your evaluation prompt is not automatically the right move. The same work found that where in-domain training data exists, a fine-tuned small model can match proprietary frontier judges on the evaluation task.</p><p>Two consequences. First, your gold set must be in the language of your content, no exceptions — the English benchmark numbers do not transfer. Second, test both rubric languages on that gold set before you commit, because the answer is empirical and it is not the one most teams assume.</p><h3>Where the judge actually belongs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkJxJgyoNw03TXUudk1JQw.png" /><figcaption>Workflo</figcaption></figure><p>Not as the final arbiter of quality. As the triage layer that decides who gets human attention.</p><p>The judge scores everything, cheaply. Clear passes ship. Clear failures go to rewrite. The uncertain middle band — the items where the judge’s own scores are marginal or where independent criteria disagree — becomes the only queue a human works through. That queue is small enough to actually clear, which is the whole point.</p><p>The part almost everyone skips: <strong>audit the pass lane.</strong> Pull a random sample of what the judge waved through and have a human read it. Failures the judge caught are visible by definition. Failures it approved are the ones that quietly become your baseline.</p><p>Two upgrades worth the effort:</p><p><strong>Use a panel, not a judge.</strong> Verga and colleagues showed that a panel of smaller models drawn from different families correlated better with human judgments than a single large judge, at more than seven times lower cost, while reducing intra-model scoring bias through pooling. This is one of the rare cases where cheaper and better point the same way. One caveat from recent work: averaging the panel’s scores is fragile, because a single juror failing in a characteristic way — mode collapse, sycophancy, a reflexive safety refusal — can drag the consensus without bound. Use a median or trimmed mean instead of a plain average.</p><p><strong>Ground the factual criteria.</strong> For anything where correctness matters, the judge should not be reasoning from parametric memory. Retrieve the source material — the document, the transcript, the curriculum, the spec — and put it in the context. This turns “does this sound right” into “does this match the source”, which is a question the model is far better at answering.</p><h3>A minimum protocol</h3><p>If you take one thing from this, take the checklist.</p><ol><li><strong>Write a rubric with criteria that can fail.</strong> Binary where possible; three to five anchored levels where not. One rubric per intent — chat helpfulness and factual accuracy are not the same instrument.</li><li><strong>Build a gold set of 100–300 items</strong>, in your content’s language, labelled by domain experts, drawn from your real distribution.</li><li><strong>Measure κ, not just agreement.</strong> Report both. If κ is under about 0.4, your judge is not measuring what you think it is.</li><li><strong>Run the swap test.</strong> Both orderings on every pairwise comparison; keep only verdicts that survive.</li><li><strong>Never share a family between generator and judge.</strong> For anything high-stakes, use a panel from different families with a robust aggregator.</li><li><strong>Pin versions and re-run the gold set on every change</strong> — model, prompt, or rubric. Scores across rubric versions are not comparable, and pretending otherwise is how teams end up celebrating a prompt edit.</li><li><strong>Sample the pass lane, not just the fail lane.</strong></li><li><strong>Keep humans on the uncertain band.</strong> That is the ROI. Not replacement — reallocation.</li></ol><h3>The point</h3><p>An LLM judge is an instrument, not an authority. Instruments are useful precisely because they are consistent, and dangerous for the same reason: a scale that reads two kilos heavy will do so with impressive reliability forever.</p><p>Nobody would report a measurement without knowing the calibration of the thing that took it. But scores from a language model arrive looking like data — numeric, tabulated, plotted — and that presentation does a lot of unearned persuading.</p><p>So the question is never <em>what did the judge say</em>. It is: how far off is this judge, in which direction, on this kind of content, this week. Answer that and you have a genuinely powerful tool for making a large pile of text tractable. Skip it and you have a machine that says yes, at scale, in a font that looks like evidence.</p><h3>Sources and further reading</h3><ul><li>Zheng et al., <em>Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena</em> (2023) — the ~80% human-agreement result — <a href="https://arxiv.org/abs/2306.05685">arXiv:2306.05685</a></li><li>Shi et al., <em>Judging the Judges: A Systematic Study of Position Bias in LLM-as-a-Judge</em> — <a href="https://arxiv.org/abs/2406.07791">arXiv:2406.07791</a></li><li>Verga et al., <em>Replacing Judges with Juries: Evaluating LLM Generations with a Panel of Diverse Models</em> — <a href="https://arxiv.org/abs/2404.18796">arXiv:2404.18796</a></li><li><em>Reliability without Validity: A Systematic, Large-Scale Evaluation of LLM-as-a-Judge Models Across Agreement, Consistency, and Bias</em> — <a href="https://arxiv.org/abs/2606.19544">arXiv:2606.19544</a></li><li><em>How Reliable is Multilingual LLM-as-a-Judge?</em> (Findings of EMNLP 2025) — <a href="https://aclanthology.org/2025.findings-emnlp.587/">ACL Anthology</a></li><li><em>Towards Reliable Multilingual LLMs-as-a-Judge: An Empirical Study</em> — <a href="https://arxiv.org/abs/2605.28710">arXiv:2605.28710</a></li><li><em>Autorubric: A Unified Framework for Rubric-Based LLM Evaluation</em> — on binary criteria, leniency and negative anchors — <a href="https://arxiv.org/abs/2603.00077">arXiv:2603.00077</a></li><li><em>ResearchRubrics: A Benchmark of Prompts and Rubrics for Evaluating Deep Research Agents</em> — binary vs. ternary grading — <a href="https://arxiv.org/abs/2511.07685">arXiv:2511.07685</a></li><li><em>Less Is More? When Dataset Context Hurts LLM-Generated Dataset Descriptions</em> — on judges preferring LLM-style metadata — <a href="https://arxiv.org/abs/2606.02334">arXiv:2606.02334</a></li><li><em>RoPoLL: Robust Panel of LLM Judges</em> — on fragile mean aggregation in juries — <a href="https://arxiv.org/abs/2606.30931">arXiv:2606.30931</a></li><li><em>Preference Leakage: A Contamination Problem in LLM-as-a-Judge</em> — <a href="https://llm-as-a-judge.github.io/">llm-as-a-judge.github.io</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bfc622a94a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Default-Deny: What Checking 10,000 Open Educational Resources Taught Me About Image Rights]]></title>
            <link>https://medium.com/@janschachtschabel/default-deny-what-checking-10-000-open-educational-resources-taught-me-about-image-rights-f17dcf1fa31a?source=rss-3386824bcabe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f17dcf1fa31a</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[image-rights]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[copyright]]></category>
            <category><![CDATA[content-moderation]]></category>
            <dc:creator><![CDATA[Jan Schachtschabel]]></dc:creator>
            <pubDate>Fri, 24 Jul 2026 22:00:10 GMT</pubDate>
            <atom:updated>2026-07-24T22:00:10.277Z</atom:updated>
            <content:encoded><![CDATA[<h3>Most of the copyright risk in an open education platform isn’t in the resources. It’s in the pictures sitting on top of them.</h3><p>Here is a situation that almost every content aggregator ends up in without ever deciding to.</p><p>You index openly licensed material — lesson plans, explainers, dossiers, worksheets — from thousands of external sites. You show each item as a card with a thumbnail, because a wall of grey rectangles is a wall nobody clicks. And the thumbnail is not a link. It is a copy: fetched, resized, re-encoded and stored on your own infrastructure.</p><p>At that moment two assumptions quietly break.</p><p><strong>Assumption one: the licence covers the picture.</strong> It usually doesn’t. A page can be genuinely, correctly CC BY-SA while the photograph at the top of it is a licensed press image that the publisher paid for and is allowed to use — and you are not. Open licensing of <em>text</em> almost never extends to <em>third-party imagery</em>, and the exception is stated in the fine print that nobody parses.</p><p><strong>Assumption two: search engines do this, so it must be fine.</strong> Search-engine thumbnail privileges were built around a specific set of facts: an engine that crawls, does not store the work as its own copy, and stops when it is told to. A portal that keeps a resized copy on its own servers and serves it from there is standing on much thinner ground.</p><p>So I built a rights-checking service in front of the preview pipeline, and then ran it across a random sample of roughly <strong>10,000 openly licensed educational records</strong> to find out what actually works. The results were not what I expected — mostly because the cheapest methods won by a landslide and the sophisticated ones came back empty.</p><p>This article is what I’d want to read before starting.</p><h3>1. The architecture decision comes first: default-deny</h3><p>Everything else follows from one choice: <strong>what happens when you don’t know?</strong></p><p>There are two possible defaults.</p><p><em>Permissive:</em> show the thumbnail unless something proves it’s a problem. Comfortable, great-looking product, and it means every undetected case is served to users at scale, continuously, for years.</p><p><em>Default-deny:</em> show the thumbnail <strong>only</strong> when a free licence has been positively established. Everything else gets a placeholder icon or an abstract generated image.</p><p>I went with default-deny, and I’d argue it’s the only defensible option for a publicly funded platform. It has an immediate, unpleasant consequence you should accept upfront: <strong>a large chunk of your catalogue will lose its picture</strong> — not because anything is wrong with it, but because nothing proved it right. That’s a product cost you pay deliberately, in exchange for not accumulating a liability you can’t see.</p><p>The second architectural decision matters just as much: <strong>check at ingestion, not later.</strong></p><p>Almost every usable signal lives on the page where the image was found, or in the file as it existed <em>before</em> your own pipeline touched it. Both are available exactly once — while you are crawling. Skip them, and the only way to get them back is to crawl the entire catalogue again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jer4PF3pM_6PCwLGpqfrlw.png" /></figure><p><em>The pipeline. Everything left of the verdict is free and runs at crawl time; the paid lane is a narrow exception, not a stage.</em></p><h3>2. What 10,000 randomly sampled resources actually looked like</h3><p>The sample was drawn at random from a catalogue of openly licensed educational material. Each record’s preview image was run through the full free pipeline — around a dozen checks — with external paid services switched off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozFwLIXz-QEHjUlPOg2L3A.png" /></figure><p><em>Verdicts across roughly 10,000 randomly sampled records.</em></p><ul><li><strong>≈ 80% green.</strong> A free licence positively established — mostly public domain and CC BY-SA, with the required attribution text extracted along the way. This is the happy path, and it’s bigger than I expected.</li><li><strong>≈ 15% yellow.</strong> No usable signal at all. Not suspicious, just silent. Under default-deny, silence loses.</li><li><strong>≈ 3.5% red.</strong> A licensed agency image on a page that presented itself as freely licensed. Roughly 350 records.</li><li><strong>≈ 1.5% grey.</strong> Technically un-checkable — dead links, unsupported formats, timeouts.</li></ul><p>The 3.5% is the interesting number, and not because of its size.</p><p><strong>None of it was where you’d look for it.</strong> The flagged images were not on link farms or content-mill blogs. They sat on public broadcasters, civic education portals, state media institutes, church-run education sites, university and institutional pages, language-learning portals. Organisations with legal departments. Organisations whose own use of those images was almost certainly perfectly licensed.</p><p>That’s the whole point. <strong>Their licence is not transferable to you.</strong> A picture with a proper press-agency credit line on a public broadcaster’s site is a correctly licensed image <em>for them</em> and an unlicensed one <em>for you</em>, and the credit line — the very thing that proves they did it right — is what lets you detect it.</p><p>Which leads to a design rule worth writing on the wall: <strong>evaluate the page, never the reputation of the domain.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8gyKU1-s8PCoDUo6Qci6A.png" /><figcaption>right holders</figcaption></figure><p><em>Which rights holders turned up. Press-photo agencies dominate — stock libraries are the smaller half of the problem.</em></p><p>Note what this distribution says: for education portals, the dominant exposure is <strong>press photography</strong>, not stock. Editorial images of politicians, events, historical moments — exactly the imagery that explanatory and civic-education content is built from.</p><h3>3. The uncomfortable finding: two nearly free methods do almost all the work</h3><p>I implemented fourteen approaches. I expected the detection to be spread across them, with the clever file-forensics methods carrying the weight.</p><p>Here’s how it actually broke down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RsXeyHIlp9x20MfF7jyrIQ.png" /><figcaption>detection methods</figcaption></figure><p><em>Share of all detections, counted without overlap.</em></p><p><strong>Roughly two thirds came from reading the visible credit line.</strong> Parse the caption, the credit box, the small grey text under the image, the site’s image-credits page. Match it against a list of agency names, on word boundaries. That’s it. In Germany this works spectacularly well for one reason: <strong>§ 13 UrhG</strong> gives authors a right to be named, so serious publishers write the credit out in the page, in plain human-readable text. The legal obligation that protects the photographer is also the strongest machine signal you have.</p><p><strong>Roughly a third came from patterns in the image URL.</strong> Agency export workflows leave fingerprints in file names: gettyimages-123456789, AdobeStock_987654321, shutterstock_1234567, imago0123456, depositphotos_…, news-agency NewsML identifiers. Publishers rename files far less often than you&#39;d think. A handful of regular expressions against src, srcset, og:image and CSS background URLs recovers a third of all cases with no network calls and no image decoding at all.</p><p><strong>Everything else combined: under 5%.</strong></p><p>Together, those two page-level methods produced about <strong>97%</strong> of all detections. Both are free. Both need nothing but the HTML of the page. Both run in milliseconds.</p><p>If you build nothing else, build these two.</p><p>The mirror image is worth stating too: <strong>the positive proof of free licensing is equally cheap.</strong> Structured rights markup in the HTML and embedded metadata are what turned 80% of the sample green — and they hand you the attribution string you’re legally required to display anyway. Detection and compliance come out of the same parser.</p><h3>4. Why the sophisticated methods came back empty</h3><p>This is the part I’d most want to warn people about, because it’s where the engineering instinct sends you first.</p><p>A preview image on an aggregation platform is a <strong>copy of a copy</strong>. The publisher’s CMS resized and re-encoded the original. Then your pipeline resized and re-encoded it again. By the time you hold the bytes, several layers of evidence are simply gone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PDrsp6C2GUGe3PNyi9AWJA.png" /><figcaption>copy of a copy problem</figcaption></figure><p><em>What survives the trip from original file to preview thumbnail.</em></p><ul><li><strong>Embedded IPTC / EXIF / XMP metadata</strong> — the richest rights information that exists, with dedicated fields for the copyright notice, the creator, the credit line, the licensor and a URL to the rights statement. Stripped during resizing, routinely and silently, by CMS image libraries. Zero hits.</li><li><strong>C2PA content credentials</strong> — cryptographically signed provenance manifests. Broken by re-encoding. Zero hits.</li><li><strong>Exact-hash matching against free image corpora</strong> — a preview is never bit-identical to the original again. Zero hits.</li><li><strong>Watermark detection</strong> — technically survives re-encoding fine, but curated educational material simply doesn’t carry visible watermarks. Zero hits, for a different reason.</li><li><strong>Perceptual hashing against a risk database</strong> — robust, works, and returned zero hits because the database was empty on day one.</li></ul><p>The industry baseline explains the pattern. Large-scale surveys of images published on the open web have consistently found that <strong>around 85% carry no metadata at all</strong>, and that of the remainder only a small minority actually identify a rights holder. The main culprit isn’t malice; it’s default CMS behaviour that strips metadata to save a few kilobytes.</p><p><strong>The counter-move:</strong> during ingestion, when you have already fetched the page, also fetch the <em>original</em> image referenced by the page — the one before your own resizing — and read its metadata. It’s one step closer to source and it survives more often.</p><p>In the sample this recovered a readable metadata block for a meaningful minority of records, and it caught a handful of agency images that every other check had missed — including one where a press-agency photo on a broadcaster’s page would otherwise have shipped as “unproblematic.”</p><p>That gain is real and it is small. It’s worth turning on at ingestion and worth leaving off in bulk re-scans, where it doubles your runtime for a couple of percentage points.</p><p>And the general rule underneath it: <strong>empty metadata is not a free licence.</strong> No signal must never map to green.</p><h3>5. The whole toolbox, ranked honestly</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gXfGPi3B8lYLencfJ5tlQw.png" /><figcaption>Fourteen methods</figcaption></figure><p><em>Fourteen methods, positioned by practical yield against cost to run at scale.</em></p><p><strong>Page-level, free, do these first</strong></p><ol><li>Structured rights markup — schema.org ImageObject, ccREL, Dublin Core. High confidence when present, rare outside professional publishers. One warning: an &quot;acquire licence page&quot; property is a weak indicator on its own and produced false positives; only treat it as red when the target is actually an agency.</li><li>Visible credit lines and agency URL patterns — the workhorse.</li><li>Domain and CDN heuristics — useful as a soft signal only. A whitelist of known free sources is far more reliable than a blacklist, and even the whitelist doesn’t mean CC: several free-stock platforms use their own bespoke licence.</li><li>Site policy — image paths blocked in robots.txt, noimageindex, machine-readable text-and-data-mining reservations under § 44b (3) UrhG. Says something about the site, never about the single image. Never decide on this alone.</li></ol><p><strong>File-level, free, keep as a backstop</strong> 5. Embedded metadata, and (5b) metadata of the original file fetched from the source page. 6. C2PA content credentials — the spec is maturing fast (version 2.x, with a formal conformance programme and trust list), and it will matter more every year. But a missing manifest is the normal case, not a negative signal. 7. Visible watermark detection — a classifier plus OCR on the image, looking for burned-in agency names. Watch the licence of your model: the most popular object-detection package is AGPL-3.0, which is a real question for a network service. Permissively licensed backbones exist. 8. Perceptual hashing against your own risk database — the one method whose value compounds. 9. Hash matching against free corpora — for <em>positive</em> proof rather than detection.</p><p><strong>Paid, selective only</strong> 10. Reverse image search. 11. Agency catalogue similarity APIs.</p><p><strong>Process, decisive but unscalable</strong> 12. Editorial review queue. 13. Notice-and-takedown. 14. Replacement rendering.</p><h3>6. Aggregation: uncertainty resolves against showing the image</h3><p>Fourteen methods produce contradictory findings. The combination rule is where the policy actually lives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZU3X6QmuHJSkhdxfYt0XuQ.png" /><figcaption>aggregation ladder</figcaption></figure><p><em>The aggregation ladder.</em></p><ul><li><strong>Any strong agency finding above the confidence threshold ⇒ red.</strong> Not overridable by green findings. If a page says “Photo: &lt;press agency&gt;” and also carries a site-wide CC footer, the restrictive reading wins.</li><li><strong>Green requires at least one strong positive proof and no red</strong> — a CC or public-domain licence URI, a rights statement pointing at a free licence, an exact match in a free corpus, or a valid signed manifest.</li><li><strong>Contradiction ⇒ yellow, into the human queue.</strong> Don’t resolve conflicts with a heuristic.</li><li><strong>No signal ⇒ yellow.</strong> Default-deny.</li></ul><p>One more subtlety that bit me: the same image appears at multiple source pages with <em>different</em> rights statements. Store findings as a list, per source, and let the most restrictive one win.</p><h3>7. Where paid services belong — and what disappeared</h3><p>Reverse image search and agency catalogue APIs are genuinely powerful and genuinely expensive at catalogue scale. Rough 2026 economics: commercial reverse-image APIs start around $200 for 5,000 searches, with million-search bundles bringing it down toward a cent per search; cloud vision web-detection sits around $3.50 per 1,000; private match-engine indices run a few hundred to a couple of thousand dollars a month.</p><p>Multiply any of those by a few hundred thousand records and the number stops being a line item.</p><p>Also worth knowing if you’re planning a build: <strong>Microsoft retired the Bing Search APIs, including Visual Search, on 11 August 2025</strong>, with existing instances decommissioned entirely. A lot of tutorials and half-finished integrations out there quietly point at a dead endpoint. The remaining routes are the direct vendors and third-party SERP aggregators.</p><p>The rule I settled on: paid lookups only for <strong>contested, high-traffic items where every free method returned nothing</strong> — a low-priority queue with a hard budget cap. Not a pipeline stage.</p><h3>8. Detection is the easy half; process is the other one</h3><p>Three things matter more over time than any individual detector.</p><p><strong>The review queue that feeds itself.</strong> Yellow items get prioritised by traffic. Every human decision writes back — and every <em>red</em> decision writes the image’s perceptual hash into the risk database. Which means the one method that caught nothing on day one becomes your strongest filter by month twelve, entirely as a by-product of work you were doing anyway. Bulk actions per domain, agency or photographer make this survivable.</p><p><strong>A takedown path with a real SLA.</strong> In most liability frameworks, the protection you have depends on what you knew and how fast you acted once you knew. That makes your response time a compliance property, not a support metric. A report button on the preview, an endpoint behind it, immediate red, hash into the database, ticket, logged. Under 24 hours.</p><p><strong>Something to show instead.</strong> A typed placeholder icon is the cheap default. An abstract generated image from the title and description is nicer — with two conditions: never use the original as a seed, and label it. Under <strong>Article 50 of the EU AI Act, transparency obligations for AI-generated content apply from 2 August 2026</strong>, so if you’re generating replacement imagery, machine-readable marking is now part of the build, not a later nicety. (Extracting a dominant colour or a blur-hash from the original is tempting and looks great — but it’s still derived from the work you decided not to show.)</p><h3>9. The data model that saves you a re-crawl</h3><p>If there’s one implementation detail worth copying, it’s this: <strong>persist the individual findings, not just the verdict.</strong></p><p>FieldWhy it existslicense_statusred / yellow / green / unchecked — drives deliverylicense_sourcewhich method decided itlicense_confidenceaggregate certaintylicense_signals[]<strong>every finding: method, result, evidence, timestamp</strong>credit_textthe visible credit line — also your attribution stringcreator / supplierfrom IPTC or the detected agencylicense_urinormalised licence URIacquire_urla purchase or licensing page — strong redphash / pdq / sha1rights matching <em>and</em> deduplication, same fieldssource_page / source_domainpage-level signals are not file-boundchecked_at, review_flag, reviewed_byre-check scheduling and audit trail</p><p>The signals array is what lets you recalibrate a threshold, add an agency to the word list, or change a legal policy — and re-decide the whole catalogue from stored evidence in minutes, instead of re-crawling the web.</p><h3>10. The legal backdrop, in one paragraph</h3><p>Not legal advice, just the shape of the terrain in the German and EU context. A line of German Federal Court decisions on search-engine thumbnails established that publishing images without technical restrictions can imply a limited consent (I ZR 69/08), that this holds even for images uploaded by someone unauthorised (I ZR 140/10), and that liability attaches from the point of knowledge (I ZR 11/16). Meanwhile the CJEU held that re-uploading an image to a different site requires fresh permission (<em>Renckhoff</em>, C-161/17) and that framing which circumvents technical protection measures is a communication to the public (<em>VG Bild-Kunst</em>, C-392/19). Add § 13 UrhG (the right to be named — the basis of the entire credit-line practice), § 44b (3) UrhG (machine-readable TDM reservations) and Article 50 of the AI Act.</p><p>The practical conclusion: the search-engine reasoning does not transfer cleanly to a portal that stores its own copies, and liability tends to hinge on knowledge. Which is precisely why the reporting path and the response time are part of the architecture, not the support process.</p><h3>Seven things I’d tell anyone building this</h3><ol><li><strong>Decide the default first.</strong> Everything downstream is a consequence of what “unknown” means.</li><li><strong>Check at ingestion.</strong> Page HTML and pre-resize files are available exactly once.</li><li><strong>Build the two cheap page-level methods before anything else.</strong> They’re ~97% of the yield for ~5% of the effort.</li><li><strong>Don’t expect file forensics to save you.</strong> Metadata is stripped, manifests are lost, hashes don’t match. Plan for it instead of discovering it.</li><li><strong>Judge pages, not domains.</strong> The problems live on the sites you’d never suspect, precisely because those sites credit their images properly.</li><li><strong>Store the evidence, not the verdict.</strong> It’s the difference between recalibrating in minutes and re-crawling for weeks.</li><li><strong>Start the risk database on day one,</strong> even though it will catch nothing. It’s the only detector whose accuracy grows while you sleep.</li></ol><p>The uncomfortable summary: the highest-value engineering here isn’t computer vision. It’s a careful HTML parser, a well-maintained list of agency names, and the discipline to say no when you don’t know.</p><p><em>Written from the perspective of building rights-checking for an open educational resources platform. Nothing here is legal advice — talk to a lawyer about your specific jurisdiction and setup.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f17dcf1fa31a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multilingual Embedding Models in 2026: What Actually Works on CPU]]></title>
            <link>https://medium.com/@janschachtschabel/multilingual-embedding-models-in-2026-what-actually-works-on-cpu-d4bf3fe3d335?source=rss-3386824bcabe------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4bf3fe3d335</guid>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jan Schachtschabel]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 18:43:13 GMT</pubDate>
            <atom:updated>2026-07-01T18:43:13.479Z</atom:updated>
            <content:encoded><![CDATA[<h3>I benchmarked 20 multilingual embedding models on a customer CPU — for speed, retrieval quality, inference framework, and scaling. Here is what I found, and the practical guidance I wish had existed when I started.</h3><p>If you’re building semantic search or a RAG pipeline and you don’t have a GPU budget, the internet is not very helpful. Almost every embedding leaderboard optimizes for accuracy on English, most “fast” claims quietly assume a CUDA device, and the models that top the charts are frequently the ones that will bring a CPU-only server to its knees.</p><p>I ran headfirst into this while building semantic search over a large multilingual document collection — content in German, English, French, Spanish and Italian, served from <strong>CPU-only</strong> infrastructure. No GPU. Permissive licenses only. Self-hostable. The same constraints apply to a huge range of real-world semantic-search and RAG deployments, so I decided to measure things properly rather than trust the leaderboards.</p><p>I tested 20 multilingual embedding models myself and measured the four things that actually decide whether a model ships: <strong>speed, retrieval quality, the inference framework you run it on, and how it scales across cores.</strong> This article is the distilled version of that work.</p><p><strong>TL;DR for the impatient:</strong></p><ul><li>The surprise winner on CPU was a <strong>static</strong> model — roughly 150× faster than the best transformers at ~95% of their quality.</li><li>Public benchmark rankings (MTEB) only <em>partly</em> matched what I measured. Trust, but verify with your own data.</li><li><strong>ONNX Runtime (fp32) is a free lunch</strong>: ~2× lower latency, zero quality loss. Use it for every transformer.</li><li>If you want a robust, dependable transformer: <strong>multilingual-e5-small</strong>.</li><li>You can distill your <em>own</em> static model from almost any sentence-transformer using <strong>Model2Vec</strong> — I did, and it matched its own teacher.</li></ul><h3>Why “multilingual” is not optional (but often is)</h3><p>Here’s a trap. Most of the best-scoring, most-hyped embedding models are <strong>English-only</strong>. If your content or your queries live in more than one language, an English-only model will quietly degrade — sometimes catastrophically for cross-lingual retrieval (a German query trying to find a French document).</p><p>There’s a real cost to going multilingual: multilingual models typically trade a little peak English accuracy for broad language coverage, and some “multilingual” models secretly cover only a couple of languages well. (In my test, jina-embeddings-v2-base-de is German/English only — great if that&#39;s your scope, useless for Spanish or Italian.)</p><p>So the decision is simple:</p><ul><li><strong>Single language, especially English?</strong> You have a huge menu; pick from the top of the leaderboard.</li><li><strong>Multiple languages, or cross-lingual retrieval?</strong> Your menu shrinks dramatically, and you need to test on <em>your</em> languages. This article is for you.</li></ul><h3>The one chart that tells the whole story</h3><p>Everything below is nuance. This is the headline: quality on the vertical axis, speed on the horizontal (log scale, batch of 32, CPU only).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ozU7o48l0c2eBrZPGtr1Q.png" /><figcaption>Quality vs. Speed on CPU</figcaption></figure><p>Read it like this: <strong>top-right is heaven</strong> (accurate <em>and</em> fast). The three teal dots parked on the right edge are static models, running at 8,000–11,000 sentences/second while the best transformers crawl along at 6–70 S/s on the same CPU. That’s not a typo — it’s roughly a <strong>150× speed difference</strong>.</p><p>The two models sitting at a perfect nDCG of 1.0 (harrier-oss-v1-270m, multilingual-e5-large-instruct) are gorgeous — and useless for synchronous search, because at 104–288 ms per query they&#39;re too slow for a search box a human is waiting on.</p><p>Here is the full picture — all 20 models, their own-measured quality, external MTEB score, latency, throughput, dimensionality and license:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHtlpTdUHqPse2U3INHbNw.png" /><figcaption>20 models, their own-measured quality, external MTEB score, latency, throughput, dimensionality and license</figcaption></figure><h3>Lesson 1: The leaderboard is a starting point, not an answer</h3><p>I pulled public MTEB / MMTEB / MIRACL scores for every model as a rough pre-filter. Then I measured retrieval quality myself on a small multilingual gold set (method below). The two did <strong>not</strong> line up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k3ecUuehgcDeUz-oO57mRQ.png" /><figcaption>MTEB vs nDCG gap</figcaption></figure><p>Look at the two red arrows:</p><ul><li><strong>granite-embedding-311m-r2</strong> sits near the <em>top</em> of MTEB (~65) but landed near the <em>bottom</em> of my test (nDCG 0.72).</li><li><strong>multilingual-e5-small</strong> is unremarkable on MTEB (~59) but was the <strong>best transformer I tested</strong> (0.94).</li></ul><p>Why the gap? Public leaderboards aggregate many tasks (classification, clustering, reranking, retrieval) across benchmarks that aren’t directly comparable (MMTEB v1 ≠ MTEB v2 ≠ MIRACL). A model tuned to shine on that mix isn’t necessarily tuned for <em>your</em> retrieval task, in <em>your</em> languages, on <em>your</em> content. The lesson isn’t “ignore MTEB” — it’s “use it to build a shortlist, then measure on your own data.” An afternoon of benchmarking saved me from shipping the wrong model.</p><p>For reference, here are the external scores I used for the pre-filter — note they come from different, not-directly-comparable benchmarks, which is exactly why they can’t be the final word:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*v3b0Zn4i3CCxFUIN-SKvAw.png" /><figcaption>MTEB Benchmark</figcaption></figure><h3>Lesson 2: Which models actually run well on CPU</h3><p>This is the information that’s genuinely hard to find, so here it is plainly. Throughput scales in clean tiers by architecture and size:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4S4lITTKnnbfSoMngmasg.png" /><figcaption>CPU throughput tiers by architecture and size</figcaption></figure><p>A few counter-intuitive findings worth internalizing:</p><ul><li><strong>Newer architecture ≠ faster on CPU.</strong> granite-107m (based on the older XLM-R) ran ~2.7× <em>faster</em> than the newer, ModernBERT-based granite-97m-r2 — despite having <em>more</em> parameters. ModernBERT simply isn&#39;t well-accelerated on CPU yet. A raw MTEB score would never reveal this.</li><li><strong>“On-device” branding doesn’t guarantee CPU speed.</strong> Google’s embeddinggemma-300m, positioned for on-device use, ran at ~15 S/s — the same as any other 300M encoder.</li><li><strong>Decoder-based embedding models are painful on CPU.</strong> Qwen3-Embedding-0.6B was the slowest model I tested at 3.2 S/s. If you don&#39;t have a GPU, avoid decoder embedders.</li></ul><p><strong>The current sweet spots from IBM and Microsoft:</strong> IBM’s Granite R2 family is worth a serious look — the small granite-embedding-97m-r2 (384-dim) is fast, compact, and notably supports a <strong>32k-token context window</strong>, which makes it a strong candidate for embedding long documents as a single vector. Microsoft&#39;s lineage runs deep here too: the excellent multilingual-e5 family builds on Microsoft&#39;s MiniLM work, and the newer harrier-oss-v1-270m posted the top quality in my test (if you can afford its latency for asynchronous work).</p><h3>Lesson 3: The framework matters as much as the model</h3><p>You picked a model. Now — do you run it on PyTorch, ONNX Runtime, or OpenVINO? On CPU, this choice changes your latency by 2–3× for <strong>free</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qlrsa7RjNWeHKqPhKSHDPQ.png" /><figcaption>ONNX-fp32 is a free lunch</figcaption></figure><p>Here’s the decision guide:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UCk0h_Nd2euKH6zyyHr5vw.png" /><figcaption>Inference framework decision guide (CPU)</figcaption></figure><p>Spelled out:</p><p><strong>PyTorch (torch-fp32)</strong> — the default everything ships with. Fine for prototyping. Leaves the most performance on the table.</p><p><strong>ONNX Runtime (fp32)</strong> — the free lunch. In my tests it delivered <strong>~2× lower latency with <em>perfect</em> parity</strong> (cosine similarity of 1.000 to the PyTorch output, identical nDCG). There is no quality trade-off. For any transformer model in production on CPU, this should be your default backend.</p><p><strong>ONNX Runtime (int8)</strong> — faster still (~2.5–3× vs. torch), but quality is <strong>model-dependent</strong>. e5-small held up beautifully (parity 0.995, nDCG even ticked up). But granite-97m-r2 (ModernBERT) dropped hard: nDCG 0.84 → 0.77. <strong>Rule: never ship int8 without running a parity + quality check on your own data first.</strong></p><p><strong>OpenVINO</strong> — Intel’s runtime. Its killer feature is AMX/VNNI int8 acceleration — but that’s <strong>Intel-only hardware</strong>. I tested it on an AMD CPU and it showed no advantage over ONNX; it also couldn’t export ModernBERT models. <strong>Verdict:</strong> on AMD, use ONNX. On Intel <em>production</em> hardware, evaluate OpenVINO int8 separately — it can reach ~4× there.</p><p>Two more traps: <strong>fp16 / O4 optimization is <em>slower</em> on CPU</strong> than fp32 (it’s a GPU feature — never use it on CPU), and <strong>static models don’t need ONNX at all</strong> — ONNX accelerates matmul and attention, operations static models don’t perform. Their bottleneck is tokenization plus a table lookup, already at ~0.5 ms.</p><p>Here’s the raw framework benchmark data behind the guidance — notice the ModernBERT-based granite-97m-r2 losing quality under int8 while e5-small holds:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mH5O3ZZTQknR4ObagSl-Yg.png" /><figcaption>Framework benchmark detail — torch vs ONNX variants</figcaption></figure><h3>Lesson 4: The surprise winner — static embeddings (and rolling your own)</h3><p>This was the most consequential finding of the whole exercise.</p><p>A <strong>static embedding model</strong> skips the transformer forward pass entirely. Instead of running your sentence through 12 attention layers, it looks up a pre-computed vector for each token in a fixed table and averages them. The vivid analogy: a transformer <em>reads</em> the sentence; a static model <em>looks each word up in a dictionary and averages</em>. The result is ~150× faster on CPU (~0.6 ms vs ~28 ms per query).</p><p>The obvious objection is “surely they’re much worse?” On my test set, they weren’t. They delivered <strong>~95% of the best transformer’s quality</strong>. And here’s the kicker:</p><blockquote><em>My self-distilled static model, </em><strong><em>m2v-gte-multilingual-768</em></strong><em>, scored nDCG </em><strong><em>0.921</em></strong><em> — </em>beating its own teacher model<em> </em><em>gte-multilingual-base (0.854).</em></blockquote><h3>You can distill your own</h3><p>The magic is a library called <a href="https://github.com/MinishLab/model2vec"><strong>Model2Vec</strong></a>. It takes <em>any</em> sentence-transformer and distills it into a static model. This means:</p><ol><li>Take a strong multilingual transformer.</li><li>Distill it into a static model with Model2Vec.</li><li>Get near-teacher quality at static-model speed.</li></ol><p>I did exactly this to produce m2v-gte-multilingual-768 (distilled from gte-multilingual-base), and it became my primary recommendation. It&#39;s <a href="https://huggingface.co/JanSchachtschabel/m2v-gte-multilingual-768">openly available on Hugging Face</a> under Apache 2.0 — feel free to use it as a template for your own distillation.</p><p><strong>The strategic payoff:</strong> if you later fine-tune a model on your own domain data, you can distill <em>that</em> into a static model — getting domain-specific quality at static-model speed.</p><h3>But — the honest caveats</h3><p>Static models are not a free lunch across the board. By design they ignore word order (“dog bites man” = “man bites dog” — it’s a bag of words), can’t disambiguate (“bank” is a single vector regardless of meaning), dilute long texts by averaging (so you need chunking), handle negation and composition weakly, and are usually weaker cross-lingual and more sensitive to output quantization.</p><p>Crucially: my gold set was small and its topics were cleanly separated — conditions that <em>flatter</em> static models and barely test their weaknesses. On messier, real-world data, a real transformer like e5-small may well claw the gap back. <strong>Treat static models as a strong candidate to verify, not a guaranteed winner to deploy blind.</strong></p><h3>Lesson 5: Scaling — indexing and search want opposite things</h3><p>Once you pick a model, one operational insight dominates: <strong>indexing and search have contradictory requirements but must use the same model</strong> (they share a vector space).</p><p><strong>Indexing</strong> is asynchronous, throughput-bound. You want maximum sentences/second. Here, counter-intuitively, <strong>many small workers beat one big process</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5A_IBQf1pUZanunXokSNgA.png" /><figcaption>Throughput: multi-process vs. threads (e-small, 8 physical cores)</figcaption></figure><p>Running 8 processes × 1 thread beat 1 process × 8 threads by ~24% total throughput. The price is N× the RAM (each worker loads its own copy of the model) and each individual worker is slower per-item. For bulk indexing, that’s a trade worth making — spin up gunicorn -w N with OMP_NUM_THREADS=1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5A_IBQf1pUZanunXokSNgA.png" /><figcaption>Throughput: multi-process vs. threads (e5-small, 8 physical cores)</figcaption></figure><p><strong>Search</strong> is synchronous, latency-bound, and the rule flips depending on the model:</p><ul><li><strong>Small model + short query</strong> → <em>fewer</em> threads are faster. For e5-small, 1 thread (16 ms) beat 16 threads (40 ms) — thread synchronization overhead swamps the tiny compute.</li><li><strong>Large model or long text</strong> → <em>more</em> cores per query helps. For bge-m3, spreading one query over 8 threads cut latency from 794 ms to 365 ms (~2.2×).</li></ul><p>So there’s no universal “use N threads” answer. Match it to the model and text length. And because <strong>query latency is the harder constraint</strong> (a human is waiting), it’s the criterion that should drive your model choice. Static models at 0.6 ms are unbeatable here.</p><h3>A note on storing vectors: quantization in the vector store</h3><p>One last gotcha, because “int8” means <em>two different things</em>. There’s int8 for <strong>model inference</strong> (speed, above), and int8/binary for <strong>vector storage</strong> in your search index (byte or bit element types) to save RAM. They&#39;re unrelated.</p><p>The storage version is <em>also</em> not free. Measured without rescoring (worst case), binary quantization (32× smaller) surprisingly beat int8 and held 97–99% of quality on <em>large</em> models — but <strong>collapsed on small models</strong> (e5-small dropped to ~61%). Small dimensions have little redundancy, so quantization hits hard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8xtRuytNh6VnvH6dAtqzQA.png" /><figcaption>Vectore-store quantization — nDCG@10 retained (no rescoring, worst case)</figcaption></figure><p>In practice most vector stores apply oversampling + rescoring (e.g. Elasticsearch’s bbq_hnsw defaults to 3×), which recovers most of this — but validate on your real corpus, and for small models consider staying at float32 or trimming dimensions via Matryoshka instead.</p><h3>My recommendation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4LVLXreRscXpJesnMCjP9Q.png" /><figcaption>My recommendation</figcaption></figure><ul><li>🏆 <strong>Primary — </strong><a href="https://huggingface.co/JanSchachtschabel/m2v-gte-multilingual-768"><strong>m2v-gte-multilingual-768</strong></a> (static, self-distilled): top quality (nDCG 0.92) at static speed (0.6 ms / 8,900 S/s). Ideal for both synchronous search and bulk indexing.</li><li>⭐ <strong>Robust alternative — </strong><a href="https://huggingface.co/intfloat/multilingual-e5-small"><strong>multilingual-e5-small</strong></a>: proven transformer (nDCG 0.94); just 15 ms with ONNX-fp32; small 384-dim (storage-friendly).</li><li>🔬 <strong>Quality reference — </strong><a href="https://huggingface.co/microsoft/harrier-oss-v1-270m"><strong>harrier-oss-v1-270m</strong></a><strong> / </strong><a href="https://huggingface.co/intfloat/multilingual-e5-large-instruct"><strong>multilingual-e5-large-instruct</strong></a>: perfect nDCG (1.0) — but too slow for synchronous search. Use for async, high-value work.</li></ul><p><strong>Framework:</strong> Always take ONNX-fp32 for transformers (free ~2×). int8 only after a parity check. Never fp16/O4 on CPU. Static models need no ONNX. OpenVINO only on Intel production hardware.</p><p><strong>Architecture:</strong> One model, two paths — a multi-worker pool for indexing (throughput), a few-thread service for search (latency). Both must use the <em>same</em> model.</p><h3>How I measured it (methodology)</h3><p>Full transparency, because you should replicate this on your own data rather than trust my numbers:</p><ul><li><strong>Hardware:</strong> AMD Ryzen 7 7730U (Zen 3, 8 physical / 16 logical cores, AVX2, 15 GB RAM), <strong>CPU-only</strong>. A laptop, deliberately — to mirror modest production constraints.</li><li><strong>Speed:</strong> custom harness, PyTorch-fp32, 8 threads; each model × batch {1, 8, 32}; 5 warmup + 20 measured runs, median. Reported throughput (sentences/s) and latency (ms).</li><li><strong>Quality:</strong> my own multilingual gold set — 25 query→document pairs across 5 languages × 5 subjects. Queries are <em>paraphrases</em> of the target document, so the test measures <strong>semantics, not word overlap</strong>. Metric: <strong>nDCG@10</strong> (plus Recall@1, MRR).</li><li><strong>Framework:</strong> the same models exported to ONNX (fp32, int8) and compared to PyTorch on speed, embedding drift (cosine to PyTorch), and nDCG.</li><li><strong>Scaling:</strong> thread sweep (1 process × 1–16 threads) and multi-process (N workers × 1 thread).</li></ul><p><strong>Honest limitations:</strong> the gold set is small and synthetic — the <em>ranking</em> is reliable, the <em>absolute numbers</em> are not to be over-read. A laptop Zen 3 is not a server EPYC, so absolute speed doesn’t transfer 1:1 (relative comparisons do). And a few models were under-tested for practical reasons (prompt templates not tuned for EmbeddingGemma/Qwen3, which likely under-rates them; the 7B e5-mistral didn&#39;t fit in 15 GB RAM). A larger, real-world test set — or a domain fine-tune — would be the natural next step.</p><h3>Sources &amp; links</h3><p><strong>Benchmarks &amp; tools</strong></p><ul><li><a href="https://huggingface.co/spaces/mteb/leaderboard">MTEB / MMTEB Leaderboard</a></li><li><a href="https://www.sbert.net/docs/sentence_transformer/usage/efficiency.html">Sentence Transformers — Speeding up Inference (backends)</a></li><li><a href="https://github.com/MinishLab/model2vec">Model2Vec (MinishLab)</a></li><li><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html">Elasticsearch dense_vector</a> · <a href="https://www.elastic.co/search-labs/blog/better-binary-quantization-lucene-elasticsearch">Better Binary Quantization (BBQ)</a></li></ul><p><strong>Models tested (Hugging Face)</strong></p><ul><li><a href="https://huggingface.co/JanSchachtschabel/m2v-gte-multilingual-768">JanSchachtschabel/m2v-gte-multilingual-768</a> (self-distilled)</li><li><a href="https://huggingface.co/intfloat/multilingual-e5-small">intfloat/multilingual-e5-small</a> · <a href="https://huggingface.co/intfloat/multilingual-e5-base">-base</a> · <a href="https://huggingface.co/intfloat/multilingual-e5-large-instruct">-large-instruct</a></li><li><a href="https://huggingface.co/ibm-granite/granite-embedding-107m-multilingual">ibm-granite/granite-embedding-107m-multilingual</a> · <a href="https://huggingface.co/ibm-granite">Granite R2 family</a></li><li><a href="https://huggingface.co/Alibaba-NLP/gte-multilingual-base">Alibaba-NLP/gte-multilingual-base</a> · <a href="https://huggingface.co/Snowflake/snowflake-arctic-embed-l-v2.0">Snowflake/snowflake-arctic-embed-l-v2.0</a></li><li><a href="https://huggingface.co/microsoft/harrier-oss-v1-270m">microsoft/harrier-oss-v1-270m</a> · <a href="https://huggingface.co/google/embeddinggemma-300m">google/embeddinggemma-300m</a> · <a href="https://huggingface.co/Qwen/Qwen3-Embedding-0.6B">Qwen/Qwen3-Embedding-0.6B</a></li><li><a href="https://huggingface.co/BAAI/bge-m3">BAAI/bge-m3</a> · <a href="https://huggingface.co/nomic-ai/nomic-embed-text-v2-moe">nomic-ai/nomic-embed-text-v2-moe</a></li><li><a href="https://huggingface.co/minishlab/potion-multilingual-128M">minishlab/potion-multilingual-128M</a> · <a href="https://huggingface.co/sentence-transformers/static-similarity-mrl-multilingual-v1">sentence-transformers/static-similarity-mrl-multilingual-v1</a></li></ul><p><strong>Excluded (license):</strong> jinaai/jina-embeddings-v3 / -v5 — CC BY-NC 4.0, not usable commercially. A reminder to always check the license before you fall in love with a benchmark score.</p><p><em>If you’re doing CPU-only multilingual retrieval, I hope this saves you a few weeks. The single most valuable thing you can do is build a small gold set in your own languages and measure — the leaderboard will only get you to the shortlist.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4bf3fe3d335" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>