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")
# Run inference
queries = [
'mrs morgan character guide',
]
documents = [
'Mrs. Morgan. Mrs. Morgan. Quest NPC to start Free J.T. Morgan quest',
'Character background. Super Model. Character background. Super Model. Available to all females, regardless of race. You are a stunningly gorgeous woman, and you have been pampered and coddled all of your life. You gain a tremendous bonus to Beauty (+6) at the cost of Strength (-2) and Intelligence (-4). BE +6 / ST -2 / IN -4',
'Slim Pickens. Slim Pickens. Slim Pickens is the general store of the town of Shrouded Hills. Gallery. TBA. See also. Shrouded Hills Inn - A tavern and accomodation in Shrouded Hills. Ristezze Imported Goods - Fancier goods and hardware shop in Shrouded Hills. General stores',
]
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.6870, 0.3428, 0.0939]])
Evaluation
Metrics
Information Retrieval
- Dataset:
val-hard-negatives - Evaluated with InformationRetrievalEvaluator
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.7997 |
| cosine_accuracy@3 | 0.9303 |
| cosine_accuracy@5 | 0.9599 |
| cosine_accuracy@10 | 0.9808 |
| cosine_precision@1 | 0.7997 |
| cosine_precision@3 | 0.3101 |
| cosine_precision@5 | 0.192 |
| cosine_precision@10 | 0.0981 |
| cosine_recall@1 | 0.7997 |
| cosine_recall@3 | 0.9303 |
| cosine_recall@5 | 0.9599 |
| cosine_recall@10 | 0.9808 |
| cosine_ndcg@10 | 0.8943 |
| cosine_mrr@10 | 0.8659 |
| cosine_map@100 | 0.8668 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 17,620 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: 5 tokensmean: 7.85 tokensmax: 12 tokens min: 57 tokensmean: 270.38 tokensmax: 790 tokens min: 14 tokensmean: 416.02 tokensmax: 1008 tokens - Samples:
anchor positive negative how to learn spells Spell Colleges. See also. Spell Colleges. See also. Magick - for info about the mechanics of spells, and magick in general Scrolls - for info about single-use consumable items which cast a specific spell when used Tulla - for details about the mage city and instructions on mastering a college of Magick Books - for lore about Magick Technical Manuals. Technical Manuals. Technical Manuals are items which increase the character's specific technological discipline aptitude proportional to their Intelligence as long as they are in the character's inventory. Each manual weighs 200 stones. The bonus to a specific technological discipline is cumulative, meaning that it is possible to have multiple copies of the same type of technical manual in the inventory for a greater bonus. It is recommended to drink an Intellect (Intelligence) Potion before placing a manual in the inventory so the bonus is even greater. You can check your aptitude in a specific technological discipline in the character panel. If it is lower than it should be after, for example, drinking an Intelligence Potion, try dropping the manual and picking it up again. This should apply the proper bonus. Characters with the Idiot Savant background will gain 1 point of expertise per manual, regardless of their Intelligence. This may be a bug, as the Idiot Savan... how to learn spells Spell Colleges. See also. Spell Colleges. See also. Magick - for info about the mechanics of spells, and magick in general Scrolls - for info about single-use consumable items which cast a specific spell when used Tulla - for details about the mage city and instructions on mastering a college of Magick Books - for lore about Magick Spell Colleges. Air. Spell Colleges. Air. Vitality of Air Minimum requirements: Level 1, WP 6 Energy: 5 (1/10 seconds) Stackable: Yes Target gains +4 to Constitution, regardless of its or the caster's Magickal Aptitude. Poison Vapours Minimum requirements: Level 1, WP 9 Energy: 10 (5/10 seconds) Resisted by: Constitution Creates a cloud of poisonous vapours concentrated around the target. Any creature other than the caster and his followers will get 15-50 PD, depending on the Magickal Aptitude of the caster. Call Winds Minimum requirements: Level 5, WP 12 Energy: 15 Resisted by: Constitution -5 Causes wind gusts to flow from the caster in all directions, pushing away all nearby creatures and dealing damage if they hit a nearby object or wall. Body of Air Minimum requirements: Level 10, WP 15 Energy: 25 (2/10 seconds) This spell transforms the body of a target into the air, making it transparent. Call Air Elemental Minimum requirements: Level 15, WP 18 Energy: 50 (5/10 seconds) Summons ... how to learn spells Spell Colleges. See also. Spell Colleges. See also. Magick - for info about the mechanics of spells, and magick in general Scrolls - for info about single-use consumable items which cast a specific spell when used Tulla - for details about the mage city and instructions on mastering a college of Magick Books - for lore about Magick Bow. Bow. For Weapons, see Bows The Bow Skill is the knack of using a classic bow weapon, be the bow short or long. Bow level is dependent upon your Dexterity (DX). Training. Bow Apprentice: The Speed of the Character with a bow is increased by 5 Trainer: any Elite Bow Guard in (Dernholm) Trainer: the Halfling Guard in Shrouded Hills Trainer: the general guards of other cities, towns, and villages. Bow Expert: The Character deals two attacks per arrow Trainer: any Elite Bow Captain (Dernholm or Caladon). Bow Master: The Character's chance of success is unaffected by range penalties Trainer: Kietzel Pierce (Anabelle's Galley in Black Root, later in Caladon) Quest: Find the Bow of Ecclesiastes. Uses. Bows require Arrows for ammunition Bows are used to deal damage at distance Enemies can often be killed before they can reach the player to engage in Melee Objects like lights (to help with Prowling) and locked items can also be destroyed. Modifiers to Bow. Items: Helmet of Yzar's Cost: give... - 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,294 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: 6 tokensmean: 9.12 tokensmax: 12 tokens min: 20 tokensmean: 394.19 tokensmax: 941 tokens min: 51 tokensmean: 433.76 tokensmax: 941 tokens - Samples:
anchor positive negative spell like dominate will but stronger Elixir of Hypnotic Suggestion. Elixir of Hypnotic Suggestion. The Elixir of Hypnotic Suggestion Schematic can be found in the Closed Sewers of Tarant (northwest corner). Expertise. Requires an expertise of 56 in Therapeutics Requires an expertise of 85 in Chemistry. Ingredients. Elixir of Persuasion + Hallucinite Elixir of Persuasion is the first degree in Therapeutics Hallucinite is the fifth degree in Chemistry. Effects. One unit can be obtained per unit of both components The target falls under the player's control as a temporary follower The follower has slave dialogue The effect last for about one hour The target will become hostile when the effect wears off. Used as an ingredient for:. None. Notes. The device is similar to the Dominate Will Spell except that it cannot be resisted. Item Page Shrink. Shrink. Shrink is the third spell in the college of Morph. Uses. This spell reduces a creature to half its size. Limitations. The only real practical use for this spell is for median and large race characters to be able to do the Clear the Halfling Gang Quest. Additional Sources. Scrolls are sold at Magick Shops. Mechanics. The target's sprite size is reduced. The target's speed is reduced. If the target is the player, then they can access special dialogue options where those exist (usually mocking in nature). Bonuses. Passing the Mastery Test of The Mistress of Morph in Tulla will reduce the casting cost by half. spell like dominate will but stronger Elixir of Hypnotic Suggestion. Elixir of Hypnotic Suggestion. The Elixir of Hypnotic Suggestion Schematic can be found in the Closed Sewers of Tarant (northwest corner). Expertise. Requires an expertise of 56 in Therapeutics Requires an expertise of 85 in Chemistry. Ingredients. Elixir of Persuasion + Hallucinite Elixir of Persuasion is the first degree in Therapeutics Hallucinite is the fifth degree in Chemistry. Effects. One unit can be obtained per unit of both components The target falls under the player's control as a temporary follower The follower has slave dialogue The effect last for about one hour The target will become hostile when the effect wears off. Used as an ingredient for:. None. Notes. The device is similar to the Dominate Will Spell except that it cannot be resisted. Item Page Elixir of Physical Prowess. Elixir of Physical Prowess. This schematic is learned when you the acquire the Second Degree in the Therapeutics discipline. Ingredients. Spirit of Camphor + Famous Blood Pills Components are purchased from General Stores and Herbalists. Effects. Three elixirs can be obtained per unit of both components Gives +2 Strength (temporary, unstackable). Used In. Energizer Muscle Maker Vivifier. Item Page spell like dominate will but stronger Elixir of Hypnotic Suggestion. Elixir of Hypnotic Suggestion. The Elixir of Hypnotic Suggestion Schematic can be found in the Closed Sewers of Tarant (northwest corner). Expertise. Requires an expertise of 56 in Therapeutics Requires an expertise of 85 in Chemistry. Ingredients. Elixir of Persuasion + Hallucinite Elixir of Persuasion is the first degree in Therapeutics Hallucinite is the fifth degree in Chemistry. Effects. One unit can be obtained per unit of both components The target falls under the player's control as a temporary follower The follower has slave dialogue The effect last for about one hour The target will become hostile when the effect wears off. Used as an ingredient for:. None. Notes. The device is similar to the Dominate Will Spell except that it cannot be resisted. Item Page Mental Inhibitor. Mental Inhibitor. The Mental Inhibitor Schematic can be found in the Black Mountain Clan Mines. Expertise. Requires an expertise of 70 in Chemistry Requires an expertise of 85 in Therapeutics. Ingredients. Corrosive Acid + Mind Marvel Corrosive acid is the fourth degree in Chemistry Corrosive acid is also sold in Inventor Shops Mind Marvel is the fifth degree in Therapeutics. Effects. One unit can be obtained per unit of both components Temporarily reduces the target's Willpower by one half. Used as an ingredient for:. None. Notes. Similar to the spell Drain Will The effect cannot be resisted. Item Page - 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: 1.5warmup_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: 1.5max_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.9507 | 0.8903 |
| 0.1815 | 100 | 0.7965 | 0.4463 | 0.8926 |
| 0.3630 | 200 | 0.3795 | 0.3983 | 0.9020 |
| 0.5445 | 300 | 0.2566 | 0.3759 | 0.8973 |
| 0.726 | 400 | 0.1918 | 0.357 | 0.9059 |
| 0.9074 | 500 | 0.1295 | 0.3644 | 0.8954 |
| 1.0889 | 600 | 0.0907 | 0.3645 | 0.8926 |
| 1.2704 | 700 | 0.0616 | 0.3454 | 0.8929 |
| 1.4519 | 800 | 0.0559 | 0.3500 | 0.8936 |
| 1.5009 | 827 | - | 0.3496 | 0.8943 |
- The bold row denotes the saved checkpoint.
Training Time
- Training: 2.2 hours
Framework Versions
- Python: 3.13.15
- Sentence Transformers: 6.2.0
- Transformers: 5.20.1
- 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}
}