ICML 2026 · AI as a Tool for Mathematics, CS & ML · Code Release

Automating QUBO Formulation
Generation from Natural Language

A multi-agent LLM pipeline that converts plain-English optimization problems into verified, executable QUBO formulations — ready for quantum and classical solvers.

Niloy Kumar Mondal  &  Md Rizwan Parvez  ·  Accepted at ICML 2026 Workshop: AI as a Tool for Mathematics, CS & ML

What is QuantumQUBO Agent?

A fully automated pipeline for QUBO formulation generation, verification, and code synthesis.

Quadratic Unconstrained Binary Optimization (QUBO) is the universal input format for quantum annealers and many classical heuristics — but formulating a real-world problem as a QUBO requires deep mathematical expertise and is notoriously error-prone.

QuantumQUBO Agent replaces this manual process with a six-stage LLM pipeline: a natural language problem description enters one end, and a mathematically verified QUBO matrix with executable Python code comes out the other.

Evaluated on the QUBOBench dataset — 100 diverse optimization problems across 9 application domains — our system achieves a 68% end-to-end success rate with automatic test-case generation and brute-force verification, no human in the loop.

OpenRouter API Qwen3.6-35B Qwen3-Coder dimod compatible D-Wave / Braket
QuantumQUBO Agent pipeline architecture
0 Benchmark Problems
0% End-to-End Success Rate
0 Specialized Agents
0 Application Domains

100 QUBO Problems

All benchmarks are drawn from the QUBOBench dataset. Filter by domain or search by name.

100 problems shown

# Problem Domain Status Tokens Time (s)

Sample Problems

Four worked examples showing the natural language input, QUBO formulation, and generated Python code.

Max-Cut

Graph Theory · ✓ Success

Given an undirected weighted graph $G=(V,E)$, partition the vertices into two disjoint subsets $V_0$ and $V_1$ to maximise the total weight of edges crossing the cut. Each vertex $i$ is assigned a binary variable $x_i \in \{0,1\}$.

\[H(x) = -\sum_{(i,j)\in E} w_{ij}\bigl(x_i + x_j - 2x_ix_j\bigr)\] \[Q_{ii} = -\!\!\sum_{j:(i,j)\in E}\!\!w_{ij},\quad Q_{ij} = 2w_{ij} \text{ for }(i,j)\in E\]
import numpy as np

def build_qubo(instance):
    n = instance["n_nodes"]
    Q = np.zeros((n, n))
    for i, j, w in instance["edges"]:
        Q[i, i] -= w
        Q[j, j] -= w
        Q[i, j] += 2 * w
    return Q

Knapsack

Combinatorial · ✓ Success

Select a subset of $n$ items, each with value $v_i$ and weight $w_i$, to maximise total value subject to the constraint that the total weight does not exceed capacity $W$. Binary variable $x_i=1$ if item $i$ is selected.

\[H(x) = -\sum_i v_i x_i + P\!\left(\sum_i w_i x_i - W\right)^{\!2}\]

where $P$ is a penalty coefficient chosen so that $P > \max_i v_i$.

def build_qubo(instance):
    v = instance["values"]
    w = instance["weights"]
    W = instance["capacity"]
    n = len(v)
    P = max(v) + 1
    Q = np.zeros((n, n))
    for i in range(n):
        Q[i,i] += -v[i] + P*w[i]**2 - 2*P*W*w[i]
        for j in range(i+1, n):
            Q[i,j] += 2*P*w[i]*w[j]
    return Q

Quantum Circuit Routing

Quantum Computing · ✓ Success

Map logical qubits to physical qubits on a hardware graph such that all two-qubit gates act on adjacent physical qubits, minimising the total SWAP overhead. Variables $x_{lp}=1$ if logical qubit $l$ is mapped to physical qubit $p$.

\[H = P_1\!\sum_l\!\Bigl(\sum_p x_{lp}-1\Bigr)^{\!2} + P_1\!\sum_p\!\Bigl(\sum_l x_{lp}-1\Bigr)^{\!2} + P_2\!\sum_{(l,l')\in G_c}\sum_{(p,p')\notin G_h} x_{lp}x_{l'p'}\]
def build_qubo(instance):
    L = instance["n_logical"]
    P = instance["n_physical"]
    hw = set(map(tuple, instance["hw_edges"]))
    gates = instance["circuit_edges"]
    n = L * P; P1 = 10; P2 = 5
    Q = np.zeros((n, n))
    # one-hot constraints …
    return Q

Portfolio Optimization

Finance · ✓ Success

Select exactly $k$ assets from a universe of $n$ to maximise expected return $\mu^Tx$ while minimising portfolio variance $x^T\Sigma x$. The cardinality constraint $\sum_i x_i = k$ is enforced as a penalty.

\[H(x)= -\mu^Tx + \lambda\, x^T\Sigma x + P\!\left(\sum_i x_i - k\right)^{\!2}\]

$\lambda$ trades off return vs. risk; $P$ enforces the cardinality constraint.

def build_qubo(instance):
    mu = np.array(instance["returns"])
    Sigma = np.array(instance["covariance"])
    k, lam = instance["k"], instance["lambda"]
    n = len(mu); P = float(np.max(np.abs(mu))) * n
    Q = lam * Sigma.copy()
    for i in range(n):
        Q[i,i] += -mu[i] + P*(1-2*k)
        for j in range(i+1,n):
            Q[i,j] += 2*P
    return Q

Cite This Work

If you use QuantumQUBO Agent in your research, please cite our paper. For the benchmark dataset, also cite QUBOBench.

@inproceedings{mondal2026quantumqubo, title = {Quantum{QUBO} Agent: Automating Quadratic Unconstrained Binary Optimization ({QUBO}) Formulation Generation from Natural Language}, author = {Niloy Kumar Mondal and Md Rizwan Parvez}, booktitle = {ICML 2026 Workshop: AI as a Tool for Mathematics, Computer Science, and Machine Learning}, year = {2026}, url = {https://openreview.net/forum?id=9YTedapat4}, }