The tech giants are targeting massive returns from their AI investments over the long term, while swinging the axe in other areas.