/ Модель

Характеристики

Контекст
32 768 токенов
Параметры
508 млн
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3-Embedding-0.6B
Библиотека
sentence-transformers
Опубликована
26 окт 2026

qwen3-embedding-0.6b-nl-legal

ЭмбеддингиТекст → embedding3 профессии
82скачиваний за 30 дней1лайквеса обновлены17 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Модель создаёт эмбеддинги для поиска релевантных статей нидерландского законодательства и судебных решений по вопросу на естественном языке.

SWIS-Leiden разработала плотную модель текстовых эмбеддингов на базе Qwen/Qwen3-Embedding-0.6B для семантического поиска по нидерландскому законодательству и судебным решениям. Модель содержит около 507,6 млн параметров, принимает текст и формирует 1024-мерные векторы; контекст — до 32 768 токенов. Она основана на Qwen3 и дообучена на примерно 280 000 парах «юридический вопрос — фрагмент документа» с использованием LoRA-адаптера, объединённого с базовой моделью.

Модель предназначена для поиска релевантных статей и судебных актов по вопросу, сформулированному обычными словами, включая юридические формулировки и поисковые запросы. В README описан поиск по источникам нидерландского и права ЕС, но обучение и оценка проводились только на нидерландских законах и судебных решениях. Для запросов следует использовать инструкцию базовой модели, сохранённую в prompt `query`; документам инструкция не нужна.

Это поисковый инструмент для обнаружения материалов, которые затем следует прочитать в официальном источнике, а не система юридических консультаций. Вопросы для обучения были сгенерированы, а не взяты у реальных пользователей; на других нидерландских текстах качество не измерялось. Выигрыш для судебных решений невелик, а текстовая модель не определяет, какое из нескольких решений по одному вопросу является ведущим. Лицензия — Apache-2.0.

Сценарии применения

  • Поиск статьи нидерландского закона по описанию ситуации обычными словами
  • Поиск судебных решений по юридическому вопросу на нидерландском языке
  • Семантический поиск по корпусу законодательства Нидерландов и ЕС
  • Поиск нормы по юридическим терминам и кратким поисковым словам

Ограничения

Обучение и оценка охватывают только нидерландское законодательство и судебные решения; качество на других нидерландских текстах не измерялось. Вопросы обучения были сгенерированы, прирост для поиска судебных решений невелик, а результаты поиска не являются юридической консультацией и не выделяют ведущие решения.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Эмбеддинги» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qwen3-Embedding-0.6B, fine-tuned for Dutch law

An embedding model for finding Dutch legislation and case law from a question in plain words. It is Qwen/Qwen3-Embedding-0.6B with a LoRA adapter merged in, trained on about 280,000 Dutch legal question-passage pairs. Same size, same 1,024 dimensions and same query instruction as the base model.

It was made for the topic search in LexAgent, which gives AI assistants access to the official Dutch and EU legal sources. The unmerged adapter is SWIS-Leiden/qwen3-embedding-0.6b-nl-legal-lora; both give the same vectors (cosine 0.9996 between them).

Why

The base model reads Dutch well but not legal Dutch. Asked about ontslag op staande voet (summary dismissal), it ranked a tax-collection rule about the beslagvrije voet above article 7:677 of the Civil Code, because both contain the word voet. After training:

cos(query, BW 7:677)cos(query, beslagvrije voet)
Base model0.2510.512
This model0.4410.073

Article 7:677 is an answer in the held-out exam, so the model never trained on it.

Usage

Queries take the base model's instruction (stored as the query prompt); documents take none.

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("SWIS-Leiden/qwen3-embedding-0.6b-nl-legal")

queries = ["Mag mijn werkgever mij op staande voet ontslaan?"]
documents = [
    "Elk der partijen is bevoegd de arbeidsovereenkomst onverwijld op te zeggen om een dringende "
    "reden, onder onverwijlde mededeling van die reden aan de wederpartij.",
    "De beslagvrije voet is het deel van het inkomen waarop geen beslag mag worden gelegd.",
]

query_embeddings = model.encode(queries, prompt_name="query")
document_embeddings = model.encode(documents)
print(model.similarity(query_embeddings, document_embeddings))

With vLLM or another OpenAI-compatible server, put the instruction in front of the query yourself:

Instruct: Given a web search query, retrieve relevant passages that answer the query
Query:{query}

The training used exactly this text, so other instructions will work less well.

How it was trained

Practice questions from our own index

LexAgent keeps its own search index of Dutch law: 391,000 article passages of regulations in force (wetten.overheid.nl) and 902,000 rulings (Rechtspraak open data), each with the exact text that gets embedded. All training pairs were built from that text, without new requests to the sources.

SetPairsHow
Questions per article141,361Qwen3.6-35B-A3B wrote questions for 39,256 article passages, in four styles
Questions per ruling121,617The same model wrote questions for 44,904 rulings, in three styles
Judges' citations32,395A ruling's summary with the citation cut out, paired with the article it cites

The four styles for an article, here for article 12 of the WAM (car insurance ends when the duty to insure passes to someone else):

StyleQuestion
CitizenIk heb mijn auto verkocht, loopt mijn autoverzekering dan gewoon door of stopt die?
LawyerEindigt de motorrijtuigenverzekering van rechtswege bij overgang van de verzekeringsplicht op een ander?
Search wordsautoverzekering einde verkoop auto
SituationMijn vader is overleden en ik erf zijn auto; stopt zijn verzekering nu?

A ruling got the legal question it decides in a lawyer's words, the facts as a citizen would tell them, and a few search words. The prompt forbids naming the law, the article number, the ECLI, the court or the parties, and a question that still names one was dropped afterwards: someone who knows the number does not need this search, and the model would only learn to match numbers. Passages without a real rule (citation titles, commencement articles, repealed articles, pure amendments) were skipped before the model saw them. Half of the laws were used, a quarter of the general administrative orders (AMvB's) and smaller shares of the rest, because people mostly ask about laws. Writing the questions took about 86,000 requests and 85 million tokens (temperature 0.7, thinking off), in one night on SWIS's own GPUs.

The citation pairs need no language model. About one in seven rulings cites an article in its summary ("Beroep op artikel 6:248 lid 2 BW verworpen"). The query is the summary's opening sentences with the citation and its lead-in words cut out, the positive is the cited article. A first version was dominated by a few articles (article 8 ECHR alone had 3,330 pairs), so it is capped at 25 pairs per article. Rulings from the Caribbean part of the Kingdom were left out.

Hard negatives

Every question also carries up to three hard negatives: texts that look right but are not. They come from the base model's own mistakes. Each question was searched with the base model (hybrid keyword and vector search, top 30), and the hits ranked near or above the right answer became candidates.

A near miss that is actually also right does damage when the model is taught it is wrong, and Dutch law repeats rules often enough for that to happen (the same rule for each group of office holders, ten rulings on one legal question). So:

  • other parts of the same article, and articles within two numbers of it in the same regulation, are never negatives;
  • a cross-encoder reranker (Qwen3-Reranker-0.6B) scores every candidate against the question, and a candidate scoring 95% of the right answer or more is dropped.

A real example, for a summary about statutory commercial interest after a lease was dissolved:

CandidateReranker score
BW 6:119a, statutory commercial interest0.98the cited article
BW 7:129d, from the title on loans0.87kept as a negative
Book 6 of the BW BES0.52kept as a negative
A policy rule on statutory interest in payment plans0.40kept as a negative

The check was often needed: for 40% of the pairs no hard negative was left, for rulings more than half. Those pairs still train, with random other passages as negatives. They teach less, but nothing false.

Held out

  • Every answer in the exam (below) was left out of training, as a positive and as a negative.
  • 5% of the passages, with all their questions, form a dev set the training run measures itself on. The split goes by passage, so no question about a dev passage reaches training.

That leaves 279,621 training pairs.

The training run

The model sees a question with its right passage and has to score that passage above every other passage in the batch: the three hard negatives and the right passages of the other 127 questions. CachedMultipleNegativesRankingLoss computes this over a batch of 128 while holding only 24 in memory at a time, so a large batch fits on one GPU. The batch sampler keeps duplicate questions and passages out of one batch, so a passage is never a negative for its own question.

MethodLoRA, rank 32, alpha 64, dropout 0.05, on q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj (about 20M of the 600M parameters), merged afterwards
LossCachedMultipleNegativesRankingLoss, scale 20, in-batch negatives plus 3 hard negatives per question
Batch128 (mini-batches of 24), no duplicates within a batch
Schedule1 epoch over 279,621 pairs, learning rate 1e-4 with 5% warmup, bf16, max 512 tokens, seed 42
Query inputThe base model's instruction, exactly as the production embedding service sends it
Hardwareone NVIDIA L40S, shared with production models, 14.8 hours
Softwaresentence-transformers 4.1.0, transformers 4.52.4, peft 0.15.2, PyTorch 2.6

LoRA freezes the base model and learns a small correction next to each weight matrix. That keeps what the base model already does well (plain Dutch, plain-language matches) and leaves a 40 MB adapter that can run next to the unchanged base model.

More data, smaller gains

A separate run on the first 50,000 pairs reached most of the gain:

Training pairsRecall@10MRR@10
none (base model)0.6410.453
50,0000.8550.686
279,6210.9000.748

After the first 50,000 pairs it is mostly the order within the top 10 that improves.

Not tested: a run without the hard negatives, and a run without the citation pairs whose cited article the reranker found barely related to the summary (a third of them). Whether either matters is still open.

The dataset itself is not published.

Evaluation

Dev set (5,000 synthetic pairs against their passages plus 20,000 distractors):

Recall@10MRR@10nDCG@10
Base model0.6410.4530.498
This model0.9000.7480.785

The dev questions come from the same writer as the training questions, which flatters these numbers.

Exam (74 hand-checked questions, searched against the full index of 391,000 legislation passages and 902,000 rulings, hybrid keyword and vector search in Weaviate, each model at its best weighting):

Legislation (47): top 1top 10MRRRulings (27): top 10MRR
Base model7220.27570.161
This model20400.57680.211

The exam is kept private so it cannot leak into training data. Three article questions got worse, among them the general deadline for an objection (article 6:7 Awb), which now ranks below the many laws that set their own deadline in the same words.

Intended use and limits

  • A finding aid: results say which article or ruling to read. Quote the official text, not the embedded copy, and do not treat a search result as legal advice.
  • Trained and tested on Dutch legislation and Dutch case law only. Other Dutch text was not measured.
  • The training questions are generated, not real user questions.
  • For case law the gain is small. Many rulings answer the same legal question, and text alone does not show which one is the leading case.
  • Rulings from the Caribbean part of the Kingdom were left out of the citation pairs.

License

Apache 2.0, like the base model and Qwen3.6, which wrote the training questions. Made by SWIS for LexAgent.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · sentence-transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen3Model
Ревизия весов
c51e1e0

0 моделей