Maximgolubov commited on
Commit
d585ccc
·
verified ·
1 Parent(s): eca9024

Add new SentenceTransformer model

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,706 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:160
9
+ - loss:MatryoshkaLoss
10
+ - loss:MultipleNegativesRankingLoss
11
+ base_model: Snowflake/snowflake-arctic-embed-l
12
+ widget:
13
+ - source_sentence: What is the total cost to process 68,000 images based on the provided
14
+ token calculations?
15
+ sentences:
16
+ - 'One way to think about these models is an extension of the chain-of-thought prompting
17
+ trick, first explored in the May 2022 paper Large Language Models are Zero-Shot
18
+ Reasoners.
19
+
20
+ This is that trick where, if you get a model to talk out loud about a problem
21
+ it’s solving, you often get a result which the model would not have achieved otherwise.
22
+
23
+ o1 takes this process and further bakes it into the model itself. The details
24
+ are somewhat obfuscated: o1 models spend “reasoning tokens” thinking through the
25
+ problem that are not directly visible to the user (though the ChatGPT UI shows
26
+ a summary of them), then outputs a final result.'
27
+ - 'Each photo would need 260 input tokens and around 100 output tokens.
28
+
29
+ 260 * 68,000 = 17,680,000 input tokens
30
+
31
+ 17,680,000 * $0.0375/million = $0.66
32
+
33
+ 100 * 68,000 = 6,800,000 output tokens
34
+
35
+ 6,800,000 * $0.15/million = $1.02
36
+
37
+ That’s a total cost of $1.68 to process 68,000 images. That’s so absurdly cheap
38
+ I had to run the numbers three times to confirm I got it right.
39
+
40
+ How good are those descriptions? Here’s what I got from this command:
41
+
42
+ llm -m gemini-1.5-flash-8b-latest describe -a IMG_1825.jpeg'
43
+ - 'So far, I think they’re a net positive. I’ve used them on a personal level to
44
+ improve my productivity (and entertain myself) in all sorts of different ways.
45
+ I think people who learn how to use them effectively can gain a significant boost
46
+ to their quality of life.
47
+
48
+ A lot of people are yet to be sold on their value! Some think their negatives
49
+ outweigh their positives, some think they are all hot air, and some even think
50
+ they represent an existential threat to humanity.
51
+
52
+ They’re actually quite easy to build
53
+
54
+ The most surprising thing we’ve learned about LLMs this year is that they’re actually
55
+ quite easy to build.'
56
+ - source_sentence: What model of MacBook Pro does the author own, and what is its
57
+ storage capacity?
58
+ sentences:
59
+ - 'On the other hand, as software engineers we are better placed to take advantage
60
+ of this than anyone else. We’ve all been given weird coding interns—we can use
61
+ our deep knowledge to prompt them to solve coding problems more effectively than
62
+ anyone else can.
63
+
64
+ The ethics of this space remain diabolically complex
65
+
66
+ In September last year Andy Baio and I produced the first major story on the unlicensed
67
+ training data behind Stable Diffusion.
68
+
69
+ Since then, almost every major LLM (and most of the image generation models) have
70
+ also been trained on unlicensed data.'
71
+ - 'My personal laptop is a 64GB M2 MacBook Pro from 2023. It’s a powerful machine,
72
+ but it’s also nearly two years old now—and crucially it’s the same laptop I’ve
73
+ been using ever since I first ran an LLM on my computer back in March 2023 (see
74
+ Large language models are having their Stable Diffusion moment).
75
+
76
+ That same laptop that could just about run a GPT-3-class model in March last year
77
+ has now run multiple GPT-4 class models! Some of my notes on that:'
78
+ - 'I think people who complain that LLM improvement has slowed are often missing
79
+ the enormous advances in these multi-modal models. Being able to run prompts against
80
+ images (and audio and video) is a fascinating new way to apply these models.
81
+
82
+ Voice and live camera mode are science fiction come to life
83
+
84
+ The audio and live video modes that have started to emerge deserve a special mention.
85
+
86
+ The ability to talk to ChatGPT first arrived in September 2023, but it was mostly
87
+ an illusion: OpenAI used their excellent Whisper speech-to-text model and a new
88
+ text-to-speech model (creatively named tts-1) to enable conversations with the
89
+ ChatGPT mobile apps, but the actual model just saw text.'
90
+ - source_sentence: How do longer inputs enhance the problem-solving capabilities of
91
+ an LLM?
92
+ sentences:
93
+ - 'This remains astonishing to me. I thought a model with the capabilities and output
94
+ quality of GPT-4 needed a datacenter class server with one or more $40,000+ GPUs.
95
+
96
+ These models take up enough of my 64GB of RAM that I don’t run them often—they
97
+ don’t leave much room for anything else.
98
+
99
+ The fact that they run at all is a testament to the incredible training and inference
100
+ performance gains that we’ve figured out over the past year. It turns out there
101
+ was a lot of low-hanging fruit to be harvested in terms of model efficiency. I
102
+ expect there’s still more to come.'
103
+ - 'Now add a walrus: Prompt engineering in DALL-E 3
104
+
105
+ 32.8k
106
+
107
+ 41.2k
108
+
109
+
110
+
111
+ Web LLM runs the vicuna-7b Large Language Model entirely in your browser, and
112
+ it’s very impressive
113
+
114
+ 32.5k
115
+
116
+ 38.2k
117
+
118
+
119
+
120
+ ChatGPT can’t access the internet, even though it really looks like it can
121
+
122
+ 30.5k
123
+
124
+ 34.2k
125
+
126
+
127
+
128
+ Stanford Alpaca, and the acceleration of on-device large language model development
129
+
130
+ 29.7k
131
+
132
+ 35.7k
133
+
134
+
135
+
136
+ Run Llama 2 on your own Mac using LLM and Homebrew
137
+
138
+ 27.9k
139
+
140
+ 33.6k
141
+
142
+
143
+
144
+ Midjourney 5.1
145
+
146
+ 26.7k
147
+
148
+ 33.4k
149
+
150
+
151
+
152
+ Think of language models like ChatGPT as a “calculator for words”
153
+
154
+ 25k
155
+
156
+ 31.8k
157
+
158
+
159
+
160
+ Multi-modal prompt injection image attacks against GPT-4V
161
+
162
+ 23.7k
163
+
164
+ 27.4k'
165
+ - 'Longer inputs dramatically increase the scope of problems that can be solved
166
+ with an LLM: you can now throw in an entire book and ask questions about its contents,
167
+ but more importantly you can feed in a lot of example code to help the model correctly
168
+ solve a coding problem. LLM use-cases that involve long inputs are far more interesting
169
+ to me than short prompts that rely purely on the information already baked into
170
+ the model weights. Many of my tools were built using this pattern.'
171
+ - source_sentence: What is the cost of OpenAI's most expensive model, o1, in terms
172
+ of $/mTok?
173
+ sentences:
174
+ - 'Today $30/mTok gets you OpenAI’s most expensive model, o1. GPT-4o is $2.50 (12x
175
+ cheaper than GPT-4) and GPT-4o mini is $0.15/mTok—200x cheaper than GPT-4, nearly
176
+ 7x cheaper than GPT-3.5 and massively more capable than that model.
177
+
178
+ Other model providers charge even less. Anthropic’s Claude 3 Haiku (from March,
179
+ but still their cheapest model) is $0.25/mTok. Google’s Gemini 1.5 Flash is $0.075/mTok
180
+ and their Gemini 1.5 Flash 8B is $0.0375/mTok—that’s 27x cheaper than GPT-3.5
181
+ Turbo last year.
182
+
183
+ I’ve been tracking these pricing changes under my llm-pricing tag.'
184
+ - 'Gemini 1.5 Pro also illustrated one of the key themes of 2024: increased context
185
+ lengths. Last year most models accepted 4,096 or 8,192 tokens, with the notable
186
+ exception of Claude 2.1 which accepted 200,000. Today every serious provider has
187
+ a 100,000+ token model, and Google’s Gemini series accepts up to 2 million.'
188
+ - 'Nothing yet from Anthropic or Meta but I would be very surprised if they don’t
189
+ have their own inference-scaling models in the works. Meta published a relevant
190
+ paper Training Large Language Models to Reason in a Continuous Latent Space in
191
+ December.
192
+
193
+ Was the best currently available LLM trained in China for less than $6m?
194
+
195
+ Not quite, but almost! It does make for a great attention-grabbing headline.
196
+
197
+ The big news to end the year was the release of DeepSeek v3—dropped on Hugging
198
+ Face on Christmas Day without so much as a README file, then followed by documentation
199
+ and a paper the day after that.'
200
+ - source_sentence: What features does Google’s Gemini offer in relation to audio input
201
+ and output?
202
+ sentences:
203
+ - 'Your browser does not support the audio element.
204
+
205
+
206
+ OpenAI aren’t the only group with a multi-modal audio model. Google’s Gemini also
207
+ accepts audio input, and the Google Gemini apps can speak in a similar way to
208
+ ChatGPT now. Amazon also pre-announced voice mode for Amazon Nova, but that’s
209
+ meant to roll out in Q1 of 2025.
210
+
211
+ Google’s NotebookLM, released in September, took audio output to a new level by
212
+ producing spookily realistic conversations between two “podcast hosts” about anything
213
+ you fed into their tool. They later added custom instructions, so naturally I
214
+ turned them into pelicans:
215
+
216
+
217
+
218
+ Your browser does not support the audio element.'
219
+ - 'Against this photo of butterflies at the California Academy of Sciences:
220
+
221
+
222
+
223
+ A shallow dish, likely a hummingbird or butterfly feeder, is red. Pieces of orange
224
+ slices of fruit are visible inside the dish.
225
+
226
+ Two butterflies are positioned in the feeder, one is a dark brown/black butterfly
227
+ with white/cream-colored markings. The other is a large, brown butterfly with
228
+ patterns of lighter brown, beige, and black markings, including prominent eye
229
+ spots. The larger brown butterfly appears to be feeding on the fruit.'
230
+ - 'I also gave a bunch of talks and podcast appearances. I’ve started habitually
231
+ turning my talks into annotated presentations—here are my best from 2023:
232
+
233
+
234
+ Prompt injection explained, with video, slides, and a transcript
235
+
236
+ Catching up on the weird world of LLMs
237
+
238
+ Making Large Language Models work for you
239
+
240
+ Open questions for AI engineering
241
+
242
+ Embeddings: What they are and why they matter
243
+
244
+ Financial sustainability for open source projects at GitHub Universe
245
+
246
+
247
+ And in podcasts:
248
+
249
+
250
+
251
+ What AI can do for you on the Theory of Change
252
+
253
+
254
+ Working in public on Path to Citus Con
255
+
256
+
257
+ LLMs break the internet on the Changelog
258
+
259
+
260
+ Talking Large Language Models on Rooftop Ruby
261
+
262
+
263
+ Thoughts on the OpenAI board situation on Newsroom Robots'
264
+ pipeline_tag: sentence-similarity
265
+ library_name: sentence-transformers
266
+ metrics:
267
+ - cosine_accuracy@1
268
+ - cosine_accuracy@3
269
+ - cosine_accuracy@5
270
+ - cosine_accuracy@10
271
+ - cosine_precision@1
272
+ - cosine_precision@3
273
+ - cosine_precision@5
274
+ - cosine_precision@10
275
+ - cosine_recall@1
276
+ - cosine_recall@3
277
+ - cosine_recall@5
278
+ - cosine_recall@10
279
+ - cosine_ndcg@10
280
+ - cosine_mrr@10
281
+ - cosine_map@100
282
+ model-index:
283
+ - name: SentenceTransformer based on Snowflake/snowflake-arctic-embed-l
284
+ results:
285
+ - task:
286
+ type: information-retrieval
287
+ name: Information Retrieval
288
+ dataset:
289
+ name: Unknown
290
+ type: unknown
291
+ metrics:
292
+ - type: cosine_accuracy@1
293
+ value: 1.0
294
+ name: Cosine Accuracy@1
295
+ - type: cosine_accuracy@3
296
+ value: 1.0
297
+ name: Cosine Accuracy@3
298
+ - type: cosine_accuracy@5
299
+ value: 1.0
300
+ name: Cosine Accuracy@5
301
+ - type: cosine_accuracy@10
302
+ value: 1.0
303
+ name: Cosine Accuracy@10
304
+ - type: cosine_precision@1
305
+ value: 1.0
306
+ name: Cosine Precision@1
307
+ - type: cosine_precision@3
308
+ value: 0.33333333333333326
309
+ name: Cosine Precision@3
310
+ - type: cosine_precision@5
311
+ value: 0.20000000000000004
312
+ name: Cosine Precision@5
313
+ - type: cosine_precision@10
314
+ value: 0.10000000000000002
315
+ name: Cosine Precision@10
316
+ - type: cosine_recall@1
317
+ value: 1.0
318
+ name: Cosine Recall@1
319
+ - type: cosine_recall@3
320
+ value: 1.0
321
+ name: Cosine Recall@3
322
+ - type: cosine_recall@5
323
+ value: 1.0
324
+ name: Cosine Recall@5
325
+ - type: cosine_recall@10
326
+ value: 1.0
327
+ name: Cosine Recall@10
328
+ - type: cosine_ndcg@10
329
+ value: 1.0
330
+ name: Cosine Ndcg@10
331
+ - type: cosine_mrr@10
332
+ value: 1.0
333
+ name: Cosine Mrr@10
334
+ - type: cosine_map@100
335
+ value: 1.0
336
+ name: Cosine Map@100
337
+ ---
338
+
339
+ # SentenceTransformer based on Snowflake/snowflake-arctic-embed-l
340
+
341
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Snowflake/snowflake-arctic-embed-l](https://huggingface.co/Snowflake/snowflake-arctic-embed-l). It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
342
+
343
+ ## Model Details
344
+
345
+ ### Model Description
346
+ - **Model Type:** Sentence Transformer
347
+ - **Base model:** [Snowflake/snowflake-arctic-embed-l](https://huggingface.co/Snowflake/snowflake-arctic-embed-l) <!-- at revision d8fb21ca8d905d2832ee8b96c894d3298964346b -->
348
+ - **Maximum Sequence Length:** 512 tokens
349
+ - **Output Dimensionality:** 1024 dimensions
350
+ - **Similarity Function:** Cosine Similarity
351
+ <!-- - **Training Dataset:** Unknown -->
352
+ <!-- - **Language:** Unknown -->
353
+ <!-- - **License:** Unknown -->
354
+
355
+ ### Model Sources
356
+
357
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
358
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
359
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
360
+
361
+ ### Full Model Architecture
362
+
363
+ ```
364
+ SentenceTransformer(
365
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'BertModel'})
366
+ (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
367
+ (2): Normalize()
368
+ )
369
+ ```
370
+
371
+ ## Usage
372
+
373
+ ### Direct Usage (Sentence Transformers)
374
+
375
+ First install the Sentence Transformers library:
376
+
377
+ ```bash
378
+ pip install -U sentence-transformers
379
+ ```
380
+
381
+ Then you can load this model and run inference.
382
+ ```python
383
+ from sentence_transformers import SentenceTransformer
384
+
385
+ # Download from the 🤗 Hub
386
+ model = SentenceTransformer("Maximgolubov/legal-ft-2")
387
+ # Run inference
388
+ queries = [
389
+ "What features does Google\u2019s Gemini offer in relation to audio input and output?",
390
+ ]
391
+ documents = [
392
+ 'Your browser does not support the audio element.\n\nOpenAI aren’t the only group with a multi-modal audio model. Google’s Gemini also accepts audio input, and the Google Gemini apps can speak in a similar way to ChatGPT now. Amazon also pre-announced voice mode for Amazon Nova, but that’s meant to roll out in Q1 of 2025.\nGoogle’s NotebookLM, released in September, took audio output to a new level by producing spookily realistic conversations between two “podcast hosts” about anything you fed into their tool. They later added custom instructions, so naturally I turned them into pelicans:\n\n\nYour browser does not support the audio element.',
393
+ 'Against this photo of butterflies at the California Academy of Sciences:\n\n\nA shallow dish, likely a hummingbird or butterfly feeder, is red. Pieces of orange slices of fruit are visible inside the dish.\nTwo butterflies are positioned in the feeder, one is a dark brown/black butterfly with white/cream-colored markings. The other is a large, brown butterfly with patterns of lighter brown, beige, and black markings, including prominent eye spots. The larger brown butterfly appears to be feeding on the fruit.',
394
+ 'I also gave a bunch of talks and podcast appearances. I’ve started habitually turning my talks into annotated presentations—here are my best from 2023:\n\nPrompt injection explained, with video, slides, and a transcript\nCatching up on the weird world of LLMs\nMaking Large Language Models work for you\nOpen questions for AI engineering\nEmbeddings: What they are and why they matter\nFinancial sustainability for open source projects at GitHub Universe\n\nAnd in podcasts:\n\n\nWhat AI can do for you on the Theory of Change\n\nWorking in public on Path to Citus Con\n\nLLMs break the internet on the Changelog\n\nTalking Large Language Models on Rooftop Ruby\n\nThoughts on the OpenAI board situation on Newsroom Robots',
395
+ ]
396
+ query_embeddings = model.encode_query(queries)
397
+ document_embeddings = model.encode_document(documents)
398
+ print(query_embeddings.shape, document_embeddings.shape)
399
+ # [1, 1024] [3, 1024]
400
+
401
+ # Get the similarity scores for the embeddings
402
+ similarities = model.similarity(query_embeddings, document_embeddings)
403
+ print(similarities)
404
+ # tensor([[0.6603, 0.0568, 0.0967]])
405
+ ```
406
+
407
+ <!--
408
+ ### Direct Usage (Transformers)
409
+
410
+ <details><summary>Click to see the direct usage in Transformers</summary>
411
+
412
+ </details>
413
+ -->
414
+
415
+ <!--
416
+ ### Downstream Usage (Sentence Transformers)
417
+
418
+ You can finetune this model on your own dataset.
419
+
420
+ <details><summary>Click to expand</summary>
421
+
422
+ </details>
423
+ -->
424
+
425
+ <!--
426
+ ### Out-of-Scope Use
427
+
428
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
429
+ -->
430
+
431
+ ## Evaluation
432
+
433
+ ### Metrics
434
+
435
+ #### Information Retrieval
436
+
437
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
438
+
439
+ | Metric | Value |
440
+ |:--------------------|:--------|
441
+ | cosine_accuracy@1 | 1.0 |
442
+ | cosine_accuracy@3 | 1.0 |
443
+ | cosine_accuracy@5 | 1.0 |
444
+ | cosine_accuracy@10 | 1.0 |
445
+ | cosine_precision@1 | 1.0 |
446
+ | cosine_precision@3 | 0.3333 |
447
+ | cosine_precision@5 | 0.2 |
448
+ | cosine_precision@10 | 0.1 |
449
+ | cosine_recall@1 | 1.0 |
450
+ | cosine_recall@3 | 1.0 |
451
+ | cosine_recall@5 | 1.0 |
452
+ | cosine_recall@10 | 1.0 |
453
+ | **cosine_ndcg@10** | **1.0** |
454
+ | cosine_mrr@10 | 1.0 |
455
+ | cosine_map@100 | 1.0 |
456
+
457
+ <!--
458
+ ## Bias, Risks and Limitations
459
+
460
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
461
+ -->
462
+
463
+ <!--
464
+ ### Recommendations
465
+
466
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
467
+ -->
468
+
469
+ ## Training Details
470
+
471
+ ### Training Dataset
472
+
473
+ #### Unnamed Dataset
474
+
475
+ * Size: 160 training samples
476
+ * Columns: <code>sentence_0</code> and <code>sentence_1</code>
477
+ * Approximate statistics based on the first 160 samples:
478
+ | | sentence_0 | sentence_1 |
479
+ |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
480
+ | type | string | string |
481
+ | details | <ul><li>min: 11 tokens</li><li>mean: 20.01 tokens</li><li>max: 36 tokens</li></ul> | <ul><li>min: 38 tokens</li><li>mean: 133.65 tokens</li><li>max: 214 tokens</li></ul> |
482
+ * Samples:
483
+ | sentence_0 | sentence_1 |
484
+ |:------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
485
+ | <code>What years are listed in the provided context?</code> | <code>Disclosures<br>Colophon<br>©<br>2002<br>2003<br>2004<br>2005<br>2006<br>2007<br>2008<br>2009<br>2010<br>2011<br>2012<br>2013<br>2014<br>2015<br>2016<br>2017<br>2018<br>2019<br>2020<br>2021<br>2022<br>2023<br>2024<br>2025<br>2026</code> |
486
+ | <code>What is the range of years mentioned in the context?</code> | <code>Disclosures<br>Colophon<br>©<br>2002<br>2003<br>2004<br>2005<br>2006<br>2007<br>2008<br>2009<br>2010<br>2011<br>2012<br>2013<br>2014<br>2015<br>2016<br>2017<br>2018<br>2019<br>2020<br>2021<br>2022<br>2023<br>2024<br>2025<br>2026</code> |
487
+ | <code>What model do I run on my iPhone?</code> | <code>I run a bunch of them on my laptop. I run Mistral 7B (a surprisingly great model) on my iPhone. You can install several different apps to get your own, local, completely private LLM. My own LLM project provides a CLI tool for running an array of different models via plugins.<br>You can even run them entirely in your browser using WebAssembly and the latest Chrome!<br>Hobbyists can build their own fine-tuned models<br>I said earlier that building an LLM was still out of reach of hobbyists. That may be true for training from scratch, but fine-tuning one of those models is another matter entirely.</code> |
488
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
489
+ ```json
490
+ {
491
+ "loss": "MultipleNegativesRankingLoss",
492
+ "matryoshka_dims": [
493
+ 768,
494
+ 512,
495
+ 256,
496
+ 128,
497
+ 64
498
+ ],
499
+ "matryoshka_weights": [
500
+ 1,
501
+ 1,
502
+ 1,
503
+ 1,
504
+ 1
505
+ ],
506
+ "n_dims_per_step": -1
507
+ }
508
+ ```
509
+
510
+ ### Training Hyperparameters
511
+ #### Non-Default Hyperparameters
512
+
513
+ - `eval_strategy`: steps
514
+ - `per_device_train_batch_size`: 10
515
+ - `per_device_eval_batch_size`: 10
516
+ - `num_train_epochs`: 10
517
+ - `multi_dataset_batch_sampler`: round_robin
518
+
519
+ #### All Hyperparameters
520
+ <details><summary>Click to expand</summary>
521
+
522
+ - `do_predict`: False
523
+ - `eval_strategy`: steps
524
+ - `prediction_loss_only`: True
525
+ - `per_device_train_batch_size`: 10
526
+ - `per_device_eval_batch_size`: 10
527
+ - `gradient_accumulation_steps`: 1
528
+ - `eval_accumulation_steps`: None
529
+ - `torch_empty_cache_steps`: None
530
+ - `learning_rate`: 5e-05
531
+ - `weight_decay`: 0.0
532
+ - `adam_beta1`: 0.9
533
+ - `adam_beta2`: 0.999
534
+ - `adam_epsilon`: 1e-08
535
+ - `max_grad_norm`: 1
536
+ - `num_train_epochs`: 10
537
+ - `max_steps`: -1
538
+ - `lr_scheduler_type`: linear
539
+ - `lr_scheduler_kwargs`: None
540
+ - `warmup_ratio`: None
541
+ - `warmup_steps`: 0
542
+ - `log_level`: passive
543
+ - `log_level_replica`: warning
544
+ - `log_on_each_node`: True
545
+ - `logging_nan_inf_filter`: True
546
+ - `enable_jit_checkpoint`: False
547
+ - `save_on_each_node`: False
548
+ - `save_only_model`: False
549
+ - `restore_callback_states_from_checkpoint`: False
550
+ - `use_cpu`: False
551
+ - `seed`: 42
552
+ - `data_seed`: None
553
+ - `bf16`: False
554
+ - `fp16`: False
555
+ - `bf16_full_eval`: False
556
+ - `fp16_full_eval`: False
557
+ - `tf32`: None
558
+ - `local_rank`: -1
559
+ - `ddp_backend`: None
560
+ - `debug`: []
561
+ - `dataloader_drop_last`: False
562
+ - `dataloader_num_workers`: 0
563
+ - `dataloader_prefetch_factor`: None
564
+ - `disable_tqdm`: False
565
+ - `remove_unused_columns`: True
566
+ - `label_names`: None
567
+ - `load_best_model_at_end`: False
568
+ - `ignore_data_skip`: False
569
+ - `fsdp`: []
570
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
571
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
572
+ - `parallelism_config`: None
573
+ - `deepspeed`: None
574
+ - `label_smoothing_factor`: 0.0
575
+ - `optim`: adamw_torch_fused
576
+ - `optim_args`: None
577
+ - `group_by_length`: False
578
+ - `length_column_name`: length
579
+ - `project`: huggingface
580
+ - `trackio_space_id`: trackio
581
+ - `ddp_find_unused_parameters`: None
582
+ - `ddp_bucket_cap_mb`: None
583
+ - `ddp_broadcast_buffers`: False
584
+ - `dataloader_pin_memory`: True
585
+ - `dataloader_persistent_workers`: False
586
+ - `skip_memory_metrics`: True
587
+ - `push_to_hub`: False
588
+ - `resume_from_checkpoint`: None
589
+ - `hub_model_id`: None
590
+ - `hub_strategy`: every_save
591
+ - `hub_private_repo`: None
592
+ - `hub_always_push`: False
593
+ - `hub_revision`: None
594
+ - `gradient_checkpointing`: False
595
+ - `gradient_checkpointing_kwargs`: None
596
+ - `include_for_metrics`: []
597
+ - `eval_do_concat_batches`: True
598
+ - `auto_find_batch_size`: False
599
+ - `full_determinism`: False
600
+ - `ddp_timeout`: 1800
601
+ - `torch_compile`: False
602
+ - `torch_compile_backend`: None
603
+ - `torch_compile_mode`: None
604
+ - `include_num_input_tokens_seen`: no
605
+ - `neftune_noise_alpha`: None
606
+ - `optim_target_modules`: None
607
+ - `batch_eval_metrics`: False
608
+ - `eval_on_start`: False
609
+ - `use_liger_kernel`: False
610
+ - `liger_kernel_config`: None
611
+ - `eval_use_gather_object`: False
612
+ - `average_tokens_across_devices`: True
613
+ - `use_cache`: False
614
+ - `prompts`: None
615
+ - `batch_sampler`: batch_sampler
616
+ - `multi_dataset_batch_sampler`: round_robin
617
+ - `router_mapping`: {}
618
+ - `learning_rate_mapping`: {}
619
+
620
+ </details>
621
+
622
+ ### Training Logs
623
+ | Epoch | Step | cosine_ndcg@10 |
624
+ |:-----:|:----:|:--------------:|
625
+ | 1.0 | 16 | 0.975 |
626
+ | 2.0 | 32 | 0.975 |
627
+ | 3.0 | 48 | 0.9815 |
628
+ | 3.125 | 50 | 0.9815 |
629
+ | 4.0 | 64 | 1.0 |
630
+ | 5.0 | 80 | 1.0 |
631
+ | 6.0 | 96 | 1.0 |
632
+ | 6.25 | 100 | 1.0 |
633
+ | 7.0 | 112 | 1.0 |
634
+ | 8.0 | 128 | 1.0 |
635
+ | 9.0 | 144 | 1.0 |
636
+ | 9.375 | 150 | 1.0 |
637
+ | 10.0 | 160 | 1.0 |
638
+
639
+
640
+ ### Framework Versions
641
+ - Python: 3.12.12
642
+ - Sentence Transformers: 5.2.2
643
+ - Transformers: 5.1.0
644
+ - PyTorch: 2.9.0+cu128
645
+ - Accelerate: 1.12.0
646
+ - Datasets: 4.5.0
647
+ - Tokenizers: 0.22.2
648
+
649
+ ## Citation
650
+
651
+ ### BibTeX
652
+
653
+ #### Sentence Transformers
654
+ ```bibtex
655
+ @inproceedings{reimers-2019-sentence-bert,
656
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
657
+ author = "Reimers, Nils and Gurevych, Iryna",
658
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
659
+ month = "11",
660
+ year = "2019",
661
+ publisher = "Association for Computational Linguistics",
662
+ url = "https://arxiv.org/abs/1908.10084",
663
+ }
664
+ ```
665
+
666
+ #### MatryoshkaLoss
667
+ ```bibtex
668
+ @misc{kusupati2024matryoshka,
669
+ title={Matryoshka Representation Learning},
670
+ author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
671
+ year={2024},
672
+ eprint={2205.13147},
673
+ archivePrefix={arXiv},
674
+ primaryClass={cs.LG}
675
+ }
676
+ ```
677
+
678
+ #### MultipleNegativesRankingLoss
679
+ ```bibtex
680
+ @misc{henderson2017efficient,
681
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
682
+ author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
683
+ year={2017},
684
+ eprint={1705.00652},
685
+ archivePrefix={arXiv},
686
+ primaryClass={cs.CL}
687
+ }
688
+ ```
689
+
690
+ <!--
691
+ ## Glossary
692
+
693
+ *Clearly define terms in order to be accessible across audiences.*
694
+ -->
695
+
696
+ <!--
697
+ ## Model Card Authors
698
+
699
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
700
+ -->
701
+
702
+ <!--
703
+ ## Model Card Contact
704
+
705
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
706
+ -->
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": null,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": null,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 1024,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 4096,
16
+ "is_decoder": false,
17
+ "layer_norm_eps": 1e-12,
18
+ "max_position_embeddings": 512,
19
+ "model_type": "bert",
20
+ "num_attention_heads": 16,
21
+ "num_hidden_layers": 24,
22
+ "pad_token_id": 0,
23
+ "position_embedding_type": "absolute",
24
+ "tie_word_embeddings": true,
25
+ "transformers_version": "5.1.0",
26
+ "type_vocab_size": 2,
27
+ "use_cache": true,
28
+ "vocab_size": 30522
29
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.2.2",
4
+ "transformers": "5.1.0",
5
+ "pytorch": "2.9.0+cu128"
6
+ },
7
+ "prompts": {
8
+ "query": "Represent this sentence for searching relevant passages: ",
9
+ "document": ""
10
+ },
11
+ "default_prompt_name": null,
12
+ "model_type": "SentenceTransformer",
13
+ "similarity_fn_name": "cosine"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a60694cbfe998eb77858133d34f7e42566ea36f9f661e58644ad60d835dd8625
3
+ size 1336413792
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "clean_up_tokenization_spaces": true,
4
+ "cls_token": "[CLS]",
5
+ "do_lower_case": true,
6
+ "is_local": false,
7
+ "mask_token": "[MASK]",
8
+ "max_length": 512,
9
+ "model_max_length": 512,
10
+ "pad_to_multiple_of": null,
11
+ "pad_token": "[PAD]",
12
+ "pad_token_type_id": 0,
13
+ "padding_side": "right",
14
+ "sep_token": "[SEP]",
15
+ "stride": 0,
16
+ "strip_accents": null,
17
+ "tokenize_chinese_chars": true,
18
+ "tokenizer_class": "BertTokenizer",
19
+ "truncation_side": "right",
20
+ "truncation_strategy": "longest_first",
21
+ "unk_token": "[UNK]"
22
+ }