Variational Beam Search for Online Learning with Distribution Shifts