English

Neural Prime Sieves: Density-Driven Generalization and Empirical Evidence for Hardy-Littlewood Asymptotics

General Mathematics 2026-04-06 v1

Abstract

Special prime families (twin, Sophie Germain, safe, cousin, sexy, Chen, and isolated primes) are central objects of analytic number theory, yet no efficiently computable probabilistic filter exists for identifying likely members among known primes at large scale. Classical sieves assign no probability weights to surviving candidates, and prior machine learning approaches are limited by the algorithmic randomness of the prime indicator sequence, yielding near-zero true positive rates. We present PrimeFamilyNet, a multi-head residual network conditioned on the backward prime gap and modular primorial residues of a known prime pp, learning probabilistic filters for all seven families simultaneously and generalising across nine orders of magnitude from training (10710^7--10910^9) to evaluation at 101610^{16}. Isolated prime recall increased monotonically from 0.8090.809 at 5×1085\times10^8 to 0.9840.984 at 101610^{16}, a gain of 17.517.5 percentage points and the only family among seven to improve with scale. Because recall is invariant to class prevalence, this reflects genuine decision boundary sharpening, not the rising isolated-prime fraction at extreme scales. A model trained only to 10910^9 reproduced the correct asymptotic direction without density supervision, corroborating Hardy--Littlewood kk-tuple predictions. The causal model retained over 95%95\% recall for five families near 101010^{10} while reducing the search space by 6262--88%88\%. For Chen primes, causal recall exceeded non-causal recall at every scale (margin +0.245+0.245 at 101610^{16}) because g+=2g^+=2 encodes only the prime case of the Chen condition. Focal Loss collapsed sparse algebraic family recall to 0.0000.000. Asymmetric Loss outperformed weighted BCE in-distribution but degraded more steeply out-of-distribution, showing that in-distribution recall alone is a misleading criterion for scale-generalisation tasks.

Keywords

Cite

@article{arxiv.2604.02383,
  title  = {Neural Prime Sieves: Density-Driven Generalization and Empirical Evidence for Hardy-Littlewood Asymptotics},
  author = {Manik Kakkar},
  journal= {arXiv preprint arXiv:2604.02383},
  year   = {2026}
}

Comments

36 pages, 6 figures; cross-listed with math.NT; code at https://github.com/Manik-00/Neural-Prime-Sieves