/ Модель

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

Контекст
514 токенов
Параметры
33,5 млн
Лицензия
Apache 2.0
Архитектура
roberta · dense
Библиотека
sentence-transformers
Опубликована
4 дек 2024

granite-embedding-30m-english

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

Компактная англоязычная модель IBM для создания текстовых эмбеддингов, семантического поиска и извлечения документов, включая поиск по истории диалога в версии r1.1.

49 797скачиваний за 30 дней33лайкавеса обновлены22 авг 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

  • RARbMath

    main_score

    Результат

    0,7889

    MTEB

    Публичная таблицадругая ревизия

  • AfriSentiClassification

    main_score

    Результат

    0,4982

    Общий результат 0,3168Общий результат 0,2179
    MTEB

    Публичная таблицадругая ревизия

  • MLSUMClusteringP2P

    main_score

    Результат

    0,3944

    MTEB

    Публичная таблицадругая ревизия

  • MIRACLRetrieval

    main_score

    Результат

    0,001

    Общий результат 0
    MTEB

    Публичная таблицадругая ревизия

  • WikipediaRetrievalMultilingual

    main_score

    Результат

    0,4241

    Общий результат 0,6703Общий результат 0,0565
    MTEB

    Публичная таблицадругая ревизия

  • EPBench

    main_score

    Результат

    0,5174

    Общий результат 0,8717
    MTEB

    Публичная таблицадругая ревизия

  • RiaNewsRetrieval

    main_score

    Результат

    0,0608

    MTEB

    Публичная таблицадругая ревизия

  • MLQARetrieval

    main_score

    Результат

    0,0245

    Общий результат 0,1342Общий результат 0,0258
    MTEB

    Публичная таблицадругая ревизия

  • AlphaNLI

    main_score

    Результат

    0,2903

    MTEB

    Публичная таблицадругая ревизия

  • ArXivHierarchicalClusteringP2P

    main_score

    Результат

    0,5702

    MTEB

    Публичная таблицадругая ревизия

  • MassiveScenarioClassification

    main_score

    Результат

    0,3949

    Общий результат 0,4233Общий результат 0,2361Общий результат 0,1474
    MTEB

    Публичная таблицадругая ревизия

  • SIB200ClusteringS2S

    main_score

    Результат

    0,1273

    Общий результат 0,2302Общий результат 0,1411
    MTEB

    Публичная таблицадругая ревизия

  • IndicGenBenchFloresBitextMining

    main_score

    Результат

    0,0839

    Общий результат 0,0493Общий результат 0,0269
    MTEB

    Публичная таблицадругая ревизия

  • LEMBPasskeyRetrieval

    main_score

    Результат

    0,14

    MTEB

    Публичная таблицадругая ревизия

  • MemGovern

    main_score

    Результат

    0,8449

    Общий результат 0,9699Общий результат 0,905
    MTEB

    Публичная таблицадругая ревизия

  • KnowMeBench

    main_score

    Результат

    0,383

    MTEB

    Публичная таблицадругая ревизия

  • Tatoeba

    main_score

    Результат

    0,0419

    Общий результат 0,0622Общий результат 0,004
    MTEB

    Публичная таблицадругая ревизия

  • WikiClusteringP2P.v2

    main_score

    Результат

    0,1764

    MTEB

    Публичная таблицадругая ревизия

  • TMD

    main_score

    Результат

    0,19

    MTEB

    Публичная таблицадругая ревизия

  • TempReasonL2Fact

    main_score

    Результат

    0,1088

    MTEB

    Публичная таблицадругая ревизия

  • XPQARetrieval

    main_score

    Результат

    0,0327

    Общий результат 0,0789
    MTEB

    Публичная таблицадругая ревизия

  • CUREv1

    main_score

    Результат

    0,0832

    MTEB

    Публичная таблицадругая ревизия

  • CodeEditSearchRetrieval

    main_score

    Результат

    0,6052

    MTEB

    Публичная таблицадругая ревизия

  • WikipediaRerankingMultilingual

    main_score

    Результат

    0,7438

    MTEB

    Публичная таблицадругая ревизия

  • MTOPIntentClassification

    main_score

    Результат

    0,5854

    MTEB

    Публичная таблицадругая ревизия

  • MassiveIntentClassification

    main_score

    Результат

    0,3108

    MTEB

    Публичная таблицадругая ревизия

  • OpusparcusPC

    main_score

    Результат

    0,8685

    MTEB

    Публичная таблицадругая ревизия

  • MasakhaNEWSClusteringP2P

    main_score

    Результат

    0,5864

    MTEB

    Публичная таблицадругая ревизия

  • XQuADRetrieval

    main_score

    Результат

    0,0954

    MTEB

    Публичная таблицадругая ревизия

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

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

Granite-Embedding-30m-English — компактная модель встраиваний из семейства Granite Embeddings, разработанная командой Granite Embedding в IBM. Она построена на энкодерной архитектуре на основе RoBERTa, содержит 33,5 млн параметров и формирует векторы текста размерности 384. Модель принимает текст на английском языке; максимальная длина контекста — 514 токенов.

Модель предназначена для получения векторных представлений, которые можно использовать для поиска по смыслу, извлечения релевантных документов и оценки сходства предложений. Версия r1.1 ориентирована на контекстный поиск в многоходовых диалогах: для запроса ей передают историю разговора в заданном формате. По данным карточки, модель примерно вдвое быстрее сопоставимых по размеру векторов моделей и показывает конкурентные результаты на бенчмарках поиска.

Модель доступна в форматах PyTorch, Safetensors и ONNX, совместима с Sentence Transformers. Лицензия — Apache 2.0. Ограничения: модель рассчитана на английский язык, а контекст ограничен 514 токенами; версии r1.1 для многоходового поиска требуется подавать историю диалога в специальном формате.

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

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

Ограничения

Модель предназначена для английского языка и ограничена контекстом в 514 токенов. Для многоходового поиска в версии r1.1 историю разговора необходимо передавать в специальном формате.

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

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

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

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

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

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

Открыть на Hugging Face

Granite-Embedding-30m-English (revision r1.1)

Model Summary: Granite-Embedding-30m-English is a 30M parameter dense bi-encoder embedding model from the Granite Embeddings suite that can be used to generate high quality text embeddings. This model produces embedding vectors of size 384 and is trained using a combination of open source relevance-pair datasets with permissive, enterprise-friendly license, and IBM collected and generated datasets. While maintaining competitive scores on academic benchmarks such as BEIR, this model also performs well on many enterprise use cases. This model is developed using retrieval oriented pre-training, contrastive fine-tuning, knowledge distillation and model merging for improved performance.

Granite-embedding-30m-r1.1 was specifically designed to support multi-turn information retrieval and is designed to handle contextual document retrieval in multi-turn conversational information retrieval. Granite-embedding-30m-r1.1 was trained on data tailored for multi-turn conversational information retrieval and uses multi-teacher distillation over granite-embedding-30m-english (https://huggingface.co/ibm-granite/granite-embedding-30m-english)

Supported Languages: English.

Intended use: The model is designed to produce fixed length vector representations for a given text, which can be used for text similarity, retrieval, and search applications.

Usage with Sentence Transformers: The model is compatible with SentenceTransformer library and is very easy to use:

First, install the sentence transformers library

pip install sentence_transformers

The model can then be used to encode pairs of text and find the similarity between their representations.

Granite-Embedding-30m-English

from sentence_transformers import SentenceTransformer, util

model_path = "ibm-granite/granite-embedding-30m-english"
# Load the Sentence Transformer model
model = SentenceTransformer(model_path)

input_queries = [
    ' Who made the song My achy breaky heart? ',
    'summit define'
    ]

input_passages = [
    "Achy Breaky Heart is a country song written by Don Von Tress. Originally titled Don't Tell My Heart and performed by The Marcy Brothers in 1991. ",
    "Definition of summit for English Language Learners. : 1 the highest point of a mountain : the top of a mountain. : 2 the highest level. : 3 a meeting or series of meetings between the leaders of two or more governments."
    ]

# encode queries and passages
query_embeddings = model.encode(input_queries)
passage_embeddings = model.encode(input_passages)

# calculate cosine similarity
print(util.cos_sim(query_embeddings, passage_embeddings))

Granite-Embedding-30m-r1.1

Specifically to encode with granite-embedding-30m-r1.1 the entire conversation, ending with the last user query, should be provided as the input, with the conversation instances arranged in reverse chronological order: first the last user query, then the preceding agent response, followed by the previous user query. Example,

Conversation: user:<user_query_1> agent: <agent_response_1> user:<user_query_2> agent: <agent_response_2> user:<user_query_3> agent: <agent_response_3> user:<last_user_query>

Conversation in input query format: <last_user_query>[SEP]agent: <agent_response_3>||user:<user_query_3>||agent: <agent_response_2>||user:<user_query_2>||agent: <agent_response_1>||user:<user_query_1>

from sentence_transformers import SentenceTransformer, util

model_path = "ibm-granite/granite-embedding-30m-english"
# Load the Sentence Transformer model
model = SentenceTransformer(model_path, revision="granite-embedding-30m-r1.1")

input_queries = [
    "Which team has won the most Super Bowls?[SEP]agent: Six teams from each conference (AFC and NFC), for a total of 12 team playoff system.||user: How many teams are in the NFL playoffs?||agent: There are 32 teams in the National Football League (NFL).||user: How many teams are in the NFL?",

    "How many teams are in the NFL playoffs?[SEP]agent: There are 32 teams in the National Football League (NFL).||user: How many teams are in the NFL?||agent: The Chicago Cardinals became the St. Louis Cardinals in 1960 and eventually moved and became the Arizona Cardinals. The Chicago Cardinals ( now the Arizona Cardinals ) were a founding member of the NFL.||user: Are the Arizona Cardinals and the Chicago Cardinals the same team?||agent: The Arizona Cardinals do play outside the United States. They had a game in London, England, on October 22, 2017, against the Los Angeles Rams at Twickenham Stadium and in 2005 they played in Mexico.||user: Do the Arizona Cardinals play outside the US?"
    ]

input_passages = [
    "Super Bowl\nThe Pittsburgh Steelers have won six Super Bowls , the most of any team ; the Dallas Cowboys , New England Patriots and San Francisco 49ers have five victories each , while the Green Bay Packers and New York Giants have four Super Bowl championships . Fourteen other NFL franchises have won at least one Super Bowl . Eight teams have appeared in Super Bowl games without a win . The Minnesota Vikings were the first team to have appeared a record four times without a win . The Buffalo Bills played in a record four Super Bowls in a row and lost every one . Four teams ( the Cleveland Browns , Detroit Lions , Jacksonville Jaguars , and Houston Texans ) have never appeared in a Super Bowl . The Browns and Lions both won NFL Championships prior to the creation of the Super Bowl , while the Jaguars ( 1995 ) and Texans ( 2002 ) are both recent NFL expansion teams . ( Detroit , Houston , and Jacksonville , however , have hosted a Super Bowl , leaving the Browns the only team to date who has neither played in nor whose city has hosted the game . ) The Minnesota Vikings won the last NFL Championship before the merger but lost to the AFL champion Kansas City Chiefs in Super Bowl IV.",

    "NFL playoffs \n The 32 - team National Football League is divided into two conferences , American Football Conference ( AFC ) and National Football Conference ( NFC ) , each with 16 teams . Since 2002 , each conference has been further divided into four divisions of four teams each . The tournament brackets are made up of six teams from each of the league 's two conferences , following the end of the regular season . Qualification into the playoffs works as follows : "
    ]

# encode queries and passages
query_embeddings = model.encode(input_queries)
passage_embeddings = model.encode(input_passages)

# calculate cosine similarity
print(util.cos_sim(query_embeddings, passage_embeddings))

Usage with Huggingface Transformers: This is a simple example of how to use the Granite-Embedding-30m-English model with the Transformers library and PyTorch.

First, install the required libraries

pip install transformers torch

The model can then be used to encode pairs of text

Granite-Embedding-30m-English

import torch
from transformers import AutoModel, AutoTokenizer

model_path = "ibm-granite/granite-embedding-30m-english"

# Load the model and tokenizer
model = AutoModel.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
model.eval()

input_queries = [
    ' Who made the song My achy breaky heart? ',
    'summit define'
    ]

# tokenize inputs
tokenized_queries = tokenizer(input_queries, padding=True, truncation=True, return_tensors='pt')

# encode queries
with torch.no_grad():
    # Queries
    model_output = model(**tokenized_queries)
    # Perform pooling. granite-embedding-30m-english uses CLS Pooling
    query_embeddings = model_output[0][:, 0]

# normalize the embeddings
query_embeddings = torch.nn.functional.normalize(query_embeddings, dim=1)

Granite-Embedding-30m-r1.1

import torch
from transformers import AutoModel, AutoTokenizer

model_path = "ibm-granite/granite-embedding-30m-english"

# Load the model and tokenizer
model = AutoModel.from_pretrained(model_path, revision="granite-embedding-30m-r1.1")
tokenizer = AutoTokenizer.from_pretrained(model_path)
model.eval()

input_queries = [
    "Which team has won the most Super Bowls?[SEP]agent: Six teams from each conference (AFC and NFC), for a total of 12 team playoff system.||user: How many teams are in the NFL playoffs?||agent: There are 32 teams in the National Football League (NFL).||user: How many teams are in the NFL?",

    "How many teams are in the NFL playoffs?[SEP]agent: There are 32 teams in the National Football League (NFL).||user: How many teams are in the NFL?||agent: The Chicago Cardinals became the St. Louis Cardinals in 1960 and eventually moved and became the Arizona Cardinals. The Chicago Cardinals ( now the Arizona Cardinals ) were a founding member of the NFL.||user: Are the Arizona Cardinals and the Chicago Cardinals the same team?||agent: The Arizona Cardinals do play outside the United States. They had a game in London, England, on October 22, 2017, against the Los Angeles Rams at Twickenham Stadium and in 2005 they played in Mexico.||user: Do the Arizona Cardinals play outside the US?"
    ]

# tokenize inputs
tokenized_queries = tokenizer(input_queries, padding=True, truncation=True, return_tensors='pt')

# encode queries
with torch.no_grad():
    # Queries
    model_output = model(**tokenized_queries)
    # Perform pooling. granite-embedding-30m-english-multiturn uses CLS Pooling
    query_embeddings = model_output[0][:, 0]

# normalize the embeddings
query_embeddings = torch.nn.functional.normalize(query_embeddings, dim=1)

Evaluation:

Granite-Embedding-30M-English model is twice as fast as other models with similar embedding dimensions, while maintaining competitive performance. The performance of the Granite-Embedding-30M-English model on MTEB Retrieval (i.e., BEIR) and code retrieval (CoIR) benchmarks is reported below.

ModelParamters (M)Embedding DimensionMTEB Retrieval (15)CoIR (10)
granite-embedding-30m-english3038449.147.0

granite-embedding-30m-r1.1 revision maintains the fast speed of granite-embedding-30m-english while demontratring strong performance on multi-turn information retrieval benchmarks. The performance of the granite-embedding-30M-r1.1 model on MTEB Retrieval (i.e., BEIR) and multi-turn information retrieval (MTRAG(https://github.com/IBM/mt-rag-benchmark), Multidoc2dial(https://github.com/IBM/multidoc2dial)) datasets is reported below.

ModelParameters (M)Embedding DimensionMTEB Retrieval (15)MT-RAGMdoc2dial
granite-embedding-30m-english3038449.149.1685.42
granite-embedding-30m-english-r1.13038448.952.3385.78
bge-small-en-v1.53351253.8638.2683.71
e5-small-v23338448.4628.7275.7

Model Architecture: granite-embedding-30m-English is based on an encoder-only RoBERTa like transformer architecture, trained internally at IBM Research. granite-embedding-30m-r1.1 shares the same architecture as granite-embedding-30m-English

Modelgranite-embedding-30m-englishgranite-embedding-125m-englishgranite-embedding-107m-multilingualgranite-embedding-278m-multilingual
Embedding size384768384768
Number of layers612612
Number of attention heads12121212
Intermediate size1536307215363072
Activation FunctionGeLUGeLUGeLUGeLU
Vocabulary Size5026550265250002250002
Max. Sequence Length512512512512
# Parameters30M125M107M278M

Training Data: Overall, the training data consists of four key sources: (1) unsupervised title-body paired data scraped from the web, (2) publicly available paired with permissive, enterprise-friendly license, (3) IBM-internal paired data targeting specific technical domains, and (4) IBM-generated synthetic data. The data is listed below:

DatasetNum. Pairs
SPECTER citation triplets684,100
Stack Exchange Duplicate questions (titles)304,525
Stack Exchange Duplicate questions (bodies)250,519
Stack Exchange Duplicate questions (titles+bodies)250,460
Natural Questions (NQ)100,231
SQuAD2.087,599
PAQ (Question, Answer) pairs64,371,441
Stack Exchange (Title, Answer) pairs4,067,139
Stack Exchange (Title, Body) pairs23,978,013
Stack Exchange (Title+Body, Answer) pairs187,195
S2ORC Citation pairs (Titles)52,603,982
S2ORC (Title, Abstract)41,769,185
S2ORC (Citations, abstracts)52,603,982
WikiAnswers Duplicate question pairs77,427,422
SearchQA582,261
HotpotQA85,000
Fever109,810
Arxiv2,358,545
Wikipedia20,745,403
PubMed20,000,000
Miracl En Pairs9,016
DBPedia Title-Body Pairs4,635,922
Synthetic: Query-Wikipedia Passage1,879,093
Synthetic: Fact Verification9,888
IBM Internal Triples40,290
IBM Internal Title-Body Pairs1,524,586
MultiDoc2Dial Train (MultiTurn Conversation)21,451
Synthetic IBM internal data19,533

Notably, we do not use the popular MS-MARCO retrieval dataset in our training corpus due to its non-commercial license, while other open-source models train on this dataset due to its high quality.

Infrastructure: We train Granite Embedding Models using IBM's computing cluster, Cognitive Compute Cluster, which is outfitted with NVIDIA A100 80gb GPUs. This cluster provides a scalable and efficient infrastructure for training our models over multiple GPUs.

Ethical Considerations and Limitations: The data used to train the base language model was filtered to remove text containing hate, abuse, and profanity. Granite-embedding-30m-english and Granite-embedding-30m-r1.1 are trained only for English texts, and has a context length of 512 tokens (longer texts will be truncated to this size).

Resources

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
RobertaModel
Ревизия весов
9b5b096

0 моделей