Instructions to use jay2219/Q-Route-70B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use jay2219/Q-Route-70B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("togethercomputer/Meta-Llama-3.3-70B-Instruct-Reference") model = PeftModel.from_pretrained(base_model, "jay2219/Q-Route-70B") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,24 +1,78 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
| 3 |
library_name: peft
|
| 4 |
-
license:
|
| 5 |
-
---
|
| 6 |
-
|
| 7 |
tags:
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
|
| 13 |
-
- adaption-labs
|
| 14 |
datasets:
|
| 15 |
- jay2219/quantum-circuit-routing
|
| 16 |
-
pipeline_tag: text-generation
|
| 17 |
---
|
| 18 |
|
| 19 |
# ⚛️ Q-Route-70B: Quantum Hardware Compiler Model Card
|
| 20 |
|
| 21 |
**Q-Route-70B** is a domain-adapted frontier AI compiler model fine-tuned on `Llama-3.3-70B-Instruct` via the **Adaption Labs AutoScientist** platform. It compiles abstract OpenQASM 2.0 quantum circuits to strictly adhere to physical target QPU connectivity graphs (Line, Ring, Star, Grid, and IBM Heavy-Hex hardware topologies).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
---
|
| 24 |
|
|
@@ -26,9 +80,8 @@ pipeline_tag: text-generation
|
|
| 26 |
|
| 27 |
- **Model Name:** `Q-Route-70B`
|
| 28 |
- **Model Type:** Fine-Tuned PEFT/LoRA Causal Language Model
|
| 29 |
-
- **Base Model:** `
|
| 30 |
- **Language/Domain:** OpenQASM 2.0 Spatial Graph Compiler Code
|
| 31 |
-
- **License:** Apache 2.0
|
| 32 |
|
| 33 |
---
|
| 34 |
|
|
@@ -54,7 +107,7 @@ import torch
|
|
| 54 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 55 |
from peft import PeftModel
|
| 56 |
|
| 57 |
-
base_model_id = "
|
| 58 |
adapter_id = "jay2219/Q-Route-70B"
|
| 59 |
|
| 60 |
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
|
|
@@ -79,8 +132,8 @@ creg c[15];
|
|
| 79 |
cx q[1], q[5];
|
| 80 |
measure q -> c;
|
| 81 |
```
|
| 82 |
-
### Compiled Hardware-Compliant OpenQASM 2.0:
|
| 83 |
-
|
| 84 |
prompt = f"<|im_start|>system\n{system_prompt}<|im_end|>\n<|im_start|>user\n{user_prompt}<|im_end|>\n<|im_start|>assistant\n"
|
| 85 |
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 86 |
|
|
@@ -99,5 +152,5 @@ print(compiled_qasm)
|
|
| 99 |
- **LoRA Alpha ($\alpha$):** 128
|
| 100 |
- **Dropout:** 0.0
|
| 101 |
- **Target Modules:** `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`
|
| 102 |
-
- **Training Dataset:** 15,000 Qiskit ground-truth pairs across 5 hardware topology families.
|
| 103 |
- **Platform:** Adaption Labs AutoScientist platform.
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: meta-llama/Llama-3.3-70B-Instruct-Reference
|
| 3 |
library_name: peft
|
| 4 |
+
license: other
|
|
|
|
|
|
|
| 5 |
tags:
|
| 6 |
+
- lora
|
| 7 |
+
- peft
|
| 8 |
+
- adapter
|
| 9 |
+
- adaption
|
| 10 |
+
pipeline_tag: text-generation
|
|
|
|
| 11 |
datasets:
|
| 12 |
- jay2219/quantum-circuit-routing
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# ⚛️ Q-Route-70B: Quantum Hardware Compiler Model Card
|
| 16 |
|
| 17 |
**Q-Route-70B** is a domain-adapted frontier AI compiler model fine-tuned on `Llama-3.3-70B-Instruct` via the **Adaption Labs AutoScientist** platform. It compiles abstract OpenQASM 2.0 quantum circuits to strictly adhere to physical target QPU connectivity graphs (Line, Ring, Star, Grid, and IBM Heavy-Hex hardware topologies).
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## Model Training
|
| 21 |
+
|
| 22 |
+
A LORA adapter for `meta-llama/Llama-3.3-70B-Instruct-Reference`. This model was trained with SFT using [Adaption](https://adaptionlabs.ai)'s AutoScientist on the quantum_circuit_routing dataset.
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
|
| 27 |
+
### AutoScientist Config
|
| 28 |
+
|
| 29 |
+
```json
|
| 30 |
+
{
|
| 31 |
+
"job_id": "72858b84-6e51-44fa-b887-56fd54517a8a",
|
| 32 |
+
"training_experiment_id": "dcc1dae2-3122-4888-99a8-3c296afd1020",
|
| 33 |
+
"original_model_name": "meta-llama/Llama-3.3-70B-Instruct-Reference",
|
| 34 |
+
"trained_model_name": "adaption_quantum_circuit_routing",
|
| 35 |
+
"training_method": "sft",
|
| 36 |
+
"training_type": "lora",
|
| 37 |
+
"data_format": "chat",
|
| 38 |
+
"hyperparams": {
|
| 39 |
+
"lora": "true",
|
| 40 |
+
"lora_r": 64,
|
| 41 |
+
"n_evals": 5,
|
| 42 |
+
"n_epochs": 2,
|
| 43 |
+
"batch_size": "max",
|
| 44 |
+
"lora_alpha": 128,
|
| 45 |
+
"lora_dropout": 0,
|
| 46 |
+
"min_lr_ratio": 0.1,
|
| 47 |
+
"warmup_ratio": 0.05,
|
| 48 |
+
"weight_decay": 0.05,
|
| 49 |
+
"learning_rate": 0.0001,
|
| 50 |
+
"max_grad_norm": 1,
|
| 51 |
+
"base_model_size": "70B",
|
| 52 |
+
"train_on_inputs": "false",
|
| 53 |
+
"training_method": "sft",
|
| 54 |
+
"lr_scheduler_type": "cosine",
|
| 55 |
+
"scheduler_num_cycles": 0.5,
|
| 56 |
+
"lora_trainable_modules": "all-linear"
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Training Data
|
| 62 |
+
|
| 63 |
+
The model was trained on 14,583 rows of adapted data with the following domain distribution: code (79%), science (21%), technology (0%).
|
| 64 |
+
|
| 65 |
+
## Model Evaluation
|
| 66 |
+
|
| 67 |
+
The model was evaluated on an in-distribution held-out test set as well as a broader domain-specific test set to measure generalization.
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
|
| 72 |
+
| Domain | Win rate vs. base model |
|
| 73 |
+
| --- | --- |
|
| 74 |
+
| code | 50% |
|
| 75 |
+
|
| 76 |
|
| 77 |
---
|
| 78 |
|
|
|
|
| 80 |
|
| 81 |
- **Model Name:** `Q-Route-70B`
|
| 82 |
- **Model Type:** Fine-Tuned PEFT/LoRA Causal Language Model
|
| 83 |
+
- **Base Model:** `meta-llama/Llama-3.3-70B-Instruct-Reference` (70B parameters)
|
| 84 |
- **Language/Domain:** OpenQASM 2.0 Spatial Graph Compiler Code
|
|
|
|
| 85 |
|
| 86 |
---
|
| 87 |
|
|
|
|
| 107 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 108 |
from peft import PeftModel
|
| 109 |
|
| 110 |
+
base_model_id = "meta-llama/Meta-Llama-3.3-70B-Instruct-Reference"
|
| 111 |
adapter_id = "jay2219/Q-Route-70B"
|
| 112 |
|
| 113 |
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
|
|
|
|
| 132 |
cx q[1], q[5];
|
| 133 |
measure q -> c;
|
| 134 |
```
|
| 135 |
+
### Compiled Hardware-Compliant OpenQASM 2.0:
|
| 136 |
+
```
|
| 137 |
prompt = f"<|im_start|>system\n{system_prompt}<|im_end|>\n<|im_start|>user\n{user_prompt}<|im_end|>\n<|im_start|>assistant\n"
|
| 138 |
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 139 |
|
|
|
|
| 152 |
- **LoRA Alpha ($\alpha$):** 128
|
| 153 |
- **Dropout:** 0.0
|
| 154 |
- **Target Modules:** `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`
|
| 155 |
+
- **Training Dataset:** ~15,000 Qiskit ground-truth pairs across 5 hardware topology families.
|
| 156 |
- **Platform:** Adaption Labs AutoScientist platform.
|