In sodium and magnesium, the space closer to the nucleus is already very negatively charged, repelling the outershell electrons from getting much closer. But in berylium there aren't any electrons to interfere with orbital size decreasing. So, large difference is observed in Li and Be compared to Na and Mg.