The tech giant is downsizing while ramping up AI investments as companies claim smaller teams can accomplish more with AI tools.