Going to have to rewrite model.hpp to separate out different parts of sampling and expose them, instead of having a single sample_beam function exposed