During inference, we marginalize out state. For log likelihood computation, you might want to obtain the state first (conditioned on full_history) via infer_discrete (see Recover discrete latent states after enumerate, scan - #2 by fehiepsi ). After adding state to the samples, I think you can use log_likelihood like what you did.