Model reference · open weights
gte-small-zh is an open-weight embedding model from thenlper. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Maker | thenlper |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 30M |
| Context | 512 tokens |
| Runs with | sentence-transformers |
| Released | 2023-11-08 |
| Popularity | 2k downloads / month |
| Licence | Open weights |
About
General Text Embeddings (GTE) model. Towards General Text Embeddings with Multi-stage Contrastive Learning
The GTE models are trained by Alibaba DAMO Academy. They are mainly based on the BERT framework and currently offer different sizes of models for both Chinese and English Languages. The GTE models are trained on a large-scale corpus of relevance text pairs, covering a wide range of domains and scenarios. This enables the GTE models to be applied to various downstream tasks of text embeddings, including information retrieval, semantic textual similarity, text reranking, etc.
| Models | Language | Max Sequence Length | Dimension | Model Size |
|---|---|---|---|---|
| GTE-large-zh | Chinese | 512 | 1024 | 0.67GB |
| GTE-base-zh | Chinese | 512 | 512 | 0.21GB |
| GTE-small-zh | Chinese | 512 | 512 | 0.10GB |
| GTE-large | English | 512 | 1024 | 0.67GB |
| GTE-base | English | 512 | 512 | 0.21GB |
| GTE-small | English | 512 | 384 | 0.10GB |
We compared the performance of the GTE models with other popular text embedding models on the MTEB (CMTEB for Chinese language) benchmark. For more detailed comparison results, please refer to the MTEB leaderboard.
| Model | Model Size (GB) | Embedding Dimensions | Sequence Length | Average (35 datasets) | Classification (9 datasets) | Clustering (4 datasets) | Pair Classification (2 datasets) | Reranking (4 datasets) | Retrieval (8 datasets) | STS (8 datasets) |
|---|---|---|---|---|---|---|---|---|---|---|
| gte-large-zh | 0.65 | 1024 | 512 | 66.72 | 71.34 | 53.07 | 81.14 | 67.42 | 72.49 | 57.82 |
| gte-base-zh | 0.20 | 768 | 512 | 65.92 | 71.26 | 53.86 | 80.44 | 67.00 | 71.71 | 55.96 |
| stella-large-zh-v2 | 0.65 | 1024 | 1024 | 65.13 | 69.05 | 49.16 | 82.68 | 66.41 | 70.14 | 58.66 |
| stella-large-zh | 0.65 | 1024 | 1024 | 64.54 | 67.62 | 48.65 | 78.72 | 65.98 | 71.02 | 58.3 |
| bge-large-zh-v1.5 | 1.3 | 1024 | 512 | 64.53 | 69.13 | 48.99 | 81.6 | 65.84 | 70.46 | 56.25 |
| stella-base-zh-v2 | 0.21 | 768 | 1024 | 64.36 | 68.29 | 49.4 | 79.96 | 66.1 | 70.08 | 56.92 |
| stella-base-zh | 0.21 | 768 | 1024 | 64.16 | 67.77 | 48.7 | 76.09 | 66.95 | 71.07 | 56.54 |
| piccolo-large-zh | 0.65 | 1024 | 512 | 64.11 | 67.03 | 47.04 | 78.38 | 65.98 | 70.93 | 58.02 |
| piccolo-base-zh | 0.2 | 768 | 512 | 63.66 | 66.98 | 47.12 | 76.61 | 66.68 | 71.2 | 55.9 |
| gte-small-zh | 0.1 | 512 | 512 | 60.04 | 64.35 | 48.95 | 69.99 | 66.21 | 65.50 | 49.72 |
| bge-small-zh-v1.5 | 0.1 | 512 | 512 | 57.82 | 63.96 | 44.18 | 70.4 | 60.92 | 61.77 | 49.1 |
| m3e-base | 0.41 | 768 | 512 | 57.79 | 67.52 | 47.68 | 63.99 | 59.54 | 56.91 | 50.47 |
| text-embedding-ada-002(openai) | - | 1536 | 8192 | 53.02 | 64.31 | 45.68 | 69.56 | 54.28 | 52.0 | 43.35 |
Code example
import torch.nn.functional as F
from torch import Tensor
from transformers import AutoTokenizer
From the published model card. Full card on the HuggingFace links in the sidebar.
Benchmarks
As published on the model card — the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| STS | MTEB AFQMC | cos_sim_pearson | 35.809 |
| STS | MTEB AFQMC | cos_sim_spearman | 36.689 |
| STS | MTEB AFQMC | euclidean_pearson | 35.707 |
| STS | MTEB AFQMC | euclidean_spearman | 36.689 |
| STS | MTEB AFQMC | manhattan_pearson | 35.833 |
| STS | MTEB AFQMC | manhattan_spearman | 36.832 |
| STS | MTEB ATEC | cos_sim_pearson | 44.667 |
| STS | MTEB ATEC | cos_sim_spearman | 45.774 |
| STS | MTEB ATEC | euclidean_pearson | 48.143 |
| STS | MTEB ATEC | euclidean_spearman | 45.774 |
| STS | MTEB ATEC | manhattan_pearson | 48.188 |
| STS | MTEB ATEC | manhattan_spearman | 45.810 |
| Classification | MTEB AmazonReviewsClassification (zh) | accuracy | 38.690 |
| Classification | MTEB AmazonReviewsClassification (zh) | f1 | 36.868 |
| STS | MTEB BQ | cos_sim_pearson | 49.037 |
| STS | MTEB BQ | cos_sim_spearman | 49.636 |
| STS | MTEB BQ | euclidean_pearson | 49.474 |
| STS | MTEB BQ | euclidean_spearman | 49.636 |
| STS | MTEB BQ | manhattan_pearson | 49.765 |
| STS | MTEB BQ | manhattan_spearman | 49.978 |
| Clustering | MTEB CLSClusteringP2P | v_measure | 39.538 |
| Clustering | MTEB CLSClusteringS2S | v_measure | 37.333 |
| Reranking | MTEB CMedQAv1 | map | 86.081 |
| Reranking | MTEB CMedQAv1 | mrr | 88.043 |
Using it via the API
Once AxForge deploys gte-small-zh for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (gte-small-zh below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gte-small-zh","input":"text to embed"}'
Create an account — your API key is available in the console. 5M tokens/month currently included with every new account at launch.