bsmith3715 commited on
Commit
2019a19
·
verified ·
1 Parent(s): 67e6892

Add new SentenceTransformer model

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
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,656 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - generated_from_trainer
7
+ - dataset_size:156
8
+ - loss:MatryoshkaLoss
9
+ - loss:MultipleNegativesRankingLoss
10
+ base_model: Snowflake/snowflake-arctic-embed-m
11
+ widget:
12
+ - source_sentence: How did the construction of railways impact the environment during
13
+ the 1800s?
14
+ sentences:
15
+ - 'The boring yet crucial secret behind good system prompts is test-driven development.
16
+ You don’t write down a system prompt and find ways to test it. You write down
17
+ tests and find a system prompt that passes them.
18
+
19
+
20
+ It’s become abundantly clear over the course of 2024 that writing good automated
21
+ evals for LLM-powered systems is the skill that’s most needed to build useful
22
+ applications on top of these models. If you have a strong eval suite you can adopt
23
+ new models faster, iterate better and build more reliable and useful product features
24
+ than your competition.
25
+
26
+ Vercel’s Malte Ubl:'
27
+ - 'An interesting point of comparison here could be the way railways rolled out
28
+ around the world in the 1800s. Constructing these required enormous investments
29
+ and had a massive environmental impact, and many of the lines that were built
30
+ turned out to be unnecessary—sometimes multiple lines from different companies
31
+ serving the exact same routes!
32
+
33
+ The resulting bubbles contributed to several financial crashes, see Wikipedia
34
+ for Panic of 1873, Panic of 1893, Panic of 1901 and the UK’s Railway Mania. They
35
+ left us with a lot of useful infrastructure and a great deal of bankruptcies and
36
+ environmental damage.
37
+
38
+ The year of slop'
39
+ - 'OpenAI made GPT-4o free for all users in May, and Claude 3.5 Sonnet was freely
40
+ available from its launch in June. This was a momentus change, because for the
41
+ previous year free users had mostly been restricted to GPT-3.5 level models, meaning
42
+ new users got a very inaccurate mental model of what a capable LLM could actually
43
+ do.
44
+
45
+ That era appears to have ended, likely permanently, with OpenAI’s launch of ChatGPT
46
+ Pro. This $200/month subscription service is the only way to access their most
47
+ capable model, o1 Pro.
48
+
49
+ Since the trick behind the o1 series (and the future models it will undoubtedly
50
+ inspire) is to expend more compute time to get better results, I don’t think those
51
+ days of free access to the best available models are likely to return.'
52
+ - source_sentence: What significant multi-modal models were released by major vendors
53
+ in 2024?
54
+ sentences:
55
+ - 'DeepSeek v3 is a huge 685B parameter model—one of the largest openly licensed
56
+ models currently available, significantly bigger than the largest of Meta’s Llama
57
+ series, Llama 3.1 405B.
58
+
59
+ Benchmarks put it up there with Claude 3.5 Sonnet. Vibe benchmarks (aka the Chatbot
60
+ Arena) currently rank it 7th, just behind the Gemini 2.0 and OpenAI 4o/o1 models.
61
+ This is by far the highest ranking openly licensed model.
62
+
63
+ The really impressive thing about DeepSeek v3 is the training cost. The model
64
+ was trained on 2,788,000 H800 GPU hours at an estimated cost of $5,576,000. Llama
65
+ 3.1 405B trained 30,840,000 GPU hours—11x that used by DeepSeek v3, for a model
66
+ that benchmarks slightly worse.'
67
+ - 'In 2024, almost every significant model vendor released multi-modal models. We
68
+ saw the Claude 3 series from Anthropic in March, Gemini 1.5 Pro in April (images,
69
+ audio and video), then September brought Qwen2-VL and Mistral’s Pixtral 12B and
70
+ Meta’s Llama 3.2 11B and 90B vision models. We got audio input and output from
71
+ OpenAI in October, then November saw SmolVLM from Hugging Face and December saw
72
+ image and video models from Amazon Nova.
73
+
74
+ In October I upgraded my LLM CLI tool to support multi-modal models via attachments.
75
+ It now has plugins for a whole collection of different vision models.'
76
+ - 'The environmental impact got much, much worse
77
+
78
+ The much bigger problem here is the enormous competitive buildout of the infrastructure
79
+ that is imagined to be necessary for these models in the future.
80
+
81
+ Companies like Google, Meta, Microsoft and Amazon are all spending billions of
82
+ dollars rolling out new datacenters, with a very material impact on the electricity
83
+ grid and the environment. There’s even talk of spinning up new nuclear power stations,
84
+ but those can take decades.
85
+
86
+ Is this infrastructure necessary? DeepSeek v3’s $6m training cost and the continued
87
+ crash in LLM prices might hint that it’s not. But would you want to be the big
88
+ tech executive that argued NOT to build out this infrastructure only to be proven
89
+ wrong in a few years’ time?'
90
+ - source_sentence: Why does the author believe that gullibility may hinder the development
91
+ of AI agents?
92
+ sentences:
93
+ - 'An interesting point of comparison here could be the way railways rolled out
94
+ around the world in the 1800s. Constructing these required enormous investments
95
+ and had a massive environmental impact, and many of the lines that were built
96
+ turned out to be unnecessary—sometimes multiple lines from different companies
97
+ serving the exact same routes!
98
+
99
+ The resulting bubbles contributed to several financial crashes, see Wikipedia
100
+ for Panic of 1873, Panic of 1893, Panic of 1901 and the UK’s Railway Mania. They
101
+ left us with a lot of useful infrastructure and a great deal of bankruptcies and
102
+ environmental damage.
103
+
104
+ The year of slop'
105
+ - 'A lot of people are excited about AI agents—an infuriatingly vague term that
106
+ seems to be converging on “AI systems that can go away and act on your behalf”.
107
+ We’ve been talking about them all year, but I’ve seen few if any examples of them
108
+ running in production, despite lots of exciting prototypes.
109
+
110
+ I think this is because of gullibility.
111
+
112
+ Can we solve this? Honestly, I’m beginning to suspect that you can’t fully solve
113
+ gullibility without achieving AGI. So it may be quite a while before those agent
114
+ dreams can really start to come true!
115
+
116
+ Code may be the best application
117
+
118
+ Over the course of the year, it’s become increasingly clear that writing code
119
+ is one of the things LLMs are most capable of.'
120
+ - 'Terminology aside, I remain skeptical as to their utility based, once again,
121
+ on the challenge of gullibility. LLMs believe anything you tell them. Any systems
122
+ that attempts to make meaningful decisions on your behalf will run into the same
123
+ roadblock: how good is a travel agent, or a digital assistant, or even a research
124
+ tool if it can’t distinguish truth from fiction?
125
+
126
+ Just the other day Google Search was caught serving up an entirely fake description
127
+ of the non-existant movie “Encanto 2”. It turned out to be summarizing an imagined
128
+ movie listing from a fan fiction wiki.'
129
+ - source_sentence: How did the approach to handling the prompt change over time according
130
+ to the context?
131
+ sentences:
132
+ - 'We already knew LLMs were spookily good at writing code. If you prompt them right,
133
+ it turns out they can build you a full interactive application using HTML, CSS
134
+ and JavaScript (and tools like React if you wire up some extra supporting build
135
+ mechanisms)—often in a single prompt.
136
+
137
+ Anthropic kicked this idea into high gear when they released Claude Artifacts,
138
+ a groundbreaking new feature that was initially slightly lost in the noise due
139
+ to being described half way through their announcement of the incredible Claude
140
+ 3.5 Sonnet.
141
+
142
+ With Artifacts, Claude can write you an on-demand interactive application and
143
+ then let you use it directly inside the Claude interface.
144
+
145
+ Here’s my Extract URLs app, entirely generated by Claude:'
146
+ - 'The two main categories I see are people who think AI agents are obviously things
147
+ that go and act on your behalf—the travel agent model—and people who think in
148
+ terms of LLMs that have been given access to tools which they can run in a loop
149
+ as part of solving a problem. The term “autonomy” is often thrown into the mix
150
+ too, again without including a clear definition.
151
+
152
+ (I also collected 211 definitions on Twitter a few months ago—here they are in
153
+ Datasette Lite—and had gemini-exp-1206 attempt to summarize them.)
154
+
155
+ Whatever the term may mean, agents still have that feeling of perpetually “coming
156
+ soon”.'
157
+ - 'When @v0 first came out we were paranoid about protecting the prompt with all
158
+ kinds of pre and post processing complexity.
159
+
160
+ We completely pivoted to let it rip. A prompt without the evals, models, and especially
161
+ UX is like getting a broken ASML machine without a manual'
162
+ - source_sentence: How many lines of Python code are typically sufficient to train
163
+ a basic version of a powerful system?
164
+ sentences:
165
+ - 'Intuitively, one would expect that systems this powerful would take millions
166
+ of lines of complex code. Instead, it turns out a few hundred lines of Python
167
+ is genuinely enough to train a basic version!
168
+
169
+ What matters most is the training data. You need a lot of data to make these
170
+ things work, and the quantity and quality of the training data appears to be the
171
+ most important factor in how good the resulting model is.
172
+
173
+ If you can gather the right data, and afford to pay for the GPUs to train it,
174
+ you can build an LLM.'
175
+ - 'So far, I think they’re a net positive. I’ve used them on a personal level to
176
+ improve my productivity (and entertain myself) in all sorts of different ways.
177
+ I think people who learn how to use them effectively can gain a significant boost
178
+ to their quality of life.
179
+
180
+ A lot of people are yet to be sold on their value! Some think their negatives
181
+ outweigh their positives, some think they are all hot air, and some even think
182
+ they represent an existential threat to humanity.
183
+
184
+ They’re actually quite easy to build
185
+
186
+ The most surprising thing we’ve learned about LLMs this year is that they’re actually
187
+ quite easy to build.'
188
+ - 'I’m still trying to figure out the best patterns for doing this for my own work.
189
+ Everyone knows that evals are important, but there remains a lack of great guidance
190
+ for how to best implement them—I’m tracking this under my evals tag. My SVG pelican
191
+ riding a bicycle benchmark is a pale imitation of what a real eval suite should
192
+ look like.
193
+
194
+ Apple Intelligence is bad, Apple’s MLX library is excellent
195
+
196
+ As a Mac user I’ve been feeling a lot better about my choice of platform this
197
+ year.
198
+
199
+ Last year it felt like my lack of a Linux/Windows machine with an NVIDIA GPU
200
+ was a huge disadvantage in terms of trying out new models.'
201
+ pipeline_tag: sentence-similarity
202
+ library_name: sentence-transformers
203
+ metrics:
204
+ - cosine_accuracy@1
205
+ - cosine_accuracy@3
206
+ - cosine_accuracy@5
207
+ - cosine_accuracy@10
208
+ - cosine_precision@1
209
+ - cosine_precision@3
210
+ - cosine_precision@5
211
+ - cosine_precision@10
212
+ - cosine_recall@1
213
+ - cosine_recall@3
214
+ - cosine_recall@5
215
+ - cosine_recall@10
216
+ - cosine_ndcg@10
217
+ - cosine_mrr@10
218
+ - cosine_map@100
219
+ model-index:
220
+ - name: SentenceTransformer based on Snowflake/snowflake-arctic-embed-m
221
+ results:
222
+ - task:
223
+ type: information-retrieval
224
+ name: Information Retrieval
225
+ dataset:
226
+ name: Unknown
227
+ type: unknown
228
+ metrics:
229
+ - type: cosine_accuracy@1
230
+ value: 0.875
231
+ name: Cosine Accuracy@1
232
+ - type: cosine_accuracy@3
233
+ value: 1.0
234
+ name: Cosine Accuracy@3
235
+ - type: cosine_accuracy@5
236
+ value: 1.0
237
+ name: Cosine Accuracy@5
238
+ - type: cosine_accuracy@10
239
+ value: 1.0
240
+ name: Cosine Accuracy@10
241
+ - type: cosine_precision@1
242
+ value: 0.875
243
+ name: Cosine Precision@1
244
+ - type: cosine_precision@3
245
+ value: 0.3333333333333333
246
+ name: Cosine Precision@3
247
+ - type: cosine_precision@5
248
+ value: 0.20000000000000004
249
+ name: Cosine Precision@5
250
+ - type: cosine_precision@10
251
+ value: 0.10000000000000002
252
+ name: Cosine Precision@10
253
+ - type: cosine_recall@1
254
+ value: 0.875
255
+ name: Cosine Recall@1
256
+ - type: cosine_recall@3
257
+ value: 1.0
258
+ name: Cosine Recall@3
259
+ - type: cosine_recall@5
260
+ value: 1.0
261
+ name: Cosine Recall@5
262
+ - type: cosine_recall@10
263
+ value: 1.0
264
+ name: Cosine Recall@10
265
+ - type: cosine_ndcg@10
266
+ value: 0.9538662191964322
267
+ name: Cosine Ndcg@10
268
+ - type: cosine_mrr@10
269
+ value: 0.9375
270
+ name: Cosine Mrr@10
271
+ - type: cosine_map@100
272
+ value: 0.9375
273
+ name: Cosine Map@100
274
+ ---
275
+
276
+ # SentenceTransformer based on Snowflake/snowflake-arctic-embed-m
277
+
278
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Snowflake/snowflake-arctic-embed-m](https://huggingface.co/Snowflake/snowflake-arctic-embed-m). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
279
+
280
+ ## Model Details
281
+
282
+ ### Model Description
283
+ - **Model Type:** Sentence Transformer
284
+ - **Base model:** [Snowflake/snowflake-arctic-embed-m](https://huggingface.co/Snowflake/snowflake-arctic-embed-m) <!-- at revision fc74610d18462d218e312aa986ec5c8a75a98152 -->
285
+ - **Maximum Sequence Length:** 512 tokens
286
+ - **Output Dimensionality:** 768 dimensions
287
+ - **Similarity Function:** Cosine Similarity
288
+ <!-- - **Training Dataset:** Unknown -->
289
+ <!-- - **Language:** Unknown -->
290
+ <!-- - **License:** Unknown -->
291
+
292
+ ### Model Sources
293
+
294
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
295
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
296
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
297
+
298
+ ### Full Model Architecture
299
+
300
+ ```
301
+ SentenceTransformer(
302
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
303
+ (1): Pooling({'word_embedding_dimension': 768, '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})
304
+ (2): Normalize()
305
+ )
306
+ ```
307
+
308
+ ## Usage
309
+
310
+ ### Direct Usage (Sentence Transformers)
311
+
312
+ First install the Sentence Transformers library:
313
+
314
+ ```bash
315
+ pip install -U sentence-transformers
316
+ ```
317
+
318
+ Then you can load this model and run inference.
319
+ ```python
320
+ from sentence_transformers import SentenceTransformer
321
+
322
+ # Download from the 🤗 Hub
323
+ model = SentenceTransformer("bsmith3715/legal-ft-cert-challengev2")
324
+ # Run inference
325
+ sentences = [
326
+ 'How many lines of Python code are typically sufficient to train a basic version of a powerful system?',
327
+ 'Intuitively, one would expect that systems this powerful would take millions of lines of complex code. Instead, it turns out a few hundred lines of Python is genuinely enough to train a basic version!\nWhat matters most is the training data. You need a lot of data to make these things work, and the quantity and quality of the training data appears to be the most important factor in how good the resulting model is.\nIf you can gather the right data, and afford to pay for the GPUs to train it, you can build an LLM.',
328
+ 'I’m still trying to figure out the best patterns for doing this for my own work. Everyone knows that evals are important, but there remains a lack of great guidance for how to best implement them—I’m tracking this under my evals tag. My SVG pelican riding a bicycle benchmark is a pale imitation of what a real eval suite should look like.\nApple Intelligence is bad, Apple’s MLX library is excellent\nAs a Mac user I’ve been feeling a lot better about my choice of platform this year.\nLast year it felt like my lack of a Linux/Windows machine with an NVIDIA GPU was a huge disadvantage in terms of trying out new models.',
329
+ ]
330
+ embeddings = model.encode(sentences)
331
+ print(embeddings.shape)
332
+ # [3, 768]
333
+
334
+ # Get the similarity scores for the embeddings
335
+ similarities = model.similarity(embeddings, embeddings)
336
+ print(similarities.shape)
337
+ # [3, 3]
338
+ ```
339
+
340
+ <!--
341
+ ### Direct Usage (Transformers)
342
+
343
+ <details><summary>Click to see the direct usage in Transformers</summary>
344
+
345
+ </details>
346
+ -->
347
+
348
+ <!--
349
+ ### Downstream Usage (Sentence Transformers)
350
+
351
+ You can finetune this model on your own dataset.
352
+
353
+ <details><summary>Click to expand</summary>
354
+
355
+ </details>
356
+ -->
357
+
358
+ <!--
359
+ ### Out-of-Scope Use
360
+
361
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
362
+ -->
363
+
364
+ ## Evaluation
365
+
366
+ ### Metrics
367
+
368
+ #### Information Retrieval
369
+
370
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
371
+
372
+ | Metric | Value |
373
+ |:--------------------|:-----------|
374
+ | cosine_accuracy@1 | 0.875 |
375
+ | cosine_accuracy@3 | 1.0 |
376
+ | cosine_accuracy@5 | 1.0 |
377
+ | cosine_accuracy@10 | 1.0 |
378
+ | cosine_precision@1 | 0.875 |
379
+ | cosine_precision@3 | 0.3333 |
380
+ | cosine_precision@5 | 0.2 |
381
+ | cosine_precision@10 | 0.1 |
382
+ | cosine_recall@1 | 0.875 |
383
+ | cosine_recall@3 | 1.0 |
384
+ | cosine_recall@5 | 1.0 |
385
+ | cosine_recall@10 | 1.0 |
386
+ | **cosine_ndcg@10** | **0.9539** |
387
+ | cosine_mrr@10 | 0.9375 |
388
+ | cosine_map@100 | 0.9375 |
389
+
390
+ <!--
391
+ ## Bias, Risks and Limitations
392
+
393
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
394
+ -->
395
+
396
+ <!--
397
+ ### Recommendations
398
+
399
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
400
+ -->
401
+
402
+ ## Training Details
403
+
404
+ ### Training Dataset
405
+
406
+ #### Unnamed Dataset
407
+
408
+ * Size: 156 training samples
409
+ * Columns: <code>sentence_0</code> and <code>sentence_1</code>
410
+ * Approximate statistics based on the first 156 samples:
411
+ | | sentence_0 | sentence_1 |
412
+ |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
413
+ | type | string | string |
414
+ | details | <ul><li>min: 12 tokens</li><li>mean: 20.49 tokens</li><li>max: 31 tokens</li></ul> | <ul><li>min: 43 tokens</li><li>mean: 135.35 tokens</li><li>max: 214 tokens</li></ul> |
415
+ * Samples:
416
+ | sentence_0 | sentence_1 |
417
+ |:-----------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
418
+ | <code>What significant advancements in AI were made in 2023, particularly regarding Large Language Models (LLMs)?</code> | <code>Stuff we figured out about AI in 2023<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>Simon Willison’s Weblog<br>Subscribe<br><br><br><br><br><br><br>Stuff we figured out about AI in 2023<br>31st December 2023<br>2023 was the breakthrough year for Large Language Models (LLMs). I think it’s OK to call these AI—they’re the latest and (currently) most interesting development in the academic field of Artificial Intelligence that dates back to the 1950s.<br>Here’s my attempt to round up the highlights in one place!</code> |
419
+ | <code>How does the development of LLMs in 2023 relate to the historical context of Artificial Intelligence since the 1950s?</code> | <code>Stuff we figured out about AI in 2023<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>Simon Willison’s Weblog<br>Subscribe<br><br><br><br><br><br><br>Stuff we figured out about AI in 2023<br>31st December 2023<br>2023 was the breakthrough year for Large Language Models (LLMs). I think it’s OK to call these AI—they’re the latest and (currently) most interesting development in the academic field of Artificial Intelligence that dates back to the 1950s.<br>Here’s my attempt to round up the highlights in one place!</code> |
420
+ | <code>What are some potential applications of Large Language Models (LLMs) mentioned in the context?</code> | <code>Large Language Models<br>They’re actually quite easy to build<br>You can run LLMs on your own devices<br>Hobbyists can build their own fine-tuned models<br>We don’t yet know how to build GPT-4<br>Vibes Based Development<br>LLMs are really smart, and also really, really dumb<br>Gullibility is the biggest unsolved problem<br>Code may be the best application<br>The ethics of this space remain diabolically complex<br>My blog in 2023</code> |
421
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
422
+ ```json
423
+ {
424
+ "loss": "MultipleNegativesRankingLoss",
425
+ "matryoshka_dims": [
426
+ 768,
427
+ 512,
428
+ 256,
429
+ 128,
430
+ 64
431
+ ],
432
+ "matryoshka_weights": [
433
+ 1,
434
+ 1,
435
+ 1,
436
+ 1,
437
+ 1
438
+ ],
439
+ "n_dims_per_step": -1
440
+ }
441
+ ```
442
+
443
+ ### Training Hyperparameters
444
+ #### Non-Default Hyperparameters
445
+
446
+ - `eval_strategy`: steps
447
+ - `per_device_train_batch_size`: 10
448
+ - `per_device_eval_batch_size`: 10
449
+ - `num_train_epochs`: 10
450
+ - `multi_dataset_batch_sampler`: round_robin
451
+
452
+ #### All Hyperparameters
453
+ <details><summary>Click to expand</summary>
454
+
455
+ - `overwrite_output_dir`: False
456
+ - `do_predict`: False
457
+ - `eval_strategy`: steps
458
+ - `prediction_loss_only`: True
459
+ - `per_device_train_batch_size`: 10
460
+ - `per_device_eval_batch_size`: 10
461
+ - `per_gpu_train_batch_size`: None
462
+ - `per_gpu_eval_batch_size`: None
463
+ - `gradient_accumulation_steps`: 1
464
+ - `eval_accumulation_steps`: None
465
+ - `torch_empty_cache_steps`: None
466
+ - `learning_rate`: 5e-05
467
+ - `weight_decay`: 0.0
468
+ - `adam_beta1`: 0.9
469
+ - `adam_beta2`: 0.999
470
+ - `adam_epsilon`: 1e-08
471
+ - `max_grad_norm`: 1
472
+ - `num_train_epochs`: 10
473
+ - `max_steps`: -1
474
+ - `lr_scheduler_type`: linear
475
+ - `lr_scheduler_kwargs`: {}
476
+ - `warmup_ratio`: 0.0
477
+ - `warmup_steps`: 0
478
+ - `log_level`: passive
479
+ - `log_level_replica`: warning
480
+ - `log_on_each_node`: True
481
+ - `logging_nan_inf_filter`: True
482
+ - `save_safetensors`: True
483
+ - `save_on_each_node`: False
484
+ - `save_only_model`: False
485
+ - `restore_callback_states_from_checkpoint`: False
486
+ - `no_cuda`: False
487
+ - `use_cpu`: False
488
+ - `use_mps_device`: False
489
+ - `seed`: 42
490
+ - `data_seed`: None
491
+ - `jit_mode_eval`: False
492
+ - `use_ipex`: False
493
+ - `bf16`: False
494
+ - `fp16`: False
495
+ - `fp16_opt_level`: O1
496
+ - `half_precision_backend`: auto
497
+ - `bf16_full_eval`: False
498
+ - `fp16_full_eval`: False
499
+ - `tf32`: None
500
+ - `local_rank`: 0
501
+ - `ddp_backend`: None
502
+ - `tpu_num_cores`: None
503
+ - `tpu_metrics_debug`: False
504
+ - `debug`: []
505
+ - `dataloader_drop_last`: False
506
+ - `dataloader_num_workers`: 0
507
+ - `dataloader_prefetch_factor`: None
508
+ - `past_index`: -1
509
+ - `disable_tqdm`: False
510
+ - `remove_unused_columns`: True
511
+ - `label_names`: None
512
+ - `load_best_model_at_end`: False
513
+ - `ignore_data_skip`: False
514
+ - `fsdp`: []
515
+ - `fsdp_min_num_params`: 0
516
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
517
+ - `tp_size`: 0
518
+ - `fsdp_transformer_layer_cls_to_wrap`: None
519
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
520
+ - `deepspeed`: None
521
+ - `label_smoothing_factor`: 0.0
522
+ - `optim`: adamw_torch
523
+ - `optim_args`: None
524
+ - `adafactor`: False
525
+ - `group_by_length`: False
526
+ - `length_column_name`: length
527
+ - `ddp_find_unused_parameters`: None
528
+ - `ddp_bucket_cap_mb`: None
529
+ - `ddp_broadcast_buffers`: False
530
+ - `dataloader_pin_memory`: True
531
+ - `dataloader_persistent_workers`: False
532
+ - `skip_memory_metrics`: True
533
+ - `use_legacy_prediction_loop`: False
534
+ - `push_to_hub`: False
535
+ - `resume_from_checkpoint`: None
536
+ - `hub_model_id`: None
537
+ - `hub_strategy`: every_save
538
+ - `hub_private_repo`: None
539
+ - `hub_always_push`: False
540
+ - `gradient_checkpointing`: False
541
+ - `gradient_checkpointing_kwargs`: None
542
+ - `include_inputs_for_metrics`: False
543
+ - `include_for_metrics`: []
544
+ - `eval_do_concat_batches`: True
545
+ - `fp16_backend`: auto
546
+ - `push_to_hub_model_id`: None
547
+ - `push_to_hub_organization`: None
548
+ - `mp_parameters`:
549
+ - `auto_find_batch_size`: False
550
+ - `full_determinism`: False
551
+ - `torchdynamo`: None
552
+ - `ray_scope`: last
553
+ - `ddp_timeout`: 1800
554
+ - `torch_compile`: False
555
+ - `torch_compile_backend`: None
556
+ - `torch_compile_mode`: None
557
+ - `include_tokens_per_second`: False
558
+ - `include_num_input_tokens_seen`: False
559
+ - `neftune_noise_alpha`: None
560
+ - `optim_target_modules`: None
561
+ - `batch_eval_metrics`: False
562
+ - `eval_on_start`: False
563
+ - `use_liger_kernel`: False
564
+ - `eval_use_gather_object`: False
565
+ - `average_tokens_across_devices`: False
566
+ - `prompts`: None
567
+ - `batch_sampler`: batch_sampler
568
+ - `multi_dataset_batch_sampler`: round_robin
569
+
570
+ </details>
571
+
572
+ ### Training Logs
573
+ | Epoch | Step | cosine_ndcg@10 |
574
+ |:-----:|:----:|:--------------:|
575
+ | 1.0 | 16 | 0.8895 |
576
+ | 2.0 | 32 | 0.9109 |
577
+ | 3.0 | 48 | 0.9192 |
578
+ | 3.125 | 50 | 0.9192 |
579
+ | 4.0 | 64 | 0.9330 |
580
+ | 5.0 | 80 | 0.9385 |
581
+ | 6.0 | 96 | 0.9385 |
582
+ | 6.25 | 100 | 0.9539 |
583
+ | 7.0 | 112 | 0.9539 |
584
+ | 8.0 | 128 | 0.9539 |
585
+ | 9.0 | 144 | 0.9539 |
586
+ | 9.375 | 150 | 0.9539 |
587
+ | 10.0 | 160 | 0.9539 |
588
+
589
+
590
+ ### Framework Versions
591
+ - Python: 3.13.2
592
+ - Sentence Transformers: 4.1.0
593
+ - Transformers: 4.51.3
594
+ - PyTorch: 2.7.0+cpu
595
+ - Accelerate: 1.6.0
596
+ - Datasets: 3.6.0
597
+ - Tokenizers: 0.21.1
598
+
599
+ ## Citation
600
+
601
+ ### BibTeX
602
+
603
+ #### Sentence Transformers
604
+ ```bibtex
605
+ @inproceedings{reimers-2019-sentence-bert,
606
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
607
+ author = "Reimers, Nils and Gurevych, Iryna",
608
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
609
+ month = "11",
610
+ year = "2019",
611
+ publisher = "Association for Computational Linguistics",
612
+ url = "https://arxiv.org/abs/1908.10084",
613
+ }
614
+ ```
615
+
616
+ #### MatryoshkaLoss
617
+ ```bibtex
618
+ @misc{kusupati2024matryoshka,
619
+ title={Matryoshka Representation Learning},
620
+ 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},
621
+ year={2024},
622
+ eprint={2205.13147},
623
+ archivePrefix={arXiv},
624
+ primaryClass={cs.LG}
625
+ }
626
+ ```
627
+
628
+ #### MultipleNegativesRankingLoss
629
+ ```bibtex
630
+ @misc{henderson2017efficient,
631
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
632
+ 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},
633
+ year={2017},
634
+ eprint={1705.00652},
635
+ archivePrefix={arXiv},
636
+ primaryClass={cs.CL}
637
+ }
638
+ ```
639
+
640
+ <!--
641
+ ## Glossary
642
+
643
+ *Clearly define terms in order to be accessible across audiences.*
644
+ -->
645
+
646
+ <!--
647
+ ## Model Card Authors
648
+
649
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
650
+ -->
651
+
652
+ <!--
653
+ ## Model Card Contact
654
+
655
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
656
+ -->
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.51.3",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 30522
25
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "4.1.0",
4
+ "transformers": "4.51.3",
5
+ "pytorch": "2.7.0+cpu"
6
+ },
7
+ "prompts": {
8
+ "query": "Represent this sentence for searching relevant passages: "
9
+ },
10
+ "default_prompt_name": null,
11
+ "similarity_fn_name": "cosine"
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ec4554b368ff016719382a2a651de85cdb4ef496ab23c57545fabe9fc004ec0
3
+ size 435588776
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
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "max_length": 512,
50
+ "model_max_length": 512,
51
+ "pad_to_multiple_of": null,
52
+ "pad_token": "[PAD]",
53
+ "pad_token_type_id": 0,
54
+ "padding_side": "right",
55
+ "sep_token": "[SEP]",
56
+ "stride": 0,
57
+ "strip_accents": null,
58
+ "tokenize_chinese_chars": true,
59
+ "tokenizer_class": "BertTokenizer",
60
+ "truncation_side": "right",
61
+ "truncation_strategy": "longest_first",
62
+ "unk_token": "[UNK]"
63
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff