SentenceTransformer based on keeeeenw/MicroLlama
This is a sentence-transformers model finetuned from keeeeenw/MicroLlama on the all-nli-pair, all-nli-pair-class, all-nli-pair-score, all-nli-triplet, stsb, quora and natural-questions datasets. 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.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: keeeeenw/MicroLlama
- Maximum Sequence Length: 2048 tokens
- Output Dimensionality: 1024 tokens
- Similarity Function: Cosine Similarity
- Training Datasets:
- Language: en
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 2048, 'do_lower_case': False}) with Transformer model: LlamaModel
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("keeeeenw/MicroLlama-text-embedding")
# Run inference
sentences = [
'How do I attract a girl?',
'How can I attract girls?',
"Why isn't my iPhone 5 charging?",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Training Details
Training Datasets
all-nli-pair
- Dataset: all-nli-pair at d482672
- Size: 10,000 training samples
- Columns:
anchor
andpositive
- Approximate statistics based on the first 1000 samples:
anchor positive type string string details - min: 4 tokens
- mean: 18.11 tokens
- max: 72 tokens
- min: 3 tokens
- mean: 9.46 tokens
- max: 34 tokens
- Samples:
anchor positive A person on a horse jumps over a broken down airplane.
A person is outdoors, on a horse.
Children smiling and waving at camera
There are children present
A boy is jumping on skateboard in the middle of a red bridge.
The boy does a skateboarding trick.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
all-nli-pair-class
- Dataset: all-nli-pair-class at d482672
- Size: 10,000 training samples
- Columns:
premise
,hypothesis
, andlabel
- Approximate statistics based on the first 1000 samples:
premise hypothesis label type string string int details - min: 6 tokens
- mean: 18.54 tokens
- max: 55 tokens
- min: 3 tokens
- mean: 10.78 tokens
- max: 37 tokens
- 0: ~33.40%
- 1: ~33.30%
- 2: ~33.30%
- Samples:
premise hypothesis label A person on a horse jumps over a broken down airplane.
A person is training his horse for a competition.
1
A person on a horse jumps over a broken down airplane.
A person is at a diner, ordering an omelette.
2
A person on a horse jumps over a broken down airplane.
A person is outdoors, on a horse.
0
- Loss:
SoftmaxLoss
all-nli-pair-score
- Dataset: all-nli-pair-score at d482672
- Size: 10,000 training samples
- Columns:
sentence1
,sentence2
, andscore
- Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type string string float details - min: 6 tokens
- mean: 18.54 tokens
- max: 55 tokens
- min: 3 tokens
- mean: 10.78 tokens
- max: 37 tokens
- min: 0.0
- mean: 0.5
- max: 1.0
- Samples:
sentence1 sentence2 score A person on a horse jumps over a broken down airplane.
A person is training his horse for a competition.
0.5
A person on a horse jumps over a broken down airplane.
A person is at a diner, ordering an omelette.
0.0
A person on a horse jumps over a broken down airplane.
A person is outdoors, on a horse.
1.0
- Loss:
CoSENTLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "pairwise_cos_sim" }
all-nli-triplet
- Dataset: all-nli-triplet at d482672
- Size: 10,000 training samples
- Columns:
anchor
,positive
, andnegative
- Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 6 tokens
- mean: 10.37 tokens
- max: 50 tokens
- min: 5 tokens
- mean: 13.04 tokens
- max: 41 tokens
- min: 5 tokens
- mean: 13.74 tokens
- max: 54 tokens
- Samples:
anchor positive negative A person on a horse jumps over a broken down airplane.
A person is outdoors, on a horse.
A person is at a diner, ordering an omelette.
Children smiling and waving at camera
There are children present
The kids are frowning
A boy is jumping on skateboard in the middle of a red bridge.
The boy does a skateboarding trick.
The boy skates down the sidewalk.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
stsb
- Dataset: stsb at ab7a5ac
- Size: 5,749 training samples
- Columns:
sentence1
,sentence2
, andscore
- Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type string string float details - min: 5 tokens
- mean: 10.21 tokens
- max: 31 tokens
- min: 6 tokens
- mean: 10.19 tokens
- max: 28 tokens
- min: 0.0
- mean: 0.54
- max: 1.0
- Samples:
sentence1 sentence2 score A plane is taking off.
An air plane is taking off.
1.0
A man is playing a large flute.
A man is playing a flute.
0.76
A man is spreading shreded cheese on a pizza.
A man is spreading shredded cheese on an uncooked pizza.
0.76
- Loss:
CoSENTLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "pairwise_cos_sim" }
quora
- Dataset: quora at 451a485
- Size: 10,000 training samples
- Columns:
anchor
andpositive
- Approximate statistics based on the first 1000 samples:
anchor positive type string string details - min: 5 tokens
- mean: 14.26 tokens
- max: 45 tokens
- min: 5 tokens
- mean: 14.48 tokens
- max: 49 tokens
- Samples:
anchor positive Astrology: I am a Capricorn Sun Cap moon and cap rising...what does that say about me?
I'm a triple Capricorn (Sun, Moon and ascendant in Capricorn) What does this say about me?
How can I be a good geologist?
What should I do to be a great geologist?
How do I read and find my YouTube comments?
How can I see all my Youtube comments?
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
natural-questions
- Dataset: natural-questions at f9e894e
- Size: 10,000 training samples
- Columns:
query
andanswer
- Approximate statistics based on the first 1000 samples:
query answer type string string details - min: 9 tokens
- mean: 12.46 tokens
- max: 25 tokens
- min: 18 tokens
- mean: 160.85 tokens
- max: 611 tokens
- Samples:
query answer when did richmond last play in a preliminary final
Richmond Football Club Richmond began 2017 with 5 straight wins, a feat it had not achieved since 1995. A series of close losses hampered the Tigers throughout the middle of the season, including a 5-point loss to the Western Bulldogs, 2-point loss to Fremantle, and a 3-point loss to the Giants. Richmond ended the season strongly with convincing victories over Fremantle and St Kilda in the final two rounds, elevating the club to 3rd on the ladder. Richmond's first final of the season against the Cats at the MCG attracted a record qualifying final crowd of 95,028; the Tigers won by 51 points. Having advanced to the first preliminary finals for the first time since 2001, Richmond defeated Greater Western Sydney by 36 points in front of a crowd of 94,258 to progress to the Grand Final against Adelaide, their first Grand Final appearance since 1982. The attendance was 100,021, the largest crowd to a grand final since 1986. The Crows led at quarter time and led by as many as 13, but the Tigers took over the game as it progressed and scored seven straight goals at one point. They eventually would win by 48 points – 16.12 (108) to Adelaide's 8.12 (60) – to end their 37-year flag drought.[22] Dustin Martin also became the first player to win a Premiership medal, the Brownlow Medal and the Norm Smith Medal in the same season, while Damien Hardwick was named AFL Coaches Association Coach of the Year. Richmond's jump from 13th to premiers also marked the biggest jump from one AFL season to the next.
who sang what in the world's come over you
Jack Scott (singer) At the beginning of 1960, Scott again changed record labels, this time to Top Rank Records.[1] He then recorded four Billboard Hot 100 hits – "What in the World's Come Over You" (#5), "Burning Bridges" (#3) b/w "Oh Little One" (#34), and "It Only Happened Yesterday" (#38).[1] "What in the World's Come Over You" was Scott's second gold disc winner.[6] Scott continued to record and perform during the 1960s and 1970s.[1] His song "You're Just Gettin' Better" reached the country charts in 1974.[1] In May 1977, Scott recorded a Peel session for BBC Radio 1 disc jockey, John Peel.
who produces the most wool in the world
Wool Global wool production is about 2 million tonnes per year, of which 60% goes into apparel. Wool comprises ca 3% of the global textile market, but its value is higher owing to dying and other modifications of the material.[1] Australia is a leading producer of wool which is mostly from Merino sheep but has been eclipsed by China in terms of total weight.[30] New Zealand (2016) is the third-largest producer of wool, and the largest producer of crossbred wool. Breeds such as Lincoln, Romney, Drysdale, and Elliotdale produce coarser fibers, and wool from these sheep is usually used for making carpets.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Evaluation Datasets
all-nli-triplet
- Dataset: all-nli-triplet at d482672
- Size: 6,584 evaluation samples
- Columns:
anchor
,positive
, andnegative
- Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 5 tokens
- mean: 19.38 tokens
- max: 89 tokens
- min: 4 tokens
- mean: 9.77 tokens
- max: 35 tokens
- min: 4 tokens
- mean: 10.49 tokens
- max: 30 tokens
- Samples:
anchor positive negative Two women are embracing while holding to go packages.
Two woman are holding packages.
The men are fighting outside a deli.
Two young children in blue jerseys, one with the number 9 and one with the number 2 are standing on wooden steps in a bathroom and washing their hands in a sink.
Two kids in numbered jerseys wash their hands.
Two kids in jackets walk to school.
A man selling donuts to a customer during a world exhibition event held in the city of Angeles
A man selling donuts to a customer.
A woman drinks her coffee in a small cafe.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
stsb
- Dataset: stsb at ab7a5ac
- Size: 1,500 evaluation samples
- Columns:
sentence1
,sentence2
, andscore
- Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type string string float details - min: 4 tokens
- mean: 15.54 tokens
- max: 49 tokens
- min: 6 tokens
- mean: 15.46 tokens
- max: 54 tokens
- min: 0.0
- mean: 0.47
- max: 1.0
- Samples:
sentence1 sentence2 score A man with a hard hat is dancing.
A man wearing a hard hat is dancing.
1.0
A young child is riding a horse.
A child is riding a horse.
0.95
A man is feeding a mouse to a snake.
The man is feeding a mouse to the snake.
1.0
- Loss:
CoSENTLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "pairwise_cos_sim" }
quora
- Dataset: quora at 451a485
- Size: 1,000 evaluation samples
- Columns:
anchor
andpositive
- Approximate statistics based on the first 1000 samples:
anchor positive type string string details - min: 6 tokens
- mean: 14.43 tokens
- max: 68 tokens
- min: 5 tokens
- mean: 14.47 tokens
- max: 55 tokens
- Samples:
anchor positive What is your New Year resolution?
What can be my new year resolution for 2017?
Should I buy the IPhone 6s or Samsung Galaxy s7?
Which is better: the iPhone 6S Plus or the Samsung Galaxy S7 Edge?
What are the differences between transgression and regression?
What is the difference between transgression and regression?
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
natural-questions
- Dataset: natural-questions at f9e894e
- Size: 1,000 evaluation samples
- Columns:
query
andanswer
- Approximate statistics based on the first 1000 samples:
query answer type string string details - min: 9 tokens
- mean: 12.5 tokens
- max: 26 tokens
- min: 24 tokens
- mean: 164.3 tokens
- max: 708 tokens
- Samples:
query answer where does the waikato river begin and end
Waikato River The Waikato River is the longest river in New Zealand, running for 425 kilometres (264Â mi) through the North Island. It rises in the eastern slopes of Mount Ruapehu, joining the Tongariro River system and flowing through Lake Taupo, New Zealand's largest lake. It then drains Taupo at the lake's northeastern edge, creates the Huka Falls, and flows northwest through the Waikato Plains. It empties into the Tasman Sea south of Auckland, at Port Waikato. It gives its name to the Waikato Region that surrounds the Waikato Plains. The present course of the river was largely formed about 17,000 years ago. Contributing factors were climate warming, forest being reestablished in the river headwaters and the deepening, rather than widening, of the existing river channel. The channel was gradually eroded as far up river as Piarere, leaving the old Hinuera channel high and dry.[2] The remains of the old river path can be clearly seen at Hinuera where the cliffs mark the ancient river edges. The river's main tributary is the Waipa River, which has its confluence with the Waikato at Ngaruawahia.
what type of gas is produced during fermentation
Fermentation Fermentation reacts NADH with an endogenous, organic electron acceptor.[1] Usually this is pyruvate formed from sugar through glycolysis. The reaction produces NAD+ and an organic product, typical examples being ethanol, lactic acid, carbon dioxide, and hydrogen gas (H2). However, more exotic compounds can be produced by fermentation, such as butyric acid and acetone. Fermentation products contain chemical energy (they are not fully oxidized), but are considered waste products, since they cannot be metabolized further without the use of oxygen.
why was star wars episode iv released first
Star Wars (film) Star Wars (later retitled Star Wars: Episode IV – A New Hope) is a 1977 American epic space opera film written and directed by George Lucas. It is the first film in the original Star Wars trilogy and the beginning of the Star Wars franchise. Starring Mark Hamill, Harrison Ford, Carrie Fisher, Peter Cushing, Alec Guinness, David Prowse, James Earl Jones, Anthony Daniels, Kenny Baker, and Peter Mayhew, the film's plot focuses on the Rebel Alliance, led by Princess Leia (Fisher), and its attempt to destroy the Galactic Empire's space station, the Death Star. This conflict disrupts the isolated life of farmhand Luke Skywalker (Hamill), who inadvertently acquires two droids that possess stolen architectural plans for the Death Star. When the Empire begins a destructive search for the missing droids, Skywalker accompanies Jedi Master Obi-Wan Kenobi (Guinness) on a mission to return the plans to the Rebel Alliance and rescue Leia from her imprisonment by the Empire.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size
: 6per_device_eval_batch_size
: 6
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: noprediction_loss_only
: Trueper_device_train_batch_size
: 6per_device_eval_batch_size
: 6per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonelearning_rate
: 5e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 3.0max_steps
: -1lr_scheduler_type
: linearlr_scheduler_kwargs
: {}warmup_ratio
: 0.0warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Falsefp16
: Falsefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Nonelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Falsedataloader_num_workers
: 0dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Falseignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torchoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Falsehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseeval_do_concat_batches
: Truefp16_backend
: autopush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Nonedispatch_batches
: Nonesplit_batches
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falsebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: proportional
Training Logs
Epoch | Step | Training Loss |
---|---|---|
0.0456 | 500 | 1.3352 |
0.0912 | 1000 | 1.1358 |
0.1368 | 1500 | 1.093 |
0.1825 | 2000 | 0.9637 |
0.2281 | 2500 | 1.1237 |
0.2737 | 3000 | 0.9959 |
0.3193 | 3500 | 1.0079 |
0.3649 | 4000 | 0.9979 |
0.4105 | 4500 | 0.9099 |
0.4562 | 5000 | 0.9126 |
0.5018 | 5500 | 0.9893 |
0.5474 | 6000 | 1.0078 |
0.5930 | 6500 | 1.0522 |
0.6386 | 7000 | 0.8661 |
0.6842 | 7500 | 0.9543 |
0.7299 | 8000 | 0.8853 |
0.7755 | 8500 | 0.9813 |
0.8211 | 9000 | 0.852 |
0.8667 | 9500 | 0.8897 |
0.9123 | 10000 | 0.9234 |
0.9579 | 10500 | 0.8947 |
1.0036 | 11000 | 0.8693 |
1.0492 | 11500 | 0.7357 |
1.0948 | 12000 | 0.6246 |
1.1404 | 12500 | 0.6771 |
1.1860 | 13000 | 0.5807 |
1.2316 | 13500 | 0.7376 |
1.2773 | 14000 | 0.6177 |
1.3229 | 14500 | 0.5667 |
1.3685 | 15000 | 0.5701 |
1.4141 | 15500 | 0.5119 |
1.4597 | 16000 | 0.517 |
1.5053 | 16500 | 0.6041 |
1.5510 | 17000 | 0.5872 |
1.5966 | 17500 | 0.5719 |
1.6422 | 18000 | 0.4646 |
1.6878 | 18500 | 0.5375 |
1.7334 | 19000 | 0.5235 |
1.7790 | 19500 | 0.5432 |
1.8247 | 20000 | 0.5648 |
1.8703 | 20500 | 0.4776 |
1.9159 | 21000 | 0.5475 |
1.9615 | 21500 | 0.4902 |
2.0071 | 22000 | 0.4883 |
2.0527 | 22500 | 0.4473 |
2.0983 | 23000 | 0.3735 |
2.1440 | 23500 | 0.4526 |
2.1896 | 24000 | 0.3509 |
2.2352 | 24500 | 0.4658 |
2.2808 | 25000 | 0.3529 |
2.3264 | 25500 | 0.3723 |
2.3720 | 26000 | 0.4281 |
2.4177 | 26500 | 0.318 |
2.4633 | 27000 | 0.3073 |
2.5089 | 27500 | 0.3907 |
2.5545 | 28000 | 0.4327 |
2.6001 | 28500 | 0.3484 |
2.6457 | 29000 | 0.3073 |
2.6914 | 29500 | 0.2621 |
2.7370 | 30000 | 0.3265 |
2.7826 | 30500 | 0.3043 |
2.8282 | 31000 | 0.3637 |
2.8738 | 31500 | 0.3331 |
2.9194 | 32000 | 0.3693 |
2.9651 | 32500 | 0.2686 |
Framework Versions
- Python: 3.10.14
- Sentence Transformers: 3.2.1
- Transformers: 4.41.2
- PyTorch: 2.1.0+cu121
- Accelerate: 1.1.1
- Datasets: 3.1.0
- Tokenizers: 0.19.1
Citation
BibTeX
Sentence Transformers and SoftmaxLoss
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
MultipleNegativesRankingLoss
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
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},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
CoSENTLoss
@online{kexuefm-8847,
title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
author={Su Jianlin},
year={2022},
month={Jan},
url={https://kexue.fm/archives/8847},
}
- Downloads last month
- 27
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.
Model tree for keeeeenw/MicroLlama-text-embedding
Base model
keeeeenw/MicroLlama