Prismatic Synthesis: Gradient-based Data Diversification Boosts Generalization in LLM Reasoning