# Quantum Circuit Generation via test-time learning with large language models

arXiv: https://arxiv.org/abs/2602.03466 · HTML: https://mlsanity.com/paper/2602.03466/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Builds on 24 of its 41 references that are in the map.
- First posted on arXiv 3 Feb 2026.

## Builds on (most cited first, 24 of 24)

- [A Survey of Large Language Models](https://mlsanity.com/paper/2303.18223/) (2023)
- [HuggingFace's Transformers: State-of-the-art Natural Language Processing](https://mlsanity.com/paper/1910.03771/) (2019)
- [The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalization](https://mlsanity.com/paper/2006.16241/) (2020)
- [WILDS: A Benchmark of in-the-Wild Distribution Shifts](https://mlsanity.com/paper/2012.07421/) (2020)
- [A Survey on Evaluation of Large Language Models](https://mlsanity.com/paper/2307.03109/) (2023)
- [Beyond Accuracy: Behavioral Testing of NLP models with CheckList](https://mlsanity.com/paper/2005.04118/) (2020)
- [Large Language Monkeys: Scaling Inference Compute with Repeated Sampling](https://mlsanity.com/paper/2407.21787/) (2024)
- [A Comprehensive Overview of Large Language Models](https://mlsanity.com/paper/2307.06435/) (2023)
- [Reinforcement learning](https://mlsanity.com/paper/2405.10369/) (2024)
- [Online Learning: A Comprehensive Survey](https://mlsanity.com/paper/1802.02871/) (2018)
- [Talking About Large Language Models](https://mlsanity.com/paper/2212.03551/) (2022)
- [Dynamic Cheatsheet: Test-Time Learning with Adaptive Memory](https://mlsanity.com/paper/2504.07952/) (2025)
- [Learning to Discover at Test Time](https://mlsanity.com/paper/2601.16175/) (2026)
- [The Effect of Natural Distribution Shift on Question Answering Models](https://mlsanity.com/paper/2004.14444/) (2020)
- [Reinforcement Learning with Quantum Variational Circuits](https://mlsanity.com/paper/2008.07524/) (2020)
- [Keeping it Simple: Language Models can learn Complex Molecular Distributions](https://mlsanity.com/paper/2112.03041/) (2021)
- [Adaptive Inference-Time Compute: LLMs Can Predict if They Can Do Better, Even Mid-Generation](https://mlsanity.com/paper/2410.02725/) (2024)
- [Inference-Time Scaling for Complex Tasks: Where We Stand and What Lies Ahead](https://mlsanity.com/paper/2504.00294/) (2025)
- [Quantum circuit synthesis with diffusion models](https://mlsanity.com/paper/2311.02041/) (2023)
- [Inference-Time Computations for LLM Reasoning and Planning: A Benchmark and Insights](https://mlsanity.com/paper/2502.12521/) (2025)
- [Agent-Q: Fine-Tuning Large Language Models for Quantum Circuit Generation and Optimization](https://mlsanity.com/paper/2504.11109/) (2025)
- [A Comprehensive Analysis of Large Language Model Outputs: Similarity, Diversity, and Bias](https://mlsanity.com/paper/2505.09056/) (2025)
- [Reinforcement Learning Generation of 4-Qubits Entangled States](https://mlsanity.com/paper/2204.12351/) (2022)
- [Reinforcement Learning to Disentangle Multiqubit Quantum States from Partial Observations](https://mlsanity.com/paper/2406.07884/) (2024)

## Built on by (most cited first, 1 of 1)

- [AG-CoT: Verified Algorithmic Traces for LLM Program Synthesis on Clifford Circuits](https://mlsanity.com/paper/2609.33192/) (2026)

## Abstract (arXiv)

Deploying large language models (LLMs) as optimizers for black-box scientific design problems requires efficient test-time refinement under expensive evaluations and without training data. We propose a memory-augmented test-time optimization framework that combines episodic memory of high-scoring candidates, score-difference feedback, and restart-from-best sampling to improve iterative search. We evaluate the approach on quantum circuit synthesis, where the objective is to maximize the Meyer--Wallach (MW) global entanglement measure under an exponentially expensive black-box oracle. On 20-qubit circuits, the framework achieves Q(psi)=0.99 without feedback. On the more challenging 25-qubit task, feedback and restart mechanisms enable multiple runs to reach Q(psi)=1.0 within 45 oracle calls, while a budget-matched random hill-climbing baseline stalls below Q(psi)≈0.29. These results demonstrate that memory and evaluator feedback substantially improve the sample efficiency of LLM-based black-box optimization and establish quantum circuit synthesis as a challenging benchmark for test-time optimization.
