Programming Quantum Circuit Parameters with Large Language Models

Tiago de Souza Farias, Caio Moraes Porto, Matheus da Silva Fonseca, Nicolas Armando Cabrera Carpi, Anderson de Araujo Oliveira, Celso Jorge Villas-BoasarXiv 2026 · arXiv

TL;DR

Researchers have demonstrated that frozen, general-purpose Large Language Models (LLMs) can "program" quantum circuits by generating near-optimal parameters directly from symbolic descriptions. While they struggle with purely random problems, LLMs excel at identifying physical and mathematical structures in molecular and parent Hamiltonians, often reaching high-precision solutions in far fewer quantum evaluations than traditional classical optimizers.

What Problem Does This Paper Address?

Variational Quantum Algorithms (VQAs) are the primary tools for the current "Noisy Intermediate-Scale Quantum" (NISQ) era. They work by using a classical optimizer to iteratively tweak the parameters of a quantum circuit to minimize an objective function, such as the ground-state energy of a molecule.

The major bottleneck is the cost of evaluation. Every step of a classical optimizer (like Adam or COBYLA) requires thousands of circuit executions on actual quantum hardware to estimate gradients and energy. As circuits grow, the number of required measurements becomes prohibitive. This paper asks: Can an LLM, acting as a "Language Model Optimizer" (LMO), use its symbolic reasoning capabilities to bypass this iterative grind and propose high-quality parameters in a "zero-shot" or "few-shot" manner?

Methods

The authors introduce the Language Model Optimizer (LMO) framework. Instead of training a specialized neural network, they use a frozen, general-purpose LLM (GPT-6 Astra).

The process works as follows:

  1. Input: The LLM receives a prompt containing the quantum circuit in OpenQASM 3 format and the target Hamiltonian as a list of Pauli strings and coefficients.
  2. Inference: The LLM generates a complete vector of numerical parameters ($\theta$) and a textual explanation of its reasoning.
  3. Verification: These parameters are loaded into a quantum simulator (or hardware) to calculate the energy.
  4. Feedback (Optional): The resulting energy can be fed back to the LLM to refine its next proposal.

The study compares this approach against the standard Adam optimizer and also tests the LLM's ability to perform "blind circuit interpretation"—identifying the purpose of a circuit without being told its name.

Comparison of conventional gradient-based optimization (a) vs. the LLM-based approach (b).

Datasets and Benchmarks

The authors evaluated the LMO across three distinct problem classes:

  • Molecular Hamiltonians ($H_4$ and $LiH$): Real-world physical systems where the LLM can leverage "physics-aware" prompts (including geometry and basis sets).
  • Structured Parent Hamiltonians: Mathematically constructed problems where a known ground state is guaranteed to be representable by the circuit.
  • General Random Hamiltonians: Problems with no inherent physical structure, serving as a baseline to test if the LLM is just a "lucky guesser."
  • Circuit Interpretation Benchmark: 45 circuit instances (Grover’s, QFT, Bernstein-Vazirani) represented in logical, native, and obfuscated forms to test the model's robustness to code changes.

Key Insights and Ideas

  • Structure is the Secret Sauce: The LLM's performance is highly dependent on problem structure. It performed remarkably well on molecules and structured math problems but failed to outperform Adam on random Hamiltonians. This suggests the LLM is performing symbolic inference based on patterns it learned during pre-training, rather than generic numerical optimization.
  • Parameters are Better than Predictions: When asked to directly predict the minimum energy of a system, the LLM often "hallucinated" values that violated physical laws (falling below the spectral lower bound). However, when asked to provide circuit parameters, the results were physically realizable and independently verifiable.
  • Functional vs. Nominal Recognition: In the "blind interpretation" task, the LLM often failed to identify an algorithm by name (e.g., failing to recognize an obfuscated Bernstein-Vazirani circuit) but could still correctly predict the measurement outcomes (the "secret bitstring") with 96.7% accuracy.
Figure 3: Workflow of language-model-based parameter optimization for molecular Hamiltonians. A molecular system is represented by a qubit Hamiltonian and a fixed parameterized quantum circuit. Their symbolic descriptions are incorporated into a prompt, optionally supplemented with molecular information and previous energy evaluations. A frozen, general-purpose LLM generates a complete parameter vector and a textual explanation of its proposed mechanism. The predicted parameters are assigned to the circuit, which can subsequently be evaluated to provide energy feedback for further proposals. Solid arrows indicate the main information and parameter flow, while the dashed arrow represents optional molecular information supplied directly to the prompt.

Key Results

  • Efficiency Gains: For the $LiH$ molecule, the LMO achieved energy errors near numerical precision within just a few evaluations. In contrast, the Adam optimizer required hundreds of evaluations to reach the same "chemical accuracy" threshold.
  • Zero-Shot Success: On structured parent Hamiltonians, the LLM reached the success threshold in its very first proposal for roughly 82-89% of the test cases.
  • Robustness: The LLM proved surprisingly resilient to "obfuscation" (randomized gate transformations that preserve the underlying math). Even when the circuit look unrecognizable to a human, the LLM could often infer its functional behavior.
Figure 2: Blind interpretation of quantum circuits using a frozen large language model. A circuit and its numerical parameters are serialized into OpenQASM 3 and provided without algorithm-specific metadata. The model generates a structured interpretation describing the circuit behavior, possible computational purpose, expected measurement outcomes, supporting gate-level evidence, alternative hypotheses, and uncertainty. Its predictions are subsequently compared with independently established circuit properties.

Limitations and Future Work

  • Scalability: The experiments were limited to relatively small systems (up to 12 qubits). It remains to be seen if LLMs can handle the massive OpenQASM files required for 50+ qubit systems.
  • The "Black Box" Problem: It is unclear to what extent the LLM is "reasoning" versus recalling similar circuits from its training data.
  • Inference Cost: While the LLM saves quantum evaluations, LLM inference itself is computationally expensive. Future work should analyze the total classical-plus-quantum resource trade-off.
  • Hybrid Strategies: The authors suggest that LLMs might be best used as "warm-start" tools—providing a high-quality initial guess that a classical optimizer then fine-tunes.

Summary updated

Abstract

Large language models (LLMs) have recently demonstrated the ability to generate parameters for variational quantum circuits without conventional optimization. However, the conditions under which this approach is effective remain unclear. Here, we investigate a frozen, general-purpose LLM that generates complete circuit parameter vectors from symbolic circuit and Hamiltonian descriptions, with optional iterative energy feedback. We evaluate the approach on general random Hamiltonians, structured parent Hamiltonians, and molecular systems. For general Hamiltonians, LLM-generated parameters exhibit larger energy errors than conventional Adam optimization, while additional feedback generally provides limited improvement. In contrast, for structured Hamiltonians, the LLM can generate promising low-energy parameter configurations, suggesting that identifiable physical and mathematical structure facilitates parameter inference. We also show that direct LLM predictions of minimum energies can violate the Hamiltonian spectral lower bound, whereas generated circuit parameters allow independent evaluation of physically realizable energy expectation values. Finally, we investigate blind circuit interpretation and find that the LLM can predict measurement outcomes even when it fails to identify the underlying quantum algorithm. These findings highlight the role of problem structure, the limitations of iterative LLM optimization, and the importance of independently verifiable predictions in quantum parameter programming.
BibTeX
@misc{farias2026programming,
  author = {Tiago de Souza Farias and Caio Moraes Porto and Matheus da Silva Fonseca and Nicolas Armando Cabrera Carpi and Anderson de Araujo Oliveira and Celso Jorge Villas-Boas},
  title = {{Programming Quantum Circuit Parameters with Large Language Models}},
  year = {2026},
  eprint = {2611.17246},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.17246},
}
Figure