Big tech is looking for ways to trim expenses while pouring billions into data centers and other AI infrastructure.