Model reference · open weights
patembed is an open-weight embedding model from datalyes. 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
| Released by | datalyes |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 194M |
| Context | 512 tokens |
| Runs with | sentence-transformers |
| Released | 2025-10-28 |
| Popularity | 2k downloads / month |
| Licence | Commercial licence needed |
About
This is a sentence-transformers model trained specifically for patent text embeddings. It is part of the PatenTEB project, which provides state-of-the-art models for patent document understanding and retrieval.
Note: This model uses task-specific instruction prompts during inference for optimal performance.
Primary deployment target distilled from patembed-large. Maintains 1024 hidden size with projection to 768-dim embeddings.
This model is part of the patembed family, developed through multi-task learning on 13 training tasks from the PatenTEB benchmark. For detailed information about the training methodology, architecture, and comprehensive evaluation results, please refer to our paper.
from sentence_transformers import SentenceTransformer
# Load the model
model = SentenceTransformer('datalyes/patembed-base')
# Encode patent texts
patent_texts = [
"A method for manufacturing semiconductor devices...",
"An apparatus for processing chemical compounds...",
]
embeddings = model.encode(patent_texts)
# Compute similarity
from sentence_transformers import util
similarity = util.cos_sim(embeddings[0], embeddings[1])
print(f"Similarity: {similarity.item():.4f}")
from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained('datalyes/patembed-base')
model = AutoModel.from_pretrained('datalyes/patembed-base')
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0]
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
# Tokenize and encode
texts = ["A method for manufacturing semiconductor devices..."]
encoded = tokenizer(texts, padding=True, truncation=True, return_tensors='pt')
with torch.no_grad():
model_output = model(**encoded)
embeddings = mean_pooling(model_output, encoded['attention_mask'])
embeddings = F.normalize(embeddings, p=2, dim=1)
from sentence_transformers import SentenceTransformer, util
model = SentenceTransformer('datalyes/patembed-base')
# Query patent
query = "Method for reducing power consumption in mobile devices"
# Candidate patents
candidates = [
"A power management system for portable electronic devices...",
"Chemical composition for battery manufacturing...",
"Method for wireless data transmission in mobile networks...",
]
# Encode and retrieve
query_emb = model.encode(query)
candidate_embs = model.encode(candidates)
# Compute similarities
scores = util.cos_sim(query_emb, candidate_embs)[0]
# Get ranked results
results = [(candidates[i], scores[i].item()) for i in range(len(candidates))]
results.sort(key=lambda x: x[1], reverse=True)
for patent, score in results:
print(f"Score: {score:.4f} - {patent[:100]}...")
This model is designed for patent-specific tasks including:
For detailed training methodology, evaluation protocols, and performance analysis, please refer to our paper.
If you use this model, please cite our paper:
@misc{ayaou2025patentebcomprehensivebenchmarkmodel,
title={PatenTEB: A Comprehensive Benchmark and Model Family for Patent Text Embedding},
author={Iliass Ayaou and Denis Cavallucci},
year={2025},
eprint={2510.22264},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2510.22264}
}
Paper: PatenTEB on arXiv
This model is released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.
Key Terms:
For full license details: https://creativecommons.org/licenses/by-nc-sa/4.0/
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys patembed for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (patembed 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":"patembed","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.