We investigate dynamical analogues of the $L^2$-Betti numbers for modules over integral group ring of a discrete sofic group. In particular, we show that the $L^2$-Betti numbers exactly measure the failure of addition formula for dynamical invariants.