/ Модель

Характеристики

Контекст
8 192 токена
Параметры
150 млн
Лицензия
Apache 2.0
Архитектура
modernbert · dense
Базовая модель
MrBERT-es
Библиотека
sentence-transformers
Опубликована
23 апр 2026

ALIA-MrBERT-es-biomedical-embeddings

ЭмбеддингиТекст → embedding3 профессии

Биэнкодер на ModernBERT для создания эмбеддингов и семантического поиска по испанским биомедицинским текстам.

493скачиваний за 30 дней0лайковвеса обновлены17 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Эмбеддинги» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

ALIA MrBERT Spanish Biomedical Embeddings — разработанная исследовательской группой SINAI Университета Хаэна модель-биэнкодер для семантического поиска по испанским биомедицинским и медицинским текстам. Она создана дообучением двуязычной модели MrBERT-es на специализированных данных с помощью curriculum learning и подбора сложных негативных примеров.

Модель построена на ModernBERT с mean pooling и содержит около 149,6 млн параметров. Она преобразует текстовые запросы и документы в эмбеддинги для поиска и оценки семантического сходства; заявленная длина контекста — до 8192 токенов. Базовая модель поддерживает испанский и английский, а специализация этой версии — испанские биомедицинские тексты.

Это proof of concept для извлечения информации в испанской биомедицинской области. Качество следует проверять по официальным клиническим источникам и с участием специалистов; возможны ошибки на текстах вне предметной области и на специально сконструированных входах. Лицензия — Apache-2.0.

Сценарии применения

  • поиск медицинских документов по текстовому запросу на испанском
  • ранжирование биомедицинских текстов по релевантности запросу
  • поиск семантически похожих медицинских предложений
  • извлечение сведений из испаноязычных биомедицинских коллекций

Ограничения

Это proof of concept, предназначенный для поиска в испанской биомедицинской области; качество результатов нужно проверять по официальным клиническим источникам и с экспертами. Модель может ошибаться на текстах вне этой области и на специально сконструированных входах.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

ALIA MrBERT Spanish Biomedical Embeddings Model

This repository contains ALIA MrBERT Spanish Biomedical Embeddings, a Spanish biomedical domain bi-encoder model for semantic similarity and information retrieval tasks. It is built upon MrBERT-es, a bilingual (Spanish-English) foundational language model based on the ModernBERT architecture, and fine-tuned on domain-specific biomedical data using a Curriculum Learning strategy.

[!WARNING] DISCLAIMER: This model is a domain-specific proof-of-concept designed to demonstrate retrieval capabilities in the Spanish biomedical domain. While optimized for this domain, results should be verified against official clinical sources and expert judgment. The model may fail in out-of-domain or adversarial inputs.


Model Details

Model Lineage

ModernBERT (architecture)
       ↓
  MrBERT-es (BSC-LT)
  Bilingual ES/EN encoder
  150M parameters
       ↓
  ALIA-MrBERT-es-biomedical-embeddings (SINAI)
  Biomedical domain fine-tuning
  Curriculum Learning + Hard Negatives

Key Features

  • 🔍 Domain: Spanish biomedical and healthcare texts
  • 📐 Architecture: ModernBERT with Mean Pooling (bi-encoder)
  • 📏 Long context: up to 8,192 tokens
  • 🎓 Training strategy: Curriculum Learning (easy → medium → hard)
  • ⚙️ Negative mining: Positive-Aware Hard Negative Mining (NVIDIA approach)

Architecture

This model uses the same base architecture as MrBERT-es, extended with a Mean Pooling layer for sentence-level embeddings:

Base ArchitectureModernBERT
Total Parameters~150M
Hidden size768
Intermediate size1,152
Attention heads12
Hidden layers22
Context length8,192 tokens
Vocabulary size51,200
Precisionbfloat16
Positional encodingRoPE
Activation functionGeLU
Attention typeMixed (global every 3 layers + sliding window)
Pooling strategyMean Pooling

Training

Training Strategy: Curriculum Learning

The model was fine-tuned using a two-phase Curriculum Learning strategy and progressively increasing the difficulty of training examples thanks to SINAI/ALIA-es-biomedical-triplets/train:

PhaseEpochsNegative TypeDifficulty Progression
Phase 18Random negativesEasy → Medium → Hard
Phase 24Hard negatives (mined)Easy → Medium → Hard
Total12——

Phase 1 - Contrastive Learning with Random Negatives: Training uses triplets {query, relevant_doc, [irrelevant_docs]} with in-batch negatives. Examples are sorted by difficulty across 4 sub-phases (2 epochs each).

Phase 2 - Advanced Refinement with Hard Negatives: Refinement using mined hard negatives with Positive-Aware Mining (NVIDIA approach) to avoid false negatives. A candidate is only considered a negative if:

score < score_positive - margin   (margin = 0.05)

Hyperparameter Optimization

Before training, hyperparameter search was conducted using Optuna (20 trials, subsets of 5,000 examples):

  • Sampler: TPESampler (Tree-structured Parzen Estimator)
  • Pruner: MedianPruner
  • Storage: SQLite for trial persistence
HyperparameterSearch Space
Learning Rate[1×10⁻⁶, 5×10⁻⁵] (log-uniform)
Warmup Ratio[0.05, 0.2]
Weight Decay[0.0, 0.1]
Mini Batch Size{1, 4, 8, 12}

Final Training Hyperparameters

HyperparameterValueDescription
Learning Rate5×10⁻⁵Nominal learning rate
Batch Size128Global batch size
Cache Mini-Batch4For CachedMultipleNegativesRankingLoss
Warmup Ratio0.1595Linear LR warmup at start of each phase
Weight Decay0.02143L2 regularization
OptimizerAdamWStandard HuggingFace Trainer optimizer
Precisionbf16Bfloat16 for Ampere+ architectures
Max Sequence Length8,192Maximum tokens processed

Loss Function

  • CachedMultipleNegativesRankingLoss: Enables training with large batches without VRAM overflow, by recalculating embeddings in smaller sub-batches (cache size: 4).

Training Framework

ComponentDetails
Librarysentence-transformers
DistributedDDP (Distributed Data Parallel) via torchrun
Memory optimizationGradient Checkpointing
LoggingWandB (offline mode)

Intended Use

Direct Use

This model is designed for semantic similarity and information retrieval tasks in the Spanish biomedical domain. Primary use cases include:

  • Semantic search: Finding relevant biomedical documents from a query
  • RAG pipelines: Retrieving biomedical context for grounded question answering
  • Biomedical document clustering: Grouping similar biomedical texts by semantic content
  • Duplicate detection: Identifying semantically similar biomedical passages

Out-of-Scope Use

  • General-domain retrieval (model is specialized for biomedical Spanish)
  • Cross-lingual retrieval beyond Spanish
  • Use as a generative model (this is an encoder-only model)
  • Clinical decision support without human expert validation

How to Use

With sentence-transformers

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("SINAI/ALIA-MrBERT-es-biomedical-embeddings")

queries = ["¿Cuáles son los síntomas principales de la insuficiencia cardíaca?"]
documents = [
    "La insuficiencia cardíaca puede causar disnea, fatiga y edema periférico...",
    "El tratamiento inicial incluye control de la presión arterial y ajuste farmacológico...",
]

query_embeddings = model.encode(queries, prompt_name="query")
doc_embeddings = model.encode(documents)

scores = model.similarity(query_embeddings, doc_embeddings)
print(scores)

With transformers (manual)

import torch
from transformers import AutoTokenizer, AutoModel

model_name = "SINAI/ALIA-MrBERT-es-biomedical-embeddings"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModel.from_pretrained(model_name, trust_remote_code=True)

def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0]
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)

texts = ["¿Qué recomendaciones existen para el manejo de la hipertensión arterial?"]
encoded = tokenizer(texts, padding=True, truncation=True, return_tensors="pt")

with torch.no_grad():
    outputs = model(**encoded)

embeddings = mean_pooling(outputs, encoded["attention_mask"])
print(embeddings.shape)  # (1, 768)

Evaluation

The model was evaluated using the MTEB (Massive Text Embedding Benchmark) framework, adapted for the legal domain. The main reported metric is NDCG@10 (Normalized Discounted Cumulative Gain at k=10), which is the standard metric used in retrieval leaderboards and aligns with the metric reported in the MrBERT family.

An additional evaluation was made thanks to ragas evaluation framework and MiniMaxAI/MiniMax-M2.5 language model. These metrics are calculated by averaging on each pair puntuation from particular subsets of some of the following datasets.

Evaluation Datasets

DatasetCategoryDescription
QARetrievalSpanish subset of the MIRACL dataset in MTEB format (jinaai/miracl-es)
STSSTSCombination of three Spanish STS datasets: PAWS-X (google-research-datasets/paws-x), STS22 (mteb/sts22-crosslingual-sts), and SemRel2024 (SemRel/SemRel2024)
CoWeSeRetrievalGenerated open-ended questions from the CoWeSe corpus (chrisnb1/cowese-qa-dataset)
AbSanitasRetrievalSpanish biomedical information retrieval dataset built from biomedical texts collected from official academic repositories and open-access sources (BSC-LT/AbSanitas)
pairs1.5kRetrievalSubset of 1.5K biomedical evaluation pairs (query + passage) located in SINAI/ALIA-es-biomedical-triplets/test.
pairs3645RetrievalSubset of 3,645 biomedical evaluation pairs (query + passage) located in SINAI/ALIA-es-biomedical-triplets/test.

Results (NDCG@10)

ModelQASTSCoWeSeAbSanitaspairs1.5kpairs3645
BAAI/bge-m30.98390.46290.79740.76130.97750.9840
Qwen/Qwen3-Embedding-0.6B0.98690.50330.88070.81650.99210.9962
sentence-transformers/paraphrase-multilingual-mpnet-base-v20.94190.46320.72620.48700.78710.8212
ALIA-MrBERT-es-biomedical-embeddings (ours)0.96660.49320.85510.81240.98770.9966

BAAI/bge-m3 and Qwen/Qwen3-Embedding-0.6B are SOTA models with a size x4 larger than ours. Yet, our model shows comparable results.

Results (ragas)

Subset: triplets_queries1724_contexts3645 (pairs3645)

ModelContext Precision (avg)Context Utilization (avg)Context Relevance (avg)
Qwen/Qwen3-Embedding-0.6B0.95770.95820.9098
ALIA-MrBERT-es-biomedical-embeddings (ours)0.95880.95890.9102

Subset: cowese_queries661_contexts551

ModelContext Relevance (avg)
Qwen/Qwen3-Embedding-0.6B0.4231
ALIA-MrBERT-es-biomedical-embeddings (ours)0.3932

Subset: absanitas_queries800_contexts25192

ModelContext Relevance (avg)
Qwen/Qwen3-Embedding-0.6B0.9228
ALIA-MrBERT-es-biomedical-embeddings (ours)0.9156

Note: Each evaluation subset is named following the pattern {dataset}_queries{N}_contexts{M}, where N is the number of queries evaluated against M contexts taken from the datasets.


Limitations and Biases

Known Limitations

  • Domain specificity: The model is optimized for Spanish biomedical texts. Performance may degrade on general-domain or other specialized texts.
  • Language: Although MrBERT-es supports Spanish and English, this fine-tuned model focuses on Spanish biomedical content.
  • Clinical accuracy: Semantic similarity does not guarantee medical correctness. Retrieved documents should be verified by qualified healthcare professionals.
  • Context length: Despite supporting up to 8,192 tokens, very long documents may still require chunking strategies for optimal retrieval performance.

Biases

  • The model may reflect biases present in the biomedical corpora used for training.
  • It may underperform on subdomains underrepresented in the source data.

Additional Information

License

Apache License, Version 2.0

Citation

If you use this model in your research, please cite:

@misc{ALIA-MrBERT-es-biomedical-embeddings,
  title        = {ALIA MrBERT Spanish Biomedical Embeddings Model},
  author       = {SINAI Research Group, Universidad de Jaén},
  year         = {2026},
  publisher    = {HuggingFace},
  howpublished = {\url{https://huggingface.co/SINAI/ALIA-MrBERT-es-biomedical-embeddings}}
}

Please also cite the base model:

@misc{tamayo2026mrbertmodernmultilingualencoders,
      title={MrBERT: Modern Multilingual Encoders via Vocabulary, Domain, and Dimensional Adaptation}, 
      author={Daniel Tamayo and Iñaki Lacunza and Paula Rivera-Hidalgo and Severino Da Dalt and Javier Aula-Blasco and Aitor Gonzalez-Agirre and Marta Villegas},
      year={2026},
      eprint={2602.21379},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2602.21379}, 
}

Funding

This work is funded by the Ministerio para la Transformación Digital y de la Función Pública - Funded by EU – NextGenerationEU within the framework of the project ALIA.

Acknowledgments

This dataset has been generated thanks to CEATIC ( Centro de Estudios Avanzados en Tecnologías de la Información y de la Comunicación) – UJA (Universidad de Jaén) which provided the needed computational resources on its clusters.


Contact: ALIA Project - SINAI Research Group - Universidad de Jaén

More Information: SINAI Research Group | ALIA-UJA Project

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · sentence-transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertModel
Ревизия весов
95d6c92

0 моделей