Reflexion can serve as good reference here:
https://arxiv.org/abs/2303.11366
Essentially, AI’s output is fed into a checker, whose output is fed back into the AI for “reflexion”. Then the AI often corrects (leading to noticeable improvement in GPT-4 perf).