See Theory of spin glasses – Theory of spin glasses. II
https://en.wikipedia.org/wiki/Replica_trick
https://www.wikiwand.com/es/Truco_de_las_r%C3%A9plicas
Imagining many identical but independent copies, or replicas, of the system; computing a thermodynamic average over them all; and then taking the number of replicas to zero. It turns out that this bizarre recipe—actually quite inspired, though mysterious—can in principle handle the difficulties posed by Quenched disorder
–> See chapter 3 of "An introduction to the theory of spin glasses and neural networks – Dotsenko"
See example in Learning with Boolean Threshold Functions, a Statistical Physics Perspective - Raemi Monasson (see Statistical physics and inference)