We introduce
gte-v1.5
series, upgraded
gte
embeddings that support the context length of up to
8192
, while further enhancing model performance.
The models are built upon the
transformer++
encoder
backbone
(BERT + RoPE + GLU).
The
gte-v1.5
series achieve state-of-the-art scores on the MTEB benchmark within the same model size category and prodvide competitive on the LoCo long-context retrieval tests (refer to
Evaluation
).
We also present the
gte-Qwen1.5-7B-instruct
,
a SOTA instruction-tuned multi-lingual embedding model that ranked 2nd in MTEB and 1st in C-MTEB.
Developed by:
Institute for Intelligent Computing, Alibaba Group
# Requires sentence_transformers>=2.7.0from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim
sentences = ['That is a happy person', 'That is a very happy person']
model = SentenceTransformer('Alibaba-NLP/gte-base-en-v1.5', trust_remote_code=True)
embeddings = model.encode(sentences)
print(cos_sim(embeddings[0], embeddings[1]))
Use with
transformers.js
:
// npm i @xenova/transformersimport { pipeline, dot } from'@xenova/transformers';
// Create feature extraction pipelineconst extractor = awaitpipeline('feature-extraction', 'Alibaba-NLP/gte-base-en-v1.5', {
quantized: false, // Comment out this line to use the quantized version
});
// Generate sentence embeddingsconst sentences = [
"what is the capital of China?",
"how to implement quick sort in python?",
"Beijing",
"sorting algorithms"
]
const output = awaitextractor(sentences, { normalize: true, pooling: 'cls' });
// Compute similarity scoresconst [source_embeddings, ...document_embeddings ] = output.tolist();
const similarities = document_embeddings.map(x =>100 * dot(source_embeddings, x));
console.log(similarities); // [34.504930869007296, 64.03973265120138, 19.520042686034362]
Use with infinity:
Infinity
is a MIT licensed server for OpenAI-compatible deployment.
docker run --gpus all -v $PWD/data:/app/.cache -p "7997":"7997" \
michaelf34/infinity:0.0.68 \
v2 --model-id Alibaba-NLP/gte-base-en-v1.5 --revision "4c742dc2b781e4ab062a4a77f4f7cbad4bdee970" --dtype bfloat16 --batch-size 32 --device cuda --engine torch --port 7997
Training Details
Training Data
Masked language modeling (MLM):
c4-en
Weak-supervised contrastive pre-training (CPT):
GTE
pre-training data
Supervised contrastive fine-tuning:
GTE
fine-tuning data
Training Procedure
To enable the backbone model to support a context length of 8192, we adopted a multi-stage training strategy.
The model first undergoes preliminary MLM pre-training on shorter lengths.
And then, we resample the data, reducing the proportion of short texts, and continue the MLM pre-training.
If you find our paper or models helpful, please consider citing them as follows:
@misc{zhang2024mgte,
title={mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrieval},
author={Xin Zhang and Yanzhao Zhang and Dingkun Long and Wen Xie and Ziqi Dai and Jialong Tang and Huan Lin and Baosong Yang and Pengjun Xie and Fei Huang and Meishan Zhang and Wenjie Li and Min Zhang},
year={2024},
eprint={2407.19669},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2407.19669},
}
@misc{li2023gte,
title={Towards General Text Embeddings with Multi-stage Contrastive Learning},
author={Zehan Li and Xin Zhang and Yanzhao Zhang and Dingkun Long and Pengjun Xie and Meishan Zhang},
year={2023},
eprint={2308.03281},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2308.03281},
}
Runs of MnLgt gte-base-en-v1.5 on huggingface.co
6
Total runs
0
24-hour runs
0
3-day runs
-13
7-day runs
-8
30-day runs
More Information About gte-base-en-v1.5 huggingface.co Model
gte-base-en-v1.5 huggingface.co is an AI model on huggingface.co that provides gte-base-en-v1.5's model effect (), which can be used instantly with this MnLgt gte-base-en-v1.5 model. huggingface.co supports a free trial of the gte-base-en-v1.5 model, and also provides paid use of the gte-base-en-v1.5. Support call gte-base-en-v1.5 model through api, including Node.js, Python, http.
gte-base-en-v1.5 huggingface.co is an online trial and call api platform, which integrates gte-base-en-v1.5's modeling effects, including api services, and provides a free online trial of gte-base-en-v1.5, you can try gte-base-en-v1.5 online for free by clicking the link below.
MnLgt gte-base-en-v1.5 online free url in huggingface.co:
gte-base-en-v1.5 is an open source model from GitHub that offers a free installation service, and any user can find gte-base-en-v1.5 on GitHub to install. At the same time, huggingface.co provides the effect of gte-base-en-v1.5 install, users can directly use gte-base-en-v1.5 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.