GPT attention measures token compatibility through dot-product similarity. This mechanism is simple, effective, and memory-efficient. But it does not explicitly model whether strong token features should reinforce or suppress one another. We introduce Q-Interference, a fully classical quantum-inspired attention mechanism for autoregressive language modeling that augments each query and key feature with an amplitude and a learned phase. The resulting attention score is phase-aware which aligned phases contribute constructively while conflicting phases contribute destructively. Although Q-Interference yields a richer interaction rule than similarity alone, a naive implementation of Q-Interference requires a large token-pair-feature interaction tensor, making it memory-intensive and often impractical. To address this limitation, we propose an exact trigonometric factorization that computes the same score using two standard matrix multiplications avoiding materialization of the large intermediate tensor. Q-Interference fits directly into a Transformer block in GPT and leaves the remainder of the model architecture and next-token prediction objective unchanged. Experiments on public benchmark datasets and baseline models show that the proposed reformulation trains stably in a controlled GPT-style setting and provides a consistent memory advantage over naive phase-aware interference attention. These results support the specific contribution of this work: an exact memory-efficient reformulation that makes phase-aware interference attention practical within a standard GPT pipeline.
Figures & tables
Figure 1: Q-Interference methodology flowchart.
Model
Comparison role
Justification
Baseline GPT
Standard internal control
Directly controlled reference for conventional causal dot-product attention under the same GPT-style training setup.
Q-GPT baseline
Quantum-inspired reference
Provides a published quantum-inspired GPT-style architectural comparison in this setting.
OPT-125M and GPT-Neo-125M
External pretrained reference
Gives context against an open autoregressive GPT-style model family.
Table 1: Baseline selection rationale.
Figure 2: Quality-memory trade-off for the main model comparison.
Dataset
Model
Best Val Loss
Test Loss
Test PPL
Peak GPU Mem (MB)
WikiText-103
Baseline GPT
3.2036
3.2049
24.6534
8055.76
WikiText-103
Q-GPT baseline
4.1142
4.1032
60.5367
7199.26
WikiText-103
Q-Interference (ours)
3.1809
3.1852
24.1718
4227.14
TinyStories
Baseline GPT
1.7279
1.7263
5.6196
8055.76
TinyStories
Q-GPT baseline
2.7036
2.7082
15.0016
7199.26
TinyStories
Q-Interference (ours)
1.7344
1.7394
5.6941
4227.14
Table 2: Baselines vs Q-Interference comparison over benchmark dataset
Dataset
Model
Test Loss
Test PPL
Peak GPU Mem (MB)
WikiText-103
GPT-Neo-125M
2.9673
19.4386
4097.91
WikiText-103
OPT-125M
3.0169
20.4278
4213.64
WikiText-103
Q-Interference (ours)
3.1852
24.1718
4227.14
TinyStories
GPT-Neo-125M
1.5198
4.5713
9934.54
TinyStories
OPT-125M
1.4217
4.1443
6219.52
TinyStories
Q-Interference (ours)
1.7394
5.6941
4227.14
Table 3: Comparison to pre-trained reference models.
Dataset
Model
Best Val Loss
Test Loss
Test PPL
Peak GPU Mem (MB)
WikiText-103
Naive interference
OOM
OOM
OOM
OOM
WikiText-103
Q-Interference (ours)
3.1809
3.1852
24.1718
4227.14
TinyStories
Naive interference
2.2972
2.3422
10.4037
12138.34
TinyStories
Q-Interference (ours)
1.7344
1.7394
5.6941
4227.14
pile-10k
Naive interference
4.0223
5.1086
165.4355
12138.34
pile-10k
Q-Interference (ours)
4.0745
4.7616
116.9275
4227.14
Table 4: Naive phase-aware attention versus Q-Interference.
Dataset
Model
Best Val Loss
Test Loss
Test PPL
Peak GPU Mem (MB)
WikiText-103
Q-Interference (ours)
3.1809
3.1852
24.1718
4227.14
WikiText-103
Q-Interference w/o phase
3.1830
3.1879
24.2373
3993.53
TinyStories
Q-Interference (ours)
1.7344
1.7394
5.6941
4227.14
TinyStories
Q-Interference w/o phase
1.7352
1.7410
5.7030
3993.53
pile-10k
Q-Interference (ours)
4.0745
4.7616
116.9275
4227.14
pile-10k
Q-Interference w/o phase
4.0736
4.7634
117.1429
3993.53
Table 5: Phase ablation for the final Q-Interference model.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Work
GPT-style
Quantum-inspired
Phase-aware
Memory-aware
Exact memory-efficient
QSANN
×
✓
×
×
×
QMSAN
×
✓
×
×
×
HyQuT
✓
✓
×
×
×
QISA
✓
✓
×
×
×
QubitCache
✓
✓
×
✓
×
Q-Interference (ours)
✓
✓
✓
✓
✓
Appendix
Table 6: Compact comparison of representative prior work and Q-Interference.
Symbol
Meaning
T
Sequence length.
dh
Dimension of one attention head.
aiq∈R+dh
Nonnegative query amplitude vector for token i .
ajk∈R+dh
Nonnegative key amplitude vector for token j .
ϕiq∈Rdh
Query phase vector for token i .
ϕjk∈Rdh
Key phase vector for token j .
Appendix
Table 7: Notation used in the proof appendix.
Term
Definition
Best validation loss
The lowest validation cross entropy observed during training. It is used to track model selection and training progress. Lower is better.
Test loss
The cross entropy loss measured on the held-out test split after training. It measures how well the model assigns probability to the correct next token. Lower is better.
Test perplexity
The exponential form of test loss. It can be read as the model’s effective uncertainty when predicting the next token. Lower is better.
Peak training GPU memory
The maximum GPU memory used during training under the reported batch size, context length, precision, and hardware. It measures practical training cost rather than language quality. Lower is better.
Memory reduction
The percentage decrease in peak GPU memory relative to a chosen baseline. A larger reduction means the model needs less GPU memory under the same reported setting.
Parameter matched comparison
A comparison where models have similar parameter counts. This helps reduce the chance that differences are caused only by model size.
Appendix
Table 8: Definitions of metrics and model terms used in the appendix result analysis.
Figure 3: Controlled comparison on the WikiText-103 dataset. The top ruler reports test perplexity and the bottom ruler reports peak training GPU memory. Each marker represents one internal model, and each label reports the exact value. Q-Interference achieves the best internal test perplexity and the lowest peak GPU memory in this controlled setting.
Figure 4: Peak GPU memory across the custom model family. Q-Interference consistently uses less memory than the standard GPT baseline, naive interference, and the Q-GPT baseline under the reported setting. The naive interference model highlights the cost of materializing the phase-aware interaction tensor.
Figure 5: Pretrained 125M model comparison. GPT-Neo-125M and OPT-125M are pretrained decoder-only models, while Q-Interference is trained from scratch in the controlled setup used in this work. The pretrained references obtain stronger final language-modeling quality, but Q-Interference shows a favorable memory profile and uses lower peak GPU memory on three of the four datasets. The comparison is intended to contextualize Q-Interference rather than to serve as a parameter-matched baseline.