PennyCoder: Efficient Domain-Specific LLMs for PennyLane-Based Quantum Code Generation

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Basit, Abdul, Shao, Minghao, Asif, Muhammad Haider, Innan, Nouhaila, Kashif, Muhammad, Marchisio, Alberto, Shafique, Muhammad
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917123327000576
author Basit, Abdul
Shao, Minghao
Asif, Muhammad Haider
Innan, Nouhaila
Kashif, Muhammad
Marchisio, Alberto
Shafique, Muhammad
author_facet Basit, Abdul
Shao, Minghao
Asif, Muhammad Haider
Innan, Nouhaila
Kashif, Muhammad
Marchisio, Alberto
Shafique, Muhammad
contents The growing demand for robust quantum programming frameworks has unveiled a critical limitation: current large language model (LLM) based quantum code assistants heavily rely on remote APIs, introducing challenges related to privacy, latency, and excessive usage costs. Addressing this gap, we propose PennyCoder, a novel lightweight framework for quantum code generation, explicitly designed for local and embedded deployment to enable on-device quantum programming assistance without external API dependence. PennyCoder leverages a fine-tuned version of the LLaMA 3.1-8B model, adapted through parameter-efficient Low-Rank Adaptation (LoRA) techniques combined with domain-specific instruction tuning optimized for the specialized syntax and computational logic of quantum programming in PennyLane, including tasks in quantum machine learning and quantum reinforcement learning. Unlike prior work focused on cloud-based quantum code generation, our approach emphasizes device-native operability while maintaining high model efficacy. We rigorously evaluated PennyCoder over a comprehensive quantum programming dataset, achieving 44.3% accuracy with our fine-tuned model (compared to 33.7% for the base LLaMA 3.1-8B and 40.1% for the RAG-augmented baseline), demonstrating a significant improvement in functional correctness.
format Preprint
id arxiv_https___arxiv_org_abs_2507_19562
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle PennyCoder: Efficient Domain-Specific LLMs for PennyLane-Based Quantum Code Generation
Basit, Abdul
Shao, Minghao
Asif, Muhammad Haider
Innan, Nouhaila
Kashif, Muhammad
Marchisio, Alberto
Shafique, Muhammad
Quantum Physics
Artificial Intelligence
68T50, 81P68, 68T07
I.2.7; I.2.2
The growing demand for robust quantum programming frameworks has unveiled a critical limitation: current large language model (LLM) based quantum code assistants heavily rely on remote APIs, introducing challenges related to privacy, latency, and excessive usage costs. Addressing this gap, we propose PennyCoder, a novel lightweight framework for quantum code generation, explicitly designed for local and embedded deployment to enable on-device quantum programming assistance without external API dependence. PennyCoder leverages a fine-tuned version of the LLaMA 3.1-8B model, adapted through parameter-efficient Low-Rank Adaptation (LoRA) techniques combined with domain-specific instruction tuning optimized for the specialized syntax and computational logic of quantum programming in PennyLane, including tasks in quantum machine learning and quantum reinforcement learning. Unlike prior work focused on cloud-based quantum code generation, our approach emphasizes device-native operability while maintaining high model efficacy. We rigorously evaluated PennyCoder over a comprehensive quantum programming dataset, achieving 44.3% accuracy with our fine-tuned model (compared to 33.7% for the base LLaMA 3.1-8B and 40.1% for the RAG-augmented baseline), demonstrating a significant improvement in functional correctness.
title PennyCoder: Efficient Domain-Specific LLMs for PennyLane-Based Quantum Code Generation
topic Quantum Physics
Artificial Intelligence
68T50, 81P68, 68T07
I.2.7; I.2.2
url https://arxiv.org/abs/2507.19562