Reinforcement Learning (RL), Bayesian Optimization (BO), and Evolutionary Algorithms (EAs) are leading AI techniques for exploring the vast search spaces in LLM and compiler optimization. RL, exemplified by Compiler-R1, guides sequence selection for performance gains, while BO efficiently tunes hyperparameters by modeling objective functions. EAs, like Google's AlphaEvolve, systematically discover optimized code through bio-inspired search.