Spaces:
Sleeping
Sleeping
Commit History
-
Swap MiniLM retriever for LeanDojo's ByT5 premise encoder
p4r5kpftnp-cmdReplaces the general-English `all-MiniLM-L6-v2` embedder with `kaiyuy/leandojo-lean4-retriever-byt5-small` — a ByT5 encoder fine-tuned on (proof_state, used_premise) pairs from Mathlib. Semantic retrieval now returns directly-relevant lemmas (`Nat.add_comm`, `Nat.add_assoc`, …) where the old setup returned irrelevant matches. What changed: - New `src/byt5_embedder.py` — LangChain Embeddings wrapper around the ByT5 encoder (mean-pooled + L2-normalized). - New `scripts/build_leandojo_index.py` — downloads the 181k pre-computed premise embeddings + dictionary from the LeanDojo HuggingFace repo and builds an IVFPQ FAISS index. IVFPQ compresses ~1 GB flat embeddings to ~17 MB with ~95% recall, keeping us under GitHub's free LFS quota. - `src/retriever.py` — drops BM25 ensemble and the generic `ms-marco-MiniLM-L-6-v2` cross-encoder reranker. The LeanDojo encoder is already domain-specialized; the generic rerank was reordering correct premises below irrelevant ones (verifie…d05440d
-
Add pre-built Mathlib FAISS index (118,885 declarations)
p4r5kpftnp-cmd +1: Claude Sonnet 4.6Built locally with: python3 scripts/build_index.py Mathlib v4.8.0 source extracted via lean-interact cache. Index files are tracked via Git LFS (index.faiss is 174MB, index.pkl is 42MB). HF Spaces supports LFS so the Space will pull these on build. With the index present, the retriever no longer logs the "skipping RAG" warning and proofs benefit from retrieved Mathlib lemma context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>cb30699