一种应用于分子生成的带量化自注意力机制的混合Transformer架构
A Hybrid Transformer Architecture with a Quantized Self-Attention Mechanism Applied to Molecular Generation
AI总结:
本研究提出一种带量子自注意力机制的混合Transformer解码器架构,将查询-键点积时间复杂度降至O(n²logd),在QM9数据集上验证了分子条件生成的可行性,为量子增强NLP提供新方向。
摘要:
自注意力机制在经典机器学习模型中的成功,启发了旨在降低计算开销的量子类似机制的开发。自注意力通过整合可学习的查询矩阵和键矩阵,计算序列中所有标记对之间的注意力分数,随后将这些分数与可学习的值矩阵相乘,得到输出自注意力矩阵,使模型能够有效捕捉输入序列内的长程依赖关系。本文提出一种混合量子-经典自注意力机制,作为Transformer解码器(大语言模型(LLM)的底层架构)的组成部分。为验证其在化学领域的实用性,我们在QM9数据集上训练该模型用于条件生成任务,以SMILES字符串作为输入,每个字符串都带有一组物理化学性质标签,在推理过程中作为生成条件。理论分析表明,查询-键点积的时间复杂度从经典模型的$\boldsymbol{\n\nmathcal{O}}(n^2 d)$降至我们量子模型的$\boldsymbol{\n\nmathcal{O}}(n^2\neg d)$,其中$n$和$d$分别代表序列长度和嵌入维度。我们利用专为高效GPU可扩展性设计的NVIDIA CUDA-Q平台开展了仿真实验。这项工作为量子增强的自然语言处理(NLP)提供了一条颇具前景的路径。
英文摘要:
The success of the self-attention mechanism in classical machine learning models has inspired the development of quantum analogs aimed at reducing computational overhead. Self-attention integrates learnable query and key matrices to calculate attention scores between all pairs of tokens in a sequence. These scores are then multiplied by a learnable value matrix to obtain the output self-attention matrix, enabling the model to effectively capture long-range dependencies within the input sequence. Here, we propose a hybrid quantum-classical self-attention mechanism as part of a transformer decoder, the architecture underlying large language models (LLMs). To demonstrate its utility in chemistry, we train this model on the QM9 dataset for conditional generation, using SMILES strings as input, each labeled with a set of physicochemical properties that serve as conditions during inference. Our theoretical analysis shows that the time complexity of the query-key dot product is reduced from $\mathcal{O}(n^2 d)$ in a classical model to $\mathcal{O}(n^2\log d)$ in our quantum model, where $n$ and $d$ represent the sequence length and embedding dimension, respectively. We perform simulations using NVIDIA's CUDA-Q platform, which is designed for efficient GPU scalability. This work provides a promising avenue for quantum-enhanced natural language processing (NLP).
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。