Validated on T-9 hardware

Quantum Language Model

First diffusion language model inference on real quantum hardware. 3 qubits, 4 CNOTs, 2648 parameters.

Try the interactive demo

How It Works

A tiny MLP learns language patterns, gets converted to a quantum circuit, and runs on real hardware.

1

Classical Training

A 2-layer MLP (61 → 32 → 16 → 8) learns masked token prediction on a tiny 8-word vocabulary. Trained with Adam optimizer for 5000 steps.

Input: "the ___ sat on the mat" ↓ [One-hot encode all tokens] [Mark masked position] ↓ MLP: 61 → 32 → 16 → 8 ↓ Output: P(cat)=0.72, P(dog)=0.18, ...
2

Quantum Conversion

The MLP's output probability distribution is encoded into rotation angles on 3 qubits. Each prediction becomes a quantum circuit with ~4 CNOTs.

q0: |0⟩──[Ry]──●────────────────╮── M │ │ q1: |0⟩───────┴──[Ry]──●────┴── M │ q2: |0⟩──────────────┴──[Ry]── M
3

Run on T-9

Circuits run on the QuTech Tuna-9 superconducting processor. 4096 shots per circuit. Measurement outcomes decoded back to token predictions.

QuTech Tuna-9 (T-9) ────────────────────── 9 transmon qubits e_1q ~ 0.1%, e_2q ~ 1% 4096 shots per circuit Measured: |101⟩ = token 5 = "mat"

Interactive Demo

Build a sentence, mask one word, and see the model's prediction. This runs the actual trained MLP weights in your browser.

VOCABULARY (tap to add to sentence)

YOUR SENTENCE

Tap tokens above to build a sentence...
Runs the classical MLP (2648 params) entirely in your browser via JavaScript. No server needed. Real T-9 hardware results shown below.

T-9 Hardware Results

8 test cases run on QuTech Tuna-9 superconducting quantum computer. 4096 shots each.

0%
Random baseline
(1/8 chance)
50%
Quantum (T-9)
4/8 correct
62.5%
Classical MLP
5/8 correct
p = 0.011
Statistical significance
quantum ≠ random
Test Case Expected Classical Quantum (T-9)
the cat ___ sat ran ran
the dog ___ ran ran cat
___ cat sat the the the
the ___ sat on a mat cat cat cat
cat ___ ran ran sat
dog ___ sat ran sat
___ mat the cat cat
the cat sat on ___ mat mat mat

Honest Limitations

This is a proof-of-concept. Here is what it cannot do.