This work investigates how current quantum computers can improve the performance of natural language processing tasks. To achieve this goal, we proposed QNet, a novel sequence encoder model entirely inferences on the quantum computer using a minimum number of qubits. QNet is inspired by Transformer, the state-of-the-art neural network model based on the attention mechanism to relate the tokens. While the attention mechanism requires time complexity of $O(n^2 \cdot d)$ to perform matrix multiplication operations, QNet has merely $O(n+d)$ quantum circuit depth, where $n$ and $d$ represent the length of the sequence and the embedding size, respectively. To employ QNet on the NISQ devices, ResQNet, a quantum-classical hybrid model composed of several QNet blocks linked by residual connections, is introduced. We evaluate ResQNet on various natural language processing tasks, including text classification, rating score prediction, and named entity recognition. ResQNet exhibits a 6% to 818% performance gain on all these tasks over classical state-of-the-art models using the exact embedding dimensions. In summary, this work demonstrates the advantage of quantum computing in natural language processing tasks.
翻译:这项工作调查了当前量子计算机如何能改善自然语言处理任务的业绩。 为了实现这一目标, 我们提议了QNet, 一个新型序列编码模型, 使用最小数量qubits完全推断量子计算机上的量子计算机。 QNet 是由“ 变异器” 启发的。 以关注机制连接符号为根据的状态神经网络模型。 虽然关注机制要求用美元( n%2\cdddd) 来进行矩阵倍增操作, QNet 只需要用美元( n+d) $ 的量子电路深度, 其中美元和美元分别代表序列的长度和嵌入规模。 要在 NISQ 设备上使用Q Q, ResQNet, 即由一些与剩余连接的QNet块组成的量子级混合模型。 我们评估了各种自然语言处理任务( ResQNet ), 包括文本分类、 评级分数预测和名称实体识别。 ResQNet 展示了所有这些任务中6- 818%的绩效, 在古典州- 州- Qal 计算 模型中, 展示了本 数字 的自然工作任务 。