A lemma stated by Li (Ann Statist 42:171-189, 2014) has been used in, for example, Nilanjana et al. (J Math Phys 57:062207, 2016), Kaur et al. (Phys Rev A 96:062318, 2017), Rouzé, Datta (IEEE Trans Inform Theory 64:593–612, 2018), Tomamichel, Tan (Comm Math Phys 338:103-137, 2015) and Wilde et al. (IEEE Trans Inform Theory 63:1792-1817, 2017) for various tasks in quantum hypothesis testing, data compression with quantum side information or quantum key distribution. This lemma was originally proven in finite dimension, with a direct extension to type I von Neumann algebras. Here, we show that the use of modular theory allows to give more transparent meaning to the objects constructed by the lemma, and to prove it for general von Neumann algebras. This yields a new proof of quantum Stein’s lemma with slightly weaker assumption, as well as immediate generalizations of its second-order asymptotics, for example the main results in Nilanjana et al. (J Math Phys 57:062207, 2016) and Li (Ann Statist 42:171-189, 2014).