A PennyLane-Centric Dataset to Enhance LLM-based Quantum Code Generation using RAG
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) offer powerful capabilities in code generation, natural language understanding, and domain-specific reasoning. Their application to quantum software development remains limited, in part because of the lack of high-quality datasets both for LLM training and as dependable knowledge sources. To bridge this gap, we introduce textitPennyLang, an off-the-shelf, high-quality dataset of 3,347 PennyLane-specific quantum code samples with contextual descriptions, curated from textbooks, official documentation, and open-source repositories. Our contributions are threefold: (1) the creation and open-source release of PennyLang, a purpose-built dataset for quantum programming with PennyLane; (2) a framework for automated quantum code dataset construction that systematizes curation, annotation, and formatting to maximize downstream LLM usability; and (3) a baseline evaluation of the dataset across multiple open-source and commercial models, including ablation studies, all conducted within a retrieval-augmented generation (RAG) pipeline. Using PennyLang with RAG substantially improves performance: for example, Qwen 7B's success rate rises from 8.7% without retrieval to 41.7% with full-context augmentation, and LLaMa 4 improves from 78.8% to 84.8%, while also reducing hallucinations and enhancing quantum code correctness. Moving beyond Qiskit-focused studies, we bring LLM-based tools and reproducible methods to PennyLane for advancing AI-assisted quantum development.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 22 of its 54 references that are in the map. First posted on arXiv 4 Mar 2025.
Builds on
22 of 54 references.
References · 22
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2024A Survey on Large Language Models for Code Generationcited by 646
10 more
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2023Financial Fraud Detection using Quantum Graph Neural Networkscited by 35
- 2024A comprehensive review of Quantum Machine Learning: from NISQ to Fault Tolerancecited by 32
- 2024Survey of different Large Language Model Architectures: Trends, Benchmarks, and Challengescited by 31
- 2023A Survey on Quantum Machine Learning: Current Trends, Challenges, Opportunities, and the Road Aheadcited by 29
- 2024Qiskit Code Assistant: Training LLMs for generating Quantum Computing Codecited by 24
- 2024FedQNN: Federated Learning using Quantum Neural Networkscited by 20
- 2024QFNN-FFD: Quantum Federated Neural Network for Financial Fraud Detectioncited by 18
- 2024Quantum Clustering for Cybersecuritycited by 6
- 2023Adapting Pre-trained Language Models for Quantum Natural Language Processingcited by 2
Built on by
Citing papers per year: 2025: 6; 2026: 1.
7 papers.
- 2025QHackBench: Benchmarking Large Language Models for Quantum Code Generation Using PennyLane Hackathon Challengescited by 7
- 2025PennyCoder: Efficient Domain-Specific LLMs for PennyLane-Based Quantum Code Generationcited by 6
- 2025Automating quantum feature map design via large language modelscited by 4
- 2025From Trace to Line: LLM Agent for Real-World OSS Vulnerability Localizationcited by 4
- 2025Taxonomy of migration scenarios for Qiskit refactoring using LLMscited by 2
- 2025Polysemy of Synthetic Neurons Towards a New Type of Explanatory Categorical Vector Spacescited by 0
- 2026PennySynth: RAG-Driven Data Synthesis for Automated Quantum Code Generationcited by 0
- 2026PennySynth: RAG-Driven Data Synthesis for Automated Quantum Code Generation25 May 2026
- 2025From Trace to Line: LLM Agent for Real-World OSS Vulnerability Localization30 Sep 2025
- 2025PennyCoder: Efficient Domain-Specific LLMs for PennyLane-Based Quantum Code Generation25 Jul 2025
- 2025QHackBench: Benchmarking Large Language Models for Quantum Code Generation Using PennyLane Hackathon Challenges24 Jun 2025
- 2025Taxonomy of migration scenarios for Qiskit refactoring using LLMs8 Jun 2025
- 2025Polysemy of Synthetic Neurons Towards a New Type of Explanatory Categorical Vector Spaces30 Apr 2025
- 2025Automating quantum feature map design via large language models10 Apr 2025
Similar, not cited
Close in wording, no citation either way
- 2025Model-Driven Quantum Code Generation Using Large Language Models and Retrieval-Augmented Generation
- 2026Revisiting Quantum Code Generation: Where Should Domain Knowledge Live?
- 2025Enhancing LLM-based Quantum Code Generation with Multi-Agent Optimization and Quantum Error Correction
- 2026Beyond Rules: LLM-Powered Linting for Quantum Programs ↗
- 2025LLM-Powered Quantum Code Transpilation
- 2026Qiskit Code Migration with LLMs ↗
- 2026QBugLM: An Agentic Benchmarking Framework for LLM-based Quantum Software Debugging
- 2026Qiskit QuantumKatas: Adapting Microsoft's Quantum Computing exercises for LLM evaluation