阅读原因:基于光与量子比特的精确单词证据的玻恩测量注意力机制
Reading Why: Born-Measured Attention with Exact Word Evidence on Light and Qubits
AI总结:
本文提出玻恩测量注意力的Transformer模型,在e-SNLI任务上准确率与同规模Softmax Transformer相当,其单词证据解释力优于Softmax模型,且权重可编译为量子比特电路,在IBM设备上验证了注意力相关特性。
摘要:
当语言模型做出回答时,我们通常只能估计其背后的原因。本文构建了一种Transformer模型,其中每一步均为玻恩测量注意力($|\boldsymbol{\theta}|\boldsymbol{k}|^4$,按行归一化),用测量乘积替代前馈非线性函数,并采用玻恩读出机制。在保持分母为输入对应值的情况下,每个类概率是单词振幅的多项式,因此其积分梯度证据可通过有限求积计算,且无求积误差:单词的贡献总和为类概率减去其无信息份额,精度达$10^{-11}$或更高。在e-SNLI自然语言推理任务中,该模型(嵌入层外约9.8万个参数)达到76.98±0.17%的测试准确率,与同等规模的Softmax Transformer(76.62±0.36%)水平相当。删除证据排名第一的单词,会改变45%测试对的答案,而任意单个单词删除可改变53%的测试对;相比之下,以相同方式解释的Softmax模型该比例为32%,其注意力×梯度方法的比例为40%。注意力机制可更接近标注者高亮的单词,但对答案的解释力较弱:删除其排名第一的单词,会改变玻恩Transformer模型32%测试对的答案。相同权重可精确编译为光电光学系统和量子比特,且相干注意力层可成为等效于该模型的电路(23量子比特上含852个CNOT门)。在IBM的ibm_kingston设备上,仅通过哈达玛测试读取注意力重叠部分,设备给出了模型在两个短测试对上的答案,且在删除操作下保持或改变答案的方式与模型一致;但证据本身尚未能在硬件中留存,本文计算了在硬件上测量证据所需的采样次数与校准方案。
英文摘要:
When a language model answers, we can usually only estimate why. We build a transformer in which every nonlinearity is a quadratic detection - an interference, a balanced reading or a camera - and the output is a Born probability: attention |<q|k>|^2, the form of the Born rule, normalised per row, a measured product for the feed-forward nonlinearity, and a Born readout; between detections, classical control rescales and re-encodes. With its denominators held at the input, each class probability is a polynomial in the word amplitudes, so its integrated-gradient evidence is computed by a finite quadrature with no quadrature error: the words' contributions sum to the class probability above its no-information share to 10^-13. On e-SNLI natural language inference it reaches 77.45 +- 0.91 % accuracy, level with a same-size softmax transformer (76.62 +- 0.36 %) and an order-free bag of embeddings (77.79 %). Exactness buys the sum, not the best ranking. Deleting the word its evidence ranks first changes the answer in 44 % of pairs, of the 53 % some deletion changes, against 31-32 % for the softmax model's integrated gradients; the model's own gradient x input does as well (43 %), as does a bag of embeddings' (43 %, seed 0), and leave-one-out does better. Holding the denominators helps the low end: the five words ranked last change the answer in 1 %, against 6 % free. The same weights compile exactly to simulated optoelectronics, and their attention to qubits. On ibm_kingston, reading only the attention, the device gave the model's answers in all three Hadamard-test runs (the two shortest pairs and one without its deciding word) and both compute-uncompute runs (one circuit per overlap); uniform attention answers otherwise on two of the three inputs. With the device's row sums the evidence correlated with the exact one at 0.997 and 0.962 by Hadamard tests; with compute-uncompute, 0.971 and 0.48.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。