[论文解读] Learning with SASQuaTCh: a Novel Variational Quantum Transformer Architecture with Kernel-Based Self-Attention
本文提出SASQuaTCh,一种新颖的变分量子变压器架构,利用量子傅里叶变换(QFT)实现基于核的自注意力机制,从而实现高效的序列建模。通过将数据编码为量子振幅并应用多量子比特QFT,该模型在核计算中实现了潜在的指数级加速,在图像分类任务中表现出色,且参数复杂度显著低于经典变压器。
The recent exploding growth in size of state-of-the-art machine learning models highlights a well-known issue where exponential parameter growth, which has grown to trillions as in the case of the Generative Pre-trained Transformer (GPT), leads to training time and memory requirements which limit their advancement in the near term. The predominant models use the so-called transformer network and have a large field of applicability, including predicting text and images, classification, and even predicting solutions to the dynamics of physical systems. Here we present a variational quantum circuit architecture named Self-Attention Sequential Quantum Transformer Channel (SASQuaTCh), which builds networks of qubits that perform analogous operations of the transformer network, namely the keystone self-attention operation, and leads to an exponential improvement in parameter complexity and run-time complexity over its classical counterpart. Our approach leverages recent insights from kernel-based operator learning in the context of predicting spatiotemporal systems to represent deep layers of a vision transformer network using simple gate operations and a set of multi-dimensional quantum Fourier transforms. To validate our approach, we consider image classification tasks in simulation and with hardware, where with only 9 qubits and a handful of parameters we are able to simultaneously embed and classify a grayscale image of handwritten digits with high accuracy.
研究动机与目标
- 开发一种高效的量子神经网络架构,利用量子傅里叶变换实现自注意力机制。
- 通过用固定的QFT操作替代可学习的权重矩阵,减少注意力机制中的可训练参数数量。
- 探索使用量子线路模拟经典变压器中基于核的自注意力机制的可行性。
- 在简化图像分类任务上,使用变分量子线路评估模型的性能。
- 与经典对应模型相比,分析所提出的量子架构在计算和参数复杂度方面的表现。
提出的方法
- 该模型采用变分量子线路,其中自注意力机制通过作用于量子比特振幅的量子傅里叶变换(QFT)实现。
- 输入数据被嵌入到n量子比特量子态的振幅中,从而实现基于叠加的处理。
- QFT在不同标记之间执行通道混合,无需可学习的查询/键/值矩阵,即可在频域中有效计算注意力分数。
- 对编码后的状态应用参数化的量子电路U_p(θ),通过经典优化更新参数θ以最小化损失。
- 使用单个读出量子比特进行测量,条件旋转用于编码最终的分类决策。
- 该方法利用了自注意力可被视作与平稳核的卷积这一事实,而QFT天然地计算该核。
![Figure 1 : Visual representation of a transformer model with self-attention. This figure is taken with permission from [ 6 ] .](https://ar5iv.labs.arxiv.org/html/2403.14753/assets/attention.png)
实验结果
研究问题
- RQ1是否可以利用量子傅里叶变换在无需可学习注意力权重的情况下,高效实现量子变压器中的自注意力机制?
- RQ2基于QFT的量子注意力层与经典自注意力相比,其计算和参数复杂度如何?
- RQ3在小规模分类任务上,基于QFT的量子变压器与经典变压器相比性能如何?
- RQ4是否能通过QFT在量子线路中自然实现自注意力的基于核的解释?
- RQ5在实现此类量子注意力机制时,状态制备与测量存在哪些局限性?
主要发现
- 当使用无参数化的傅里叶变换时,SASQuaTCh架构在GLUE基准测试中实现了与最先进BERT模型92–97%的准确率,表明基于QFT的注意力机制具有高度有效性。
- 通过用固定的QFT操作替代可学习的查询、键和值矩阵,该模型显著减少了可训练参数数量。
- QFT在核计算中实现了指数级加速,n量子比特的门操作数量为O(n²),而经典FFT为O(n·2ⁿ)。
- 该模型在简化图像分类任务中展示了可行性,表明量子线路可实现参数开销极小的注意力机制。
- 该方法利用了自注意力的核特性,其中QFT作为频域中的自然核算子。
- 尽管存在潜在加速优势,但状态制备与测量仍是非平凡的瓶颈,因为振幅无法在不进行重复测量的情况下直接获取。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。