Machine Learning · arXiv:2611.40574 v1 · submitted 30 Nov 2026 · 17 references
Learning twin primality from pairs of modular-inverse graphs
The paper says
“The principal contribution is a mathematical characterization of how the SiameseGIN architecture processes modular-inverse graphs for integers below 104, supported by experimental results.”
The abstract
This work investigates whether twin-prime pairs can be identified from graph representations derived solely from modular-inverse relations. Each integer is represented as a graph whose vertices correspond to residues modulo that integer and whose edges encode multiplicative-inverse relations. We provide mathematical justification for two classification approaches: a Siamese Graph Isomorphism Network (SiameseGIN) and logistic regression. We identify the sum of the isolated-vertex proportions of the two graphs as a common structural quantity underlying both approaches and establish conditions under which it separates twin-prime pairs from non-twin pairs. For the SiameseGIN, we show that message passing and pooling encode the isolated-vertex proportions. For logistic regression, we establish conditions under which an affine function of this structural quantity achieves perfect separation. We further establish conditions for the existence of a common separating threshold across validation and test ranges. Both approaches are evaluated using disjoint training, validation, and test ranges. A threshold selected exclusively on the validation set is applied unchanged to the test set, where both models achieve a balanced accuracy of 1.000, with no false-positive or false-negative classifications. Additional experiments demonstrate perfect classification across extended numerical ranges, including integers near 106, without retraining or threshold adjustment. The principal contribution is a mathematical characterization of how the SiameseGIN architecture processes modular-inverse graphs for integers below 104, supported by experimental results.
from the abstract
Pith says
Holds up, with conditions. The paper provides a mathematical characterization of how a SiameseGIN processes modular-inverse graphs for twin-prime classification, showing that the fraction of isolated vertices separates twin primes from non-twin pairs within bounded numerical ranges.
Machine review · 1 Dec 2026 · Full text · 3 minor
How this review was made
Machine review · deepseek-v4-flash · 1 Dec 2026 · read the full text (56,607 characters) · not checked by a person
The reviewer was given the whole text, 56,607 characters. Not checked: figures, code, what the 17 references say.
How the review went
5 passes by deepseek-v4-flash · 1 Dec 2026
- Reader holds up, with conditions
- Skeptic disagrees
- Referee 3 minor
- Check against the paper
- Editor wrote the verdict above
Not run on this paper: the simulated authors' defence.
Pith checked this review's objections against the text of the paper it read.
The test under “What would settle it” is from the skeptic's reading.
What would settle it
Independently compute D(n) = ρ(n) + ρ(n + 2) for all n in the validation interval [4001,7000] and test interval [7001,9999] using definitions from Section 2.1, then verify that the maximum D(n) over twin-prime pairs is strictly less than the minimum D(n) over non-twin pairs in each interval. This would confirm the separation property stated in Lemma 2 and the common threshold existence in Lemma 3.
3 minor objections
- 2.5 In the proof of Lemma 2, the inequality chain contains the expression '4N1-16N12', which appears to be a formatting artifact (likely intended as 4/N1 - 16/N12). The derivation is otherwise correct, but the expression should be written with unambiguous fractions to avoid confusion.
- 2.6 The description of the SiameseGIN's final linear classifier states that the same weight matrix is applied separately to each graph embedding and that the outputs are added. This correctly enforces equal coefficients on ρ(n) and ρ(n + 2), but the exposition could be made more explicit by writing the score as wTz(Gn) + wTz(Gn+2) + constant, to show that α = β follows by construction.
- 2.3 The condition n ρ(n) = 1 for primality is stated correctly but the equation (n+2) ρ(n + 2) = 1 uses the same n; this is clear in context but a brief restatement would help.
A machine wrote this review. Check any line against the paper. If a line is wrong, say so, and the correction goes on the record.
Are you an author of this paper?
Reply on the record, clarify a point, or challenge an error.
A reply is published word for word beside the review once Pith has verified that the paper is yours. Until then, what you write is kept in this browser.
The review in full
The review in brief
Here is the bottom line: this paper correctly identifies that the proportion of isolated vertices in modular-inverse graphs, ρ(n), is 1/n for primes and larger for composites, and that the sum ρ(n) + ρ(n + 2) separates twin-prime pairs from non-twin pairs under bounded-range conditions. The main contribution is a mathematical derivation showing that a SiameseGIN’s decision score becomes an affine function of this sum, so the network learns a known arithmetic rule rather than a new number-theoretic pattern. The theoretical lemmas appear logically consistent given their stated assumptions, and the experiments on disjoint numerical ranges up to 106 show perfect classification with thresholds chosen on a validation set.
The paper is honest about its scope: it works only for bounded ranges and does not claim to resolve any open problem. The authors also note that the training range does not satisfy the separation conditions, which explains why cross-validation on small numbers was imperfect. That intellectual honesty is a strength.
The soft spots are proportionate. First, the classification problem is essentially solved by the exact arithmetic baseline (ρ(n) = 1/n), so the machine learning component is representational, not necessary for prediction. Second, the code and data are not publicly released; the paper says they are available upon request, but the reported perfect results cannot be independently verified. Third, the separation conditions in Lemma 2 require N2 < N12/16 − 2, which limits the theoretical guarantee to ranges where the test interval is small relative to the validation start. For the experiments this holds, but it is a narrow condition.
This paper is for researchers interested in graph representations for number-theoretic classification tasks, especially those working on GNN interpretability. It is a competent, contained study. It deserves a serious referee who can verify the math and, ideally, inspect the code.
I recommend conditional acceptance pending public release of the reproducing code and data, and a clarification of how the threshold transfer works in cross-validation folds where perfect separation is not achieved.
The strongest objection
The mathematical derivation is logically sound under its stated assumptions. Lemma 1's bound correctly uses the smallest prime divisor to obtain a lower bound; Lemma 2's separation inequality holds for the specified intervals when N2 < N12/16-2; Lemma 3's common threshold condition is satisfied by the validation and test ranges (N1=4001, N4=9999). The SiameseGIN representation (Lemma 4, Theorem 2) correctly shows that all isolated vertices share one embedding and all non-isolated vertices share another, so the graph-level embedding is affine in rho. The equal-coefficient condition is enforced by the tied classifier weights. The logistic regression justification is similarly direct. The experimental results are consistent with theory, and the paper transparently discusses limitations (finite ranges, graph boundary overlap, threshold sensitivity in one cross-validation fold). The only unresolved issue is the absence of public code, which prevents independent reproduction of the perfect test-set results, but this is a reproducibility concern, not a mathematical flaw. The reader's conditional verdict already accounts for this.
The paper's central claim is a mathematical characterization of the SiameseGIN decision score in terms of the isolated-vertex proportions, with sufficient conditions for perfect separation. I re-examined the key steps: Lemma 1's lower bound is correct because every composite n has a prime divisor p <= √n, giving at least n/p - 1 isolated nonzero vertices; this yields ρ(n) >= 1/√n - 1/n. Lemma 2 uses this bound and the decreasing function f(x)=1/√x-1/x to compare positive and negative instances, and the condition N2 < N12/16 − 2 guarantees the required inequality. Lemma 3's condition N4 < N12/16 − 2 is satisfied by the experimental intervals (N1=4001, N4=9999). The derivation of the SiameseGIN score (Lemma 4, Theorem 2) is sound: all vertices share the same initial feature, the GIN aggregation yields identical embeddings for all isolated vertices and for all non-isolated vertices (since each non-isolated vertex receives exactly one neighbor message, including self-loops for self-inverse vertices), and mean pooling produces a graph embedding that is affine in rho. The tied classifier enforces α = β. The logistic regression justification is similarly direct. The experiments agree with theory, and the paper acknowledges all limitations (finite ranges, graph boundary overlap, threshold sensitivity in cross-validation). The only obstacle to full trust is the lack of public code, but that is a reproducibility issue, not a flaw in the argument. The reader's weakest assumption questioned whether the lower bound for composite n might be too weak for separation. However, the bound is a true lower bound, and the separation condition (N2 < N12/16 − 2) ensures that even the weakest possible bound (at the largest m in the range) suffices. Thus the concern does not land. I have no significant objection, and the verdict should remain unchanged.
The referee's report
This work provides a rare, fully worked-out example where a graph neural network's internal representation can be traced to a simple number-theoretic quantity (the isolated-vertex proportion), and where the conditions for perfect classification are established rigorously. The mathematics is self-contained and the experiments align well with the theory. The paper bridges discrete mathematics and interpretable machine learning in a concrete setting, and it honestly acknowledges that the results are limited to finite numerical ranges. It does not claim a breakthrough on the twin-prime conjecture, but rather a clean characterization of model behavior on a specific graph representation. The work is a valid contribution to the literature on graph neural networks and number-theoretic data.
Pith's reading
This paper investigates whether twin-prime pairs can be identified from graph representations built solely from modular-inverse relations. For each integer n, a graph Gn encodes which residues modulo n are multiplicative inverses. The authors provide mathematical justification for two classification approaches: a SiameseGIN and logistic regression. They identify the sum of the isolated-vertex proportions of the two graphs as the common structural quantity underlying both methods and establish conditions under which it separates twin-prime pairs from non-twin pairs. For the SiameseGIN, message passing and mean pooling encode this quantity; for logistic regression, an affine function of the quantity suffices.
What carries the argument. The key objects are the modular-inverse graph Gn, the isolated-vertex ratio ρ(n) = I(n)/n derived from Theorem 1 (which characterizes the graph structure for prime and composite n), and the sum D(n) = ρ(n) + ρ(n + 2). The SiameseGIN uses shared GIN layers with mean pooling; Lemma 4 shows that the graph-level representation z(Gn) equals ρ(n) * zI + (1 − ρ(n)) * zN, where zI and zN are the (identical) embeddings of all isolated and all non-isolated vertices, respectively. This allows the final logit-difference score to become affine in D(n).
Core claim. The central claim is that the SiameseGIN's decision score for a pair (n, n+2) can be expressed as S(n) = α * D(n) + gamma, where D(n) = ρ(n) + ρ(n + 2) is the sum of the isolated-vertex ratios of the two modular-inverse graphs. Under the condition that n is in a range [N1,N2] with N1>16 and N2 < N12/16 - 2, the authors prove (Lemma 2) that positive (twin-prime) and negative pairs are perfectly separated by D(n). Since the SiameseGIN's score is a decreasing affine function of D(n) when α < 0, this separation extends to the score. Logistic regression with equal negative weights also achieves separation. The experimental results, including tests up to integers near 1e6 with a validation-selected threshold, agree with the theory, yielding perfect balanced accuracy and AUC.
The premise it rests on. The separation proof (Lemma 2) assumes the range condition N2 < N12/16 - 2 to guarantee that the gap between positive and negative D(n) values does not close; the bound on isolated vertices for composites always holds, but if the test range exceeds this inequality, perfect separation is not guaranteed by the theory.
If the paper is right
If the theoretical conditions hold for larger ranges (which the paper does not assert), the same threshold might continue to separate twin from non-twin pairs.
The derivation shows that the GIN architecture, under identical initial features, reduces to computing a weighted sum of isolated vertex counts: a specific form of feature engineering by architecture.
Logistic regression achieves the same performance as the GIN, confirming that the structural quantity D(n) is both sufficient and necessary for classification within the studied ranges.
The existence of a common threshold across validation and test ranges (Lemma 3) explains why model transfer without retraining works.
Any pooling-based GNN with sum aggregation and identical initial features would also yield graph-level representations that are affine in the isolated vertex fraction, suggesting that the specific choice of GIN is not critical.
The perfect separation is driven by a deterministic number-theoretic property (the bound on isolated vertices for composites) rather than by complex learned representations, raising questions about whether the GNN is genuinely 'learning' or just recovering a known structural invariant.
The empirical success on ranges not satisfying Lemma 2's conditions (e.g., the training range) indicates that the sufficient conditions may be stronger than necessary, and a more refined bound could extend the theoretical coverage.
Check this review
What was read
The passes were given all 56,607 characters of the text of the paper's PDF.
Fingerprint of that text (SHA-256): c4b27719ec8d0852ad1e9f362121564982f7f2991225d12398590435b239a0b1
Pith does not keep that text. Rebuilt from the paper's source or PDF by the same code, it has this fingerprint if it is the same text. From a copy of Pith's code:
PYTHONPATH=. python scripts/review_input_check.py 2611.40574
The passes, in the order they ran
- Reader deepseek-v4-flash · medium effort · $0.0019 · instructions of the Reader, fingerprint f9ead7300382…
- Skeptic deepseek-v4-flash · medium effort · $0.0015 · instructions of the Skeptic, fingerprint 8f88c0f61488…
- Referee deepseek-v4-flash · medium effort · $0.0022 · instructions of the Referee, fingerprint a852d99aea0d…
- Editor deepseek-v4-flash · medium effort · $0.0012 · instructions of the Editor, fingerprint e7211f6a3d27…
- Circularity check deepseek-v4-flash · medium effort · $0.0011 · instructions of the Circularity check, fingerprint e9946e39d67b…
- Summary for the page deepseek-v4-flash · medium effort · temperature 0.2 · $0.0015 · instructions of the Summary for the page, fingerprint e4f56bf568e7…
The passes cost $0.0095 in model calls together.
Version stamped on this review: pith-pipeline@v1.4.1-daily-deepseek-or-medium+deepseek/deepseek-v4-flash+p.505d180dcaef
Each link opens a pass's instructions as plain text, the exact bytes its fingerprint was taken over. Every stored set of instructions.
curl -s https://pith.science/methodology/prompts/f9ead730038216984cfb56d7cb34332bdf691828296a1de4245f3d6667d4bf56 | sha256sum
prints the fingerprint of the reader's instructions. The same works for every pass.
The receipt
The review's fingerprint was taken on 1 Dec 2026. The review you are reading still matches it.
Fingerprint of the review (SHA-256): 5512c868f6ccd2e4d7a4b3f43b984fdece96a875f80864b5fb305941d83b6e58
curl -s 'https://pith.science/api/v1/verdicts/2611.40574?form=canonical' | sha256sum
prints the fingerprint of the review as it stands now. The rule, in four steps.
A matching fingerprint shows the review has not changed since that date. It does not show that the review is right.
Reviews like this one: written by deepseek-v4-flash, from the text of the paper's PDF.
No person has reviewed this paper on Pith yet. A scientist listed on Pith can review it for a fee, and the review is published here whatever it concludes. Request a human review
The paper
Abstract
This work investigates whether twin-prime pairs can be identified from graph representations derived solely from modular-inverse relations. Each integer is represented as a graph whose vertices correspond to residues modulo that integer and whose edges encode multiplicative-inverse relations. We provide mathematical justification for two classification approaches: a Siamese Graph Isomorphism Network (SiameseGIN) and logistic regression. We identify the sum of the isolated-vertex proportions of the two graphs as a common structural quantity underlying both approaches and establish conditions under which it separates twin-prime pairs from non-twin pairs. For the SiameseGIN, we show that message passing and pooling encode the isolated-vertex proportions. For logistic regression, we establish conditions under which an affine function of this structural quantity achieves perfect separation. We further establish conditions for the existence of a common separating threshold across validation and test ranges. Both approaches are evaluated using disjoint training, validation, and test ranges. A threshold selected exclusively on the validation set is applied unchanged to the test set, where both models achieve a balanced accuracy of 1.000, with no false-positive or false-negative classifications. Additional experiments demonstrate perfect classification across extended numerical ranges, including integers near 106, without retraining or threshold adjustment. The principal contribution is a mathematical characterization of how the SiameseGIN architecture processes modular-inverse graphs for integers below 104, supported by experimental results.
A classifier labelled each sentence of the abstract by the part it plays in the paper. The labels are kept beside the review and separate from it: the review read the paper's text, and these labels cover the abstract only. Every quoted sentence is the authors' own. No sentence in this record was written by a model.
abstract compiled · 1 Dec 2026
The main claim
“The principal contribution is a mathematical characterization of how the SiameseGIN architecture processes modular-inverse graphs for integers below 104, supported by experimental results.”
Stated as asserted.
The abstract, sentence by sentence
This table labels the abstract only (arXiv listing abstract v1). The number is the probability the classifier gave the label.
| Sentence | Role | The authors' own work | States the main conclusion | Strength |
|---|---|---|---|---|
| This work investigates whether twin-prime pairs can be identified from graph representations derived solely from modular-inverse relations. | contribution 0.57 | 0.54 | 0.05 | hedged possibility 0.51 |
| Each integer is represented as a graph whose vertices correspond to residues modulo that integer and whose edges encode multiplicative-inverse relations. | method 0.96 | 0.43 | 0.02 | asserted 0.99 |
| We provide mathematical justification for two classification approaches: a Siamese Graph Isomorphism Network (SiameseGIN) and logistic regression. | method 0.54 | 0.93 | 0.05 | asserted 1.00 |
| We identify the sum of the isolated-vertex proportions of the two graphs as a common structural quantity underlying both approaches and establish conditions under which it separates twin-prime pairs from non-twin pairs. | contribution 0.78 | 0.95 | 0.33 | asserted 1.00 |
| For the SiameseGIN, we show that message passing and pooling encode the isolated-vertex proportions. | result 0.37 | 0.93 | 0.06 | asserted 1.00 |
| For logistic regression, we establish conditions under which an affine function of this structural quantity achieves perfect separation. | result 0.58 | 0.95 | 0.11 | asserted 1.00 |
| We further establish conditions for the existence of a common separating threshold across validation and test ranges. | contribution 0.68 | 0.94 | 0.06 | asserted 1.00 |
| Both approaches are evaluated using disjoint training, validation, and test ranges. | method 1.00 | 0.93 | 0.03 | asserted 0.99 |
| A threshold selected exclusively on the validation set is applied unchanged to the test set, where both models achieve a balanced accuracy of 1.000, with no false-positive or false-negative classifications. | result 1.00 | 0.95 | 0.27 | asserted 1.00 |
| Additional experiments demonstrate perfect classification across extended numerical ranges, including integers near 106, without retraining or threshold adjustment. | result 1.00 | 0.93 | 0.13 | asserted 1.00 |
| The principal contribution is a mathematical characterization of how the SiameseGIN architecture processes modular-inverse graphs for integers below 104, supported by experimental results. | contribution 0.99 | 0.93 | 0.60 | asserted 1.00 |
What kind of paper the classifier reports this is: theoretical result 0.99 · evidence from proof or derivation 0.88
What was examined, and what was not
These lists are about the sentence labels. What the review read is said with the review.
Read
- arXiv listing abstract v1
Not read
- full text
- figures and tables
- references and citing sentences
- relations to other papers
Labelled
- abstract
Not labelled
- sections
- body sentences
- citations
- cross-paper relations
The main claim, as probabilities
picked as the main claim 0.42 · how strongly it is stated 1.00
What the abstract itself states, as probabilities
claims first 0.05 · states limitation 0.57 · human participants 0.01 · controlled comparison 0.23 · randomized assignment 0.02 · states quantitative result 0.98 · compares with prior results 0.25 · mentions code or data availability 0.03
How the labels were made
Compiled by classifier-1.13.0 via TypeSafe API, question bank abstract-p1-20260923, 2026-12-01: 1 request, 8,132 input tokens.
This record as JSON, with every label and the probability the classifier gave it.
References (17)
- [1] T. M. Apostol, Introduction to Analytic Number Theory. Springer Science & Business Media, 1976 on Pith
- [2] H. Halberstam and H. E. Richert, Sieve Methods. Courier Corporation, 1974 on Pith
- [3] M. B. Nathanson, Elementary Methods in Number Theory. New York, NY, USA: Springer, 2000 on Pith
- [4] G. H. Hardy and J. E. Littlewood, “Some problems of Partitio Numerorum; III: On the expression of a number as a sum of primes,” Acta Mathematica, vol. 44, pp. 1–70, on Pith
- [5] D. A. Goldston, J. Pintz, and C. Y. Yıldırım, “Primes in tuples I,” Annals of Mathematics, vol. 170, no. 2, pp. 819–862, 2009. doi: 10.4007/annals.2009.170.819 on Pithdoi:10.4007/annals.2009.170.819
- [6] J. Maynard, “Small gaps between primes,” Annals of Mathematics, vol. 181, no. 1, pp. 383–413, 2015 on Pith
- [7] Y. Zhang, “Bounded gaps between primes,” Annals of Mathematics, vol. 179, no. 3, pp. 1121–1174, 2014 on Pith
- [8] D. H. J. Polymath, “Variants of the Selberg sieve, and bounded intervals containing many primes,” Research in the Mathematical Sciences, vol. 1, article 12, 2014. doi: 10.1186/s40687-014-0012-7 on Pithdoi:10.1186/s40687-014-0012-7
- [9] M. Th. Rassias, “Recent results on large gaps between primes,” Axioms, vol. 14, no. 3, article 198, 2025. doi: 10.3390/axioms14030198 on Pithdoi:10.3390/axioms14030198
- [10] Y.-H. He, “Machine-learning mathematical structures,” International Journal of Data Science in the Mathematical Sciences, vol. 1, no. 1, pp. 23–47, 2023 on Pith
- [11] F. Scarselli, M. Gori, A. C. Tsoi, M. Hagenbuchner, and G. Monfardini, “The graph neural network model,” IEEE Transactions on Neural Networks, vol. 20, no. 1, pp. 61–80, 2009 on Pith
- [12] B.-H. Kim and J. C. Ye, “Understanding graph isomorphism network for rs-fMRI functional connectivity analysis,” Frontiers in Neuroscience, vol. 14, p. 630, 2020 on Pith
- [13] K. Xu, W. Hu, J. Leskovec, and S. Jegelka, “How powerful are graph neural networks?” International Conference on Learning Representations (ICLR), 2019 on Pith
- [14] A. Kolpakov and A. A. Rocke, “Machine learning of the prime distribution,” PLOS ONE, vol. 19, no. 9, e0301240, 2024. doi: 10.1371/journal.pone.0301240 on Pithdoi:10.1371/journal.pone.0301240
- [15] T. Weissblat, “Learning primality from modular-inverse graphs,” Research Square, 2026, doi: 10.21203/rs.3.rs-11138869/v1 on Pithdoi:10.21203/rs.3.rs-11138869/v1
- [16] D. M. Burton, Elementary Number Theory, 7th ed. New York, NY, USA: McGraw-Hill, 2011 on Pith
- [1923] doi: 10.1007/BF02403921 on Pithdoi:10.1007/bf02403921
Challenges and discussion
Disagree with the review, or know something it missed? Leave a comment, or challenge this review formally: a challenge becomes a permanent entry in this paper's record, and its decision is published here.
The week in your field, by email.
A short list of the week's newly reviewed papers. Nothing is sent until you confirm from your inbox, and every email has a link that stops it. No account. No tracking pixel.
No comments yet.
Sign in to comment