The replacement policy contributes to enhancing the cache hit ratio, affecting the performance of the processor indirectly. Prior proposed static replacement policies are limited to certain classes of workload types, failing to achieve high hit rates in various benchmarks. In this work, we propose a self-adaptive replacement algorithm. The algorithm detects the drop points of the hit ratio online based on Bayesian inference and selects a new policy from a policy pool containing multiple policies according to its weight at the change points. Besides, the algorithm updates the weights based on the performance of the selected policy. Compared to the static replacement policy, our algorithm is able to apply to more access patterns and achieve a high hit ratio. We choose 15 benchmarks from DPC3 and concatenate them to generate a total of 13 composite benchmarks. We run our algorithm using a 2MB last-level cache (LLC) and show that our algorithm improves the hit rate by 2.6% over LRU and 10.6% over Random.