accesspatterns.dev

The wrong model still answers

Query with a different model from the one that wrote the vectors and you get a confident wrong answer, silently.

Why

A vector is a position in one model's space. Two models build their spaces independently, and there is no reason a position in one means anything in the other. So the embedding model that wrote your vectors has to be the model that queries them.

Nothing in the database will tell you when it is not. The last example is the entire extent of the checking: the index counts the numbers, confirms each one is a finite 32-bit float, and stops. It has no idea which model produced them. Both models here emit 384 numbers, so there is nothing to count wrong, and the mismatched search comes back with a full set of results, ordinary-looking scores, and no error field anywhere in the response.

The second and fourth examples are the pair worth sitting with. Same broken pairing, same index, same articles. One question comes back visibly wrong; the other comes back fine. The two models are both English sentence encoders trained on overlapping data, so their spaces are loosely correlated: a strongly worded query still lands in roughly the right region, while a vaguer one drifts. That is worse than the failure being total. A total failure is caught in five minutes. This one passes whichever question you happened to try first, and ships.

The scores degrade even where the ranking survives, so they are worth reading too. Matched, the best result scores 0.43 and the fourth 0.78. Mismatched, the same question gives 0.83 and 0.89. Two things have gone wrong there. Everything is further away, so anything downstream holding a relevance threshold - and every retrieval pipeline holds one somewhere - now rejects the lot and reports no results rather than an error. And the spread has collapsed from 0.34 to 0.06, which means the index can no longer tell you which of its answers is the good one. A vector from the wrong model lands in a region where nothing in particular is near it, so everything is equally far away and the ordering that comes back is close to arbitrary.

Where this actually bites is rarely a careless developer. It is a model upgrade that re-embeds new documents but not the old ones, or two services running different library versions. The fix is to treat the model identity and version as part of the index's contract: write it down beside the index, and when it changes, re-embed the whole corpus rather than half of it.

The index checks the number of dimensions and nothing else, so a query from the wrong model returns confident nonsense with no error - and because two models' spaces are loosely correlated, some questions still look right, which is what stops anyone noticing.

HelpCentre

These rows are real and already here. Running an operation against them downloads a DynamoDB-compatible engine, about 850 KB, and executes it in this tab.

Try an example

"Stop sending me so many emails", embedded by MiniLM, searched against the index MiniLM wrote. The right article is first at 0.43, and the rest trail off to 0.78. These are cosine distances, so lower is nearer, and that spread is the index discriminating: it has an opinion about which article is best.

pk(pk)
title
topic
embMini
embBge
ARTICLE#hc-signin-reset
Reset a forgotten passwordS
signinS
[-0.0557, -0.0348, -0.0595, … 384]L
[-0.0486, -0.04, 0.029, … 384]L
ARTICLE#hc-signin-link
Why your sign-in link expiredS
signinS
[-0.0295, -0.0396, 0.0118, … 384]L
[-0.0899, -0.0402, 0.0195, … 384]L
ARTICLE#hc-signin-2fa
Turn on two-factor authenticationS
signinS
[0.0051, 0.0093, -0.0412, … 384]L
[-0.0643, -0.0075, -0.0313, … 384]L
ARTICLE#hc-signin-locked
Unlock an account after too many failed attemptsS
signinS
[-0.0093, -0.0184, -0.0054, … 384]L
[-0.068, -0.0464, 0.0233, … 384]L
ARTICLE#hc-billing-card
Update the card we charge each monthS
billingS
[0.0234, 0.0116, -0.0589, … 384]L
[-0.0766, -0.0523, 0.0284, … 384]L
ARTICLE#hc-billing-invoice
Read your invoice line by lineS
billingS
[-0.0318, 0.0757, -0.0467, … 384]L
[-0.0688, -0.067, 0.0026, … 384]L
ARTICLE#hc-billing-plan
Change your plan in the middle of a billing cycleS
billingS
[-0.0173, 0.0838, -0.0119, … 384]L
[-0.0671, -0.0781, 0.0231, … 384]L
ARTICLE#hc-billing-refund
Claim a refund for a duplicate chargeS
billingS
[-0.119, 0.019, 0.031, … 384]L
[-0.0798, -0.0269, 0.0207, … 384]L
ARTICLE#hc-export-csv
Export your records as a CSV fileS
exportS
[0.0192, 0.0394, -0.1332, … 384]L
[-0.0291, -0.0069, 0.0469, … 384]L
ARTICLE#hc-export-schedule
Schedule a nightly export to cloud storageS
exportS
[-0.0088, 0.0396, -0.0101, … 384]L
[-0.0596, -0.0672, 0.0115, … 384]L
ARTICLE#hc-export-columns
What each column in the export meansS
exportS
[-0.006, -0.0161, -0.1159, … 384]L
[-0.0287, -0.0223, 0.0215, … 384]L
ARTICLE#hc-export-restore
Restore records from an earlier exportS
exportS
[-0.0607, -0.0025, -0.0113, … 384]L
[-0.0601, 0.0063, 0.1176, … 384]L
ARTICLE#hc-notif-email
Choose which emails we send youS
notificationsS
[0.0371, -0.0846, 0.0536, … 384]L
[-0.0199, -0.0246, 0.0076, … 384]L
ARTICLE#hc-notif-mute
Mute notifications for a single projectS
notificationsS
[-0.02, -0.0366, 0.0468, … 384]L
[0.0115, 0.0398, 0.006, … 384]L
ARTICLE#hc-notif-digest
Swap instant alerts for a daily digestS
notificationsS
[0.0393, 0.0248, 0.0187, … 384]L
[-0.0312, -0.0591, -0.0218, … 384]L
ARTICLE#hc-notif-slack
Send alerts to a Slack channelS
notificationsS
[0.0295, -0.0497, -0.0552, … 384]L
[-0.0287, -0.0721, -0.0149, … 384]L

Run an operation to see the raw engine response.

table HelpCentrekeys pkitems 16