Instructions to use SriRamanaAtmic/AtmicQuoterv3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use SriRamanaAtmic/AtmicQuoterv3 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("SriRamanaAtmic/AtmicQuoterv3") sentences = [ "Represent this sentence for searching relevant passages: moon water reflection analogy Ramana teachings on Self", "The mind is like the moon, deriving its light of consciousness from the Self, which thus resembles the Sun", "Sri Ramanasramam never charged for Bhagavan’s Darshan (seeing him) or for his teachings.", "Verse 14: Even to the distinctionless you, distinctions... appear even as the movements of water are mistaken for the dance of the still moon.", "Verse 8: Like bubbles rising on the surface of the waters of the ocean, all the worlds arise from, stay in and resolve into the Supreme Being." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [5, 5] - Notebooks
- Google Colab
- Kaggle
AtmicQuoterv3
Fine-tuned from BAAI/bge-small-en-v1.5 (MultipleNegativesRankingLoss, 3 epochs, batch size 16,
lr 2e-5) on the combined AtmicQuoterv1 + AtmicQuoterv3 training data, for exact-citation
retrieval over Sri Ramana Maharshi's teachings. Queries are encoded with the BGE query
instruction (Represent this sentence for searching relevant passages: ); passages are not.
Benchmark: base vs. AtmicQuoterv3 (alone vs. hybrid BM25)
Validation set: 1,006 queries (48 from the root validation.jsonl + 958 from AtmicQuoterv1's
validation split). Corpus: 8,742 unique passages (AtmicQuoterv1's corpus and the full
citation/RAG_citation.json corpus, after the text normalization described below).
"alone" = dense retrieval only, ranking the full corpus. "hybrid BM25" = AtmicQuoterv3 blended with BM25 (0.7 model / 0.3 BM25, min-max normalized per query), no reranker.
| metric | base (bge-small) alone | AtmicQuoterv3 alone | AtmicQuoterv3 + hybrid BM25 |
|---|---|---|---|
| accuracy@1 | 0.3201 | 0.5447 | 0.5746 |
| recall@3 | 0.4284 | 0.7346 | 0.7604 |
| recall@5 | 0.4821 | 0.7903 | 0.8131 |
| recall@10 | 0.5537 | 0.8400 | 0.8618 |
| mrr@3 | 0.3693 | 0.6307 | 0.6584 |
| mrr@10 | 0.3911 | 0.6503 | 0.6771 |
| ndcg@3 | 0.3845 | 0.6575 | 0.6847 |
| ndcg@10 | 0.4298 | 0.6967 | 0.7223 |
| map@100 | 0.3991 | 0.6551 | 0.6811 |
Training data
Sources (5,655 training rows): AtmicQuoterv1's training set (3,830 rows) + AtmicQuoterv3's
training set (1,825 rows: layer2 rows whose positive contains a citation/RAG_citation.json chunk
verbatim, plus root book/page-cited rows; negatives are hard negatives mined from the corpus).
Text normalization applied to every chunk (train positives/negatives, validation positives,
corpus): the leading [source tag] block is removed and the trailing | Topics: ... metadata
is removed, e.g. Verse 30: All ego gone, ... the Self. | Topics: ego-extinction, self-abidance
becomes Verse 30: All ego gone, ... the Self.. Whitespace is normalized and exact duplicates are
dropped.
Format: JSON Lines, one training example per line, with three negatives per row. At training
time query becomes the anchor (BGE query instruction prepended), pos[0] the positive and neg[0..2]
the negatives.
Training record from AtmicQuoterv1:
{"query": "What is Jnana according to Ramana Maharshi?", "pos": ["This knowledge that there is nothing but God or the Self... is Jnana"], "neg": ["Verse 30: All ego gone, Living as That alone Is penance good for growth, Sings Ramana, the Self.", "Bhagavan Sri Ramana Maharshi, born Venkataraman Iyer, was the second of four children born to a devout family in Tiruchuzhi, Tamil Nadu, India.", "Everything happens according to each individual’s karma"], "register": null}
Training record from AtmicQuoterv3 (register marks the v3 rows; v1 rows have null):
{"query": "What is Bhakti & Jnana? Are they two different or Interrelated?", "pos": ["Since God is verily the Self, love of the Self is love of God; and that is bhakti"], "neg": ["Jnana and bhakti are thus one and the same", "Bhakti is jnana mata", "In that state bhakti is no other than jnana, jnana nothing else but bhakti"], "register": "v3_train"}
Validation record (query + gold passage pos) and corpus record (id is a hash of the
normalized text):
{"query": "What should I focus on whenever I have free time during the day?", "pos": ["The Self is the real book, you can glance anywhere in that book; nobody can take it away from you. Whenever you are free turn toward the Self. Thereafter you may read whatever you like."]}
{"id": "p_...", "text": "Everything happens according to each individual’s karma"}
SentenceTransformer based on BAAI/bge-small-en-v1.5
This is a sentence-transformers model finetuned from BAAI/bge-small-en-v1.5. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for retrieval.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: BAAI/bge-small-en-v1.5
- Maximum Sequence Length: 128 tokens
- Output Dimensionality: 384 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': 'BertModel'})
(1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'cls', 'include_prompt': True})
(2): Normalize({})
)
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("sentence_transformers_model_id")
# Run inference
queries = [
'Represent this sentence for searching relevant passages: unstable soul notion how to rest in silence Ramana',
]
documents = [
'The notion ‘I am an unstable soul’ has arisen by letting go one’s immovable Nature. The sadhaka should cast off this notion and rest in the Supreme Silence',
'There is no audio recording of Bhagavan Sri Ramana Maharshi. When devotees suggested broadcasting his voice, he replied that his “voice is silence” and could not be captured on a medium.',
'Everything appears to be the same for the Realized Soul',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 384] [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.6570, 0.2615, 0.2363]])
Evaluation
See "Benchmark: base vs. AtmicQuoterv3" above.
Bias, Risks and Limitations
What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->
Training Details
Training Dataset
- Size: 5,655 training samples (see "Training data" above for the format and example records)
- Columns:
anchor,positive,negative_1,negative_2, andnegative_3 - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim", "gather_across_devices": false, "directions": [ "query_to_doc" ], "partition_mode": "joint", "hardness_mode": null, "hardness_strength": 0.0 }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 16learning_rate: 2e-05warmup_steps: 0.1weight_decay: 0.01load_best_model_at_end: True
All Hyperparameters
Click to expand
per_device_train_batch_size: 16num_train_epochs: 3.0max_steps: -1learning_rate: 2e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_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: 8prediction_loss_only: Trueeval_on_start: Falseeval_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: Noneremove_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: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}
Training Time
- Training: 18.1 minutes
- Evaluation: 1.1 minutes
- Total: 19.2 minutes
Framework Versions
- Python: 3.11.9
- Sentence Transformers: 5.6.0
- Transformers: 5.12.1
- PyTorch: 2.12.1
- Accelerate: 1.14.0
- Datasets: 5.0.0
- Tokenizers: 0.22.2
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",
}
MultipleNegativesRankingLoss
@misc{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}
- Downloads last month
- 465
Model tree for SriRamanaAtmic/AtmicQuoterv3
Base model
BAAI/bge-small-en-v1.5