Enhancing Generalization in Chain of Thought Reasoning for Smaller Models