Instructions to use ysmeta/EVE-Embed-1.1-Legal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ysmeta/EVE-Embed-1.1-Legal with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ysmeta/EVE-Embed-1.1-Legal") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
EVE-Embed-1.1-Legal
Korean embedding model for legal precedent retrieval, fine-tuned from dragonkue/BGE-m3-ko.
It is built for the query style practitioners actually use β plain questions like "λ νΈμΉ΄ νμ¬ μ§μ μ°¨μ£Όκ° μκΈ° μ°¨λ‘ λ λ°κ³ μμ νλ©΄ μ΄μμ¬μ λ² μλ°μΈκ°μ?" β rather than the formal νμμ¬ν phrasing courts write.
| baseline (BGE-m3-ko) | EVE-Embed-1.1-Legal | change | |
|---|---|---|---|
| nDCG@10 | 0.6982 | 0.7872 | +12.8% |
| recall@1 | 0.5647 | 0.6700 | +18.7% |
| general Korean retrieval | 0.8698 | 0.8695 | β0.03% |
Retrieval is over the full 59,786-document corpus β no candidate pre-filtering, no reduced pool. The last row is the check that matters as much as the first: the model gained in its domain without losing general Korean retrieval ability.
Evaluation
Scored on EVE-Bench-Legal-1.0: 6,000 practitioner-style queries against 59,786 Korean court precedents.
| model | nDCG@10 | recall@1 | recall@10 |
|---|---|---|---|
| EVE-Embed-1.1-Legal | 0.7872 | 0.6700 | 0.9045 |
| EVE-Embed-1.0-Legal | 0.7800 | 0.6617 | 0.8978 |
| dragonkue/BGE-m3-ko | 0.6982 | 0.5647 | 0.8342 |
| nlpai-lab/KURE-v1 | 0.6916 | 0.5562 | 0.8308 |
| BAAI/bge-m3 | 0.6472 | 0.5083 | 0.7932 |
| intfloat/multilingual-e5-large | 0.6288 | 0.4897 | 0.7788 |
Why the benchmark uses rewritten queries
The corpus ships a natural query-document pair per case: νμμ¬ν (the legal question) and νκ²°μμ§ (the holding). Public models score ~0.87 nDCG@10 on that pairing β but both fields are written by the same court about the same issue and share most of their wording, so the score largely measures lexical overlap. Rewriting the query into ordinary practitioner language drops every public model by 0.17β0.20, which is the part of the original score that was not comprehension. All numbers above are on the rewritten (hard) set.
What changed in 1.1: hard negatives, verified
Version 1.0 shipped with no mined hard negatives, because adding them cost β36.5% and β7.5% in earlier runs. This version puts them back β after removing the ones that were never negatives to begin with.
An LLM (tencent/Hy3, GPTQ-Int4, served locally) judged 20,000 queries against their top-10 mined candidates. Of 200,000 candidate negatives, 64,741 (32.4%) genuinely answer the query. That is the mechanism behind the earlier losses: roughly one in three mined "hard negatives" was teaching the model that a correct answer is wrong. Legal precedents cluster tightly by issue, so the nearest non-gold neighbours of a legal question are usually relevant cases with a different holding.
Training on the survivors β 19,038 queries with an average of 3.9 verified negatives β is what separates 1.1 from 1.0:
| nDCG@10 | recall@1 | |
|---|---|---|
| EVE-Embed-1.0-Legal (in-batch negatives only) | 0.7800 | 0.6617 |
| EVE-Embed-1.1-Legal (+ verified hard negatives) | 0.7872 | 0.6700 |
| difference | +0.0072 | +0.0083 |
| 95% bootstrap CI (paired, 10,000 resamples) | [+0.0046, +0.0099] | [+0.0028, +0.0138] |
| p | <0.0001 | 0.0024 |
The gain is real but small, and it is reported that way on purpose: 5,063 of the 6,000 queries rank identically under both models, and the shift comes from 559 wins against 378 losses among the 937 that moved. Both models are scored on the same queries, so the comparison is paired β an unpaired reading would put the standard error near 0.0045 and call this inconclusive.
The revised conclusion: hard negatives are not harmful in this domain. Unverified hard negatives are. The cost of verification (one LLM call per query, ~5 queries/sec, 68 minutes for 20,000) is small next to a 36.5% regression.
Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("ysmeta/EVE-Embed-1.1-Legal")
query = "κ³μ½κΈμ μ΄λ―Έ λ°μλλ°λ μλλ°©μ΄ κ³μ½μ μ·¨μν μ μλμ?"
docs = [
"μμ κΆμ΄μ λ±κΈ°μ²κ΅¬μ¬κ±΄ λΉμ¬μμ μΌλ°©μ΄ κ³μ½μ΄νμ μ°©μν νμλ ν΄μ κΆ νμ¬λ₯Ό ν μ μμΌλ―λ‘ β¦",
"μλμ°¨κ³μ½μ 묡μμ κ°±μ μ΄ μΈμ λλ κ²½μ° β¦",
]
q = model.encode(query, normalize_embeddings=True)
d = model.encode(docs, normalize_embeddings=True)
print(q @ d.T)
No instruction prefix is required.
Training
- Base: dragonkue/BGE-m3-ko (Apache-2.0)
- Data: EVE-Train-Legal-1.1 β 134,996 (query, precedent) pairs generated from 45,000 precedents, plus 19,038 queries carrying LLM-verified hard negatives
- Loss: CachedMultipleNegativesRankingLoss
- Effective batch: 512 (256 Γ gradient accumulation 2)
- LR: 1e-5, 1 epoch, max_seq_len 384, bf16, 302 steps (~25 min)
- Checkpoint selection:
load_best_model_at_endon a held-out hard slice - Hardware: 1 Γ NVIDIA H200
The verified negatives are added to the pair set rather than replacing it. Training on the 19,038 verified queries alone would have confounded the negatives' effect with a 7Γ data cut, and the result would not have been attributable to either.
What did not work
Published for reuse, since most of these levers moved the score the wrong way:
| configuration | nDCG@10 | vs baseline |
|---|---|---|
| mined negatives (skip top-3), lr 2e-5, 65% formal queries | 0.4434 | β36.5% |
| mined negatives (skip top-10), lr 5e-6, synthetic only | 0.6457 | β7.5% |
| no mined negatives, batch 64 | 0.7535 | +7.9% |
| no mined negatives, batch 512 | 0.7643 | +9.5% |
| above + 4.3Γ more data (= 1.0) | 0.7800 | +11.7% |
| above + LLM-verified negatives (= 1.1) | 0.7872 | +12.8% |
Skipping the top 10 mined hits did not rescue them β only judging each candidate did.
A related trap worth repeating: the first run gained 5.7% on the formal-query set while losing 36.5% on the practitioner set. Evaluating only on the easy set would have reported that run as a success. Evaluation design decided the conclusion.
Limitations
- νλ‘ only. The corpus contains court precedents, not statute text (λ²λ Ή μ‘°λ¬Έ), so queries that should resolve to a specific article are not covered.
- Case distribution of the 59,786-document corpus: λ―Όμ¬ 46.3%, νμ¬ 21.9%, μΌλ°νμ 14.1%, μΈλ¬΄ 11.9%, νΉν 4.3%, κ°μ¬ 1.6%. νΉν/κ°μ¬ coverage is thin.
- Finance is covered as litigation, not as practice documents. 17.3% of the corpus (10,323 cases) names a financial institution or instrument β 보νκΈ, μ½μμ΄μκΈ, λμ¬κΈ, κ·Όμ λΉκΆμ€μ λ±κΈ°λ§μ, λ°°λΉμ΄μ and similar β concentrated in λ―Όμ¬, where 23.8% of cases qualify. That is case law about finance. Contract terms (μ½κ΄), product disclosures, filings and internal policy documents are a different register and are not represented; retrieval over those needs its own corpus.
- Training queries are LLM-generated, not collected from real users. They were written to imitate practitioner phrasing, but real query logs would differ.
- The negative verification is also LLM-generated and inherits the judge's biases. It errs toward marking borderline candidates relevant, which discards usable negatives rather than admitting false ones β the safe direction, but it means the verified set is smaller and more conservative than a human-labelled one would be.
- Not legal advice. Retrieval surfaces precedents; it does not interpret them.
License
Apache-2.0, inherited from the base model. The training corpus derives from
joonhok-exo-ai/korean_law_open_data_precedents (OpenRAIL); the dataset repos carry
that licence.
- Downloads last month
- -