AI is primarily trained, not programmed, in modern machine learning and deep learning approaches. While traditional programming involves writing explicit instructions and rules for a computer to follow, AI, particularly machine learning and deep learning, relies on training models to learn patterns and make predictions from data.