SOFIA (SOFt Intel Artificial) is a cutting-edge sentence embedding model developed by Zunvra.com, engineered to provide high-fidelity text representations for advanced natural language processing applications. Leveraging the powerful sentence-transformers/all-mpnet-base-v2 as its foundation, SOFIA employs sophisticated fine-tuning methodologies including Low-Rank Adaptation (LoRA) and a dual-loss optimization strategy (cosine similarity and triplet loss) to excel in semantic comprehension and information retrieval.
Model Type: Sentence Transformer with Adaptive Projection Head
Base Model: sentence-transformers/all-mpnet-base-v2 (based on MPNet architecture)
Fine-Tuning Technique: LoRA (Low-Rank Adaptation) for parameter-efficient training
Loss Functions: Cosine Similarity Loss + Triplet Loss with margin 0.2
Projection Dimensions: 1024 (standard), 3072, 4096 (for different use cases)
Vocabulary Size: 30,522
Max Sequence Length: 384 tokens
Embedding Dimension: 1024
Model Size: ~110MB (base) + ~3MB (LoRA adapters)
License: Apache 2.0
Version: v1.0
Release Date: September 2025
Developed by: Zunvra.com
Architecture Overview
SOFIA's architecture is built on the MPNet transformer backbone, which uses permutation-based pre-training for improved contextual understanding. Key components include:
Pooling Layer: Mean pooling for sentence-level representations
LoRA Adapters: Applied to attention and feed-forward layers for efficient fine-tuning
Projection Head: Dense layer mapping to task-specific embedding dimensions
The dual-loss training (cosine + triplet) ensures both absolute similarity capture and relative ranking preservation, making SOFIA robust across various similarity tasks.
Intended Use
SOFIA is designed for production-grade applications requiring accurate and efficient text embeddings:
Semantic Search & Retrieval: Powering search engines and RAG systems
Text Similarity Analysis: Comparing documents, sentences, or user queries
Clustering & Classification: Unsupervised grouping and supervised intent detection
1import numpy as np
2from sentence_transformers import util
34query ='What is machine learning?'5corpus =['ML is a subset of AI.','Weather is sunny today.','Deep learning uses neural networks.']67query_emb = model.encode(query)8corpus_emb = model.encode(corpus)910similarities = util.cos_sim(query_emb, corpus_emb)[0]11best_match_idx = np.argmax(similarities)12print(f'Best match: {corpus[best_match_idx]} (score: {similarities[best_match_idx]:.3f})')
Clustering
python
1from sklearn.cluster import KMeans
23texts =['Apple is a fruit.','Banana is yellow.','Car is a vehicle.','Bus is transportation.']4embeddings = model.encode(texts)56kmeans = KMeans(n_clusters=2, random_state=42)7clusters = kmeans.fit_predict(embeddings)8print(clusters)# [0, 0, 1, 1]
JavaScript/Node.js Usage
javascript
1import{SentenceTransformer}from"sentence-transformers";23const model =awaitSentenceTransformer.from_pretrained("MaliosDark/sofia-embedding-v1");4const embeddings =await model.encode(["hello","world"],{normalize:true});5console.log(embeddings[0].length);// 1024
SOFIA is available on the Hugging Face Hub for easy integration:
python
1from sentence_transformers import SentenceTransformer
23# Load from Hugging Face Hub4model = SentenceTransformer('MaliosDark/sofia-embedding-v1')56# The model includes interactive widgets for testing7# Visit: https://huggingface.co/MaliosDark/sofia-embedding-v1