Staying competitive in the AI arms race is pricey.