Self-Optimizing Systems in AI