semantic optimization for AI