A statistical framework for weak-to-strong generalization