Self-Attention Mechanism (SAM), an important component of machine learning, has been relatively little investigated in the field of quantum machine learning. Inspired by the Variational Quantum Algorithm (VQA) framework and SAM, Quantum Self-Attention Network (QSAN) that can be implemented on a near-term quantum computer is proposed.Theoretically, Quantum Self-Attention Mechanism (QSAM), a novel interpretation of SAM with linearization and logicalization is defined, in which Quantum Logical Similarity (QLS) is presented firstly to impel a better execution of QSAM on quantum computers since inner product operations are replaced with logical operations, and then a QLS-based density matrix named Quantum Bit Self-Attention Score Matrix (QBSASM) is deduced for representing the output distribution effectively. Moreover, QSAN is implemented based on the QSAM framework and its practical quantum circuit is designed with 5 modules. Finally, QSAN is tested on a quantum computer with a small sample of data. The experimental results show that QSAN can converge faster in the quantum natural gradient descent framework and reassign weights to word vectors. The above illustrates that QSAN is able to provide attention with quantum characteristics faster, laying the foundation for Quantum Natural Language Processing (QNLP).
翻译:在量子机器学习领域,作为机器学习的重要组成部分的自我保护机制(SAM)相对而言很少得到调查,在量子机器学习领域,受量子计算机学习领域(QLS)的启发,在量子计算机学习领域(VQA)框架和SAM、Qantum自我保护网络(QSAN)的启发下,可以在近期量子计算机上实施。 从理论角度讲,量子自我保护机制(QSAM)是SAM的一种新解释,它具有线性化和逻辑化,在量子机器学习领域(QLS)首先展示量子逻辑相似性(QLS),使量子计算机更好地执行QSAM,因为内部产品操作被逻辑操作取代,而基于QAM(QSAN)的密度矩阵(QSAN)可有效代表产出分布。此外,QSAN的运用QSAM框架及其实用量子电流电路设计。最后, QSAN在量子计算机上测试量子系统质量,使量子系统质量基础,使量子序列数据更加一致。