Shot Optimization in Quantum Machine Learning Architectures to Accelerate Training

Shot Optimization in Quantum Machine Learning Architectures to Accelerate Training
复制标题

DOI:
10.1109/access.2023.3270419
复制
发表时间:
2023-04
期刊:
影响因子:
3.9
通讯作者:
Koustubh Phalak;Swaroop Ghosh
Koustubh Phalak;Swaroop Ghosh
中科院分区:
计算机科学3区
文献类型:
--
作者:
Koustubh Phalak;Swaroop Ghosh

文献摘要

相似文献

作为量子计算(QC)和机器学习(ML)领域的交叉,量子机器学习(QML)最近成为一个快速发展的领域。与经典模型相比,混合量子经典模型在各种机器学习任务中表现出指数级的加速。一方面,由于长时间的等待队列和访问成本,在实际硬件上训练QML模型仍然是一个挑战。另一方面,由于模拟时间呈指数增长,基于模拟的训练不能扩展到大型QML模型。由于测量操作将量子信息转换为经典二进制数据,因此量子电路被多次执行(称为射击)以获得基态概率或量子位期望值。较高的射击次数会增加QML模型在实际硬件上的训练时间和访问成本。更高的射击次数也增加了基于模拟的训练时间。在本文中,我们提出了QML模型的镜头优化方法,其代价是对模型性能的影响最小。我们使用混合量子-经典QML模型将分类任务作为MNIST和FMNIST数据集的测试用例。首先,我们扫描数据集的短版本和完整版本的镜头数量。我们观察到,完整版本的训练比短版本的数据集提供了5-6%的测试精度,训练次数高达10倍。因此,可以通过减小数据集大小来加快训练时间。接下来,我们提出了基于短版本数据集的自适应投篮分配,以优化训练周期内的投篮数量,并评估对分类精度的影响。我们使用(a)线性函数,其中射击次数随时代线性减少,(b)阶跃函数,其中射击次数随时代同步减少。我们注意到,与MNIST数据集的常规恒定射击函数相比,线性(步进)射击函数减少射击的测试精度增加了0.01左右,损失和最大$\boldsymbol {\sim}4$ %(1%)降低了高达100X (10X),并且在FMNIST数据集上使用线性(步进)射击函数减少射击的测试精度增加了0.05,损失和$\boldsymbol {\sim}5$ -7%(5-7%)降低。为了进行比较,我们还使用所提出的射击优化方法对不同分子进行了基态能量估计,并观察到阶跃函数在射击次数减少1000倍时给出了最佳和最稳定的基态能量预测。
Quantum Machine Learning (QML) has recently emerged as a rapidly growing domain as an intersection of Quantum Computing (QC) and Machine Learning (ML) fields. Hybrid quantum-classical models have demonstrated exponential speedups in various machine learning tasks compared to their classical counterparts. On one hand, training of QML models on real hardware remains a challenge due to long wait queue and the access cost. On the other hand, simulation-based training is not scalable to large QML models due to exponentially growing simulation time. Since the measurement operation converts quantum information to classical binary data, the quantum circuit is executed multiple times (called shots) to obtain the basis state probabilities or qubit expectation values. Higher number of shots worsen the training time of QML models on real hardware and the access cost. Higher number of shots also increase the simulation-based training time. In this paper, we propose shot optimization method for QML models at the expense of minimal impact on model performance. We use classification task as a test case for MNIST and FMNIST datasets using a hybrid quantum-classical QML model. First, we sweep the number of shots for short and full versions of the dataset. We observe that training the full version provides 5-6% higher testing accuracy than short version of dataset with up to 10X higher number of shots for training. Therefore, one can reduce the dataset size to accelerate the training time. Next, we propose adaptive shot allocation on short version dataset to optimize the number of shots over training epochs and evaluate the impact on classification accuracy. We use a (a) linear function where the number of shots reduce linearly with epochs, and (b) step function where the number of shots reduce in step with epochs. We note around 0.01 increase in loss and maximum $\boldsymbol {\sim }4$ % (1%) reduction in testing accuracy for reduction in shots by up to 100X (10X) for linear (step) shot function compared to conventional constant shot function for MNIST dataset, and 0.05 increase in loss and $\boldsymbol {\sim }5$ -7% (5-7%) reduction in testing accuracy with similar reduction in shots using linear (step) shot function on FMNIST dataset. For comparison, we also use the proposed shot optimization methods to perform ground state energy estimation of different molecules and observe that step function gives the best and most stable ground state energy prediction at 1000X less number of shots.