@YidaZhang0628 sorry but I cannot help you. I don’t have experience with VI. But I can point you towards the following literature that can help you:
Blei, D. M., Kucukelbir, A., & McAuliffe, J. D. (2016). Variational Inference: A Review for Statisticians. Journal of the American Statistical Association , 112 (518), 859–877. https://doi.org/10.1080/01621459.2017.1285773
Kucukelbir, A., Ranganath, R., Gelman, A., & Blei, D. M. (2015). Automatic Variational Inference in Stan. ArXiv:1506.03431 [Stat] . http://arxiv.org/abs/1506.03431
Yao, Y., Vehtari, A., Simpson, D., & Gelman, A. (2018). Yes, but Did It Work?: Evaluating Variational Inference. 35th International Conference on Machine Learning, ICML 2018 . http://arxiv.org/abs/1802.02538
Also don’t forget to check the section 18 of Variational Inference in the Stan Reference Manual.