SentenceTransformer based on BAAI/bge-m3
This is a sentence-transformers model finetuned from BAAI/bge-m3. It maps inputs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: BAAI/bge-m3
- Maximum Sequence Length: 8192 tokens
- Output Dimensionality: 1024 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'XLMRobertaModel'})
(1): Pooling({'embedding_dimension': 1024, 'pooling_mode': 'cls', 'include_prompt': True})
(2): Normalize({'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
)
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("pameydorke/arcanumchat-retriever-bge-m3-v2")
# Run inference
queries = [
'bestiary characters items list',
]
documents = [
'Databases. Databases. Bestiary. Endings. Characters. Items. Locations. Races. Schematics. Skills. Spell Colleges. Technological Disciplines',
"Character background. Child of a Hero. Character background. Child of a Hero. Available to all. You start with your father's +1 sword and are known throughout the land as a child of a Hero. Therefore you will incur terrible negative reaction for any evil act. Bad Reaction Adjustment x2 / Enchanted Sword",
'Mystick Menagerie. Mystick Menagerie. The Mystick Menagerie is a magickal items shop in Caladon, run by a shop clerk. Gallery. TBA. See also. Enchanted Panoply - Shop with magickal smith items in Caladon. Magick shops',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 1024] [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.4318, 0.0171, 0.0138]])
Evaluation
Metrics
Information Retrieval
- Dataset:
val-hard-negatives - Evaluated with InformationRetrievalEvaluator
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.8182 |
| cosine_accuracy@3 | 0.9388 |
| cosine_accuracy@5 | 0.9666 |
| cosine_accuracy@10 | 0.9777 |
| cosine_precision@1 | 0.8182 |
| cosine_precision@3 | 0.3129 |
| cosine_precision@5 | 0.1933 |
| cosine_precision@10 | 0.0978 |
| cosine_recall@1 | 0.8182 |
| cosine_recall@3 | 0.9388 |
| cosine_recall@5 | 0.9666 |
| cosine_recall@10 | 0.9777 |
| cosine_ndcg@10 | 0.9038 |
| cosine_mrr@10 | 0.8793 |
| cosine_map@100 | 0.8806 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 18,170 training samples
- Columns: anchor, positive, and negative
- Approximate statistics based on the first 100 samples:
anchor positive negative type string string string modality text text text details min: 6 tokensmean: 8.73 tokensmax: 11 tokens min: 51 tokensmean: 324.69 tokensmax: 879 tokens min: 13 tokensmean: 409.05 tokensmax: 1008 tokens - Samples:
anchor positive negative turn target into liquid Body of Water. Body of Water. Body of Water is the fourth spell in the college of Water. Uses. This spell transforms the body of a target into Water and liquid, making the target slow, but resistant to attack. When cast on a target, all equipped items are moved into the target's inventory (or dropped to the ground if inventory becomes full). Limitations. The player or their followers lose all bonuses from formally equipped items. Additional Sources. Scrolls are sold in Magick Shops. Mechanics. For NPC targets: Unequipping includes "hidden" items that sometimes are not normally shown in an NPC's body or inventory screen. Thus it makes pickpocketing possible for hidden items. It also makes pickpocketing easier for other items that were previously equipped. Casting this spell on an NPC will not cause them to become hostile. For the player and party members: The target receives -5 speed, DR is set to 95, PR to 30, and ER to 90 Thus the target becomes more difficult to hit and much more dif... The Gem of Water Purification. The Gem of Water Purification. An acolyte of V’ed Eckes was sent out to receive a water gem and has returned wearing technological armor. V’ed Eckes wants you to get the gem. Possible solutions :. Pick pocket gem Kill him Convince him that he no longer belongs there and he will give it to you. An interesting discussion, very much a reference to Fallout :) turn target into liquid Body of Water. Body of Water. Body of Water is the fourth spell in the college of Water. Uses. This spell transforms the body of a target into Water and liquid, making the target slow, but resistant to attack. When cast on a target, all equipped items are moved into the target's inventory (or dropped to the ground if inventory becomes full). Limitations. The player or their followers lose all bonuses from formally equipped items. Additional Sources. Scrolls are sold in Magick Shops. Mechanics. For NPC targets: Unequipping includes "hidden" items that sometimes are not normally shown in an NPC's body or inventory screen. Thus it makes pickpocketing possible for hidden items. It also makes pickpocketing easier for other items that were previously equipped. Casting this spell on an NPC will not cause them to become hostile. For the player and party members: The target receives -5 speed, DR is set to 95, PR to 30, and ER to 90 Thus the target becomes more difficult to hit and much more dif... Body of Stone. Body of Stone. Body of Earth is the fourth spell in the college of Earth. Uses. This spell transforms the body of a target into earth and stone, making the target slow, but strong and resistant to attack. When cast on a target, all equipped items are moved into the target's inventory (or dropped to the ground if inventory becomes full). Limitations. The player or their followers lose all bonuses from formally equipped items. Additional Sources. Scrolls are sold in Magick Shops. Mechanics. For NPC targets: Unequipping includes "hidden" items that sometimes are not normally shown in an NPC's body or inventory screen. Thus it makes pickpocketing possible for hidden items. It also makes pickpocketing easier for other items that were previously equipped. Casting this spell on an NPC will not cause them to become hostile. For the player and party members: The target receives +10 Strength, -5 speed, +11 FR, DR is set to 50, and PR is set to 90. Thus the target becomes more diff... turn target into liquid Body of Water. Body of Water. Body of Water is the fourth spell in the college of Water. Uses. This spell transforms the body of a target into Water and liquid, making the target slow, but resistant to attack. When cast on a target, all equipped items are moved into the target's inventory (or dropped to the ground if inventory becomes full). Limitations. The player or their followers lose all bonuses from formally equipped items. Additional Sources. Scrolls are sold in Magick Shops. Mechanics. For NPC targets: Unequipping includes "hidden" items that sometimes are not normally shown in an NPC's body or inventory screen. Thus it makes pickpocketing possible for hidden items. It also makes pickpocketing easier for other items that were previously equipped. Casting this spell on an NPC will not cause them to become hostile. For the player and party members: The target receives -5 speed, DR is set to 95, PR to 30, and ER to 90 Thus the target becomes more difficult to hit and much more dif... Create Undead. Create Undead. Work in Progress. Create Undead - Loss: GISTEmbedLoss with these parameters:
{ "guide": "SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')", "temperature": 0.07, "margin_strategy": "absolute", "margin": 0.0, "contrast_anchors": true, "contrast_positives": true, "gather_across_devices": false }
Evaluation Dataset
Unnamed Dataset
- Size: 2,156 evaluation samples
- Columns: anchor, positive, and negative
- Approximate statistics based on the first 100 samples:
anchor positive negative type string string string modality text text text details min: 5 tokensmean: 8.27 tokensmax: 12 tokens min: 20 tokensmean: 303.92 tokensmax: 803 tokens min: 51 tokensmean: 393.05 tokensmax: 941 tokens - Samples:
anchor positive negative arcana fist damage spells Original Post: Most optimized brawler build. As title asks: how would you build a character with primary damage is their fists.My working thought is half-orc, half-orge or orge (if using unofficial patch with additional content). Traditional melee build though with early emphasis on strength given how slow fists can be.Now my dilemma is either staying purely neutral as the best gauntlets (for fist damage) are tech. However, there are spells that can improve fist damage such as harden fist spell and later elemental spells (which would require significant investment into Willpower)Thoughts? User 1: Tech is super fun, but Magick is super powerful. I played 3 melee type builds from start to finish: pure neutral maxed melee, teched-out maxed melee and magick maxed melee. Not unarmed, but melee nonetheless. Neutral is what you would except it to be in the game, any companion can easily support it as maxed melee is a monster regardless. Tech, obviously super fun, plenty of cool tech wea... Original Post: Arcanum on steam deck? User 1: Good evening, Don't know if this is still of interest to somebody. I bought my steam deck recently and being a +15years Arcanum lover as with all my new devices this one too had to run Arcanum smoothly for me to feel alright. With the help of what was written in previous comments I was able to find a way to apply the Unofficial Arcanum patch 2.02 and play the game DECENTLY AS INTENDED, here is how: Desktop Mode - Start by copying the game folder from steamapps/common/ folder to your document folder in dolphin - open steam and add the unofficial patch.exe that you previously downloaded as a non steam game. Once set use the properties button to force start this .exe with protongGE. - run the unofficial patch.exe on steam and when prompted by the popup window browse for a new path to the folder that you now have in the documents, select the arcanum folder inside the arcanum folder....it is what it is ( meaning you should have a path ending a... arcana fist damage spells Original Post: Most optimized brawler build. As title asks: how would you build a character with primary damage is their fists.My working thought is half-orc, half-orge or orge (if using unofficial patch with additional content). Traditional melee build though with early emphasis on strength given how slow fists can be.Now my dilemma is either staying purely neutral as the best gauntlets (for fist damage) are tech. However, there are spells that can improve fist damage such as harden fist spell and later elemental spells (which would require significant investment into Willpower)Thoughts? User 1: Tech is super fun, but Magick is super powerful. I played 3 melee type builds from start to finish: pure neutral maxed melee, teched-out maxed melee and magick maxed melee. Not unarmed, but melee nonetheless. Neutral is what you would except it to be in the game, any companion can easily support it as maxed melee is a monster regardless. Tech, obviously super fun, plenty of cool tech wea... Original Post: Nonsensical fatigue consumption. Magic seems to cost more or less fatigue than advertised in spell descriptions, specially things like harm which vary from costing 6-7 fatigue points to low as four points. Actually consuming five points is a rare occasion. I was not holding or casting other spells to account for maintenance, attacking or doing anything else that I am aware that consumes fatigue in the same turn and yet the spell amount apparently varies.Is there some obscure rule that I am not aware of or is that another Arcanum bug? User 1: The combat log should tell you, I haven’t played in a while but from memory there are a lot of mundane actions that will use fatigue. User 2: If any of your actions spend red dots, not just green - this will consume some fatigue. Make some fatigue limiters and forget about dangerous fatigue consumption almost entirely. And for emergencies have some crafted fatigue restorers as well. Yes mages can use them. Don't remember about apt ... arcana fist damage spells Original Post: Most optimized brawler build. As title asks: how would you build a character with primary damage is their fists.My working thought is half-orc, half-orge or orge (if using unofficial patch with additional content). Traditional melee build though with early emphasis on strength given how slow fists can be.Now my dilemma is either staying purely neutral as the best gauntlets (for fist damage) are tech. However, there are spells that can improve fist damage such as harden fist spell and later elemental spells (which would require significant investment into Willpower)Thoughts? User 1: Tech is super fun, but Magick is super powerful. I played 3 melee type builds from start to finish: pure neutral maxed melee, teched-out maxed melee and magick maxed melee. Not unarmed, but melee nonetheless. Neutral is what you would except it to be in the game, any companion can easily support it as maxed melee is a monster regardless. Tech, obviously super fun, plenty of cool tech wea... Original Post: A question for those who have PLAYED the Arcanum Demo.. I have asked this twice now, and both times I have failed to ask properly. Apologies for that, and fingers crossed that three times is the charm that I get it right this time:1) I am hoping that people who have PLAYED the official demo "Arcanum Version 55 {3-13-01)" will reply with their experience playing it. 2) I am hoping to know if they PLAYED it before and/or after the full version 3) And if they found anything notable about their PLAYING experience And now to answer all other comments and questions that have been somehow implied in my first two attempts? * Yes, I own the full version, and on original disk * Yes, I am fully patched to 1.0.7.4 * No, I don't wish the Steam or GoG version as well * Yes, I have tried other mods (all of them) * Yes, I have (and know where to get) the official demo version "Arcanum Version 55 {3-13-01)" * No, I don't wish a... - Loss: GISTEmbedLoss with these parameters:
{ "guide": "SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')", "temperature": 0.07, "margin_strategy": "absolute", "margin": 0.0, "contrast_anchors": true, "contrast_positives": true, "gather_across_devices": false }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 16num_train_epochs: 1warmup_steps: 0.1gradient_accumulation_steps: 2per_device_eval_batch_size: 16eval_on_start: Trueload_best_model_at_end: Truebatch_sampler: no_duplicates
All Hyperparameters
per_device_train_batch_size: 16num_train_epochs: 1max_steps: -1learning_rate: 5e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 2average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Falsefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 16prediction_loss_only: Trueeval_on_start: Trueeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Trueignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Nonedataloader_multiprocessing_context: Nonedataloader_in_order: Trueremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonelocal_rank: -1prompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}warmup_ratio: None
Training Logs
| Epoch | Step | Training Loss | Validation Loss | val-hard-negatives_cosine_ndcg@10 |
|---|---|---|---|---|
| 0 | 0 | - | 1.9355 | 0.8946 |
| 0.1761 | 100 | 0.7447 | 0.4546 | 0.8974 |
| 0.3521 | 200 | 0.3567 | 0.4033 | 0.9027 |
| 0.5282 | 300 | 0.2488 | 0.3406 | 0.9052 |
| 0.7042 | 400 | 0.1579 | 0.332 | 0.9086 |
| 0.8803 | 500 | 0.1225 | 0.3381 | 0.9057 |
| 1.0 | 568 | - | 0.3428 | 0.9038 |
- The bold row denotes the saved checkpoint.
Training Time
- Training: 3.3 hours
Framework Versions
- Python: 3.13.16
- Sentence Transformers: 6.2.0
- Transformers: 5.20.2
- PyTorch: 2.11.0+cu130
- Accelerate: 1.15.0
- Datasets: 4.8.5
- Tokenizers: 0.23.3
Additional Resources
- Training and Finetuning Embedding Models with Sentence Transformers: the end-to-end guide for training or finetuning Sentence Transformer models.
- Introduction to Matryoshka Embedding Models: variable-size embeddings that can be truncated with minimal quality loss.
- Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval: post-training compression of embedding vectors.
- Multimodal Embedding & Reranker Models with Sentence Transformers: use text, image, audio, and video models through the same API.
- Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers: train multimodal embedding models, with a Visual Document Retrieval walkthrough.
Citation
BibTeX
Sentence Transformers
@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",
}
GISTEmbedLoss
@misc{solatorio2024gistembed,
title={GISTEmbed: Guided In-sample Selection of Training Negatives for Text Embedding Fine-tuning},
author={Aivin V. Solatorio},
year={2024},
eprint={2402.16829},
archivePrefix={arXiv},
primaryClass={cs.LG}
}