4 min read
On this page

Prime Weighting

In Plain English#

Every constraint in a problem is different — a clause in a SAT formula is not the same as an edge-cut constraint in graph partitioning. But traditional algorithms treat constraints all the same, which causes problems: two constraints can create the same gradient direction, leading to gradient resonance and catastrophic interference.

Prime weighting solves this by giving every constraint a unique mathematical identity, like assigning each person a unique fingerprint. The assignment uses prime numbers because primes have a special property: they’re multiplicatively independent. You can’t create one prime by multiplying other primes together.

Why this matters: When each constraint has a unique prime weight, no two constraints ever produce the same gradient signature. The system always knows which constraint is causing which gradient. This eliminates an entire class of failure modes.


The Mathematics#

Each constraint cc receives a prime pcp_c and weight:

W(pc)=11+ln(pc)W(p_c) = \frac{1}{1 + \ln(p_c)}

Key properties:

  • Monotonic: Larger primes → smaller weights (refinement, not dominance)
  • Logarithmic suppression: Prevents large primes from vanishing entirely
  • Prime Number Theorem: The KK-th prime pKKlnKp_K \sim K \ln K, so weights scale consistently

Why This Formula?#

The weight formula W(p)=1/(1+lnp)W(p) = 1/(1 + \ln p) emerges from the Prime Number Theorem:

pKKlnKp_K \sim K \ln K

This means: 11+lnpK11+lnK+lnlnK\frac{1}{1 + \ln p_K} \sim \frac{1}{1 + \ln K + \ln \ln K}

So the KK-th constraint receives weight 1/K\approx 1/K — a natural harmonic scaling that matches the structure of modular arithmetic.


The Euler Product Connection#

The prime weights connect to the Riemann zeta function via the Euler product:

ζ(s)=p prime11ps\zeta(s) = \prod_{p \text{ prime}} \frac{1}{1 - p^{-s}}

When constraints compose multiplicatively:

Pmult=v(11pv2)p(11p2)=1ζ(2)=6π2P_{\text{mult}} = \prod_{v} \left(1 - \frac{1}{p_v^2}\right) \approx \prod_{p} \left(1 - \frac{1}{p^{2}}\right) = \frac{1}{\zeta(2)} = \frac{6}{\pi^2}

The constraint satisfaction probability approaches ζ(2)1\zeta(2)^{-1} — a constant! This is the multiplicative bootstrap that makes the system stable.


Why Primes Are Special#

Fundamental Theorem of Arithmetic#

Every integer factors uniquely into primes. This means:

  • Multiplicative independence: No prime can be expressed as a product of other primes
  • Unique factorization: Each constraint’s gradient signature is distinct
  • No collisions: The mapping cpcc \to p_c is injective

Contrast with Uniform Weights#

Weight SchemeGradient Collision ProbabilityScaling
UniformHigh (many constraints share weights)O(1)
RandomMedium (birthday paradox)O(√K)
PrimeZero (guaranteed unique)O(1)

Ablation Results#

From the NitroSAT benchmarks:

Ablation studies show 4x speedup and 75% reduction in topological complexity when using prime weights vs. uniform weights.

The prime-weighted system:

  • Detects phase transitions earlier and more reliably
  • Navigates fractures without losing progress
  • Scales better to large clause counts

Prime Weighting in Practice#

BAHA#

Each clause gets a prime weight; the fracture detector monitors the free energy gradient ρ(β)\rho(\beta).

The Arithmetic Sector uses prime-weighted operators as the identity kernel — each constraint flows along its own geometric path.

Multiplicative PINN#

Each physics constraint (Navier-Stokes, Poisson, etc.) receives a distinct prime weight, enabling multiplicative enforcement without gradient conflicts.

Spectral-Multiplicative Framework#

Graph partitioning constraints receive prime weights that maintain ρ0.99\rho \geq 0.99 correlation between spectral and multiplicative functionals.


Key Insight#

Prime weighting is causal, not decorative. It’s not a heuristic — it’s a mathematical guarantee of uniqueness that emerges from the Fundamental Theorem of Arithmetic. Every other approach to constraint satisfaction has to deal with gradient collisions somehow; prime weighting eliminates them at the source.


See Also#

Start typing to search all 77 articles and guides.