Improve retrieval quality: measure, then rerank, adapt queries and upgrade embedders in one rebuild
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 24/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- machine-learning, python, sqlite
- Ambito
- data, machine-learning, search
Direzione di ricerca
Start by reading src/litkit/embeddings/specter2.py and src/litkit/embeddings/sbert_mpnet.py, then inspect the FTS5 issue and the build record work in #65. First establish a retrieval test set and evaluation command covering the stated document types; record recall and nDCG for the current configuration before comparing reranking, query adaptation, lexical fusion, and replacement embedders. Done means adopted changes show measured gains and any re-embedding changes ship together with model revisions recorded.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Retrieval uses models and methods from around 2021–22:
- Paper search:
allenai/specter2_basewithout SPECTER2's ad hoc query adapter (src/litkit/embeddings/specter2.py). Short typed queries are embedded the way abstracts are. - Passage search:
sentence-transformers/all-mpnet-base-v2(src/litkit/embeddings/sbert_mpnet.py). It is a general-domain model, behind current embedding models and not trained on biomedical text. - Two stages: passages are searched only within a Stage 1 shortlist of papers chosen by title and abstract. A relevant passage in a paper whose abstract is about something else is missed (exact mode avoids this).
- Lexical matching: exact-token matching, with no ranked keyword scoring (such as BM25) and no rank fusion with the semantic results.
- Reranking: none in LitKit. Chatty has an optional LLM reranker in its chat path only.
Constraint
Re-embedding PMC OA takes about a day on roughly 20 GPUs and about a month on modest hardware. Changes that need re-embedding should be measured first and then shipped together in one rebuild.
Proposal
- Measure. Build a retrieval test set: queries with known relevant passages, covering biomedical papers and non-scientific documents (manuals, policies). Report recall and nDCG at fixed cutoffs for each configuration.
- Cheap wins (no re-embedding).
- A cross-encoder reranker over the top candidates, for example MedCPT's cross-encoder or a bge reranker. It runs on CPU for a few dozen passages per query.
- SPECTER2's ad hoc query adapter for query embeddings.
- BM25 scoring and reciprocal rank fusion, once the FTS5 index is maintained at scale (see the FTS5 issue).
- Changes that need a rebuild. Compare these on the test set:
- a newer chunk embedder (for example MedCPT for biomedical text, or a current general model such as Qwen3-Embedding or BGE-M3);
- contextual chunks (paper title and section heading prepended before embedding).
- One rebuild. Ship the winners together with the other changes that need a rebuild: the FTS5 index, the build record from #65, and the duplicate-vector fix.
Done when
- The test set and an evaluation command are in the repository, and results for the current configuration are recorded.
- Each adopted change shows a measured gain on the test set.
- Changes that need re-embedding are released together, with the model revisions recorded in the build record.
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 2
- Merge medio
- 8h 57m
- PR unite (30g)
- 36
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lanl/litkit
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 22/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
docs(contributing): the two things that silently block a PRForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaavailable documentation good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 95/100
Nixitov/Riptide-Native#944 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
JTHCode/secretguard#24 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 ·
I maintainer di solito rispondono entro 1 giorno