/ Модель

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

Контекст
32 768 токенов
Параметры
1,5 млрд
Лицензия
Apache 2.0
Архитектура
qwen2 · dense
Базовая модель
Qwen2.5-1.5B
Опубликована
15 авг 2025

lychee-embed

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

Многоязычная модель на базе Qwen2.5-1.5B, которая превращает тексты в эмбеддинги для семантического поиска и сравнения сходства.

95скачиваний за 30 дней9лайковвеса обновлены18 авг 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Lychee-embed — многоязычная модель для создания текстовых эмбеддингов, совместно разработанная командой NLP Харбинского технологического института в Шэньчжэне. Она основана на Qwen2.5-1.5B и дообучена по многоэтапной схеме с разогревом, обучением на задачах, слиянием моделей и финальным дообучением. Модель предназначена для семантического поиска, сравнения сходства текстов и других задач на основе эмбеддингов.

Модель содержит 1,5 млрд параметров, принимает текст и выдаёт векторы размерностью до 1536; поддерживаются настраиваемые размерности от 32 до 1536 и инструкции, задающие контекст задачи. README заявляет поддержку более 100 языков и длину последовательности 8K, тогда как метаданные указывают нативный контекст 32768 токенов. Репозиторий распространяется в формате safetensors, лицензия — Apache-2.0.

Для повышения качества поиска авторы рекомендуют подбирать инструкции под задачу; README сообщает, что их отсутствие на стороне запроса может снизить качество примерно на 1–5%.

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

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

Ограничения

Для retrieval-сценариев качество зависит от подходящих инструкций: по данным README, их отсутствие в запросе может снизить качество примерно на 1–5%. README приводит длину последовательности 8K, а метаданные — контекст 32768 токенов.

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

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

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

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

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

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

Открыть на Hugging Face

Lychee Embed

Lychee-embed is the latest generalist text embedding model based on the Qwen2.5 model. It is suitable for text retrieval (semantic correlation), text similarity and other downstream tasks, and supports multiple languages of Qwen2.5. Lychee-embed is jointly developed by the NLP Team of Harbin Institute of Technology, Shenzhen and is built based on an innovative multi-stage training framework (warm-up, task-learning, model merging, annealing). The first batch of open source is 1.5B parameter version.

The multi-stage training framework

Lychee-embed:

  • Model Type: Text Embedding
  • Language Support: 100+ Languages
  • Param Size: 1.5B
  • Context Length: 8k
  • Embedding Dim: 1536, Supports diverse settings with 32 steps from 32 to 1536
  • Model Precision: BF16

For more details, please refer to our Paper.

Model List

Model TypeModelsSizeLayersSequence LengthEmbedding DimensionMRL SupportInstruction Aware
Text Embeddinglychee-embed1.5B288K1636YesYes
Text Rerankinglychee-rerank1.5B288K--Yes

Note:

  • MRL Support indicates whether the embedding model supports custom dimensions for the final embedding.
  • Instruction Aware notes whether the embedding or reranking model supports customizing the input instruction according to different tasks.
  • Like most embedding models, for most downstream tasks, using instructions (instruct) typically yields an improvement of 1% to 5% compared to not using them. Therefore, we recommend that developers create tailored instructions specific to their tasks and scenarios. In multilingual contexts, we also advise users to write their instructions in English, as most instructions utilized during the model training process were originally written in English.

Model Usage

📌 Tips: We recommend that developers customize the instruct according to their specific scenarios, tasks, and languages. Our tests have shown that in most retrieval scenarios, not using an instruct on the query side can lead to a drop in retrieval performance by approximately 1% to 5%.

Sentence Transformers Usage

# Requires transformers>=4.51.0
# Requires sentence-transformers>=2.7.0

from sentence_transformers import SentenceTransformer

# Load the model
model = SentenceTransformer("vec-ai/lychee-embed")

# We recommend enabling flash_attention_2 for better acceleration and memory saving,
# together with setting `padding_side` to "left":
# model = SentenceTransformer(
#     "vec-ai/lychee-embed",
#     model_kwargs={"attn_implementation": "flash_attention_2", "device_map": "auto"},
#     tokenizer_kwargs={"padding_side": "left"},
# )

# The queries and documents to embed
queries = [
    "What is the capital of China?",
    "Explain gravity",
]
documents = [
    "The capital of China is Beijing.",
    "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun.",
]

# Encode the queries and documents. Note that queries benefit from using a prompt
# Here we use the prompt called "query" stored under `model.prompts`, but you can
# also pass your own prompt via the `prompt` argument
query_embeddings = model.encode(queries, prompt_name="query")
document_embeddings = model.encode(documents)

# Compute the (cosine) similarity between the query and document embeddings
similarity = model.similarity(query_embeddings, document_embeddings)
print(similarity)
# tensor([[0.8952, 0.4001],
#         [0.4668, 0.8334]])

Transformers Usage

# Requires transformers>=4.51.0

import torch
from transformers import AutoTokenizer, AutoModel


def last_token_pool(last_hidden_states: torch.Tensor,
                 attention_mask: torch.Tensor) -> torch.Tensor:
    left_padding = (attention_mask[:, -1].sum() == attention_mask.shape[0])
    if left_padding:
        return last_hidden_states[:, -1]
    else:
        sequence_lengths = attention_mask.sum(dim=1) - 1
        batch_size = last_hidden_states.shape[0]
        return last_hidden_states[torch.arange(batch_size, device=last_hidden_states.device), sequence_lengths]


def get_detailed_instruct(task_description: str, query: str) -> str:
    return f'Instruct: {task_description}\nQuery:{query}'

# Each query must come with a one-sentence instruction that describes the task
task = 'Given a web search query, retrieve relevant passages that answer the query'

queries = [
    get_detailed_instruct(task, 'What is the capital of China?'),
    get_detailed_instruct(task, 'Explain gravity')
]
# No need to add instruction for retrieval documents
documents = [
    "The capital of China is Beijing.",
    "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun."
]
input_texts = queries + documents

tokenizer = AutoTokenizer.from_pretrained('vec-ai/lychee-embed', padding_side='left')
model = AutoModel.from_pretrained('vec-ai/lychee-embed')

# We recommend enabling flash_attention_2 for better acceleration and memory saving.
# model = AutoModel.from_pretrained('vec-ai/lychee-embed', attn_implementation="flash_attention_2", torch_dtype=torch.float16).cuda()

max_length = 8192

# Tokenize the input texts
batch_dict = tokenizer(
    input_texts,
    padding=True,
    truncation=True,
    max_length=max_length,
    return_tensors="pt",
)
batch_dict.to(model.device)
outputs = model(**batch_dict)
embeddings = last_token_pool(outputs.last_hidden_state, batch_dict['attention_mask'])

# normalize embeddings
embeddings = torch.nn.functional.normalize(embeddings, p=2, dim=1)
scores = (embeddings[:2] @ embeddings[2:].T)
print(scores.tolist())
# [[0.8952088952064514, 0.40010833740234375], [0.4668009877204895, 0.8333653807640076]]

vLLM Usage

# Requires vllm>=0.8.5
import torch
from vllm import LLM

def get_detailed_instruct(task_description: str, query: str) -> str:
    return f'Instruct: {task_description}\nQuery:{query}'

# Each query must come with a one-sentence instruction that describes the task
task = 'Given a web search query, retrieve relevant passages that answer the query'

queries = [
    get_detailed_instruct(task, 'What is the capital of China?'),
    get_detailed_instruct(task, 'Explain gravity')
]
# No need to add instruction for retrieval documents
documents = [
    "The capital of China is Beijing.",
    "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun."
]
input_texts = queries + documents

model = LLM(model="vec-ai/lychee-embed", task="embed")

outputs = model.embed(input_texts)
embeddings = torch.tensor([o.outputs.embedding for o in outputs])
scores = (embeddings[:2] @ embeddings[2:].T)
print(scores.tolist())
# [[0.9007290601730347, 0.4043760895729065], [0.469818651676178, 0.8317853212356567]]

Evaluation

ModelParamMTEBCMTEBMMTEBMLDRMTEB-CodeToolBenchFollowIRBRIGHT
BGE-multilingual9.24B69.8868.4461.2549.1062.0463.65-2.1317.68
NV-Embed-v27.85B72.31-56.25-63.7450.541.0419.28
GritLM-7B7.24B66.8-60.93-73.635.423.4520.63
E5-mistral7.11B66.659.9260.28-69.231.79-0.6217.54
GTE-Qwen2-7B7.62B69.8871.6262.5156.5362.1759.484.9422.89
GTE-Qwen2-1.5B1.54B67.1967.1259.4752.1161.9862.570.7418.47
BGE-M3 (Dense)0.56B59.8461.7959.5452.5058.2258.45-3.1111.94
Jina-v30.57B65.5263.0758.3740.7158.8559.64-1.3411.34
Qwen3-Embedding-8B7.57B73.8470.5880.68
Qwen3-Embedding-4B4.02B72.2769.4580.06
Qwen3-Embedding-0.6B0.60B66.3364.3375.41
Lychee-embed1.54B68.3969.7758.4353.8572.5486.355.7419.47

For more details, please refer to our Paper.

Citation

If you find our work helpful, feel free to give us a cite.

@inproceedings{zhang2025phased,
title={Phased Training for LLM-powered Text Retrieval Models Beyond Data Scaling},
author={Xin Zhang and Yanzhao Zhang and Wen Xie and Dingkun Long and Mingxin Li and Pengjun Xie and Meishan Zhang and Wenjie Li and Min Zhang},
booktitle={Second Conference on Language Modeling},
year={2025},
url={https://openreview.net/forum?id=NC6G1KCxlt}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
Qwen2Model
Ревизия весов
767e250

0 моделей