Bayesian regularization of the length of memory in reversible sequences