Self-Attention Mechanism (SAM) is skilled at extracting important information from the interior of data to improve the computational efficiency of models. Nevertheless, many Quantum Machine Learning (QML) models lack the ability to distinguish the intrinsic connections of information like SAM, which limits their effectiveness on massive high-dimensional quantum data. To address this issue, a Quantum Kernel Self-Attention Mechanism (QKSAM) is introduced, which combines the data representation benefit of Quantum Kernel Methods (QKM) with the efficient information extraction capability of SAM. A Quantum Kernel Self-Attention Network (QKSAN) framework is built based on QKSAM, with Deferred Measurement Principle (DMP) and conditional measurement techniques, which releases half of the quantum resources with probabilistic measurements during computation. The Quantum Kernel Self-Attention Score (QKSAS) determines the measurement conditions and reflects the probabilistic nature of quantum systems. Finally, four QKSAN models are deployed on the Pennylane platform to perform binary classification on MNIST images. The best-performing among the four models is assessed for noise immunity and learning ability. Remarkably, the potential learning benefit of partial QKSAN models over classical deep learning is that they require few parameters for a high return of 98\% $\pm$ 1\% test and train accuracy, even with highly compressed images. QKSAN lays the foundation for future quantum computers to perform machine learning on massive amounts of data, while driving advances in areas such as quantum Natural Language Processing (NLP).
翻译:自注意力机制(SAM)擅长提取数据内部的重要信息,从而提升模型的计算效率。然而,许多量子机器学习(QML)模型缺乏像SAM那样区分信息内在关联的能力,这限制了它们在处理大规模高维量子数据时的有效性。为解决这一问题,本文提出了一种量子核自注意力机制(QKSAM),它将量子核方法(QKM)的数据表示优势与SAM的高效信息提取能力相结合。基于QKSAM,构建了量子核自注意力网络(QKSAN)框架,该框架采用延迟测量原则(DMP)和条件测量技术,在计算过程中通过概率测量释放了一半的量子资源。量子核自注意力得分(QKSAS)决定了测量条件,并反映了量子系统的概率特性。最后,在Pennylane平台上部署了四个QKSAN模型,对MNIST图像进行二分类任务。其中表现最佳的模型被评估了其抗噪能力和学习能力。值得注意的是,部分QKSAN模型相较于经典深度学习的潜在学习优势在于,即使使用高度压缩的图像,它们也仅需少量参数即可获得98%±1%的高测试和训练准确率。QKSAN为未来量子计算机在大量数据上执行机器学习奠定了基础,同时推动了量子自然语言处理(NLP)等领域的发展。