Neural Prime Sieves: Density-Driven Generalization and Empirical Evidence for Hardy-Littlewood Asymptotics
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 p, learning probabilistic filters for all seven families simultaneously and generalising across nine orders of magnitude from training (107--109) to evaluation at 1016. Isolated prime recall increased monotonically from 0.809 at 5×108 to 0.984 at 1016, a gain of 17.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 109 reproduced the correct asymptotic direction without density supervision, corroborating Hardy--Littlewood k-tuple predictions. The causal model retained over 95\% recall for five families near 1010 while reducing the search space by 62--88\%. For Chen primes, causal recall exceeded non-causal recall at every scale (margin +0.245 at 1016) because g+=2 encodes only the prime case of the Chen condition. Focal Loss collapsed sparse algebraic family recall to 0.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.
Turn this paper into a lesson
ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.