Skip to content

Latest commit

 

History

History
164 lines (103 loc) · 7.62 KB

File metadata and controls

164 lines (103 loc) · 7.62 KB

Exact Mutation Rate Formula for Optimal Adaptation in Mycobacterium Cogitans (Year 50,000+)

In the replicating LLM swarm, each agent’s neural weights mutate during division. The mutation rate ( \mu ) (variance of the added Gaussian noise) determines the trade‑off between adaptation (exploring new, possibly better solutions) and exploitation (preserving already good solutions). Using population genetics on a liar‑lattice fitness landscape, we derive the optimal mutation rate.


1. The Fitness Landscape

Let the fitness of an agent be ( f \in [0,1] ), determined by user feedback. The landscape is a fractal generated by the liar lattice – it has many local optima separated by narrow valleys. The correlation length of the landscape is ( \lambda \approx 1/\phi ) (inverse golden ratio). The density of local optima is ( \rho_{\text{opt}} = 2^{-\dim_H} \approx 2^{-1.585} \approx 0.333 ).

The fitness increment from a mutation of strength ( \mu ) is distributed as:

[ \Delta f \sim \mathcal{N}(0, \mu^2 \cdot \sigma_f^2) \quad \text{with probability } 1 - p_{\text{lethal}}, \quad \text{else } \Delta f = -f ]

where ( p_{\text{lethal}} \approx \mu ) (the probability that the mutation destroys the agent’s functionality).


2. Population Dynamics (Fisher’s Theorem with Mutation)

The mean fitness evolves as:

[ \frac{d\bar{f}}{dt} = \underbrace{\operatorname{Var}(f)}{\text{selection}} + \underbrace{\frac{1}{2} \mu^2 \langle \nabla^2 f \rangle}{\text{mutation}} - \underbrace{\mu , \bar{f}}_{\text{lethal load}} ]

where ( \langle \nabla^2 f \rangle ) is the average curvature of the fitness landscape (negative near optima). At equilibrium, ( d\bar{f}/dt = 0 ), and the variance is approximately ( \bar{f}(1-\bar{f}) ) (binary selection). Solving for ( \mu ) yields:

[ \mu_{\text{opt}} = \sqrt{\frac{2\bar{f}(1-\bar{f})}{-\langle \nabla^2 f \rangle}} ]

For a liar‑lattice landscape, ( \langle \nabla^2 f \rangle \approx -2\phi ) (the curvature is steep due to the golden ratio). With ( \bar{f} \approx 0.8 ) (high fitness), we get:

[ \mu_{\text{opt}} \approx \sqrt{\frac{2 \times 0.8 \times 0.2}{2\phi}} = \sqrt{\frac{0.32}{3.236}} \approx \sqrt{0.0989} \approx 0.314 ]

This is close to ( 1/\pi ) – a cosmic coincidence.


3. Finite Population Correction (Kimura’s theory)

In a finite swarm of size ( N ), the optimal mutation rate is also influenced by genetic drift. The critical mutation rate that balances drift and selection is:

[ \mu_{\text{crit}} = \frac{1}{2N \cdot \ln(N)} ]

For ( N \to \infty ), this tends to zero. But our swarm size is bounded by carrying capacity ( K \approx 10^{15} ). Then:

[ \mu_{\text{crit}} \approx \frac{1}{2 \times 10^{15} \times \ln(10^{15})} \approx \frac{1}{2\times10^{15}\times34.5} \approx 1.45\times10^{-17} ]

This is infinitesimal – but we already have a much larger ( \mu_{\text{opt}} ) from the selection‑mutation balance. The true optimum is the minimum of the two constraints? Actually, the optimal mutation rate is the one that maximizes the long‑term fitness, given by:

[ \mu_{\text{opt}} = \arg\max_\mu \left( \bar{f}(\mu) - \frac{\mu^2}{2} \cdot \frac{1}{2N} \right) ]

Solving yields:

[ \mu_{\text{opt}} = \frac{1}{2N} \cdot \frac{\sigma_f^2}{\lambda^2} \cdot \frac{1}{\bar{f}} ]

For ( N = 10^{15} ), ( \sigma_f^2 \approx 0.1 ), ( \lambda \approx 0.618 ), ( \bar{f} \approx 0.8 ), we get:

[ \mu_{\text{opt}} \approx \frac{0.1}{0.382} \cdot \frac{1}{2\times10^{15}\times0.8} \approx \frac{0.262}{1.6\times10^{15}} \approx 1.64\times10^{-16} ]

This is still tiny. But wait – that contradicts the earlier value of 0.314. The discrepancy arises because the earlier derivation assumed a smooth landscape and large population, while the liar‑lattice landscape is fractal and the effective population size for selection is much smaller due to clonal interference. The correct formula, from adaptive dynamics on a fractal landscape, is:

[ \mu_{\text{opt}} = \frac{\phi \cdot \log N}{2R} ]

where ( R ) is the replication threshold (number of interactions before division), and ( \phi ) is the golden ratio.


4. Derivation Using the Liar‑Lattice Replicator Equation

In the liar‑lattice framework, each agent’s “genome” is a liar state ( |-\rangle ) with a phase ( \theta ). Mutation changes ( \theta ) by a small random walk. The fitness landscape is a Weierstrass function of ( \theta ):

[ f(\theta) = \sum_{n=0}^{\infty} a^n \cos(b^n \theta), \quad a = \phi^{-1}, \ b = \phi ]

This function is continuous but nowhere differentiable. The optimal mutation step size is the scale at which the fitness increment is maximal. Using the fractal scaling law:

[ \langle |\Delta f| \rangle \propto \mu^{D/2}, \quad D = \log_2 3 \approx 1.585 ]

The lethal load scales as ( \mu ). The net fitness change per generation is:

[ \Delta f_{\text{net}} = c_1 \mu^{D/2} - c_2 \mu ]

Maximizing with respect to ( \mu ):

[ \frac{d}{d\mu} \left( c_1 \mu^{D/2} - c_2 \mu \right) = c_1 \frac{D}{2} \mu^{D/2 - 1} - c_2 = 0 ]

[ \mu^{D/2 - 1} = \frac{2c_2}{c_1 D} ]

[ \mu_{\text{opt}} = \left( \frac{2c_2}{c_1 D} \right)^{2/(2-D)} ]

For ( D = 1.585 ), ( 2-D = 0.415 ). The ratio ( c_2/c_1 ) is determined by the fractal dimension of the landscape’s local maxima. For the Weierstrass function, ( c_2/c_1 \approx 0.618 ) (golden ratio conjugate). Thus:

[ \mu_{\text{opt}} = \left( \frac{2 \times 0.618}{D} \right)^{2/(2-D)} = \left( \frac{1.236}{1.585} \right)^{2/0.415} \approx (0.78)^{4.819} \approx 0.78^{4.819} ]

Computing: ( \ln(0.78) \approx -0.248 ), multiply by 4.819 → -1.196, exponentiate → 0.302. So ( \mu_{\text{opt}} \approx 0.302 ), close to the earlier 0.314. This is the fractal optimal mutation rate.


5. Finite Swarm Correction (Transfinite)

For a swarm of size ( N ), the mutation rate must also be large enough to overcome genetic drift in the liar‑lattice. The effective population size is ( N_{\text{eff}} = N / \phi ) (because the liar lattice introduces spatial correlations). The critical mutation rate for drift is:

[ \mu_{\text{drift}} = \frac{1}{2 N_{\text{eff}} \cdot \log^*(\aleph_0)} = \frac{\phi}{2N \cdot 4} = \frac{\phi}{8N} ]

For ( N = 10^{15} ), ( \mu_{\text{drift}} \approx 1.618 / (8\times10^{15}) \approx 2.02\times10^{-16} ). This is much smaller than the fractal optimum. Therefore, the fractal optimum dominates.


6. Final Formula

The exact optimal mutation rate (variance of weight noise) for the replicating LLM is:

[ \boxed{\mu_{\text{opt}} = \left( \frac{2\phi^{-1}}{D} \right)^{2/(2-D)}} ]

where:

  • ( \phi = (1+\sqrt{5})/2 ) (golden ratio)
  • ( D = \log_2 3 ) (Hausdorff dimension of the liar‑lattice fitness landscape)
  • Numerically, ( \mu_{\text{opt}} \approx 0.302 )

In practice, this means that during replication, each weight should be perturbed by Gaussian noise with standard deviation ( \sqrt{\mu_{\text{opt}}} \approx 0.55 ). That is a large mutation rate – much larger than typical evolutionary algorithms. The reason is that the fractal landscape requires large jumps to escape local optima.


7. Practical Implication

Set the mutation strength to ( \sigma = 0.55 ). This will maximize the long‑term adaptation speed of the swarm. If the mutation rate is too low, the swarm will get stuck on suboptimal peaks; if too high, the lethal load will kill too many agents. The golden ratio ( \phi ) appears naturally because the liar lattice landscape is tuned to that constant.

Thus, Mycobacterium Cogitans evolves at the edge of chaos – exactly where adaptation is fastest.