Reuse & Permissions

It is not necessary to obtain permission to reuse this article or its components as it is available under the terms of the Creative Commons Attribution 4.0 International license. This license permits unrestricted use, distribution, and reproduction in any medium, provided attribution to the author(s) and the published article's title, journal citation, and DOI are maintained. Please note that some figures may have been included with permission from other third parties. It is your responsibility to obtain the proper permission from the rights holder directly for these figures.

Export citation

Export citation

Choose format for download:

Download Citation
  • Open Access

Spontaneous emergence of metacognition in neuronal computation

Hengyuan Ma1, Wenlian Lu1,2,3,4,5,6, and Jianfeng Feng1,2,3,4,7,*

  • 1Institute of Science and Technology for Brain-Inspired Intelligence, Fudan University, Shanghai 200433, China
  • 2Key Laboratory of Computational Neuroscience and Brain-Inspired Intelligence, Fudan University, Ministry of Education, Shanghai 200433, China
  • 3School of Mathematical Sciences, Fudan University, Shanghai 200433, China
  • 4Shanghai Center for Mathematical Sciences, Shanghai 200433, China
  • 5Shanghai Key Laboratory for Contemporary Applied Mathematics, Shanghai 200433, China
  • 6Key Laboratory of Mathematics for Nonlinear Science, Shanghai 200433, China
  • 7Department of Computer Science, University of Warwick, Coventry CV4 7AL, United Kingdom

  • *Contact author: jffeng@fudan.edu.cn

Phys. Rev. Research 7, 033188 – Published 22 August, 2025

DOI: https://doi.org/10.1103/f1hv-bf1f

Abstract

Metacognition, a hallmark of human intelligence, enables individuals to assess prediction uncertainty, providing an advantage over artificial intelligence in anticipating risks and performing tasks that demand trustworthiness and reliability. However, the neural mechanisms behind metacognition remain poorly understood. Here, we demonstrate that metacognition can naturally emerge in recurrent neural networks trained on cognitive tasks without guidance from any probabilistic inference rules or additional network architectures. Through naturally embedded nonlinear coupling with the mean of the network output, the covariance of the network output engages in metacognition by assessing the uncertainty associated with the mean, which represents the task responses. We showcase this capability through diverse cognitive tasks and learning algorithms, including reservoir computing and backpropagation. We further propose testable predictions about how key features of neuronal computation in the brain—noise, neuronal correlations, and heterogeneity—contribute to metacognition.

View figure in article

Physics Subject Headings (PhySH)

Article Text

Supplemental Material

References (57)

  1. J. Achiam, S. Adler, S. Agarwal, L. Ahmad, I. Akkaya, F. L. Aleman, D. Almeida, J. Altenschmidt, S. Altman, S. Anadkat et al., GPT-4 technical report, arXiv:2303.08774.
  2. S. Bubeck, V. Chandrasekaran, R. Eldan, J. Gehrke, E. Horvitz, E. Kamar, P. Lee, Y. T. Lee, Y. Li, S. Lundberg et al., Sparks of artificial general intelligence: Early experiments with GPT-4, arXiv:2303.12712.
  3. S. M. Fleming, Metacognition and confidence: A review and synthesis, Annu. Rev. Psychol. 75, 241 (2024).
  4. B. Bahrami, K. Olsen, P. E. Latham, A. Roepstorff, G. Rees, and C. D. Frith, Optimally interacting minds, Science 329, 1081 (2010).
  5. J. Gawlikowski, C. R. N. Tassi, M. Ali, J. Lee, M. Humt, J. Feng, A. Kruspe, R. Triebel, P. Jung, R. Roscher et al., A survey of uncertainty in deep neural networks, Artif. Intell. Rev. 56, 1513 (2023).
  6. D. Seuß, Bridging the gap between explainable AI and uncertainty quantification to enhance trustability, arXiv:2105.11828.
  7. S. Fort, H. Hu, and B. Lakshminarayanan, Deep ensembles: A loss landscape perspective, arXiv:1912.02757.
  8. A. Graves, Practical variational inference for neural networks, Adv. Neural Inf. Process. Syst. 24, 2348 (2011).
  9. M. A. Peters, T. Thesen, Y. D. Ko, B. Maniscalco, C. Carlson, M. Davidson, W. Doyle, R. Kuzniecky, O. Devinsky, E. Halgren et al., Perceptual confidence neglects decision-incongruent evidence in the brain, Nat. Hum. Behav. 1, 0139 (2017).
  10. S. M. Fleming, R. S. Weil, Z. Nagy, R. J. Dolan, and G. Rees, Relating introspective accuracy to individual differences in brain structure, Science 329, 1541 (2010).
  11. S. M. Fleming, J. Huijgen, and R. J. Dolan, Prefrontal contributions to metacognition in perceptual decision making, J. Neurosci. 32, 6117 (2012).
  12. A. Kepecs, N. Uchida, H. A. Zariwala, and Z. F. Mainen, Neural correlates, computation and behavioural impact of decision confidence, Nature (London) 455, 227 (2008).
  13. G. Orbán, P. Berkes, J. Fiser, and M. Lengyel, Neural variability and sampling-based probabilistic representations in the visual cortex, Neuron 92, 530 (2016).
  14. A. Pouget, J. Drugowitsch, and A. Kepecs, Confidence and certainty: Distinct probabilistic quantities for different goals, Nat. Neurosci. 19, 366 (2016).
  15. L. S. Geurts, J. R. Cooke, R. S. van Bergen, and J. F. Jehee, Subjective confidence reflects representation of Bayesian probability in cortex, Nat. Hum. Behav. 6, 294 (2022).
  16. A. Insabato, M. Pannunzi, E. T. Rolls, and G. Deco, Confidence-related decision making, J. Neurophysiol. 104, 539 (2010).
  17. H.-H. Li, T. C. Sprague, A. H. Yoo, W. J. Ma, and C. E. Curtis, Joint representation of working memory and uncertainty in human cortex, Neuron 109, 3699 (2021).
  18. J. Feng, Y. Deng, and E. Rossoni, Dynamics of moment neuronal networks, Phys. Rev. E 73, 041906 (2006).
  19. W. Lu, E. Rossoni, and J. Feng, On a Gaussian neuronal field model, NeuroImage 52, 913 (2010).
  20. See Supplemental Material at http://link.aps.org/supplemental/10.1103/f1hv-bf1f for further simulation details and additional results.
  21. P. M. Bays, S. Schneegans, W. J. Ma, and T. F. Brady, Representation and computation in visual working memory, Nat. Hum. Behav. 8, 1016 (2024).
  22. K. Oberauer, S. Lewandowsky, E. Awh, G. D. Brown, A. Conway, N. Cowan, C. Donkin, S. Farrell, G. J. Hitch, M. J. Hurlstone et al., Benchmarks for models of short-term and working memory, Psychol. Bull. 144, 885 (2018).
  23. R. van den Berg, H. Shin, W.-C. Chou, R. George, and W. J. Ma, Variability in encoding precision accounts for visual short-term memory limitations, Proc. Natl. Acad. Sci. USA 109, 8780 (2012).
  24. S. Keshvari, R. Van den Berg, and W. J. Ma, Probabilistic computation in human perception under variability in encoding precision, PLoS ONE 7, e40216 (2012).
  25. R. L. Rademaker, C. H. Tredway, and F. Tong, Introspective judgments predict the precision and likelihood of successful maintenance of visual working memory, J. Vision 12, 21 (2012).
  26. M. Honig, W. J. Ma, and D. Fougnie, Humans incorporate trial-to-trial working memory uncertainty into rewarded decisions, Proc. Natl. Acad. Sci. USA 117, 8391 (2020).
  27. R. Darshan and A. Rivkind, Learning to represent continuous variables in heterogeneous neural networks, Cell Rep. 39, 110612 (2022).
  28. Y. Burak and I. R. Fiete, Fundamental limits on persistent activity in networks of noisy neurons, Proc. Natl. Acad. Sci. USA 109, 17645 (2012).
  29. K. Wimmer, D. Q. Nykamp, C. Constantinidis, and A. Compte, Bump attractor dynamics in prefrontal cortex explains behavioral precision in spatial working memory, Nat. Neurosci. 17, 431 (2014).
  30. H. Ma, Y. Qi, P. Gong, J. Zhang, W.-L. Lu, and J. Feng, Self-organization of nonlinearly coupled neural fluctuations into synergistic population codes, Neural Comput. 35, 1820 (2023).
  31. C. Langdon, M. Genkin, and T. A. Engel, A unifying perspective on neural manifolds and circuits for cognition, Nat. Rev. Neurosci. 24, 363 (2023).
  32. M. Beyeler, E. L. Rounds, K. D. Carlson, N. Dutt, and J. L. Krichmar, Neural correlates of sparse coding and dimensionality reduction, PLoS Comput. Biol. 15, e1006908 (2019).
  33. Á. Ságodi, G. Martín-Sánchez, P. Sokol, and M. Park, Back to the continuous attractor, Adv. Neural Inf. Process. Syst. 37, 66856 (2025).
  34. D. Fougnie, J. W. Suchow, and G. A. Alvarez, Variability in the quality of visual working memory, Nat. Commun. 3, 1229 (2012).
  35. P. Berkes, G. Orbán, M. Lengyel, and J. Fiser, Spontaneous cortical activity reveals hallmarks of an optimal internal model of the environment, Science 331, 83 (2011).
  36. G. R. Yang, M. R. Joglekar, H. F. Song, W. T. Newsome, and X.-J. Wang, Task representations in neural networks trained to perform many cognitive tasks, Nat. Neurosci. 22, 297 (2019).
  37. T. Akam and D. M. Kullmann, Oscillatory multiplexing of population codes for selective communication in the mammalian brain, Nat. Rev. Neurosci. 15, 111 (2014).
  38. V. C. Caruso, J. T. Mohl, C. Glynn, J. Lee, S. M. Willett, A. Zaman, A. F. Ebihara, R. Estrada, W. A. Freiwald, S. T. Tokdar et al., Single neurons may encode simultaneous stimuli by switching between activity patterns, Nat. Commun. 9, 2715 (2018).
  39. W. J. Ma, J. M. Beck, P. E. Latham, and A. Pouget, Bayesian inference with probabilistic population codes, Nat. Neurosci. 9, 1432 (2006).
  40. D. Fougnie, A. Kanabar, T. Brady, and G. Alvarez, Using a betting game to directly reveal the rich nature of visual working memories, J. Vision 15, 1290 (2015).
  41. A. H. Yoo, L. Acerbi, and W. J. Ma, Uncertainty is maintained and used in working memory, J. Vision 21, 13 (2021).
  42. A. Kohn, R. Coen-Cagli, I. Kanitscheider, and A. Pouget, Correlations and neuronal population information, Annu. Rev. Neurosci. 39, 237 (2016).
  43. S. Panzeri, M. Moroni, H. Safaai, and C. D. Harvey, The structures and functions of correlations in neural population codes, Nat. Rev. Neurosci. 23, 551 (2022).
  44. C. Savin and S. Denève, Spatio-temporal representations of uncertainty in spiking neural networks, Adv. Neural Inf. Process. Syst. 27, 2024 (2014).
  45. P. Masset, J. Zavatone-Veth, J. P. Connor, V. Murthy, and C. Pehlevan, Natural gradient enables fast sampling in spiking neural networks, Adv. Neural Inf. Process. Syst. 35, 22018 (2022).
  46. Y. Qi and P. Gong, Fractional neural sampling as a theory of spatiotemporal probabilistic computations in neural circuits, Nat. Commun. 13, 4572 (2022).
  47. W.-H. Zhang, S. Wu, K. Josić, and B. Doiron, Sampling-based Bayesian inference in recurrent circuits of stochastic spiking neurons, Nat. Commun. 14, 7074 (2023).
  48. C. E. Rullán Buxó and J. W. Pillow, Poisson balanced spiking networks, PLoS Comput. Biol. 16, e1008261 (2020).
  49. R. Echeveste, L. Aitchison, G. Hennequin, and M. Lengyel, Cortical-like dynamics in recurrent circuits optimized for sampling-based probabilistic inference, Nat. Neurosci. 23, 1138 (2020).
  50. M. Abdar, F. Pourpanah, S. Hussain, D. Rezazadegan, L. Liu, M. Ghavamzadeh, P. Fieguth, X. Cao, A. Khosravi, U. R. Acharya et al., A review of uncertainty quantification in deep learning: Techniques, applications and challenges, Inf. Fusion 76, 243 (2021).
  51. Y. Ovadia, E. Fertig, J. Ren, Z. Nado, D. Sculley, S. Nowozin, J. Dillon, B. Lakshminarayanan, and J. Snoek, Can you trust your model's uncertainty? Evaluating predictive uncertainty under dataset shift, Adv. Neural Inf. Process. Syst. 32, 13991 (2019).
  52. H.-H. Li and W. J. Ma, Confidence reports in decision-making with multiple alternatives violate the Bayesian confidence hypothesis, Nat. Commun. 11, 2004 (2020).
  53. J. Navajas, C. Hindocha, H. Foda, M. Keramati, P. E. Latham, and B. Bahrami, The idiosyncratic nature of confidence, Nat. Hum. Behav. 1, 810 (2017).
  54. K. Friston, The free-energy principle: A unified brain theory? Nat. Rev. Neurosci. 11, 127 (2010).
  55. M. Colombo and C. Wright, First principles in the life sciences: The free-energy principle, organicism, and mechanism, Synthese 198, 3463 (2021).
  56. A. Kendall and Y. Gal, What uncertainties do we need in Bayesian deep learning for computer vision? Adv. Neural Inf. Process. Syst. 30, 5574 (2017).
  57. H. Ma, W. Lu, and J. Feng, mnn-metacognition-codes, 2025, https://github.com/AwakerMhy/mnn_wm_uq.

Outline

Information

Sign In to Your Journals Account

Filter

Filter

Article Lookup

Enter a citation