Serialize potentials
Move beam search out