malteos commited on
Commit
f7bd684
·
verified ·
1 Parent(s): 1062a43

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +174 -0
README.md ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - de
4
+ - en
5
+ library_name: sentence-transformers
6
+ pipeline_tag: sentence-similarity
7
+ tags:
8
+ - sentence-transformers
9
+ - feature-extraction
10
+ - retrieval
11
+ - german
12
+ - mteb
13
+ base_model: nvidia/Nemotron-3-Embed-1B-BF16
14
+ license: cc-by-nc-4.0
15
+ ---
16
+
17
+ # most-embed-de: A German Retrieval-Optimized Embedding Model
18
+
19
+ ![most-embed-de-hero-banner-medium](https://cdn-uploads.huggingface.co/production/uploads/5efda656ff69163f6f59e5d2/b6j5lk8-PlLQTehjo65Nn.png)
20
+
21
+ **most-embed-de** is a 1.1B-parameter German text-embedding model optimized for the **retrieval in German customer-support applications**. It acts as the
22
+ retriever behind a support RAG system, an FAQ/help-center search, or an agent that has to find the one
23
+ passage in a company's own documentation that resolves a customer's request.
24
+
25
+ It is a fine-tune of **[nvidia/Nemotron-3-Embed-1B-BF16](https://huggingface.co/nvidia/Nemotron-3-Embed-1B-BF16)**
26
+ (2048-dim embeddings, up to 32k context). Among models it can be deployed next to, it is:
27
+
28
+ - **#1 in its size class (≤1.5B) on the German retrieval + reranking cut of MTEB(deu)** — and it beats
29
+ the 7.6B `Qwen3-Embedding-8B` and the 14B `F2LLM-v2-14B` while being **~7–12× smaller**.
30
+ - **#1 in its size class on customer-support retrieval** (our SupportIR-DE benchmark), second only to the Nemotron-3-Embed
31
+ 7.6B model and again ahead of `Qwen3-Embedding-8B` — at a fraction of the serving cost.
32
+ - Target language: **German**
33
+ - Base model languages: English, Arabic, Assamese, Bengali, Bulgarian, Chinese, Danish, Dutch, Finnish, French, Hindi, Hinglish, Indonesian, Italian, Japanese, Korean, Malay, Marathi, Nepali, Norwegian, Persian, Portuguese, Romanian, Russian, Spanish, Swahili, Swedish, Tamil, Telugu, Thai, Ukrainian, Urdu, Vietnamese.
34
+
35
+ At 1.1B parameters it runs comfortably on a single commodity GPU, so you get 7–14B-class German support
36
+ retrieval quality at ~1B-class latency and cost.
37
+
38
+ ## Why this model exists
39
+
40
+ Public German retrieval benchmarks like the German slice of MTEB and RTEB are dominated by
41
+ **Wikipedia-style open-domain QA and legal question answering**. They are excellent academic tasks, but
42
+ they are **not** what many real world applications such a customer-support RAG systems need. A support retriever has to:
43
+
44
+ - work **within a single company's index** (a query about *your* return policy must not match a
45
+ *competitor's* return policy), and
46
+ - handle the real register of support queries — terse keyword searches, full questions, and statement-style
47
+ descriptions of a problem — across very different **industries** (telco, banking, insurance, e-commerce),
48
+ each with its own vocabulary and document conventions.
49
+
50
+ None of the public German benchmarks measure this. So we built one.
51
+
52
+
53
+ ## Evaluation
54
+
55
+ ### German Retrieval
56
+
57
+ ![german-retrieval](https://cdn-uploads.huggingface.co/production/uploads/5efda656ff69163f6f59e5d2/ERv5HapZ5fPOjm65nnclD.png)
58
+
59
+ German Retrieval is essentially the [**Retrieval + Reranking subset of MTEB(deu)**](https://mteb-leaderboard.hf.space/) — LegalQuAD,
60
+ GerDaLIR (small, for efficiency), GermanDPR, GermanQuAD, XMarket, and MIRACL(de) — scored with the
61
+ official MTEB methodology (mean of nDCG@10, MRR@5 for GermanQuAD). Baselines are the published leaderboard
62
+ numbers; most-embed-de is measured on the identical task suite.
63
+
64
+ ### SupportIR-DE — customer-support retrieval
65
+
66
+ ![supportir-de](https://cdn-uploads.huggingface.co/production/uploads/5efda656ff69163f6f59e5d2/yaGrfFK3HksVny9incG3p.png)
67
+
68
+ SupportIR-DE scores **company-scoped nDCG@10**: every query is ranked only against *its own company's*
69
+ documents — the index a real support RAG system actually searches — across four industries, **held out by
70
+ company in 5-fold cross-validation** (mean ± std over folds).
71
+
72
+ Because no public German benchmark reflects support retrieval, we designed **SupportIR-DE** as part of
73
+ this project:
74
+
75
+ - **Four industries** — telecommunications, retail banking & payments, insurance, and e-commerce /
76
+ omni-channel retail — each with real German help-center content from public Web pages and sourced from the [Common Crawl corpus](https://commoncrawl.org).
77
+ - **Company-scoped task** — every query is evaluated against only its own company's document index
78
+ (brand/company disambiguation is part of the task, exactly as in deployment). A pooled-industry variant
79
+ is reported as a diagnostic.
80
+ - **Multiple query registers** — natural questions, keyword searches, and statement-style problem
81
+ descriptions, so a model cannot look strong on one register alone.
82
+ - **Held out by company** (k-fold cross-validation over companies) with confidence intervals, plus a
83
+ human-authored FAQ gold slice for judge calibration.
84
+
85
+ SupportIR-DE is **not yet public**.
86
+
87
+
88
+ ## How it was built — autonomous, agent-driven development
89
+
90
+
91
+ ![agent-model-building-lifecycle-medium](https://cdn-uploads.huggingface.co/production/uploads/5efda656ff69163f6f59e5d2/KzvsH_78UOH9ZtAY9TV5e.png)
92
+
93
+ The distinguishing feature of this project is not a single training trick; it is the **development
94
+ process**. most-embed-de was produced by an **autonomous, agent-driven research pipeline** that carried the
95
+ work through the *entire* model-building lifecycle:
96
+
97
+ - **literature and landscape research** (what German retrieval benchmarks exist, where they fall short),
98
+ - **benchmark selection and design** (choosing the public evaluation cut; designing SupportIR-DE),
99
+ - **data curation** (sourcing and cleaning German support corpora; generating and quality-judging training
100
+ data; contamination and leakage guards),
101
+ - **experimental design** (choosing the base model, the training and retention mix, and the ablations),
102
+ - **scheduling and operating training + evaluation jobs on a GPU cluster**, and
103
+ - **evaluation and error analysis** (including catching a train/test leakage issue in a retention pool and
104
+ correcting the reported numbers).
105
+
106
+ The approach was inspired by [Andrej Karpathy's autoresearch project](https://github.com/karpathy/autoresearch). A human
107
+ directed the objectives and reviewed every decision gate; the agents did the research, engineering, and
108
+ analysis in between. The result is a stat
109
+
110
+ ## Usage
111
+
112
+ The model can be used with all frameworks and inference systems that support Nemotron-3-Embed:
113
+
114
+ ### Sentence Transformers
115
+
116
+ ```python
117
+ import torch
118
+ from sentence_transformers import SentenceTransformer
119
+
120
+ MODEL_ID = "malteos/most-embed-de"
121
+
122
+ model = SentenceTransformer(
123
+ MODEL_ID,
124
+ device="cuda",
125
+ model_kwargs={
126
+ "dtype": torch.bfloat16,
127
+ "attn_implementation": "flash_attention_2", # optional
128
+ },
129
+ )
130
+ model.max_seq_length = 32768
131
+
132
+ QUERIES = [
133
+ "Write a Python function that counts the frequency of each element in a list of lists.",
134
+ "Write a function that orders a dictionary with tuple keys by the product of each key's tuple values.",
135
+ "What symptoms and common triggers help distinguish eczema from other inflammatory skin conditions?",
136
+ "How can someone reduce exposure to pollen during allergy season?",
137
+ ]
138
+
139
+ DOCUMENTS = [
140
+ "def frequency_lists(list1):\n flattened = [item for sublist in list1 for item in sublist]\n counts = {}\n for item in flattened:\n if item in counts:\n counts[item] += 1\n else:\n counts[item] = 1\n return counts",
141
+ "def sort_dict_item(test_dict):\n return {key: test_dict[key] for key in sorted(test_dict.keys(), key=lambda ele: ele[0] * ele[1])}",
142
+ "Eczema commonly causes itchy, dry, inflamed patches of skin. The affected areas may look red, scaly, cracked, or darker than the surrounding skin depending on skin tone. Symptoms can flare after exposure to irritants, allergens, stress, or changes in weather.",
143
+ "People with pollen allergy can reduce exposure by staying indoors on dry, windy days, avoiding early-morning outdoor activity, and going outside after rain when pollen levels are lower. They should check pollen forecasts, close windows and doors when counts are high, and consider starting allergy medication before symptoms begin if high pollen is expected. After being outside, showering, changing clothes, avoiding outdoor laundry drying, and wearing a face mask for yard work can help limit pollen contact.",
144
+ ]
145
+ query_embeddings = model.encode_query(QUERIES, batch_size=8, convert_to_tensor=True)
146
+ document_embeddings = model.encode_document(DOCUMENTS, batch_size=8, convert_to_tensor=True)
147
+
148
+ scores = model.similarity(query_embeddings, document_embeddings)
149
+ print("Similarity scores:")
150
+ print(f"{'':>4}" + "".join(f"d[{i}]".rjust(10) for i in range(scores.shape[1])))
151
+ for query_index, row in enumerate(scores):
152
+ print(f"q[{query_index}]" + "".join(f"{score.item():>10.4f}" for score in row))
153
+ ```
154
+
155
+ ### vLLM Online Serving
156
+
157
+ ```bash
158
+ MODEL_ID=malteos/most-embed-de
159
+
160
+ vllm serve "$MODEL_ID"
161
+ ```
162
+
163
+ vLLM defaults to port 8000. Add host and port when you need an explicit bind address or a non-default port:
164
+
165
+ ```bash
166
+ vllm serve "$MODEL_ID" --host 0.0.0.0 --port 8000
167
+ ```
168
+
169
+ For other frameworks, see the [usage section in the Nemotron model card](https://huggingface.co/nvidia/Nemotron-3-Embed-1B-BF16#usage).
170
+
171
+
172
+ ## License
173
+
174
+ **CC-BY-NC-4.0** — free for research and non-commercial use with attribution. [Reach out for commercial use or extended support](https://ostendorff.org/contact/).