To prevent gnocchi from being dense, avoid overmixing the dough and use the right amount of flour. Be gentle when rolling and shaping the gnocchi, and boil them until they float. Adding a little ricotta cheese can also help make them lighter.