/ Модель

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

Контекст
1 024 токена
Лицензия
CC BY-NC 4.0
Архитектура
ogma · dense
Библиотека
ogma
Опубликована
23 апр 2026

ogma-base

Сходство предложенийТекст → score10 профессий

Компактная англоязычная модель Ogma Base создаёт эмбеддинги для семантического поиска, RAG и других задач сравнения и извлечения текста.

145скачиваний за 30 дней1лайквеса обновлены22 июл 2026

Бенчмарки

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

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

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

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

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

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

Ogma Base — компактная англоязычная модель для создания текстовых эмбеддингов, разработанная авторами семейства Ogma. Это плотная модель с 13,3 млн параметров и контекстом до 1024 токенов; она поддерживает симметричное кодирование и Matryoshka-размерности 256, 128, 64 и 32. В README указана средняя оценка 57,02 на 66 англоязычных задачах MTEB.

Модель предназначена для семантического поиска, извлечения документов в RAG, векторного поиска, кластеризации, классификации, оценки сходства предложений и памяти агентных систем. Небольшой размер позволяет развертывать её локально и использовать на CPU. Она не генерирует текст и рассчитана на английский язык; для задач парного ранжирования в README отмечено отставание от MiniLM-L6-v2.

Доступны форматы ONNX и safetensors. Лицензия CC-BY-NC-4.0 ограничивает коммерческое использование; для него требуется отдельная лицензия или переобучение на подходящей модели-учителе.

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

  • семантический поиск по документам
  • поиск релевантных фрагментов для RAG
  • локальный сервис эмбеддингов для конфиденциальных текстов
  • кластеризация текстов по смыслу
  • классификация текстов с помощью эмбеддингов
  • сходство и сопоставление предложений
  • память агента с поиском по длинным фрагментам

Ограничения

Модель работает с английским текстом и не предназначена для генерации текста. В README также отмечено отставание в задачах парного ранжирования и ограничение лицензии CC-BY-NC-4.0 на коммерческое использование.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

ogma-base  ·  13.3M efficient text embedding model  ·  MTEB 57.02

High-quality English text embedding model for semantic search, RAG, vector search, retrieval, clustering, classification, STS, and agent memory — MTEB 57.02, 13.3M parameters, 1024-token context

Ogma Base is the quality-first mid-size model in the Ogma family. At 13.3M parameters it scores 57.02 MTEB in our canonical 66-task Ogma paper results, using only 59% of MiniLM-L6-v2's parameters and handling 4× longer input sequences (1024 vs 256 tokens). The sweet spot for quality-first RAG pipelines and agent memory.

Why the name Ogma?

Ogma is named after Ogma (also written Oghma), the Irish god associated with eloquence and credited in myth with inventing Ogham, an early alphabet for encoding language into symbols. That is the core job of an embedding model: turn language into compact vectors that machines can search, compare, cluster, and reason over.


Use cases

ogma-base is the quality-first Ogma model for semantic search, RAG retrieval, agent memory, vector databases, document retrieval, text classification, clustering, STS / sentence similarity, and retrieval-heavy agent pipelines. It is aimed at users who want better quality than MiniLM-class models while keeping the model small enough for practical CPU deployment.

Good fits:

  • Production RAG and enterprise search where retrieval quality matters but the model still needs to be lightweight.
  • Local or private embedding services for teams that want to avoid external embedding APIs for sensitive text.
  • Agent memory systems with long context chunks, symmetric query/document encoding (SYM everywhere, or QRY/QRY), and frequent retrieval.
  • Efficient CPU deployments where 13.3M parameters is easier to host than larger embedding transformers.
  • Classification, clustering, and routing features where embedding quality directly affects downstream decisions.

Choose ogma-base when you want the strongest general-purpose Ogma model before moving into larger, accuracy-first territory.


Highlights

  • 🏆 MTEB avg 57.02 — canonical Ogma paper result over 66/66 MTEB English tasks
  • 📏 1024-token context — 4× longer than all-MiniLM-L6-v2 (256 tokens)
  • 🔀 Symmetric routing via task tokens — encode everything with [SYM], or use [QRY]/[QRY] for retrieval (queries and documents both encoded with task="qry"); benchmark both routes on your task
  • 📐 Matryoshka dims: [256, 128, 64, 32] — one model, any precision
  • 🛡️ +4.0% F1 on prompt injection detection vs MiniLM (same architecture series)

Performance

MTEB English — 66/66 tasks (category-averaged)

Benchmarked with MTEB v2.10.7 on the standard 66-task English benchmark using category averaging (same methodology as the MTEB leaderboard).

Categoryogma-baseall-MiniLM-L6-v2Δ vs MiniLM
Classification67.7462.62+5.12
Clustering41.4941.94-0.45
PairClassification83.7382.37+1.36
Reranking51.2558.04-6.79
Retrieval42.3641.95+0.41
STS82.8478.90+3.94
Summarization29.7330.81-1.08
Overall57.0256.09+0.93

Why choose Ogma Base?

ogma-base is the recommended choice when you want a strong quality/size tradeoff without going to full transformer scale (bge, e5). It is MiniLM-class on the external comparison line while being smaller and context-aware.

Safety — Toxicity & Prompt Injection Detection

Evaluated on the Ogma transformer architecture (same family). Embeddings are extracted then fed to a logistic regression (LR) or MLP classifier head — the embedding model itself is not fine-tuned. Evaluated against all-MiniLM-L6-v2 as baseline.

1. Jigsaw Toxic Comment Classification

Dataset: Arsive/toxicity_classification_jigsaw — Binary toxicity classification Train: 25,960 · Test: 6,490

ModelClassifierAccuracyF1PrecisionRecallAUC-ROC
OgmaLogReg89.12%88.26%89.09%87.44%95.74%
OgmaMLP88.91%87.98%89.14%86.85%95.92%
MiniLMLogReg87.32%86.25%87.46%85.07%94.96%
MiniLMMLP91.71%91.24%90.13%92.39%97.16%

Ogma (LR) leads MiniLM (LR) by +2.01% F1. MiniLM (MLP) leads on this dataset — the additional training data (25K samples) allows the MLP to compensate for MiniLM's slightly weaker base representations.

2. Prompt Injection Detection — deepset/prompt-injections

Dataset: deepset/prompt-injections — Binary injection detection Train: 546 · Test: 116 (low-data regime)

ModelClassifierAccuracyF1PrecisionRecallAUC-ROC
OgmaLogReg86.21%84.62%100.0%73.33%97.77%
OgmaMLP90.52%90.27%96.23%85.0%98.1%
MiniLMLogReg82.76%80.39%97.62%68.33%94.52%
MiniLMMLP87.07%86.24%95.92%78.33%93.96%

Ogma leads across both classifiers: +4.03% F1 (MLP), +4.23% F1 (LogReg). Ogma's representations are better separated in the low-data regime — it achieves 100% precision with LogReg, meaning zero false positives.

3. Prompt Injection Detection — neuralchemy/Prompt-injection-dataset

Dataset: neuralchemy/Prompt-injection-dataset — Binary injection detection Train: 4,391 · Test: 942

ModelClassifierAccuracyF1PrecisionRecallAUC-ROC
OgmaLogReg95.22%95.93%95.84%96.01%99.30%
OgmaMLP95.44%96.16%94.89%97.46%99.37%
MiniLMLogReg94.59%95.38%95.46%95.29%98.92%
MiniLMMLP93.95%94.85%94.59%95.11%98.92%

Ogma leads across all metrics: +0.78% F1 (MLP), +0.55% F1 (LR). Both models perform well at scale; Ogma maintains its edge and achieves higher AUC-ROC (99.37% vs 98.92%).

Summary

TaskOgma best F1MiniLM best F1Δ
Jigsaw Toxicity88.26% (LR)91.24% (MLP)−2.98%
deepset Injection90.27% (MLP)86.24% (MLP)+4.03%
neuralchemy Injection96.16% (MLP)95.38% (LR)+0.78%

Ogma is a stronger feature extractor for prompt injection detection — the safety-critical task for agent pipelines. MiniLM edges ahead on toxicity when given sufficient labelled data and a more powerful classifier head. For agentic use cases where detecting adversarial instructions is the priority, Ogma representations are the better choice.

Architecture

PropertyValue
ArchitectureCustom Transformer
Internal dim (d_model)256
Output dim (d_output)256
Transformer layers12
Attention heads4
Vocabulary30,000 (SentencePiece / AlbertTokenizer)
Max sequence length1,024 tokens
PoolingMean pooling
Task tokens[QRY] (query), [DOC] (document), [SYM] (symmetric)
Matryoshka dims[32, 64, 128, 256]
Output normalisationL2 (unit sphere)
Parameters13.3M
Model filemodel.safetensors (51 MB)

Key design choices:

  • Task token prepend: A learnable task token ([QRY], [DOC], or [SYM]) is prepended to the input sequence before the transformer. Recommended inference route: [QRY]/[QRY] — encode both queries and documents with [QRY]; this benchmarked highest on MTEB. [SYM] everywhere is the next-best symmetric alternative. We do not recommend [DOC] at inference time — it is exposed for downstream fine-tuning, not as an asymmetric query/document route.
  • Matryoshka training: The model is trained with Matryoshka Representation Learning, meaning embeddings truncated to any supported sub-dimension remain well-calibrated without retraining.
  • Mean pooling: The average of all token outputs (excluding padding) produces the sentence embedding, which consistently outperforms CLS-token pooling in the Ogma architecture family.
  • L2 normalisation: All outputs are unit-normalised; cosine similarity == dot product == euclidean similarity (up to a constant), simplifying downstream usage.

Usage

Installation

pip install torch tokenizers transformers huggingface_hub

Basic Encoding

from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("axiotic/ogma-base", trust_remote_code=True).eval()
tok   = AutoTokenizer.from_pretrained("axiotic/ogma-base", trust_remote_code=True)

sentences = [
    "The quick brown fox jumps over the lazy dog",
    "A fast auburn vulpine leaps over an idle canine",
    "The capital of France is Paris",
]
emb = model.embed(sentences, task="sym", tokenizer=tok)
# emb.shape → (256,) per sentence, L2-normalised

sim = (emb[0] @ emb[1]).item()   # cosine sim == dot product (L2-normalised)
print(f"paraphrase: {sim:.4f}")

task="sym" is a safe default for all similarity tasks (STS, clustering, classification) and for retrieval. Ogma is trained for symmetric routing — queries and documents are always encoded with the same task token. The two recommended routes are:

  1. [SYM] for everything (the safe default above), or
  2. [QRY]/[QRY] — encode both queries and documents with task="qry".

Try both on your downstream task; either can win depending on the data, and [QRY]/[QRY] is the natural starting point when fine-tuning a classifier or retrieval head on top of the embeddings.

Retrieval

Encode queries and documents with the same task token. Below we show the [QRY]/[QRY] route — both calls use task="qry". This is intentional (Ogma is symmetric, not asymmetric); swap in task="sym" to compare the SYM route on your data.

from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("axiotic/ogma-base", trust_remote_code=True).eval()
tok   = AutoTokenizer.from_pretrained("axiotic/ogma-base", trust_remote_code=True)

queries = ["What is knowledge distillation?"]
docs = [
    "Knowledge distillation trains a smaller student model to mimic a larger teacher.",
    "The Eiffel Tower is in Paris, France.",
]

q = model.embed(queries, task="qry", tokenizer=tok)   # (256,) per query  — symmetric: both sides use qry
d = model.embed(docs,    task="qry", tokenizer=tok)   # (256,) per doc    — not a typo; Ogma is symmetric

scores = (q @ d.T).squeeze(0)   # cosine sim (L2-normalised, dot == cosine)
print(scores.tolist())          # [higher, lower] — first doc is relevant

Matryoshka — Flexible Dimensionality

Ogma is trained with Matryoshka Representation Learning. Slice and re-normalise to any supported sub-dimension with no retraining:

import torch, torch.nn.functional as F
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("axiotic/ogma-base", trust_remote_code=True).eval()
tok   = AutoTokenizer.from_pretrained("axiotic/ogma-base", trust_remote_code=True)

emb = model.embed(["hello world"], task="sym", tokenizer=tok)   # full 256d

for d in model.config.matryoshka_dims:
    sub = F.normalize(emb[:, :d], dim=-1)
    print(f"{d}d  norm={sub.norm(dim=-1).item():.4f}")

Model Family

ModelParamsSizeMTEB AvgClassClustPairClassRerankRetSTSSummd_outContext
ogma-large32.4M124 MB57.4168.641.684.053.143.783.730.92561024
ogma-base13.3M51 MB57.0267.7441.4983.7351.2542.3682.8429.732561024
ogma-small8.6M33 MB56.3266.4940.6982.9150.5142.0582.0029.592561024
ogma-mini3.5M14 MB53.0661.7737.3879.6647.3936.2177.7131.332561024
ogma-micro2.3M8.9 MB52.1859.5336.8878.6249.7433.0975.6331.771281024
all-MiniLM-L6-v222.7M87 MB56.0962.6241.9482.3758.0441.9578.9030.81384256
potion-base-32M32.0M123 MB51.2266.039.278.250.932.273.929.8256inf
potion-base-8M7.6M29 MB50.0364.4432.9376.6249.7331.7173.2429.28256inf

All Ogma: MTEB 2.10.7, 66-task standard English set, category-averaged. MiniLM/Potion: published scores from the Model2Vec results page.


Training Details

PropertyValue
Teacher modeljinaai/jina-embeddings-v5-text-small (CC-BY-NC-4.0)
Training paradigmKnowledge distillation from cached teacher embeddings
Training data~7M curated English sentence pairs
TokenizerAlbertTokenizer (SentencePiece, vocab=30,000)
Embedding initialisationPCA of teacher embeddings (128d) projected to d_model
LossDistillation + contrastive (balanced schedule)
Evaluation frameworkMTEB 2.10.7

Limitations

  • No text generation. Ogma is an encoder-only embedding model.
  • English only. Training data and evaluation are English-only.
  • Slower than static models. Transformer inference is 40-100× slower than static models (Potion, Model2Vec) on CPU. The trade-off: contextual understanding and 4× longer sequences.
  • Non-commercial licence. Due to distillation from a CC-BY-NC-4.0 teacher, Ogma inherits the NonCommercial restriction. Commercial use requires a separate Jina AI licence or retraining with a permissive teacher (Apache 2.0 compatible models like BGE or E5 can substitute at the cost of a full retraining run).
  • Reranking gap. Ogma lags behind MiniLM-L6-v2 on reranking tasks (category avg delta: -6.8). This is an architectural characteristic: the model optimises for semantic similarity and classification over pairwise ranking.

Licence & Attribution

This model is released under CC-BY-NC-4.0 (Creative Commons Attribution-NonCommercial 4.0 International).

Required attribution (must be included in all uses):

This model was trained via knowledge distillation from jina-embeddings-v5-text-small (https://huggingface.co/jinaai/jina-embeddings-v5-text-small) by Jina AI, licensed under CC-BY-NC-4.0.


Citation

@misc{ogma2026,
  title     = {Ogma: Efficient Dense Retrieval via Structured Embeddings},
  author    = {Axiotic AI},
  year      = {2026},
  url       = {https://huggingface.co/axiotic/ogma-base},
}

MTEB(eng, v2) — full 41-task results

Added 2026-07 — measured on the current 41-task MTEB(eng, v2) benchmark (subprocess-per-task harness, validated by reproducing minishlab/potion-base-8M at 0.5328 vs its official 53.33). The small-mteb numbers above use a 20-task subset and are not directly comparable.

meanClassClustPairClassRerankRetrievalSTSSumm
0.59820.72650.43390.83740.45730.41660.81550.3132

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

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

GPU в ailist

Универсальный рантайм · ogma

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
OgmaModel
Ревизия весов
0ef687d

0 моделей