Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

Lecture notes in computer science

Quantum Attention Based Language Model for Answer Selection

Qin Zhao, Chenguang Hou, Ruifeng Xu

Published Jan 1, 2022• 2 citations
Publisher
DOI
10.1007/978-3-030-96033-9_4

Related papers

Context Based Quantum Language Model with Application to Question Answering

Qin Zhao, Chenguang Hou, Ruifeng Xu

Lecture notes in computer science•Jan 1, 2020•1 citation

QHAN: Quantum-inspired Hierarchical Attention Mechanism Network for Question Answering

Peng Guo, Panpan Wang

The approach to question answering is challenging because it usually requires finding useful information from within and between question and answer sentences for sentence semantic matching. The key information mined from existing question and answer sentences, as a supplement to semantic information, maybe helpful for this task. However, capturing the intra-sentence and inter-sentence semantic interactions is somewhat difficult given the implicit interrelationships between question and answer sentences. Although the learning effect of multi-layer neural network is good, it lacks explanatory and theoretical support. This paper mainly studies how to select the best answer sentence from a set of question and answer sentences, mine information more effectively, perform semantic matching, and have a certain interpretability. Therefore, we propose a hierarchical attention network (QHAN) based on the mathematical framework of quantum theory, which integrates the attention mechanism under quantum measurement and density matrix (DMATT) and the attention mechanism under quantum weak measurement and weak value (WMATT) in one in a unified model framework. QHAN can not only discover key sentences in a set of question and answer sentences and key words in a sentence, but also perform sentence semantic matching quickly and accurately. Furthermore, QHAN has the advantage of interpretability in terms of models due to the physical meaning and attentional full weight distribution implied by quantum theory. Extensive experiments on the question answering dataset show that our method is comparable to the baselines and can explain why the selected question and answer sentence is the best option in terms of intra-sentence and inter-sentence attention distributions.

International Journal of Artificial Intelligence Tools•Jan 11, 2023•5 citations

Reading Why: Born-Measured Attention with Exact Word Evidence on Light and Qubits

Teerawat Tongloy, Jiraporn Pongsopa, Rangsan Jomtarak

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 ||^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.

arXiv:2611.05355•Nov 3, 2026•0 citations

Quantum NLP Models on Natural Language Inference

Ling Sun, Peter Sullivan, Michael Martin +1 more

arXiv:2510.15972•Communications in computer and information science•Jan 1, 2026•2 citations

An adaptive contextual quantum language model

Jingfei Li, Peng Zhang, Dawei Song +1 more

Physica A Statistical Mechanics and its Applications•Mar 28, 2016•24 citations

Sublinear Time Quantum Algorithm for Attention Approximation

Zhao Song, Jianfei Xue, Jiahao Zhang +1 more

Given the query, key and value matrices $Q, K, V\in \mathbb{R}^{n\times d}$, the attention module is defined as $\mathrm{Att}(Q, K, V)=D^{-1}AV$ where $A=\exp(QK^\top/\sqrt{d})$ with $\exp(\cdot)$ applied entrywise, $D=\mathrm{diag}(A{\bf 1}_n)$. The attention module is the backbone of modern transformers and large language models, but explicitly forming the softmax matrix $D^{-1}A$ incurs $Ω(n^2)$ time, motivating numerous approximation schemes that reduce runtime to $\widetilde O(nd)$ via sparsity or low-rank factorization. We propose a quantum data structure that approximates any row of $\mathrm{Att}(Q, K, V)$ using only row queries to $Q, K, V$. Our algorithm preprocesses these matrices in $\widetilde{O}\left( ε^{-1} n^{0.5} \left( s_λ^{2.5} + s_λ^{1.5} d + α^{0.5} d \right) \right)$ time, where $ε$ is the target accuracy, $s_λ$ is the $λ$-statistical dimension of the exponential kernel defined by $Q$ and $K$, and $α$ measures the row distortion of $V$ that is at most $d/{\rm srank}(V)$, the stable rank of $V$. Each row query can be answered in $\widetilde{O}(s_λ^2 + s_λd)$ time. To our knowledge, this is the first quantum data structure that approximates rows of the attention matrix in sublinear time with respect to $n$. Our approach relies on a quantum Nyström approximation of the exponential kernel, quantum multivariate mean estimation for computing $D$, and quantum leverage score sampling for the multiplication with $V$.

quant-pharXiv:2602.00874•Feb 3, 2026•0 citations
The approach to question answering is challenging because it usually requires finding useful information from within and between question and answer sentences for sentence semantic matching. The key information mined from existing question and answer sentences, as a supplement to semantic information, maybe helpful for this task. However, capturing the intra-sentence and inter-sentence semantic interactions is somewhat difficult given the implicit interrelationships between question and answer sentences. Although the learning effect of multi-layer neural network is good, it lacks explanatory and theoretical support. This paper mainly studies how to select the best answer sentence from a set of question and answer sentences, mine information more effectively, perform semantic matching, and have a certain interpretability. Therefore, we propose a hierarchical attention network (QHAN) based on the mathematical framework of quantum theory, which integrates the attention mechanism under quantum measurement and density matrix (DMATT) and the attention mechanism under quantum weak measurement and weak value (WMATT) in one in a unified model framework. QHAN can not only discover key sentences in a set of question and answer sentences and key words in a sentence, but also perform sentence semantic matching quickly and accurately. Furthermore, QHAN has the advantage of interpretability in terms of models due to the physical meaning and attentional full weight distribution implied by quantum theory. Extensive experiments on the question answering dataset show that our method is comparable to the baselines and can explain why the selected question and answer sentence is the best option in terms of intra-sentence and inter-sentence attention distributions.
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 ||^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.
Given the query, key and value matrices Q,K,V∈Rn×dQ, K, V\in \mathbb{R}^{n\times d}Q,K,V∈Rn×d, the attention module is defined as Att(Q,K,V)=D−1AV\mathrm{Att}(Q, K, V)=D^{-1}AVAtt(Q,K,V)=D−1AV where A=exp⁡(QK⊤/d)A=\exp(QK^\top/\sqrt{d})A=exp(QK⊤/d​) with exp⁡(⋅)\exp(\cdot)exp(⋅) applied entrywise, D=diag(A1n)D=\mathrm{diag}(A{\bf 1}_n)D=diag(A1n​). The attention module is the backbone of modern transformers and large language models, but explicitly forming the softmax matrix D−1AD^{-1}AD−1A incurs Ω(n2)Ω(n^2)Ω(n2) time, motivating numerous approximation schemes that reduce runtime to O~(nd)\widetilde O(nd)O(nd) via sparsity or low-rank factorization. We propose a quantum data structure that approximates any row of Att(Q,K,V)\mathrm{Att}(Q, K, V)Att(Q,K,V) using only row queries to Q,K,VQ, K, VQ,K,V. Our algorithm preprocesses these matrices in O~(ε−1n0.5(sλ2.5+sλ1.5d+α0.5d))\widetilde{O}\left( ε^{-1} n^{0.5} \left( s_λ^{2.5} + s_λ^{1.5} d + α^{0.5} d \right) \right)O(ε−1n0.5(sλ2.5​+sλ1.5​d+α0.5d)) time, where εεε is the target accuracy, sλs_λsλ​ is the λλλ-statistical dimension of the exponential kernel defined by QQQ and KKK, and ααα measures the row distortion of VVV that is at most d/srank(V)d/{\rm srank}(V)d/srank(V), the stable rank of VVV. Each row query can be answered in O~(sλ2+sλd)\widetilde{O}(s_λ^2 + s_λd)O(sλ2​+sλ​d) time. To our knowledge, this is the first quantum data structure that approximates rows of the attention matrix in sublinear time with respect to nnn. Our approach relies on a quantum Nyström approximation of the exponential kernel, quantum multivariate mean estimation for computing DDD, and quantum leverage score sampling for the multiplication with VVV.