Training a retriever to rank examples by their usefulness for solving a problem, using ground-truth solution outcomes.