The Many Faces of Generalization: from Traditional ML to LLM Safety