How AI can learn from the law: putting humans in the loop only on appeal