In this talk, based on joint works with Nicholas Cook, Huy Tuan Pham and Sohom Bhattacharya, I will discuss recent developments in the
emerging theory of nonlinear large deviations, focusing on sharp upper tails for counts of several fixed subgraphs in a large sparse random
graph (such as Erdős–Rényi or uniformly d-regular). These results allow in turn to determine the typical structure of samples from
an associated class of Gibbs measures, known as Exponential Random Graph Models, which are widely used in the analysis of social networks.