Portfolio code for HyDE-style dense retrieval on 2WikiMultihopQA and a one-shot query encoder trained to match mean HyDE teacher embeddings (no LLM at retrieval time).
CreatLab · Aug–Nov 2025 · Champaign, IL
| Stage | What to run | Location |
|---|---|---|
| A. Corpus / queries | BEIR-style corpus.jsonl, queries.jsonl, qrels.tsv | two_wiki/data/data/dev_retrieval/ (create locally; see two_wiki/prepare_2wiki_corpus.py) |
| B. Hypotheses (LLM) | Export hypothesis_docs per query | two_wiki/export_hyde_hypotheses.py + two_wiki/hyde_simple_config.json |
| C. Teacher vectors | Mean-pool hypothesis embeddings → .npy + .json | python scripts/build_teacher_embeddings.py (config: config/e5_embedding_config.json) |
| D. Distillation | E5 query encoder (LoRA) or Contriever student | training/distill_e5_query_encoder.py, training/distill_contriever.py |
| E. Merge LoRA (E5) | Full weights for indexing | training/merge_lora.py |
| F. Indexes & metrics | FAISS build / Recall@K | two_wiki/build_*_index.py, two_wiki/eval_*.py, two_wiki/bge/ |
| G. End-to-end HyDE demos | Live LLM + encoder + FAISS on dev split | retrieval/hyde_rag_bge_m3_2wiki.py, retrieval/hyde_rag_e5_2wiki.py |
| H. Extra baselines | Contriever TreeHop-style eval | retrieval/eval_contriever_2wiki.py, retrieval/simple_2wiki_multihop_eval.py, retrieval/build_2wiki_index.py |
Core library: src/hyde/ (Promptor, generators, HyDE mean-pooling).
cd "HyDE Fine-Tuning for Efficient Query Retrieval"
python -m venv .venv && source .venv/bin/activate
pip install -e .
pip install -r requirements.txt
Run scripts from the repository root unless noted (two_wiki/* is usually run from two_wiki/ so relative data/ paths resolve).
| Variable | Used by |
|---|---|
HYDE_E5_LORA_PATH | training/merge_lora.py, two_wiki/build_e5_index.py, two_wiki/eval_e5_retrieval.py |
HYDE_MERGED_E5_DIR | training/merge_lora.py output |
HYDE_2WIKI_DATA_DIR | two_wiki/build_e5_index.py, two_wiki/eval_e5_retrieval.py |
HYDE_E5_INDEX_FILE | two_wiki/eval_e5_retrieval.py |
# After editing config/e5_embedding_config.json → metadata_file points to your JSONL/JSON export
python scripts/build_teacher_embeddings.py --config config/e5_embedding_config.json
# Optional: --backend transformers_e5 (HF E5 + last-token pool instead of SentenceTransformer)
Outputs under artifacts/teacher_embeddings/, including stable names teacher_embeddings.npy and teacher_metadata.json for training defaults.
MS MARCO / DL19 demos, duplicate embedding generators, scratch notebooks, Qwen index, duplicate E5 eval copies, and one-off test.py files—so the tree tracks the 2Wiki + distillation story only.
目录已按 简历主线 重组:假文档生成 → 教师向量 → 查询端蒸馏 → 建索引与 Recall 评估;重复脚本已删除,两个旧的 hyde_embedding_generator*.py 合并为 scripts/build_teacher_embeddings.py。
Add a LICENSE when you open-source; upstream models (E5, BGE, Contriever) follow their own terms.
1 commits
Python
97.3%
Shell
2.7%
Portfolio code for HyDE-style dense retrieval on 2WikiMultihopQA and a one-shot query encoder trained to match mean HyDE teacher embeddings (no LLM at retrieval time).
CreatLab · Aug–Nov 2025 · Champaign, IL
| Stage | What to run | Location |
|---|---|---|
| A. Corpus / queries | BEIR-style corpus.jsonl, queries.jsonl, qrels.tsv | two_wiki/data/data/dev_retrieval/ (create locally; see two_wiki/prepare_2wiki_corpus.py) |
| B. Hypotheses (LLM) | Export hypothesis_docs per query | two_wiki/export_hyde_hypotheses.py + two_wiki/hyde_simple_config.json |
| C. Teacher vectors | Mean-pool hypothesis embeddings → .npy + .json | python scripts/build_teacher_embeddings.py (config: config/e5_embedding_config.json) |
| D. Distillation | E5 query encoder (LoRA) or Contriever student | training/distill_e5_query_encoder.py, training/distill_contriever.py |
| E. Merge LoRA (E5) | Full weights for indexing | training/merge_lora.py |
| F. Indexes & metrics | FAISS build / Recall@K | two_wiki/build_*_index.py, two_wiki/eval_*.py, two_wiki/bge/ |
| G. End-to-end HyDE demos | Live LLM + encoder + FAISS on dev split | retrieval/hyde_rag_bge_m3_2wiki.py, retrieval/hyde_rag_e5_2wiki.py |
| H. Extra baselines | Contriever TreeHop-style eval | retrieval/eval_contriever_2wiki.py, retrieval/simple_2wiki_multihop_eval.py, retrieval/build_2wiki_index.py |
Core library: src/hyde/ (Promptor, generators, HyDE mean-pooling).
cd "HyDE Fine-Tuning for Efficient Query Retrieval"
python -m venv .venv && source .venv/bin/activate
pip install -e .
pip install -r requirements.txt
Run scripts from the repository root unless noted (two_wiki/* is usually run from two_wiki/ so relative data/ paths resolve).
| Variable | Used by |
|---|---|
HYDE_E5_LORA_PATH | training/merge_lora.py, two_wiki/build_e5_index.py, two_wiki/eval_e5_retrieval.py |
HYDE_MERGED_E5_DIR | training/merge_lora.py output |
HYDE_2WIKI_DATA_DIR | two_wiki/build_e5_index.py, two_wiki/eval_e5_retrieval.py |
HYDE_E5_INDEX_FILE | two_wiki/eval_e5_retrieval.py |
# After editing config/e5_embedding_config.json → metadata_file points to your JSONL/JSON export
python scripts/build_teacher_embeddings.py --config config/e5_embedding_config.json
# Optional: --backend transformers_e5 (HF E5 + last-token pool instead of SentenceTransformer)
Outputs under artifacts/teacher_embeddings/, including stable names teacher_embeddings.npy and teacher_metadata.json for training defaults.
MS MARCO / DL19 demos, duplicate embedding generators, scratch notebooks, Qwen index, duplicate E5 eval copies, and one-off test.py files—so the tree tracks the 2Wiki + distillation story only.
目录已按 简历主线 重组:假文档生成 → 教师向量 → 查询端蒸馏 → 建索引与 Recall 评估;重复脚本已删除,两个旧的 hyde_embedding_generator*.py 合并为 scripts/build_teacher_embeddings.py。
Add a LICENSE when you open-source; upstream models (E5, BGE, Contriever) follow their own terms.
1 commits
Python
97.3%
Shell
2.7%