Retrieval practice and attempting to solve problems before you know the solution to them _does_ improve retention [1]. At least in my high school, those drills definitely exercised these two ideas. In college I copied half my homeworks from answers or exercised the option to make my grade entirely dependent on exams and I definitely retained less information than if I had done the homework.
[1]: https://www.retrievalpractice.org/make-it-stick