Complex-Valued Unitary Representations as Classification Heads for Improved Uncertainty Quantification in Deep Neural Networks
Organizations: University of Tartu Tartu, Estonia · 3S Holding OÜ Tartu 51011, Estonia
Abstract
Modern deep neural networks achieve high predictive accuracy but remain poorly calibrated: their confidence scores do not reliably reflect the true probability of correctness. We propose a quantum-inspired classification head architecture that projects backbone features into a complex-valued Hilbert space and evolves them under a learned unitary transformation parameterised via the Cayley map. Through a controlled hybrid experimental design - training a single shared backbone and comparing lightweight interchangeable heads - we isolate the effect of complex-valued unitary representations on calibration. Our ablation study on CIFAR-10 reveals that the unitary magnitude head (complex features evolved under a Cayley unitary, read out via magnitude and softmax) achieves an Expected Calibration Error (ECE) of 0.0146, representing a 2.4x improvement over a standard softmax head (0.0355) and a 3.5x improvement over temperature scaling (0.0510). Surprisingly, replacing the softmax readout with a Born rule measurement layer - the quantum-mechanically motivated approach - degrades calibration to an ECE of 0.0819. On the CIFAR-10H human-uncertainty benchmark, the wave function head achieves the lowest KL-divergence (0.336) to human soft labels among all compared methods, indicating that complex-valued representations better capture the structure of human perceptual ambiguity. We provide theoretical analysis connecting norm-preserving unitary dynamics to calibration through feature-space geometry, report negative results on out-of-distribution detection and sentiment analysis to delineate the method's scope, and discuss practical implications for safety-critical applications. Code is publicly available.
Figures & tables
| Variant | Complex | Unitary | Born | Readout |
|---|---|---|---|---|
| Full WaveHead | Born rule | |||
| NoBorn (Mag) | Magnitude + softmax | |||
| NoUnitary | Born rule | |||
| ComplexLinear | Magnitude + softmax | |||
| Softmax | Linear + softmax | |||
| Softmax (2x) | Wider linear + softmax |
| Method | Experiments | Type |
|---|---|---|
| Softmax Head | 2, 3, 5 | Baseline head |
| WaveFunction Head | 2, 3, 5 | Proposed (Born) |
| NoBorn (Magnitude) Head | 5 | Proposed (best) |
| MC-Dropout Head | 2, 3 | Bayesian approx. |
| Evidential Head | 2, 3 | Dirichlet-based |
| Temperature Scaling | 2 | Post-hoc |
| Head | Acc. | ECE | NLL | Brier | KL-Div |
|---|---|---|---|---|---|
| Softmax | 0.913 | 0.036 | 0.287 | 0.132 | 0.404 |
| WaveFunction | 0.909 | 0.082 | 0.349 | 0.148 | 0.336 |
| MC-Dropout | 0.913 | 0.048 | 0.325 | 0.137 | 0.486 |
| Evidential | 0.096 | 0.004 | 2.303 | 0.900 | 2.148 |
| TempScaling | 0.913 | 0.052 | 0.355 | 0.139 | 0.568 |
| Head | SVHN | CIFAR-100 | Gaussian | Uniform |
|---|---|---|---|---|
| WaveFunction | 0.853 | 0.841 | 0.837 | 0.863 |
| Softmax | 0.881 | 0.854 | 0.849 | 0.831 |
| MC-Dropout | 0.888 | 0.850 | 0.846 | 0.827 |
| Energy | 0.809 | 0.862 | 0.767 | 0.804 |
| Model | Acc. | Neg. Acc. | ECE | Neg. ECE |
|---|---|---|---|---|
| WaveTransformer | 0.745 | 0.654 | 0.208 | 0.285 |
| Transformer | 0.762 | 0.709 | 0.176 | 0.224 |
| LSTM | 0.762 | 0.722 | 0.201 | 0.254 |
| TextCNN | 0.757 | 0.715 | 0.127 | 0.166 |
| Variant | Acc. | ECE | NLL | Brier | Params |
|---|---|---|---|---|---|
| Full WaveHead | 0.909 | 0.082 | 0.349 | 0.148 | 17.2K |
| NoBorn (Mag) | 0.911 | 0.015 | 0.280 | 0.131 | 17.2K |
| NoUnitary | 0.909 | 0.082 | 0.350 | 0.148 | 17.3K |
| ComplexLinear | 0.913 | 0.053 | 0.359 | 0.140 | 17.3K |
| Softmax | 0.913 | 0.036 | 0.287 | 0.132 | 0.7K |
| Softmax (2x) | 0.913 | 0.051 | 0.346 | 0.139 | 9.6K |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Seed 42 | Seed 123 | Seed 456 | ||||
|---|---|---|---|---|---|---|
| Variant | Acc. | ECE | Acc. | ECE | Acc. | ECE |
| Full WaveHead | 0.907 | 0.080 | 0.909 | 0.082 | 0.910 | 0.084 |
| NoBorn (Mag) | 0.910 | 0.013 | 0.911 | 0.015 | 0.913 | 0.016 |
| NoUnitary | 0.907 | 0.081 | 0.909 | 0.082 | 0.910 | 0.084 |
| ComplexLinear | 0.912 | 0.052 | 0.913 | 0.053 | 0.914 | 0.054 |
| Softmax | 0.911 | 0.034 | 0.913 | 0.036 | 0.914 | 0.036 |
| (no warmup) | 0.031 | 0.024 | 0.019 | 0.020 |
|---|---|---|---|---|
| 0.027 | 0.020 | 0.016 | 0.017 | |
| (default) | 0.025 | 0.018 | 0.015 | 0.016 |
| 0.026 | 0.019 | 0.015 | 0.016 |
Uncertainty Calibration
Uncertainty calibration aligns model confidence and predictive intervals with observed correctness and outcome frequencies.
See all 264 papers