  We propose a novel technique for speeding up the self-learning Monte Carlo
method applied to the single-site impurity model. For the case where the
effective Hamiltonian is expressed by polynomial functions of differences of
imaginary-time coordinate between vertices, we can remove the dependence of CPU
time on the number of vertices, $n$, by saving and updating some coefficients
for each insertion and deletion process. As a result, the total cost for a
single-step update is drastically reduced from $O(nm)$ to $O(m^2)$ with $m$
being the order of polynomials in the effective Hamiltonian. Even for the
existing algorithms, in which the absolute value is used instead of the
difference as the variable of polynomial functions, we can limit the CPU time
for a single step of Monte Carlo update to $O(m^2 + m \log n)$ with the help of
balanced binary search trees. We demonstrate that our proposed algorithm with
only logarithmic $n$-dependence achieves an exponential speedup from the
existing methods, which suffer from severe performance issues at low
temperatures.
