Downloads · 30 days
7
5% of all-time downloads
samuellimabraz/Qwen3-VL-8B-rslora-r32
Qwen3-VL-8B-rslora-r32 is a image-text-to-text model from samuellimabraz. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
7
5% of all-time downloads
All-time downloads
141
Public
Parameters
8.8B
17.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors17.5 GB · 100%
From the Hugging Face model README
The first multimodal Vision-Language Model specialized for quantum computing with Qiskit
</div>This model is a fine-tuned version of Qwen3-VL-8B-Instruct specialized for quantum computing tasks using Qiskit 2.0. This model can interpret visual representations of quantum computing: circuit diagrams, Bloch spheres, and measurement histograms.
The model was trained using Rank-Stabilized Low-Rank Adaptation (rsLoRA) with rank 32 for 1 epoch on the Quantum Assistant Dataset, achieving significant improvements on multimodal quantum code generation tasks.
Evaluation was conducted on three complementary benchmarks: Qiskit HumanEval (151 function completion problems), Qiskit HumanEval Hard (151 code generation problems), and the synthetic test set (1,290 samples). Models were served via vLLM on A100 80GB PCIe with greedy decoding (temperature 0).
<sub>QHE: Qiskit HumanEval (function completion) · QHE Hard: code generation · †Qwen2.5-Coder-14B-Qiskit evaluated only on text samples (55% of synthetic dataset)</sub>
| Metric | Improvement vs Baseline |
|---|---|
| Qiskit HumanEval Pass@1 | +11.26 pp (32.45% → 43.71%) |
| Qiskit HumanEval Hard Pass@1 | +16.56 pp (11.92% → 28.48%) |
| Multimodal Code Pass@1 | +25.89 pp (37.50% → 63.39%) |
| Text-only Code Pass@1 | +15.21 pp (30.24% → 45.45%) |
The most significant differential is in multimodal samples: the fine-tuned model achieves 63.39% Pass@1 on image-based code generation vs 45.45% on text-only (+17.94 pp), validating that training on visual-textual samples develops domain-specific visual understanding capabilities.
<p align="center"> <img src="https://media.githubusercontent.com/media/samuellimabraz/quantum-assistant/e6343925e75425cdf4cac47592fd963b8fdb76f2/assets/images/fig_combined_results.png" alt="Combined Results" width="95%"> <br> <em>Evaluation results: (a) Qiskit HumanEval benchmarks, (b) visual content impact, (c) synthetic dataset, (d) fine-tuning gains</em> </p>| Category | Pass@1 | vs Baseline |
|---|---|---|
| quantum_info_and_operators | 65.76% | +37.74 pp |
| circuits_and_gates | 61.47% | +25.46 pp |
| hardware_and_providers | 57.94% | +50.00 pp |
| transpilation_and_compilation | 57.43% | +38.62 pp |
| algorithms_and_applications | 52.27% | +28.18 pp |
| noise_and_error_mitigation | 42.86% | +38.10 pp |
| primitives_and_execution | 32.18% | +21.84 pp |
The experimental strategy was organized in two phases: PEFT technique selection and hyperparameter optimization.
Five LoRA variants were compared with controlled configuration (r=16, α=32, 1 epoch):
| Variant | Eval Loss ↓ | Eval Accuracy ↑ | Runtime (s) |
|---|---|---|---|
| rsLoRA | 0.622 | 0.818 | 1,060 |
| DoRA | 0.622 | 0.818 | 2,307 |
| rsLoRA (frozen aligner) | 0.623 | 0.817 | 1,057 |
| LoRA (vanilla) | 0.646 | 0.812 | 1,056 |
| PiSSA | 0.657 | 0.812 | 1,172 |
| OLoRA | 0.742 | 0.794 | 1,067 |
Key findings:
With rsLoRA selected, the impact of adapter rank and training duration was investigated:
| Configuration | Eval Loss ↓ | Eval Accuracy ↑ | Notes |
|---|---|---|---|
| r=32, 1 epoch | 0.607 | 0.821 | Optimal trade-off |
| r=64, 1 epoch | 0.609 | 0.822 | Marginal improvement |
| r=16, 1 epoch | 0.622 | 0.818 | Baseline rsLoRA |
| r=32, 2 epochs | 0.638 | 0.825 | Slight overfitting |
| r=128, 3 epochs | 0.789 | 0.822 | Severe overfitting |
Conclusions: rsLoRA with r=32 and 1-2 epochs maximizes generalization while avoiding memorization of the synthetic dataset.
This model is part of the Quantum Assistant collection. All models are merged versions ready for inference:
| Model | Configuration | Description |
|---|---|---|
| Qwen3-VL-8B-rslora-r32-2 | rsLoRA r=32, 2 epochs | Best overall performance |
| Qwen3-VL-8B-rslora-r32 | rsLoRA r=32, 1 epoch | Best generalization |
| Qwen3-VL-8B-rslora-r64 | rsLoRA r=64, 1 epoch | Higher capacity |
| Qwen3-VL-8B-rslora-r128 | rsLoRA r=128, 1 epoch | Maximum capacity |
| Qwen3-VL-8B-lora | LoRA r=16, 1 epoch | Vanilla LoRA |
| Qwen3-VL-8B-dora | DoRA r=16, 1 epoch | Magnitude-direction decomposition |
| Qwen3-VL-8B-pissa | PiSSA r=16, 1 epoch | SVD initialization |
| Qwen3-VL-8B-olora | OLoRA r=16, 1 epoch | QR orthonormal initialization |
| Qwen3-VL-8B-rslora-frozen | rsLoRA r=16, frozen aligner | Ablation study |
| Qwen3-VL-8B-rslora | rsLoRA r=16, 1 epoch | Baseline rsLoRA |
python -m vllm.entrypoints.openai.api_server \
--host 0.0.0.0 \
--port 8000 \
--model samuellimabraz/Qwen3-VL-8B-rslora-r32 \
--gpu-memory-utilization 0.92 \
--max-model-len 12288 \
--max-num-seqs 16 \
--max-num-batched-tokens 49152 \
--enable-chunked-prefill \
--enable-prefix-caching
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
from qwen_vl_utils import process_vision_info
model = Qwen3VLForConditionalGeneration.from_pretrained(
"samuellimabraz/Qwen3-VL-8B-rslora-r32",
torch_dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained("samuellimabraz/Qwen3-VL-8B-rslora-r32")
messages = [
{"role": "system", "content": "You are a quantum computing expert assistant specializing in Qiskit."},
{"role": "user", "content": "Create a function that builds a 3-qubit GHZ state and returns the circuit."}
]
messages_with_image = [
{"role": "system", "content": "You are a quantum computing expert assistant specializing in Qiskit."},
{"role": "user", "content": [
{"type": "image", "image": "path/to/circuit.png"},
{"type": "text", "text": "Implement the quantum circuit shown in the image."}
]}
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
padding=True,
return_tensors="pt"
).to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=1024)
output = processor.batch_decode(
generated_ids[:, inputs.input_ids.shape[1]:],
skip_special_tokens=True
)[0]
print(output)
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen3-VL-8B-Instruct |
| PEFT Method | rsLoRA (Rank-Stabilized LoRA) |
| Rank (r) | 32 |
| Alpha (α) | 64 |
| Dropout | 0.10 |
| Target Modules | all-linear |
| Learning Rate | 2e-4 |
| LR Scheduler | Cosine |
| Weight Decay | 0.05 |
| Warmup Steps | 10 |
| Epochs | 1 |
| Batch Size | 32 |
| Precision | bfloat16 |
| Framework | ms-swift |
| Component | Status |
|---|---|
| Vision Encoder (ViT) | ❄️ Frozen |
| Vision-Language Aligner | 🔥 Trainable |
| Language Model (LLM) | 🔥 Trainable |
You are a quantum computing expert assistant specializing in Qiskit.
Provide accurate, clear, and well-structured responses about quantum computing concepts,
algorithms, and code implementation. Use Qiskit 2.0 best practices.
circuits_and_gates than primitives_and_executionIf you use this model in your research, please cite:
@article{braz2026quantumassistant,
title = {Quantum Assistant: Specialization of Multimodal Vision-Language Models for Quantum Computing},
author = {Braz, Samuel Lima and Leite, Jo{\~a}o Paulo Reus Rodrigues},
journal = {Expert Systems with Applications},
year = {2026},
issn = {0957-4174},
doi = {10.1016/j.eswa.2026.133931},
url = {https://doi.org/10.1016/j.eswa.2026.133931},
publisher = {Elsevier}
}
This model is released under the Apache 2.0 License.