Quantum field theories (QFTs) describe a lot of physical phenomena in our world. And giving a mathematical definition of QFTs is a long-standing problem. There are several mathematical formulations: Wightman formulation, Osterwalder–Schrader formulation and Atiya-Segal formulation. And each of them cover different aspects of QFTs. Recently, Costello and their collabolators formulate QFTs by using factorization algbras. This formulaion cover a lot of classes of QFTs: TQFTs, 2d CFTs and perturbative QFTs. And they reproduce various results such as asymptotic freedom in non-Abelian gauge theories. Factorization algbras can be given by Batalin–Vilkovisky quantization (BV quantization) of the Lagrangian. However the original BV quantizations are perturbative and they do not have non-perturbative effects like instanton. In this talk, we propose BV quantizations which include instanton effects in compact scalar theory. In modern language, it is a BV formulation of ℤ gauging.