Spectral Approximate Inference