Phase transitions are present in a wide array of systems ranging from traffic to machine learning algorithms. In this talk, we will relate the concept of phase transitions to the convexity properties of the associated thermodynamic energy. Motivated by noisy stochastic gradient descent in supervised learning, we will consider the problem of understanding the thermodynamic limit of exchangeable weakly interacting diffusions (AKA propagation of chaos) from an energetic perspective. The strategy will be to exploit the 2-Wasserstein gradient flow structure associated with the thermodynamic energy in the infinite particle setting. Using this perspective, we will show how the convexity properties of the thermodynamic energy affects the homogenization limit or the stability of the log-Sobolev inequality.