rag-assign-dpr-ce
2026-2 RAG ๊ณผ์ ์ฉ DPR bi-encoder. yali98/rag-assign-dpr ์์ ์ด์ด์,
yali98/rag-assign-cross-encoder ๋ก ๊ณ ๋ฅธ hard negative ๋ก ์ถ๊ฐ ํ์ต.
- negative ํ๋ณด:
datasets/yali98/rag-assign-ce-negatives(BM25 ์์ 100 โ rag-assign-dpr ์์ 30 + qrels hard_neg, goldยทweak_posยท์ ๋ต ๋ฌธ์์ด ํฌํจ ๋ฌธ์ ์ ์ธ) - ๊ฐ ํ๋ณด์ gold ๋ฅผ cross-encoder ๋ก ์ ์ ๋งค๊น โ gold ์ด์ ์ ์ ๋ฌธ์ ์ ์ธ (2,200,579 ๊ฐ ์ค 22,717 ๊ฐ) โ
CE ์ ์ ๋ด๋ฆผ์ฐจ์ ์์ 8๊ฐ๋ฅผ ์ง๋ฌธ์ hard negative ๋ก ์ฌ์ฉ:
dpr_ce_negatives.json({qid: [pid, ...]}, CE ์ ์ ๋ด๋ฆผ์ฐจ์ ์ ์ฒด ๋ชฉ๋ก, ์ 8๊ฐ ์ฌ์ฉ) - ํ์ต: ์ง๋ฌธ๋ง๋ค gold 1 + ์ negative ์ค ๋ฌด์์ 1 + in-batch negative, cross-entropy
- epochs 3, lr 1e-5, batch 64, max_q_len 64, max_p_len 256, warmup 0.1, weight_decay 0, grad_clip 2.0, seed 42, gradient checkpointing
- ํ์ต ์ง๋ฌธ 57,880 ๊ฐ (train_qa ์ค
random.Random(0).sample(train_qa, 1000)์ val ๋ก ์ ์ธ), best = val gold/weak@5 โ gold MRR ๊ธฐ์ค - ํ์ต GPU: RTX 3080 (bf16 autocast). negative CE ์ ์ 31๋ถ + ํ์ต 34๋ถ (epoch ๋น ์ฝ 11๋ถ)
- ํ์ต ์ฝ๋: ๊ณผ์ main.ipynb ์
mine_dpr_ce_negatives,train_dpr(..., init=..., negs=...)
| epoch | loss | val gold/weak@1 | val gold/weak@5 | val gold MRR |
|---|---|---|---|---|
| 1 | 0.1564 | 0.478 | 0.712 | 0.474 |
| 2 | 0.1295 | 0.481 | 0.703 | 0.476 |
| 3 | 0.1037 | 0.489 | 0.705 | 0.481 |
์ฐธ๊ณ : rag-assign-dpr (10 epoch) val = gold/weak@1 .455 / @5 .702 / MRR .456
from transformers import AutoTokenizer, DPRQuestionEncoder, DPRContextEncoder
q = DPRQuestionEncoder.from_pretrained("yali98/rag-assign-dpr-ce", subfolder="question_encoder")
c = DPRContextEncoder.from_pretrained("yali98/rag-assign-dpr-ce", subfolder="ctx_encoder")
tok = AutoTokenizer.from_pretrained("yali98/rag-assign-dpr-ce", subfolder="question_encoder")
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support