Search arXiv⌕ Search

arXiv subjects

Marcel Crasmaru

Publications and source records attributed to Marcel Crasmaru.

5 recordsLinked to original sources

Born Attention is Linear: Exact Sub-Quadratic Attention and Constant-State Inference from Quantum Measurement

Softmax attention costs O(T^2) in sequence length because the exponential kernel has no finite feature map, so linear-time variants approximate it. We observe that Born-rule attention, whose weights are quantum-measurement probabilities | |^2 over complex queries and keys, is an exact finite kernel with the rank-one density-matrix feature map rho_x = x x^dagger, since | |^2 = tr(rho_Q rho_K). As the complex degree-two case of polynomial-kernel linear attention, it admits an exact O(T d^2) causal recurrence and constant-state decoding, independent of T, and keeps rotary positions exactly. On an A100, constant-state decoding uses 6.4 MB per layer at 0.12 ms per token at any length, against a 3.2 GB FlashAttention-2 cache at 2.26 ms per token at 1M tokens; a fused prefill overtakes FlashAttention-2 between 16k and 32k tokens (4x at 128k). Whether the operator matches softmax is a separate modeling question, answered here at small scale: bolted into a real-valued GPT it trails softmax by 0.12 nats at 1k context and 0.77 at 16k (attention dilution, which a decay kept exactly in the state repairs), while inside a fully complex residual stream it matches softmax at 1k; gated linear attention beats both. At 128k context on PG-19, Born with a fixed decay is 0.32 nats ahead of softmax and within 0.04 of gated linear attention, which is 1.8x faster. Streamed in constant state over the PG-19 test set in 5M-byte windows, 4M-complex-parameter byte models score 1.66 (Born with decay) and 1.70 (gated) bits per byte, where a 350M-parameter hierarchical model built for that window reports 2.45.

cs.LG↗

CNet: A Complex-Valued Deep Learning Framework with Wirtinger Autodifferentiation and FFT--Hadamard Convolution

CNet is a C++/CUDA framework for deep complex-valued neural networks (CVNNs), trained by gradient descent with explicit Wirtinger (CR-calculus) derivatives. Complex models are underexplored yet natural where data is intrinsically complex -- RF/IQ, MRI k-space, radar/SAR, audio spectra -- and phase carries information real networks discard. CNet is physics-native: a network is a cascade of complex (often unitary) operations on an amplitude vector, and classification is a Born-rule measurement p_k = |z_k|^2 / ||z||^2 rather than a softmax over real logits. Every layer ships a CPU reference and a finite-difference-verified CUDA kernel; the static, batch-cloned computation graph captures cleanly into CUDA Graphs, outperforming eager and compiled torch.complex64 on an H100. We present three studies. (1) A fully complex causal language model, built on a new causal (triangular-masked) Fourier mixer with an O(N log N) Bluestein evaluation of the forward pass and its Wirtinger adjoint, matches a parameter-matched real causal FNet on character-level tiny-shakespeare in under half the steps. We introduce Born-rule attention, a content-based causal mixer whose weights are the quantum-measurement probabilities | |^2 -- to our knowledge the first classical, complex-valued attention to replace softmax with the squared-magnitude Born score; with rotary embeddings and per-token complex normalization it reaches 1.52 nats/char, matching softmax self-attention, and transfers unchanged to byte-level (1.31 nats/char) and sub-word WikiText-103. (2) On radio-modulation classification (RML2016.10a/RML22) we trace the pooled-power accuracy ceiling to discarded temporal structure and recover it with a learnable cyclostationary conjugate-lag operator. (3) A bottleneck analysis of the Fourier phase problem in coherent-diffraction imaging isolates where complex-valued networks still need new operators.

cs.LG↗

Searching for Primes: A Neural AlphaZero Approach to a Factoring Game

We study a one-player token game on an $N\times N$ board where tokens slide along diagonals or duplicate onto neighbouring ones to form a combinatorial rectangle $R\times S$. A conserved integer weight $W'$ and a strict monovariant guarantee $O(N^2)$-length solutions, placing the game in $\mathsf{NP}$. We prove that reaching a final position factors this $2N$-bit $W'$ into two $N$-bit factors $V,M < 2^N$ that encode the rectangle's rows and columns. Consequently, solving the game for a balanced-semiprime target is equivalent to integer factoring. However, if the target rectangle is known, the solution reduces to two polynomial-time steps: a forced downward chip-flow and a $0/1$-polynomial factorisation leveraging Cohn's theorem. The game's entire difficulty is thus isolated to the initial number-theoretic split. Supplying the popcounts of the factors as a promise preserves this asymptotic hardness but bounds the target search space. We exploit this constrained space using a learned policy/value network and an AlphaZero-style Monte-Carlo tree search, empirically probing the limits of neural look-ahead on a factoring-equivalent environment.

math.OC↗

Two-Thread Coverage MCTS for SAT and XSAT

We introduce a Monte-Carlo Tree Search solver for SAT and XSAT that pairs WalkSAT-style rollouts with a two-thread symmetry-breaking initialisation: one thread starts from all-true, the other from all-false, bounding each thread's initial Hamming distance to a satisfying assignment by $\lfloor n/2 \rfloor$. Empirically the solver closes 100/100 SATLIB graph-colouring encodings (flat200-479, sw100) in tens of milliseconds each, 20/20 planted 3-XOR-SAT at $n{=}200$ (median 10~s), 6/6 at $n{=}300$ (median 138~s), and one SAT Competition 2025 instance (Break-triple-04-06.xml.cnf) in 50~ms via the polarity split alone. On a full 16-round DES key-recovery encoding ($n{=}1976$, $m{=}30072$) it drives the negative-clause count from $\sim 200$ down to 24 (99.9% clauses satisfied) over 7 hours before hitting the S-box plateau.

math.OC↗

On the Equivalence of Convolutional and Hadamard Networks using DFT

In this paper we introduce activation functions that move the entire computation of Convolutional Networks into the frequency domain, where they are actually Hadamard Networks. To achieve this result we employ the properties of Discrete Fourier Transform. We present some implementation details and experimental results, as well as some insights into why convolutional networks perform well in learning use cases.

math.OC↗