Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 17
How to use yaobaishen/Qwen3-VL-Reranker-8B-vdr-lora with sentence-transformers:
from sentence_transformers import CrossEncoder
model = CrossEncoder("yaobaishen/Qwen3-VL-Reranker-8B-vdr-lora")
query = "Which planet is known as the Red Planet?"
passages = [
"Venus is often called Earth's twin because of its similar size and proximity.",
"Mars, known for its reddish appearance, is often referred to as the Red Planet.",
"Jupiter, the largest planet in our solar system, has a prominent red spot.",
"Saturn, famous for its rings, is sometimes mistaken for the Red Planet."
]
scores = model.predict([(query, passage) for passage in passages])
print(scores)This is a Cross Encoder model finetuned from Qwen/Qwen3-VL-Reranker-8B on the llamaindex-vdr-en-train-preprocessed dataset using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
CrossEncoder(
(0): Transformer({'transformer_task': 'any-to-any', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}, 'image': {'method': 'forward', 'method_output_name': 'logits'}, 'video': {'method': 'forward', 'method_output_name': 'logits'}, 'message': {'method': 'forward', 'method_output_name': 'logits', 'format': 'structured'}}, 'module_output_name': 'causal_logits', 'processing_kwargs': {'chat_template': {'chat_template': 'reranker', 'add_generation_prompt': True}}, 'architecture': 'Qwen3VLForConditionalGeneration'})
(1): LogitScore({'true_token_id': 9693, 'false_token_id': 2152, 'module_input_name': 'causal_logits'})
)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import CrossEncoder
# Download from the 🤗 Hub
model = CrossEncoder("yaobaishen/Qwen3-VL-Reranker-8B-vdr-lora")
# Get scores for pairs of inputs
pairs = [
['What are the new anthropological perspectives on development as discussed by Quarles Van Ufford and Giri in 2003?', 'https://huggingface.co/yaobaishen/Qwen3-VL-Reranker-8B-vdr-lora/resolve/main/assets/image_0.jpg'],
['What are the new anthropological perspectives on development as discussed by Quarles Van Ufford and Giri in 2003?', 'https://huggingface.co/yaobaishen/Qwen3-VL-Reranker-8B-vdr-lora/resolve/main/assets/image_1.jpg'],
['What are the three main positions anthropologists have taken in relation to development, as discussed by David Lewis?', 'https://huggingface.co/yaobaishen/Qwen3-VL-Reranker-8B-vdr-lora/resolve/main/assets/image_2.jpg'],
['What are the three main positions anthropologists have taken in relation to development, as discussed by David Lewis?', 'https://huggingface.co/yaobaishen/Qwen3-VL-Reranker-8B-vdr-lora/resolve/main/assets/image_1.jpg'],
['Who are the three sisters known as the Fates in Greek mythology?', 'https://huggingface.co/yaobaishen/Qwen3-VL-Reranker-8B-vdr-lora/resolve/main/assets/image_4.jpg'],
]
scores = model.predict(pairs)
print(scores)
# [ 4.8125 -5.625 4.875 -4.75 3.375 ]
vdr-eval-hardCrossEncoderRerankingEvaluator with these parameters:{
"at_k": 10
}
| Metric | Value |
|---|---|
| map | 0.9768 |
| mrr@10 | 0.9801 |
| ndcg@10 | 0.9845 |
query, document, and label| query | document | label | |
|---|---|---|---|
| type | string | image | int |
| modality | text | image | |
| details |
|
|
|
| query | document | label |
|---|---|---|
What are the new anthropological perspectives on development as discussed by Quarles Van Ufford and Giri in 2003? |
![]() |
1 |
What are the new anthropological perspectives on development as discussed by Quarles Van Ufford and Giri in 2003? |
![]() |
0 |
What are the three main positions anthropologists have taken in relation to development, as discussed by David Lewis? |
![]() |
1 |
BinaryCrossEntropyLoss with these parameters:{
"activation_fn": "torch.nn.modules.linear.Identity",
"pos_weight": null
}
per_device_train_batch_size: 1num_train_epochs: 1warmup_steps: 0.1gradient_accumulation_steps: 8bf16: Truegradient_checkpointing: Truegradient_checkpointing_kwargs: {'use_reentrant': False}per_device_eval_batch_size: 1save_only_model: Trueload_best_model_at_end: Trueper_device_train_batch_size: 1num_train_epochs: 1max_steps: -1learning_rate: 5e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 8average_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: 1prediction_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: Truesave_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: Trueignore_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: 0dataloader_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: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}warmup_ratio: None| Epoch | Step | Training Loss | vdr-eval-hard_ndcg@10 |
|---|---|---|---|
| -1 | -1 | - | 0.9813 |
| 0.05 | 125 | 0.2833 | - |
| 0.1 | 250 | 0.2578 | 0.9813 |
| 0.15 | 375 | 0.2396 | - |
| 0.2 | 500 | 0.2365 | 0.9547 |
| 0.25 | 625 | 0.2523 | - |
| 0.3 | 750 | 0.2308 | 0.9845 |
| 0.35 | 875 | 0.2204 | - |
| 0.4 | 1000 | 0.1964 | 0.9831 |
| 0.45 | 1125 | 0.2392 | - |
| 0.5 | 1250 | 0.2281 | 0.9809 |
| 0.55 | 1375 | 0.2234 | - |
| 0.6 | 1500 | 0.1982 | 0.9836 |
| 0.65 | 1625 | 0.1809 | - |
| 0.7 | 1750 | 0.2319 | 0.9838 |
| 0.75 | 1875 | 0.1801 | - |
| 0.8 | 2000 | 0.2585 | 0.9832 |
| 0.85 | 2125 | 0.2225 | - |
| 0.9 | 2250 | 0.1990 | 0.9817 |
| 0.95 | 2375 | 0.1773 | - |
| 1.0 | 2500 | 0.2126 | 0.9834 |
| -1 | -1 | - | 0.9845 |
@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",
}