Instructions to use alphaedge-ai/sparseup-fr-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use alphaedge-ai/sparseup-fr-v0 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("alphaedge-ai/sparseup-fr-v0") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Sparseup-fr-v0
Description
This is a sparse encoder model trained on the lightonai/embeddings-fine-tuning-filtered-fr dataset using the sentence-transformers library. It maps inputs to a 50240-dimensional sparse vector space and can be used for semantic search and sparse retrieval.
This is a replication of the methodology applied by Linkup for his linkup-sparseup-embed-v1 model except that instead of English, we're applying it to French.
The resulting model becomes the new SOTA for sparse embedding models in French (see the results section).
More details about are available in this 📝 blog post and this 🤗 HF collection.
Model Details
Model Description
| Feature | Value |
|---|---|
| Model Type | Sparse Encoder |
| Maximum Sequence Length | 8192 tokens |
| Maximum Query Length | 256 tokens |
| Maximum Document Length | 1024 tokens |
| Output Dimensionality | 50240 dimensions |
| Similarity Function | Dot Product |
| Supported Modality | Text |
| Language | French |
| License | apache-2.0 |
| Training Datasets | fiqa_fr, hotpotqa_fr, nq_fr, msmarco_fr, fever_fr, squadv2_fr, trivia_fr, miracl_fr, mldr_fr |
Full Model Architecture
SparseEncoder(
(0): Transformer({'transformer_task': 'fill-mask', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}}, 'module_output_name': 'token_embeddings', 'query_length': 256, 'document_length': 1024, 'architecture': 'ModernBertForMaskedLM'})
(1): SparseUpPooling({'logit_shift': 2.0, 'position_top_k': 12, 'vocab_fold': 'case_space', 'chunk_size': 32, 'prefix_token_ids': [[50238], [50239]], 'special_token_ids': [1, 2, 3, 4, 50238, 50239], 'embedding_dimension': 50240, 'pool_factor': 1})
)
Evaluation
Metrics
Below, the blue cells correspond to the best model across all embedding models categories, while the green cells correspond to the best sparse model for French.
Truncation configuration
| Dataset | mLateOn (307 M) | mDenseOn (307 M) | Sparseup (150 M) | Sparseup-fr-v0 (150 M) | Opensearch (167 M) | Splade-camembert (111 M) | bm25 |
|---|---|---|---|---|---|---|---|
| arguana | 68.51 | 59.64 | 47.01 | 49.46 | 41.41 | 46.12 | 41.18 |
| climatefever | 48.19 | 48.98 | 34.58 | 34.66 | 31.85 | 27.84 | 27.44 |
| dbpedia | 69.03 | 65.76 | 55.86 | 61.71 | 62.22 | 58.34 | 51.42 |
| fever | 93.39 | 90.99 | 87.24 | 91.91 | 87.74 | 77.31 | 75.73 |
| fiqa2018 | 59.68 | 56.10 | 29.01 | 41.68 | 33.56 | 39.06 | 27.76 |
| hotpotqa | 91.85 | 85.80 | 76.69 | 77.55 | 74.08 | 70.43 | 67.84 |
| msmarco | 60.39 | 59.67 | 51.52 | 50.06 | 49.51 | 57.55 | 44.00 |
| nfcorpus | 35.50 | 34.35 | 28.43 | 28.53 | 34.27 | 30.14 | 30.73 |
| nq | 69.09 | 63.75 | 50.49 | 56.36 | 55.05 | 51.39 | 44.95 |
| quoraretrieval | 87.65 | 89.61 | 77.96 | 85.44 | 85.82 | 82.82 | 70.94 |
| scidocs | 40.99 | 44.17 | 33.51 | 34.97 | 30.96 | 31.54 | 32.31 |
| scifact | 79.42 | 80.91 | 65.05 | 67.47 | 66.74 | 67.99 | 65.57 |
| touche2020 | 55.94 | 55.05 | 43.78 | 52.99 | 48.08 | 50.49 | 50.70 |
| Average | 66.13 | 64.21 | 52.40 | 56.37 | 53.94 | 53.15 | 48.50 |
Sliding window configuration
| Dataset | mLateOn (307 M) | mDenseOn (307 M) | Sparseup (150 M) | Sparseup-fr-v0 (150 M) | Opensearch (167 M) | Splade-camembert (111 M) | bm25 |
|---|---|---|---|---|---|---|---|
| arguana | 68.51 | 59.64 | 46.28 | 49.46 | 41.67 | 46.12 | 41.18 |
| climatefever | 48.19 | 48.98 | 27.27 | 33.89 | 31.46 | 26.02 | 27.44 |
| dbpedia | 69.03 | 65.76 | 55.99 | 61.92 | 62.39 | 58.21 | 51.42 |
| fever | 93.39 | 90.99 | 86.67 | 91.91 | 88.74 | 78.51 | 75.73 |
| fiqa2018 | 59.68 | 56.14 | 27.84 | 41.67 | 33.29 | 38.79 | 27.76 |
| hotpotqa | 91.85 | 85.80 | 76.64 | 77.60 | 74.08 | 70.44 | 67.84 |
| msmarco | 60.39 | 59.67 | 51.52 | 50.06 | 49.13 | 57.55 | 44.00 |
| nfcorpus | 35.50 | 34.35 | 25.69 | 28.62 | 33.67 | 30.11 | 30.73 |
| nq | 69.09 | 63.75 | 50.81 | 56.40 | 54.52 | 51.57 | 44.95 |
| quoraretrieval | 87.65 | 89.61 | 77.96 | 85.44 | 85.82 | 82.85 | 70.94 |
| scidocs | 40.99 | 44.17 | 31.95 | 34.72 | 30.95 | 31.30 | 32.31 |
| scifact | 79.42 | 80.91 | 64.42 | 67.47 | 67.94 | 68.04 | 65.57 |
| touche2020 | 56.03 | 55.05 | 48.53 | 55.38 | 52.68 | 54.54 | 50.70 |
| Average | 66.13 | 64.22 | 51.66 | 56.50 | 54.33 | 53.39 | 48.50 |
Usage
Sentence Transformers
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SparseEncoder
model = SparseEncoder("alphaedge-ai/sparseup-fr-v0", trust_remote_code=True)
query = [
"Quel est le salaire moyen d'un ingénieur en France ?",
]
documents = ["En 2024, le salaire médian d'un ingénieur diplômé en France tourne autour de 45 000 euros brut annuels en début de carrière, et dépasse souvent 60 000 euros après dix ans."]
q = model.encode_query(query)
print(model.decode(q, top_k=10))
# [[('▁salaire', 2.640625), ('▁france', 2.515625), ('énieur', 2.46875), ('▁ing', 2.390625), ...]]
Diagnosis
format_bag
import torch
from sparseup import format_bag, l0
with torch.inference_mode():
q = model.encode_query([query], convert_to_tensor=True, show_progress_bar=False)
d = model.encode_document(documents, convert_to_tensor=True, show_progress_bar=True)
score = float(model.similarity(q, d)[0, 0])
print(f"dot(query, doc0) = {score:.3f} L0 query = {int(l0(q)[0])} L0 doc0 = {int(l0(d[0]))}")
print("\nquery :", QUERY)
print(format_bag(model.decode(q[0], top_k=15)))
dot(query, doc0) = 135.328 L0 query = 68 L0 doc0 = 227
query : Quel est le salaire moyen d'un ingénieur en France ?
salaire 2.65 ██████████
france 2.51 ██████████
énieur 2.48 █████████
ing 2.40 █████████
énieurs 2.26 █████████
engineering 2.17 ████████
average 2.12 ████████
french 2.10 ████████
pay 2.07 ████████
França 2.03 ████████
salari 2.02 ████████
françaises 1.95 ███████
Francia 1.91 ███████
française 1.87 ███████
français 1.86 ███████
highlight_html
from IPython.display import HTML, display
from sparseup import highlight_html
doc0 = DOCUMENTS[0]
display(HTML("<b>Highlight</b>" + highlight_html(doc0, model.decode(d[0]))))
Training Details
Training Hyperparameters
Non-Default Hyperparameters
num_train_epochs: 1learning_rate: 2e-05warmup_steps: 0.05bf16: Truegradient_checkpointing: Truegradient_checkpointing_kwargs: {'use_reentrant': False}per_device_eval_batch_size: 4dataloader_num_workers: 4prompts: {'query': '[Q] ', 'positive': '[D] ', 'negative_0': '[D] ', 'negative_1': '[D] ', 'negative_2': '[D] ', 'negative_3': '[D] ', 'negative_4': '[D] ', 'negative_5': '[D] ', 'negative_6': '[D] '}batch_sampler: no_duplicates
All Hyperparameters
Click to expand
per_device_train_batch_size: 8num_train_epochs: 1max_steps: -1learning_rate: 2e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.05optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Truefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Truegradient_checkpointing_kwargs: {'use_reentrant': False}torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 4prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 4dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Nonedataloader_multiprocessing_context: Nonedataloader_in_order: Trueremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonelocal_rank: -1prompts: {'query': '[Q] ', 'positive': '[D] ', 'negative_0': '[D] ', 'negative_1': '[D] ', 'negative_2': '[D] ', 'negative_3': '[D] ', 'negative_4': '[D] ', 'negative_5': '[D] ', 'negative_6': '[D] '}batch_sampler: no_duplicatesrouter_mapping: {}learning_rate_mapping: {}warmup_ratio: None
Citations
Sparseup-fr-v0
@misc {hf_blogpost_french_sparseup,
author = { {BOURDOIS, Loïck} },
organization = { {AlphaEdge AI} },
title = { Sparseup-fr: A French replication of Linkup's sparse embedding model},
year = 2026,
url = { https://huggingface.co/blog/alphaedge-ai/french-sparseup },
publisher = { Hugging Face }
}
Linkup-Platform/linkup-sparseup-embed-v1
Introducing SPARSEUP by Linkup: a move towards more competitive open sparse models by Thibault FORMAL, Pierre ERBACHER and Cosimo RULLI (2026)
https://www.linkup.so/blog/introducing-sparseup-by-linkup
mDenseOn, mLateOn, training data
@misc{sourty2026denseonlateonfullyopen,
title = {DenseOn with the LateOn: Fully Open Dense and Late-Interaction Models for Multilingual, Long-Context, and Code Search},
author = {Raphaël Sourty and Antoine Chaffin and Paulo Roberto Moura Junior and Amélie Chatelain},
year = {2026},
eprint = {2607.27178},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2607.27178},
}
mmBERT
@misc{marone2025mmbertmodernmultilingualencoder,
title={mmBERT: A Modern Multilingual Encoder with Annealed Language Learning},
author={Marc Marone and Orion Weller and William Fleshman and Eugene Yang and Dawn Lawrie and Benjamin Van Durme},
year={2025},
eprint={2509.06888},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2509.06888},
}
opensearch-project/opensearch-neural-sparse-encoding-multilingual-v1
@misc{geng2025competitivesearchrelevanceinferencefree,
title={Towards Competitive Search Relevance For Inference-Free Learned Sparse Retrievers},
author={Zhichao Geng and Yiwen Wang and Dongyu Ru and Yang Yang},
year={2025},
eprint={2411.04403},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2411.04403},
}
sparse-encoder/splade-camembert-base-v2
splade-camembert-base-v2 by Arthur BRESNU (2025)
https://huggingface.co/sparse-encoder/splade-camembert-base-v2
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
CachedSpladeLoss
@misc{gao2021scaling,
title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
year={2021},
eprint={2101.06983},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
@misc{formal2022distillationhardnegativesampling,
title={From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective},
author={Thibault Formal and Carlos Lassance and Benjamin Piwowarski and St\'ephane Clinchant},
year={2022},
eprint={2205.04733},
archivePrefix={arXiv},
primaryClass={cs.IR},
}
SparseMultipleNegativesRankingLoss
@misc{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}
FlopsLoss
@article{paria2020minimizing,
title={Minimizing flops to learn efficient sparse representations},
author={Paria, Biswajit and Yeh, Chih-Kuan and Yen, Ian EH and Xu, Ning and Ravikumar, Pradeep and P{'o}czos, Barnab{'a}s},
journal={arXiv preprint arXiv:2004.05665},
year={2020}
}
- Downloads last month
- -
