Optimizing heavy models with early exit branches