Babies are exceptional learners, possibly because they use surprise to guide attention and learning. My research shows that infants learn more after surprising physical or social events. Adults show a Goldilocks effect—optimal learning from moderate surprise. Understanding surprise-based learning in babies may help improve future artificial intelligence systems.