Manuscript Offprint

arXiv:2611.05355

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

Teerawat Tongloy, Jiraporn Pongsopa, Rangsan Jomtarak

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Teerawat Tongloy¹, Jiraporn Pongsopa², and Rangsan Jomtarak²

¹School of Integrated Innovative Technology, King Mongkut's Institute of Technology Ladkrabang, Bangkok, Thailand

²Faculty of Science and Technology, Suan Dusit University, Bangkok, Thailand

When a language model answers, we can usually only estimate why. We build a transformer in which every step is a Born measurement—attention ∣⟨q∣k⟩∣4|\langle q|k\rangle|^4 normalised over each row, a measured product in place of the feed-forward nonlinearity, and a Born readout. With its denominators held at their values for 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−1110^{-11} or better. On e-SNLI natural language inference, with about 98k parameters outside the embedding, the model reaches 76.98±0.17%76.98 \pm 0.17\% test accuracy, level with a softmax transformer of the same size (76.62±0.36%76.62 \pm 0.36\%). Deleting the word its evidence ranks first changes the answer in 45% of test pairs, out of the 53% any single deletion can change, against 32% for the softmax model explained the same way and 40% by its attention ×\times gradient. Attention can look more like the words annotators highlighted, yet accounts for the answer less well: deleting the word it ranks first changes the Born Transformer's answer in 32% of pairs. The same weights compile exactly to optoelectronic optics and to qubits, and a coherent attention layer becomes one circuit equal to the model (852 CNOTs on 23 qubits). On IBM's ibm_kingston, reading only the attention overlaps by Hadamard tests, the device gave the model's answers on two short test pairs and kept or changed them under deletion as the model does; the evidence itself did not yet survive the device, and we work out the shots and calibration that measuring it on hardware would need.

1 Introduction

Why a language model gives the answer it gives can usually only be estimated. Explanations of neural networks are mostly computed after training and approximate what the model did, and for language models the most visible quantity, the attention weights, need not explain the output [1, 2]. A model that is right for the wrong reasons looks, from its accuracy, the same as one that is right for the right ones.

Teerawat Tongloy: teerawat.to@kmitl.ac.th

Jiraporn Pongsopa: jiraporn_pon@dusit.ac.th

Rangsan Jomtarak: rangsan_jom@dusit.ac.th

In earlier work, Seeing Why [3], a picture classifier built from a Born readout gave evidence maps that need no approximation, and that could be measured on the hardware that classifies. Pictures, however, are read pixel by pixel; in a sentence, words matter through each other. Here we ask whether the same can be had for a model that relates words: a transformer.

Attention needs two things: an overlap between a query and a key, and a weighted sum. Both are native to light and to qubits: an overlap is an interference, a weighted sum a coherent combination. What is not native is the softmax. We replace every nonlinearity of a transformer—softmax, LayerNorm, ReLU—by one operation, a Born measurement, the rule Born gave a century ago [4]. The model is then a ratio of polynomials in the word amplitudes, and its evidence follows exactly from integrated gradients [5] with the denominators held.

Because the evidence is exact and part of the model, the model can be checked as well as scored: we report, for every model, accuracy beside the completeness of its evidence, a deletion test and agreement with human highlights.

The model is interpretable by design: its explanation is part of how it is built, not an estimate added after training, and the accuracy it gives up for that is the cost of the design. Where the exactness comes from should be said plainly. It comes from the model being a polynomial once its denominators are held, and a classical polynomial network without any measurement constraint has it as well (Section 3). What the Born rule adds is that this polynomial is what a physical measurement computes: the same exact evidence then comes with a model that light and qubits can run, and the questions become physical ones—which measurements, how many shots, what loss of visibility the evidence tolerates.

Light and qubits then pull the design in two directions. On light a measurement is cheap—a detector—and a field can be split into copies, but classical fields cannot hold the copies together in a tensor product; on qubits they can, but every measurement costs shots. So we build the model twice from the same idea: the Born Transformer, which measures inside every block and suits light, and a coherent attention layer, which measures only at the end and suits qubits. Both keep exact evidence, and the attention of the first, read by small circuits, runs on a quantum computer today.

Fig. 1 follows one test pair through the model, on light and on a quantum computer. Our contributions:

  1. A transformer built only from Born measurements (Section 2, Fig. 2): attention ∣⟨q∣k⟩∣4|\langle q|k\rangle|^{4} normalised over each row, a measured product in place of the feed-forward nonlinearity, and a Born readout, so that each class probability is a ratio of polynomials in the word amplitudes.

  2. Born evidence per word (BEW, Section 2.2): the word-level counterpart of the Born evidence maps (BEM) of Seeing Why [3]. BEW extends BEM from a quadratic form to a deep, attention-based model: still exact—the words' evidence sums to the class probability above its no-information share—now by quadrature rather than in closed form.

  3. Natural language inference, validated beyond accuracy (Section 3): on e-SNLI the model is level with a softmax transformer of the same size; deleting the word its evidence ranks first changes its answer more often, also against the softmax model explained the same way, and its top words are closer than that model's evidence to those annotators highlighted; the attention weights, as close to the annotators, account for the answer less well.

  4. One set of weights, two realisations (Section 4): the trained weights compile exactly to optics and to qubits; an independent mesh decomposition confirms the optical build.

  5. A coherent attention layer (Section 5): with no measurement until the end, attention is one circuit equal to the model; with brickwall maps it needs 852 CNOTs on 23 qubits, and keeps the quality of its evidence.

  6. On a quantum computer, and what it costs (Section 6): on ibm_kingston, with the attention overlaps read by the device and the rest computed classically, the answer survives the device and follows the model when a word is deleted; measuring BEW itself on the device does not yet work, and an analysis of shots, visibility and calibration says why and what it needs; the coherent layer's post-selection has a closed form and a measured scaling.

a On light (simulated): every step a Born measurement

Figure

b On a quantum computer: the same weights, ibm_kingston

Figure

Figure 1: Overview, drawn from the trained model's own data for the test pair "men play hockey. / aliens play" (contradiction). (a) On light: the modulator holds one field per word (phase as colour); in each of two blocks Born attention weighs the words by ∣⟨qi∣kj⟩∣4|\langle q_i | k_j \rangle|^4 read by interference, and the measured feed-forward reads Re[(Wh)‾(Vh‾)]\text{Re}[\overline{(Wh)}(\overline{Vh})] by homodyne detection; the camera's three regions give the Born probabilities, and each word's Born evidence (BEW; red for the answer, blue against it; dots: the annotators' words) sums to Pg−bgP_g - b_g exactly. (b) On IBM's ibm_kingston, with the same weights: a word's query, 16 complex numbers computed classically, is loaded as the amplitudes of four qubits, and every overlap is a Hadamard test (2×2722 \times 272 circuits); the measured overlaps follow the ideal ones (r=0.992r = 0.992), the answer survives (contradiction, 0.988 against 0.983 exact), and deleting "aliens", the word the evidence ranks first, turns the device's answer to entailment.

References (40)