feat(embed-test): extend HF parity to MiniLM-L6-v2 + paraphrase-multilingual-MiniLM-L12-v2 (closes khive ship gate)#115
Closed
ohdearquant wants to merge 2 commits into
Conversation
…se-multilingual-MiniLM-L12-v2 Add two new golden fixture generators and committed fixtures for sentence-transformers/all-MiniLM-L6-v2 (WordPiece, mean pool, no prefix) and sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 (SentencePiece, mean pool, no prefix). Generator uses HF cache snapshot for full tokenizer config; weight path resolution matches the existing E5/BGE pattern. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…t (closes khive ship gate) Add all_minilm_l6_v2_parity_vs_hf and paraphrase_multilingual_minilm_l12_v2_parity_vs_hf test functions following the BGE/E5 pattern. Both use plain embed() (no prompt prefix), masked mean pooling, and COS_SIM_MIN_F32 (0.9990) tolerance. Results on this machine: all-MiniLM-L6-v2: 5/5 PASS, min cosine 0.999899 paraphrase-multilingual-L12: 5/5 PASS, min cosine 0.999875 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 25, 2026
Owner
Author
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.
Layer
L3 — ship gate (PR11 of 11)
What
Extends the HF parity regression gate (PR10) to the two embedding models khive uses in production:
sentence-transformers/all-MiniLM-L6-v2— 384-dim, mean pool + L2, no prompt prefix, WordPiece (BERT-base-uncased style)sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2— 384-dim, mean pool + L2, no prompt prefix, SentencePiece (XLM-R style)Why
These are the actual ship-criterion models for khive launch. Without parity vs HF on these specifically, khive's recall pipeline can't validate retrieval quality against any reference framework.
Parity result (with full stack applied)
Both clear the
COS_SIM_MIN_F32 = 0.9990ship gate.Note on tokenizer config resolution
~/.lattice/models/all-minilm-l6-v2/contains weights but notokenizer.jsonorconfig.json. The Python generator (gen_embed_parity_goldens.py) was extended with afind_hf_cache_snapshot()helper to fall back to~/.cache/huggingface/hub/models--<owner>--<name>/snapshots/<hash>/for full tokenizer config. Runtime lattice service still loads weights from~/.lattice/models/unchanged — this only affects golden generation.After this PR merges, lattice can ship v0.2.5
Stack
Base: #114 (PR10 HF parity gate)
Umbrella: #104
🤖 Generated with Claude Code