One way to do this is to set up a trust, and then have the 401(k) beneficiary be the trust. You would have to make sure that the 401(k) administrator allows the beneficiary to be a trust.
Setting up the trust costs money, but one advantage of the trust is that you could have more complex rules in place beyond those offered by a 401(k). You would have to keep the rules of the trust updated to cover any changes in the family tree.
Most (all ?) 401(k) programs allow the employee to modify the list of beneficiaries at almost any time though an online interface. I don't think that you can modify the percentages in the trust documents quite as easily.
A big issue in family law is the case where the person doesn't update the beneficiary list even after divorces and remarriages. Setting up a trust and then neglecting to update it would face the same issues.
Remember that 401(k) and other retirement funds require additional paperwork to skip the spouse of the employee.