/ Модель

Характеристики

Контекст
256 токенов
Лицензия
MIT
Архитектура
gpt2 · dense
Библиотека
transformers
Опубликована
27 фев 2026

quantumgpt-124m

Генерация текстаТекст → текст3 профессии
321скачиваний за 30 дней0лайковвеса обновлены8 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Модель на базе GPT-2 генерирует небольшие квантовые схемы в OpenQASM 2.0 по текстовым описаниям.

QuantumGPT-124M — авторская модель на архитектуре GPT-2 от merileijona, предназначенная для генерации квантовых схем в OpenQASM 2.0 по текстовым описаниям. Модель содержит 124 млн параметров, использует 12 слоёв и 12 голов внимания, а её контекст ограничен 256 токенами. Она обучена на 8 129 парах описаний и схем из 92 категорий, включая квантовые состояния, вентили, алгоритмы и вариационные схемы; основной язык карточки — английский.

Модель подходит для обучения квантовым вычислениям, быстрого создания шаблонов схем, автодополнения кода QASM и подготовки примеров для тестирования симуляторов и компиляторов. Она ориентирована на небольшие схемы примерно на 1–4 кубита. По данным предварительных тестов, простые схемы и двухкубитная запутанность генерируются лучше, чем сложные алгоритмы и схемы с параметрическими вентилями.

Вывод может быть синтаксически корректным, но семантически неправильным; запуск на симуляторе или оборудовании требует проверки. README также сообщает об отсутствии дообучения на безопасность. Модель распространяется по лицензии MIT.

Сценарии применения

  • создание примеров квантовых схем для обучения
  • подготовка шаблонов схем на 1–4 кубита
  • автодополнение кода OpenQASM 2.0
  • генерация тестовых схем для квантовых симуляторов
  • быстрое прототипирование квантовых алгоритмов

Ограничения

Лучше подходит для небольших схем; качество снижается на схемах с четырьмя и более кубитами, сложных алгоритмах и параметрических вентилях. Синтаксически корректная схема может быть семантически неверной, поэтому её нужно проверять перед запуском.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

QuantumGPT-124M: Quantum Circuit Generation Model

Benchmark evidence update

This note covers checkpoint 6ae6d8d081cfb6eefda299d2335554168082fd39 with native context 256.

Originally reported. Preliminary examples and approximate accuracy by circuit type. The original card gives approximate results by circuit family. The v2 comparison reports 67.2% syntax and 23.4% semantic pass@1 for this model.

On the original long wording, all 384 inputs exceeded the 256-token window. That arm is ineligible for ranking.

Evidence gap. No fixed case list or item-level results accompany the original examples. The 354M comparison gives different v1 figures, 68.2% syntax and 13.8% semantic pass@1.

Measured on the compact development suite. The checkpoint returned 23/384 syntax-valid answers, 4/384 answers with the requested structure, and 0/384 fully correct answers. It passed 0/257 on the fixed panel with verified short reference answers.

The compact suite uses one greedy raw answer per task, the native prompt transport and context, and task-specific numerical checks for the full circuit contract. Its 384 problems are synthetic and have been used for development.

The benchmark manifest SHA-256 is 320535d4ff74d9f07db024c1e86c0e8208a8fd93c294f47332cb9c38fadf9243. Evaluation settings, context stops and full panel counts

Pinned original card

QuantumGPT-124M is a GPT-2 architecture language model trained specifically for generating quantum circuits in OpenQASM 2.0 format from natural language descriptions.

Model Description

  • Model Type: Causal Language Model (GPT-2 architecture)
  • Parameters: 124 million
  • Training Data: 8,129 quantum circuits across 92 categories (~373K tokens)
  • Output Format: OpenQASM 2.0
  • Specialty: Generates syntactically valid quantum circuits for 1-4 qubit systems

Quick Start

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("merileijona/quantumgpt-124m")
tokenizer = AutoTokenizer.from_pretrained("merileijona/quantumgpt-124m")

prompt = "<|user|>Create a Bell state with two qubits<|end|>\n<|assistant|>"
inputs = tokenizer(prompt, return_tensors="pt")

outputs = model.generate(
    **inputs,
    max_new_tokens=200,
    do_sample=True,
    temperature=0.8,
    top_k=50,
    repetition_penalty=1.1,
    pad_token_id=tokenizer.eos_token_id,
)

text = tokenizer.decode(outputs[0], skip_special_tokens=False)
qasm = text.split("<|end|>", 1)[0]
print(qasm)

Expected Output:

OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
h q[0];
cx q[0],q[1];
measure q -> c;

Model Details

Architecture

  • Base Model: GPT-2 (124M parameters)
  • Layers: 12
  • Attention Heads: 12
  • Embedding Dimension: 768
  • Context Length: 256 tokens
  • Dropout: 0.2 (training)
  • Activation Function: GELU (standard, not gelu_new)

Implementation Notes

  • Converted from a NanoGPT-style training checkpoint
  • All Conv1D weights correctly transposed for HuggingFace compatibility
  • Bias tensors injected for GPT2LMHeadModel compatibility
  • Word embeddings are tied with lm_head

Training Configuration

  • Dataset Size: 8,129 training samples
  • Unique Circuits: 739 (with 11x augmentation via paraphrasing)
  • Training Tokens: ~373,000
  • Training Steps: 1,000 iterations
  • Hardware: NVIDIA RTX 4070 12GB
  • Training Time: ~0.5 hours
  • Final Validation Loss: 0.2691
  • Train/Val Gap: 0.044 (excellent generalization)

Dataset Composition

The model was trained on 92 distinct categories of quantum circuits:

Single-Qubit Operations (14 categories):

  • Basic gates: H, X, Y, Z, S, T, Sdg, Tdg
  • Parametric rotations: RX, RY, RZ
  • Universal gates: U1, U2, U3

Two-Qubit Operations (11 categories):

  • Bell states (all 4 variants)
  • Entanglement: CNOT, CZ, SWAP, iSWAP
  • Controlled rotations

Three-Qubit Operations (6 categories):

  • GHZ states, W states
  • Toffoli, Fredkin gates

Quantum Algorithms (15 categories):

  • Deutsch-Jozsa, Grover's search
  • Phase estimation, QFT variants

Variational Circuits (15 categories):

  • VQE ansatzes, QAOA
  • Hardware-efficient ansatzes

Plus: Arithmetic circuits, error correction codes, special states, and more.

Prompt Format

The model was trained using explicit conversation delimiters:

<|user|>{description}<|end|>
<|assistant|>{qasm}<|end|>

These markers are literal text tokens, not special tokenizer tokens.

Generation should begin with:

<|assistant|>

and stop at the first occurrence of:

<|end|>

If <|assistant|> is omitted, generation quality may degrade.

Performance

Accuracy by Circuit Type from preliminary testing (just approximations!)

Circuit TypeAccuracyNotes
Basic gates (H, X, Y, Z)95-100%Near-perfect on simple gates
2-qubit entanglement90-95%Strong on Bell states, CNOT patterns
3-qubit states (GHZ, W)85-90%Good semantic understanding
Arithmetic circuits75-85%Moderate accuracy on adders/incrementers
Complex algorithms70-80%Struggles with QFT, Grover's
4+ qubit circuits60-70%Limited training data for large systems

Example Test Results (Step 600)

Perfect Generation:

Prompt: "Apply Hadamard gate to single qubit"
Output: ✅ OPENQASM 2.0; ... h q[0]; measure q[0] -> c[0];

Prompt: "Create Bell state with two qubits"
Output: ✅ OPENQASM 2.0; ... h q[0]; cx q[0],q[1]; measure q -> c;

Prompt: "Generate GHZ state with three qubits"
Output: ✅ OPENQASM 2.0; ... h q[0]; cx q[0],q[1]; cx q[0],q[2]; measure q -> c;

Limitations

  1. Qubit Count: Optimized for 1-3 qubit circuits. Performance degrades for 4+ qubits due to limited training data.

  2. Complex Algorithms: May generate syntactically valid but semantically incorrect circuits for advanced algorithms (e.g., full quantum teleportation, complex QFT implementations).

  3. Parametric Gates: Limited support for gates with specific angle parameters. May substitute similar gates (e.g., RY → Y, S → T).

  4. No Execution Guarantee: Generated circuits are syntactically valid QASM 2.0 but not guaranteed to execute correctly on quantum hardware without validation.

Intended Use

Primary Use Cases

✅ Educational Tools: Generate example circuits for quantum computing education ✅ Rapid Prototyping: Quick circuit templates for experimentation ✅ Code Completion: Assist developers writing QASM code ✅ Benchmarking: Generate diverse circuits for compiler/simulator testing

Out of Scope

❌ Production Quantum Computing: Not suitable for critical quantum applications ❌ Large-Scale Circuits: Limited to small qubit counts (1-4 qubits) ❌ Hardware Deployment: Requires validation before running on actual quantum hardware

Training Data

The model was trained on a custom dataset of 8,129 quantum circuits:

  • Source: Synthetically generated via xAI Grok API with extensive quality control
  • Format: Natural language description → QASM 2.0 code pairs
  • Quality Control: 100% QASM syntax validation, SHA256 hash deduplication
  • Diversity: 11x augmentation via paraphrasing (10 variations + original)
  • Dataset Availability: merileijona/quantum-circuits-8k

Data Generation Pipeline

  1. Master Generation: 739 unique circuits across 92 categories
  2. Hash Deduplication: SHA256 hashing ensures zero duplicates
  3. Description Augmentation: 10x paraphrasing for diversity
  4. Validation: 100% QASM 2.0 syntax compliance
  5. Train/Val/Test Split: 70/15/15

Ethical Considerations

  • No Safety Alignment: Model has not undergone safety fine-tuning
  • Hallucination Risk: May generate plausible but incorrect quantum circuits
  • Educational Purpose: Designed for learning, not production deployment
  • Verification Required: Always validate generated circuits before use

Citation

If you use this model in your research, please cite:

@misc{quantumgpt124m,
  author = {Merilehto, Juhani},
  title = {QuantumGPT-124M: Quantum Circuit Generation with GPT-2},
  year = {2026},
  publisher = {HuggingFace},
  howpublished = {\url{https://huggingface.co/merileijona/quantumgpt-124m}},
  note = {GPT-2 model trained on 8,129 quantum circuits for OpenQASM 2.0 generation}
}

Model Card Authors

Juhani Merilehto

  • HuggingFace: @merileijona
  • GitHub: @juhanimerilehto
  • Affiliation(s): University of Vaasa, School of Management; University of Turku, Faculty of Technology

License

This model is released under the MIT License.

Acknowledgments

  • Training Framework: Based on Andrej Karpathy's nanoGPT architecture
  • Data Generation: Powered by xAI Grok API
  • Tokenizer: Standard GPT-2 tokenizer (HuggingFace GPT2TokenizerFast)
  • Infrastructure: Trained on NVIDIA RTX 4070 12GB

Additional Resources


Model Version: 1.0
Release Date: February 2026
Last Updated: February 27, 2026

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
GPT2LMHeadModel
Ревизия весов
3ea52f3

0 моделей