Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Mar 28;20(3):e1012004.
doi: 10.1371/journal.pcbi.1012004. eCollection 2024 Mar.

Self-replicating artificial neural networks give rise to universal evolutionary dynamics

Affiliations

Self-replicating artificial neural networks give rise to universal evolutionary dynamics

Boaz Shvartzman et al. PLoS Comput Biol. .

Abstract

In evolutionary models, mutations are exogenously introduced by the modeler, rather than endogenously introduced by the replicator itself. We present a new deep-learning based computational model, the self-replicating artificial neural network (SeRANN). We train it to (i) copy its own genotype, like a biological organism, which introduces endogenous spontaneous mutations; and (ii) simultaneously perform a classification task that determines its fertility. Evolving 1,000 SeRANNs for 6,000 generations, we observed various evolutionary phenomena such as adaptation, clonal interference, epistasis, and evolution of both the mutation rate and the distribution of fitness effects of new mutations. Our results demonstrate that universal evolutionary phenomena can naturally emerge in a self-replicator model when both selection and mutation are implicit and endogenous. We therefore suggest that SeRANN can be applied to explore and test various evolutionary dynamics and hypotheses.

PubMed Disclaimer

Conflict of interest statement

The authors have declared that no competing interests exist.

Figures

Fig 1
Fig 1. SeRANN evolution framework.
(A) A juvenile SeRANN individual “learns” to both classify images from the training set and to copy arbitrary genotypes using standard deep-learning techniques. (B) An adult SeRANN then classifies images from the test set and copies its own genotype, producing a classification accuracy, which is its fertility, and replicated genotypes, which are its offspring genotypes. (C) The individual fertility is compared to the population mean fertility to determine the individual’s expected contribution to the offspring generation–which are then sampled from the offspring genotypes of all individuals. (D) Each genotype is decoded to a source code using the RiboDecoder (see Methods) and executed by the Python interpreter. Only valid source codes, which don’t cause execution errors (e.g., due to syntax errors), continue to the next generation. (E) The source code of the ancestor of the population, see Fig B in S1 Text for the genotype and supporting code.
Fig 2
Fig 2. Adaptative evolution.
(A-C) In the first 270 generations, the population mean fitness increased and the mutation rate decreased, whereas the mutational robustness fluctuated. (D-F) Starting around generation 1,350 (dashed line), major adaptations occurred in all three metrics. The number of accumulated mutations increased, but the number of network parameters and the loss_weight value fluctuated rather than trended (Fig H in S1 Text). (G) Population mean fitness (x-axis) vs. mutation rate (y-axis) over time (color, brighter is later). Panels D-G show a rolling average over 10 generations. Fitness: survival rate × fertility (Eq 3); Mutation rate: number of mutations per genotype replication; Robustness: one minus average absolute fitness difference between parent and mutant offspring (Eq 5).
Fig 3
Fig 3. Allele frequency dynamics.
(A) An initially high mutation rate led to early appearance and fixation of 13 mutant alleles in the first 270 generations. (B) Starting from generation 1,350 (dashed line), 11 mutant alleles fixed: four very rapidly, and then roughly one every 585 generations. (C) The time to fixation (y-axis) of 24 mutant alleles that successfully fixed (blue lines in A and B) declines with their fitness relative to the population mean at the time they appeared (x-axis; gray line shows linear regression; Pearson correlation ρ = −0.6, P < 0.002). Allele 38 (pink) is the only one to reach fixation with relative fitness <1, at 0.988. Gray lines denote mutant alleles that never reached 90% frequency. Frequency curves smoothed for visualization using a rolling average over 10 generations. See Fig J and Table E in S1 Text for details on fixed mutant alleles.
Fig 4
Fig 4. Genotype frequency dynamics: site 62.
Due to clonal interference, the total frequency of all genotypes carrying a site-62 mutant allele (black) is much higher than the frequencies of any site-62 genotypes; three genotypes that reached 60% are in green, blue, and orange. The inset shows the fertility and mutation rate of the different genotypes decreasing over time, although the decrease in fertility (0.14%) is minor compared the decrease in mutation rate (19.43%; Table F in S1 Text). These alleles and genotypes appeared more than once during the experiment, in multiple and different parental genotypes (e.g., m62 occurred 10,702 times during the experiment). Frequency lines smoothed for visualization using a rolling average over 10 generations.
Fig 5
Fig 5. Phenotypic evolution over three generations.
The phenotype of three SeRANN individuals from the same lineage over three consecutive generations: “grandparent”, “parent”, “offspring”. The grandparent had 14 mutant alleles (sites 6, 11, 31, 34, 35, 37, 38, 65, 66, 71, 77, 84, 85, 91) compared to the ancestor; these are the 14 mutant alleles that fixed up to generation 1420 (Table E in S1 Text). The parent was born in generation 805 with an additional mutant allele in site 0. This mutation caused a replication layer (g_layer in blue) to switch to a classification layer (X_layer in red). This required the layer names to change, as well as the layer type to change from Conv1D to Conv2D. This modification in the source code had a strong effect on the fertility (up from 0.93 to 0.96), the mutation rate (from <0.02 to 5.5) and the offspring survival rate (down from 0.9988 to 0.063). Despite the low survival rate, the parent managed to produce an offspring in the next generation (805), with 6 additional mutations. Three were reversions back to the ancestor allele at sites 0, 37, and 65. Three were forward mutations to mutant alleles at sites 22, 47, and 83. These three alleles fixed in the population by generation 1439. The effect of the 6 new mutations was to revert the earlier change that occurred in the parent as well as a 0.002 increase in the loss_weight (higher values favor classification). The offspring fertility, at 0.94, decreased compared to the parent, probably due to the layer switch, but increased compared to the grandparent, probably due to the increase in loss_weight (from 0.1026 to 0.1046). The offspring mutation rate, on the other hand, decreased back to a low level (<0.02) and therefore the offspring survival rate increased to 0.9958, much higher than the parent, though not as high as the grandparent. The offspring genotype was the dominant genotype of the three new mutant alleles (sites 22, 47, and 83, see Table E in S1 Text). See Fig D in S1 Text for source codes.
Fig 6
Fig 6. Distribution of fitness effects of new mutations.
(A) The distribution of fitness effects (DFE) evolved during the in-silico evolutionary experiment: the frequency of lethal mutations decreased (red line) and the frequency of neutral and slightly deleterious mutations increased (blue line). (B) The DFE in the SeRANN population (blue) is bi-modal with peaks for lethal and near-neutral mutations, similar to a DFE estimated in VSV (red; vesicular stomatitis virus; data from [45]). VSV has more slightly deleterious mutations, whereas SeRANN has more near-lethal mutations, perhaps because the DFE of SeRANN is still evolving. Fitness effects were estimated as the absolute fitness ratio between mutant and parent such that values of 0, <1, 1, and >1 represent lethal, deleterious, neutral, and beneficial mutations. 5,000 parent-mutant pairs were sampled for every window of 1,000 generations for panel A; the average over all generations is shown in panel B.

References

    1. Fisher RA. The Genetical Theory of Natural Selection. New York, NY: Dover Publications; 1958. Available: http://archive.org/details/geneticaltheoryo031631mbp
    1. Ofria C, Wilke CO. Avida: A Software Platform for Research in Computational Evolutionary Biology. Artificial Life. 2004;10: 191–229. doi: 10.1162/106454604773563612 - DOI - PubMed
    1. Knibbe C, Mazet O, Chaudier F, Fayard J-M, Beslon G. Evolutionary coupling between the deleteriousness of gene mutations and the amount of non-coding sequences. Journal of Theoretical Biology. 2007;244: 621–630. doi: 10.1016/j.jtbi.2006.09.005 - DOI - PubMed
    1. Stanley KO, Clune J, Lehman J, Miikkulainen R. Designing neural networks through neuroevolution. Nature Machine Intelligence. 2019;1: 24–35. doi: 10.1038/s42256-018-0006-z - DOI
    1. Miikkulainen R. Neuroevolution. Encyclopedia of Machine Learning. Boston, MA: Springer US; 2011. pp. 716–720. doi: 10.1007/978-0-387-30164-8_589 - DOI