Can Llms Learn From Previous Mistakes