Efficient Detection of LLM-generated Texts with a Bayesian Surrogate Model