Improve retrieval quality: measure, then rerank, adapt queries and upgrade embedders in one rebuild
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 24/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- machine-learning, python, sqlite
- Área
- data, machine-learning, search
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 2
- Merge medio
- 8 h 57 min
- PR fusionados (30 d)
- 36
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lanl/litkit
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
lanl/litkit#47 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
lanl/litkit#18 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de lanl/litkit
Issues similares
-
docs(contributing): the two things that silently block a PRPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoavailable documentation good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 95/100
Nixitov/Riptide-Native#944 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
JTHCode/secretguard#24 ·
Los mantenedores suelen responder en 1 día
-
area: middleware documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
omarelshamy25x/shamy-hijri#63 ·
Los mantenedores suelen responder en 1 día