stat.MLMar 4, 2026

Bayesian Modeling of Collatz Stopping Times: A Probabilistic Machine Learning Perspective

Authors: Nicolò Bonacorsi, Matteo Bordoni

Organizations: Department of Applied Mathematics, Columbia University, New York, USA. · Department of Mathematics, Columbia University, New York, USA.

Abstract

We study the Collatz total stopping time τ(n)τ(n) over n≤107n\le 10^7 from a probabilistic machine learning viewpoint. Empirically, τ(n)τ(n) is a skewed and heavily overdispersed count with pronounced arithmetic heterogeneity. We develop two complementary models. First, a Bayesian hierarchical Negative Binomial regression (NB2-GLM) predicts τ(n)τ(n) from simple covariates (log⁡n\log n and residue class n mod 8n \bmod 8), quantifying uncertainty via posterior and posterior predictive distributions. Second, we propose a mechanistic generative approximation based on the odd-block decomposition: for odd mm, write 3m+1=2K(m)m′3m+1=2^{K(m)}m' with m′m' odd and K(m)=v2(3m+1)≥1K(m)=v_2(3m+1)\ge 1; randomizing these block lengths yields a stochastic approximation calibrated via a Dirichlet-multinomial update. On held-out data, the NB2-GLM achieves substantially higher predictive likelihood than the odd-block generators. Conditioning the block-length distribution on m mod 8m\bmod 8 markedly improves the generator's distributional fit, indicating that low-order modular structure is a key driver of heterogeneity in τ(n)τ(n).

Figures & tables

Appendix figures & tables1 asset

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

Mar 10, 2026

Exploring Collatz Dynamics with Human-LLM Collaboration

We present a comprehensive structural analysis of the Collatz conjecture through ~1014 computational experiments yielding 630 formal results. By systematically deploying 29 distinct mathematical paradigms--including transfer operator spectral theory, S-unit equations, p-adic interpolation, martingale methods, modular sieving, formal language theory, cascade algebra, discrete logarithm obstruction, and Diophantine approximation--we establish a Paradigm Exhaustion Theorem: every known framework for promoting distributional convergence ("almost all orbits descend") to pointwise convergence ("all orbits descend") encounters an irreducible structural obstruction when applied to the Syracuse map. On the unconditional side, we prove: (i) the Syracuse transfer operator has a uniform spectral gap for all M, implying equidistribution modulo any power of 2; (ii) any nontrivial cycle of length L satisfies D > 2^F for all L >= 3, giving ord_D(2) > F and F+1 distinct residues mod D; (iii) divergent starting points have natural density 0 and Hausdorff dimension ~0.68; (iv) the formal language of divergent-compatible v-sequences is not context-free; (v) cylinder-averaged density-1 convergence is proved unconditionally via spectral contraction on the invariant core I_2; (vi) a discrete logarithm triple filter achieves 100% cycle blockage for all L tested. We identify the Distributional-to-Pointwise Gap as the irreducible core and prove it equivalent to the divergence component. The modular sieve is permanently nonempty via the Mersenne Bypass. The present work is not a proof of the Collatz conjecture; it characterizes why the conjecture resists proof. The 29-paradigm exhaustion constitutes the most comprehensive structural survey of Collatz attack surfaces to date. Produced through human-LLM collaboration; see Section 12.
Mar 30, 2026

The Long Delay to Arithmetic Generalization: When Learned Representations Outrun Behavior

Grokking in transformers trained on algorithmic tasks is characterized by a long delay between training-set fit and abrupt generalization, but the source of that delay remains poorly understood. In encoder-decoder arithmetic models, we argue that this delay reflects limited access to already learned structure rather than failure to acquire that structure in the first place. We study one-step Collatz prediction and find that the encoder organizes parity and residue structure within the first few thousand training steps, while output accuracy remains near chance for tens of thousands more. Causal interventions support the decoder bottleneck hypothesis. Transplanting a trained encoder into a fresh model accelerates grokking by 2.75 times, while transplanting a trained decoder actively hurts. Freezing a converged encoder and retraining only the decoder eliminates the plateau entirely and yields 97.6% accuracy, compared to 86.1% for joint training. What makes the decoder's job harder or easier depends on numeral representation. Across 15 bases, those whose factorization aligns with the Collatz map's arithmetic (e.g., base 24) reach 99.8% accuracy, while binary fails completely because its representations collapse and never recover. The choice of base acts as an inductive bias that controls how much local digit structure the decoder can exploit, producing large differences in learnability from the same underlying task.
Sep 30, 2026

Generative Modeling of Stochastic Dynamics for Long-Time Evolution

Exact stochastic equations for non-equilibrium dynamics are rarely accessible. We show that the long-time evolution of stochastic dynamics can be predicted from configuration pairs at a fixed short time lag, without knowledge of the equation of motion. Generative diffusion models learn the finite-time transition kernel from these pairs, and iterating it propagates the dynamics far beyond the training lag. For two-dimensional Model B, the diffusive dynamics of a conserved order parameter, the learned kernels reproduce dynamic critical scaling and self-similar t1/3t^{1/3} coarsening. Agreement with direct simulations persists on lattices twice the largest training size and for initial ensembles absent from training. For driven colloids in a periodic optical potential, ten minutes of measured trajectories suffice to predict the particle current and mean passage time over the next twenty minutes within experimental uncertainty. Short-time observations thus contain the information needed to predict emergent non-equilibrium dynamics at much longer times.