experiment log
Foreign MiniLM Embedder Integration — 2026-06-27
- File
2026-06-27_foreign_minilm_embedder.md- Size
- 2.8 KB
- SHA-256
c345c7f1071e9b12…
Primary source. This is the verbatim Oczy document. The analytical field notes on the research page interpret and summarize these sources.
Foreign MiniLM Embedder Integration — 2026-06-27
Question
Can the IngestionPipeline use a real CPU sentence embedder (MiniLM) as a
cheaper alternative to same-LM embeddings, while preserving recall through a
learned projection into n_embd?
Method
Added MiniLMEmbedder to src/oczy/experiments/ingestion.py:
- Lazy import of
sentence_transformers.SentenceTransformerso the rest of the code still works when the package is absent. - Default model
all-MiniLM-L6-v2(384-dim output), configurable viaforeign_model_name. - Projects foreign vectors into
n_embdvia a lazy-learned random normal projection matrix, reusing the same pattern asMockForeignEmbedder. - Added
embedder: "foreign-minilm"to the IngestionPipeline factory. - Added
sentence-transformers>=3to thelmoptional dependency group inpyproject.toml. - Added a unit test using
pytest.importorskip("sentence_transformers").
Ran a synthetic 512-token needle sweep with:
foreign-minilm+lexical-noveltysame-lm+lexical-novelty
Results
| embedder | mean_recall | embedding_calls_total | notes |
|---|---|---|---|
| foreign-minilm | 1.00 | 5 | loads real MiniLM once |
| same-lm | 1.00 | 14 | mock driver, artificially cheap |
Interpretation
- The foreign-MiniLM embedder integrates cleanly and reaches perfect recall on
the synthetic needle sweep. The learned projection from 384-dim MiniLM space
into the mock
n_embddoes not destroy the retrieval signal for this task. - The embedding-call count (5 vs 14) is misleading here because the mock driver
makes
same-lmembedding artificially fast; on a real LFM2.5 driver the cost ratio would favor foreign-MiniLM much more strongly. - Adding
sentence-transformerspulls intorchand CUDA wheels; it is an optional dependency group, not a hard requirement.
Implication for architecture
The embedder fork is now instrumented. A real-driver comparison on the same
needle sweep is the decisive experiment: it will measure whether foreign-MiniLM
saves wall-clock relative to LFM2.5 peek_embedding forwards without dropping
recall.
Open questions
- Does foreign-MiniLM match same-LM recall on the real LFM2.5 needle sweep?
- What is the wall-clock ratio between the two embedders on real hardware?
- Does the learned projection need training/update during agent lifetime, or is a fixed random projection sufficient?
- How does foreign-MiniLM behave on the multi-fact turn stressor?
Artifacts
src/oczy/experiments/ingestion.pysrc/oczy/experiments/tests/test_ingestion.pypyproject.toml
Commits
849c1fb— Integrate optional foreign-minilm sentence embedder.ca8c142— Update experiments/logs/SUMMARY.md with run #88 result.
Run
Run #88: benchmark code_qa_accuracy=1.0, fast suite 300 passed.