/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Опубликована
11 апр 2024

snowflake-arctic-embed-m

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

Snowflake Arctic Embed M — англоязычная BERT-модель для построения эмбеддингов и семантического поиска по запросам и документам.

387 тыс.скачиваний за 30 дней167лайковвеса обновлены13 дек 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

  • CUREv1

    main_score

    Результат

    0,1758

    MTEB

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

  • SIB200ClusteringS2S

    main_score

    Результат

    0,0792

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

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

  • MassiveIntentClassification

    main_score

    Результат

    0,3107

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

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

  • BSARDRetrieval

    main_score

    Результат

    0,3784

    MTEB

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

  • BengaliSentimentAnalysis

    main_score

    Результат

    0,532

    MTEB

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

  • ESGReports

    main_score

    Результат

    0,3537

    MTEB

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

  • EPBench

    main_score

    Результат

    0,672

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

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

  • PublicHealthQA

    main_score

    Результат

    0,7413

    MTEB

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

  • SyntheticText2SQL

    main_score

    Результат

    0,462

    MTEB

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

  • CovidRetrieval

    main_score

    Результат

    0,0085

    MTEB

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

  • XNLI

    main_score

    Результат

    0,5864

    MTEB

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

  • IndicGenBenchFloresBitextMining

    main_score

    Результат

    0,0091

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

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

  • TempReasonL3Fact

    main_score

    Результат

    0,2135

    MTEB

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

  • ScalaClassification

    main_score

    Результат

    0,5045

    MTEB

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

  • PunjabiNewsClassification

    main_score

    Результат

    0,6452

    MTEB

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

  • TweetSentimentClassification

    main_score

    Результат

    0,4016

    MTEB

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

  • Tatoeba

    main_score

    Результат

    0,0978

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

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

  • NusaTranslationBitextMining

    main_score

    Результат

    0,5485

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

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

  • MIRACLRetrievalHardNegatives

    main_score

    Результат

    0,0013

    MTEB

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

  • MLQARetrieval

    main_score

    Результат

    0,1128

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

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

  • NorwegianParliamentClassification

    main_score

    Результат

    0,5389

    MTEB

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

  • STSBenchmarkMultilingualSTS

    main_score

    Результат

    0,5044

    MTEB

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

  • OpusparcusPC

    main_score

    Результат

    0,9566

    MTEB

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

  • VoyageMMarcoReranking

    main_score

    Результат

    0,2656

    MTEB

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

  • MemGovern

    main_score

    Результат

    0,8703

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

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

  • XPQARetrieval

    main_score

    Результат

    0,0744

    MTEB

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

  • BiorxivClusteringP2P

    main_score

    Результат

    0,3697

    MTEB

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

  • MasakhaNEWSClusteringP2P

    main_score

    Результат

    0,4845

    MTEB

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

  • SwissJudgementClassification

    main_score

    Результат

    0,4614

    MTEB

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

  • TwentyNewsgroupsClustering

    main_score

    Результат

    0,3773

    MTEB

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

  • IsiZuluNewsClassification

    main_score

    Результат

    0,2319

    MTEB

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

  • MIRACLRetrieval

    main_score

    Результат

    0,5572

    MTEB

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

  • KorHateSpeechMLClassification

    main_score

    Результат

    0,0354

    MTEB

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

  • IndicCrosslingualSTS

    main_score

    Результат

    0,2068

    MTEB

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

  • MassiveScenarioClassification

    main_score

    Результат

    0,4153

    MTEB

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

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

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

Snowflake Arctic Embed M — плотная текстовая embedding-модель Snowflake для поиска по смыслу и извлечения релевантных документов. В карточке она описана как средняя модель семейства Arctic Embed, основанная на intfloat/e5-base-unsupervised и обученная в несколько этапов на парах запрос–документ и триплетах с трудными негативными примерами. Метаданные указывают архитектуру BERT, 136,7 млн параметров и контекст до 512 токенов.

Модель предназначена для построения векторного поиска и retrieval-компонента в системах RAG. Для версии M README приводит размерность эмбеддингов 768 и оценку MTEB Retrieval 54,90 NDCG@10. Она принимает текст и выдаёт векторные представления, которые можно сравнивать для ранжирования по релевантности. Карточка позиционирует исходную модель как англоязычную; более новые версии семейства отдельно заявлены для многоязычных сценариев.

Модель распространяется по лицензии Apache-2.0. Ограничение контекста — 512 токенов; заявленные характеристики retrieval относятся к оценке из карточки и могут различаться на конкретных данных и настройках поиска.

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

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

Ограничения

Контекст ограничен 512 токенами. В README версия M заявлена для англоязычного retrieval; качество на конкретных корпусах зависит от данных и настроек поиска.

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

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

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

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

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

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

Открыть на Hugging Face

News

12/04/2024: Release of snowflake-arctic-embed-l-v2.0 and snowflake-arctic-embed-m-v2.0 our newest models with multilingual workloads in mind. These models outperform prior versions of Arctic Embed and we suggest these replace prior versions!

07/26/2024: Release preprint [2407.18887] Embedding And Clustering Your Data Can Improve Contrastive Pretraining on arXiv.

07/18/2024: Release of snowflake-arctic-embed-m-v1.5, capable of producing highly compressible embedding vectors that preserve quality even when squished as small as 128 bytes per vector. Details about the development of this model are available in the launch post on the Snowflake engineering blog.

05/10/2024: Release the technical report on Arctic Embed

04/16/2024: Release the ** snowflake-arctic-embed ** family of text embedding models. The releases are state-of-the-art for Retrieval quality at each of their representative size profiles. Technical Report is coming shortly. For more details, please refer to our Github: Arctic-Text-Embed.

Models

snowflake-arctic-embed is a suite of text embedding models that focuses on creating high-quality retrieval models optimized for performance.

The snowflake-arctic-embedding models achieve state-of-the-art performance on the MTEB/BEIR leaderboard for each of their size variants. Evaluation is performed using these scripts. As shown below, each class of model size achieves SOTA retrieval accuracy compared to other top models.

The models are trained by leveraging existing open-source text representation models, such as bert-base-uncased, and are trained in a multi-stage pipeline to optimize their retrieval performance. First, the models are trained with large batches of query-document pairs where negatives are derived in-batch—pretraining leverages about 400m samples of a mix of public datasets and proprietary web search data. Following pretraining models are further optimized with long training on a smaller dataset (about 1m samples) of triplets of query, positive document, and negative document derived from hard harmful mining. Mining of the negatives and data curation is crucial to retrieval accuracy. A detailed technical report can be found here.

NameMTEB Retrieval Score (NDCG @ 10)Parameters (Millions)Embedding Dimension
snowflake-arctic-embed-xs50.1522384
snowflake-arctic-embed-s51.9833384
snowflake-arctic-embed-m54.90110768
snowflake-arctic-embed-m-long54.83137768
snowflake-arctic-embed-l55.983351024

Aside from being great open-source models, the largest model, snowflake-arctic-embed-l, can serve as a natural replacement for closed-source embedding, as shown below.

Model NameMTEB Retrieval Score (NDCG @ 10)
snowflake-arctic-embed-l55.98
Google-gecko-text-embedding55.7
text-embedding-3-large55.44
Cohere-embed-english-v3.055.00
bge-large-en-v1.554.29

snowflake-arctic-embed-xs

This tiny model packs quite the punch. Based on the all-MiniLM-L6-v2 model with only 22m parameters and 384 dimensions, this model should meet even the strictest latency/TCO budgets. Despite its size, its retrieval accuracy is closer to that of models with 100m paramers.

Model NameMTEB Retrieval Score (NDCG @ 10)
snowflake-arctic-embed-xs50.15
GIST-all-MiniLM-L6-v245.12
gte-tiny44.92
all-MiniLM-L6-v241.95
bge-micro-v242.56

snowflake-arctic-embed-s

Based on the intfloat/e5-small-unsupervised model, this small model does not trade off retrieval accuracy for its small size. With only 33m parameters and 384 dimensions, this model should easily allow scaling to large datasets.

Model NameMTEB Retrieval Score (NDCG @ 10)
snowflake-arctic-embed-s51.98
bge-small-en-v1.551.68
Cohere-embed-english-light-v3.051.34
text-embedding-3-small51.08
e5-small-v249.04

snowflake-arctic-embed-m

Based on the intfloat/e5-base-unsupervised model, this medium model is the workhorse that provides the best retrieval performance without slowing down inference.

Model NameMTEB Retrieval Score (NDCG @ 10)
snowflake-arctic-embed-m54.90
bge-base-en-v1.553.25
nomic-embed-text-v1.553.25
GIST-Embedding-v052.31
gte-base52.31

snowflake-arctic-embed-m-long

Based on the nomic-ai/nomic-embed-text-v1-unsupervised model, this long-context variant of our medium-sized model is perfect for workloads that can be constrained by the regular 512 token context of our other models. Without the use of RPE, this model supports up to 2048 tokens. With RPE, it can scale to 8192!

Model NameMTEB Retrieval Score (NDCG @ 10)
snowflake-arctic-embed-m-long54.83
nomic-embed-text-v1.553.01
nomic-embed-text-v152.81

snowflake-arctic-embed-l

Based on the intfloat/e5-large-unsupervised model, this large model is a direct drop-in for closed APIs and delivers the most accurate retrieval experience.

Model NameMTEB Retrieval Score (NDCG @ 10)
snowflake-arctic-embed-l55.98
UAE-Large-V154.66
bge-large-en-v1.554.29
mxbai-embed-large-v154.39
e5-Large-v250.56

Usage

Using Sentence Transformers

You can use the sentence-transformers package to use an snowflake-arctic-embed model, as shown below.

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("Snowflake/snowflake-arctic-embed-m")

queries = ['what is snowflake?', 'Where can I get the best tacos?']
documents = ['The Data Cloud!', 'Mexico City of Course!']

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

scores = query_embeddings @ document_embeddings.T
for query, query_scores in zip(queries, scores):
    doc_score_pairs = list(zip(documents, query_scores))
    doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)
    # Output passages & scores
    print("Query:", query)
    for document, score in doc_score_pairs:
        print(score, document)

Produces:

Query: what is snowflake?
0.2747492 The Data Cloud!
0.19998045 Mexico City of Course!
Query: Where can I get the best tacos?
0.29974818 Mexico City of Course!
0.2344071 The Data Cloud!

Using Huggingface transformers

You can use the transformers package to use an snowflake-arctic-embed model, as shown below. For optimal retrieval quality, use the CLS token to embed each text portion and use the query prefix below (just on the query).

import torch
from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained('Snowflake/snowflake-arctic-embed-m')
model = AutoModel.from_pretrained('Snowflake/snowflake-arctic-embed-m', add_pooling_layer=False)
model.eval()

query_prefix = 'Represent this sentence for searching relevant passages: '
queries  = ['what is snowflake?', 'Where can I get the best tacos?']
queries_with_prefix = ["{}{}".format(query_prefix, i) for i in queries]
query_tokens = tokenizer(queries_with_prefix, padding=True, truncation=True, return_tensors='pt', max_length=512)

documents = ['The Data Cloud!', 'Mexico City of Course!']
document_tokens =  tokenizer(documents, padding=True, truncation=True, return_tensors='pt', max_length=512)

# Compute token embeddings
with torch.no_grad():
    query_embeddings = model(**query_tokens)[0][:, 0]
    document_embeddings = model(**document_tokens)[0][:, 0]


# normalize embeddings
query_embeddings = torch.nn.functional.normalize(query_embeddings, p=2, dim=1)
document_embeddings = torch.nn.functional.normalize(document_embeddings, p=2, dim=1)

scores = torch.mm(query_embeddings, document_embeddings.transpose(0, 1))
for query, query_scores in zip(queries, scores):
    doc_score_pairs = list(zip(documents, query_scores))
    doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)
    #Output passages & scores
    print("Query:", query)
    for document, score in doc_score_pairs:
        print(score, document)

Using Transformers.js

If you haven't already, you can install the Transformers.js JavaScript library from NPM by running:

npm i @xenova/transformers

You can then use the model to compute embeddings as follows:

import { pipeline, dot } from '@xenova/transformers';

// Create feature extraction pipeline
const extractor = await pipeline('feature-extraction', 'Snowflake/snowflake-arctic-embed-m', {
    quantized: false, // Comment out this line to use the quantized version
});

// Generate sentence embeddings
const sentences = [
    'Represent this sentence for searching relevant passages: Where can I get the best tacos?',
    'The Data Cloud!',
    'Mexico City of Course!',
]
const output = await extractor(sentences, { normalize: true, pooling: 'cls' });

// Compute similarity scores
const [source_embeddings, ...document_embeddings ] = output.tolist();
const similarities = document_embeddings.map(x => dot(source_embeddings, x));
console.log(similarities); // [0.15664823859882132, 0.24481869975470627]

Using Infinity

OpenAI compatible API deployment with Infinity and Docker.

docker run --gpus all -v $PWD/data:/app/.cache -p "7997":"7997" \
michaelf34/infinity:0.0.70 \
v2 --model-id Snowflake/snowflake-arctic-embed-m --dtype float16 --batch-size 32 --engine torch --port 7997

FAQ

TBD

Contact

Feel free to open an issue or pull request if you have any questions or suggestions about this project. You also can email Daniel Campos(daniel.campos@snowflake.com).

License

Arctic is licensed under the Apache-2. The released models can be used for commercial purposes free of charge.

Acknowledgement

We want to thank the open-source community, which has provided the great building blocks upon which we could make our models. We thank our modeling engineers, Danmei Xu, Luke Merrick, Gaurav Nuti, and Daniel Campos, for making these great models possible. We thank our leadership, Himabindu Pucha, Kelvin So, Vivek Raghunathan, and Sridhar Ramaswamy, for supporting this work. We also thank the open-source community for producing the great models we could build on top of and making these releases possible. Finally, we thank the researchers who created BEIR and MTEB benchmarks. It is largely thanks to their tireless work to define what better looks like that we could improve model performance.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
BertModel
Ревизия весов
fc74610

0 моделей