e5-base-labor-law-ko
intfloat/multilingual-e5-base fine-tuned so that everyday Korean questions about work
retrieve the correct statute article or Supreme Court ruling.
⚠️ Portfolio research project, not legal advice. 본 모델은 법률 자문을 제공하지 않습니다.
Why
Korean workers do not ask questions in legal language. Asked "작년에 안 준 알바비 지금이라도 받을 수 있나요?", BM25 ranked the correct article (근로기준법 제49조, 임금채권 3년 시효) 3,885th. This model closes that vocabulary gap.
Results
| System | Recall@1 | Recall@10 | MRR@10 | NDCG@10 |
|---|---|---|---|---|
| BM25 (Kiwi) | 0.478 [0.427–0.531] | 0.827 | 0.601 | 0.656 [0.617–0.696] |
| multilingual-e5-base | 0.513 [0.460–0.567] | 0.904 | 0.649 | 0.711 [0.676–0.747] |
| e5-base FINE-TUNED | 0.657 [0.606–0.707] | 0.952 | 0.769 | 0.815 [0.785–0.847] |
| Hybrid RRF (BM25+e5-base FINE-TUNED) | 0.606 [0.552–0.657] | 0.922 | 0.720 | 0.769 [0.735–0.804] |
335 held-out questions over a 3,922-chunk corpus, 95% bootstrap CIs (1,000 resamples).
The base and fine-tuned Recall@1 intervals do not overlap. A leakage audit
(check_leakage.py) gates these numbers and excluded 2 queries whose source ruling is
duplicated upstream under two 판례일련번호.
Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Khabib1304/e5-base-labor-law-ko")
# keep the e5 prefixes - they were used in training and evaluation
q = model.encode(["query: 5인 미만 사업장도 연차휴가가 있나요?"], normalize_embeddings=True)
p = model.encode(["passage: [근로기준법 제60조(연차 유급휴가)] ..."], normalize_embeddings=True)
print(q @ p.T)
Training
| Base model | intfloat/multilingual-e5-base (MIT) |
| Training pairs | 3631 synthetic question/article pairs |
| Loss | CachedMultipleNegativesRankingLoss |
| Batch / mini-batch | 64 / 8 |
| Epochs / LR | 2 / 2e-05 |
| Hardware | NVIDIA GeForce RTX 5060, 6.31 GB peak |
| Time | 3.2 minutes |
Data
11 Korean labor statutes with their decrees and rules, plus 507 Supreme Court rulings (2008+), from the 법제처 국가법령정보 OpenAPI via the legalize-kr mirrors. Statutes and judgments are excluded from copyright under 저작권법 제7조. Law snapshot: 2026-09-25 — each statute pinned to the version then in force.
Training questions were generated by free-tier LLMs in the voice of 알바생/정규직/계약직/사장님 and filtered by rules, near-duplicate detection and an LLM-as-judge answerability check.
Limitations
- The test set is LLM-generated and not human-verified; absolute numbers may be optimistic, though the before/after comparison is sound (identical queries for every system).
- Judge coverage was partial (1,626 of 4,102 pairs; it rejected 2.9%).
- 별표 annex tables are missing upstream (PDF only), notably the list of provisions applying to workplaces with fewer than 5 employees.
- Laws change. Results describe the 2026-09-25 snapshot.
- No forgetting check against a general Korean retrieval benchmark was run.
Full method, decision log and evaluation code: https://github.com/Habibulo/labor-law-rag-finetune