Contributing money to a 401(k) or other retirement account is one of the first steps in securing your financial future. The next step is leaving the money in the account to grow.

All too often, though, young investors cash out their 401(k) accounts well before reaching old age.

According to Boston-based mutual fund company Fidelity Investments, 46 percent of 20- to 24-year-olds drained their 401(k) accounts over the trailing 12 months through the end of June. Among 25- to 29-year-olds, 38 percent did the same.

Why the high cash-out rate?

For one, young investors are at an age when they are likely to change jobs often.

When you switch jobs, you can leave your 401(k) savings with a former employer if the balance exceeds $5,000. For amounts greater than $1,000 to $5,000, an employer can opt to roll the money into an individual retirement account. Balances of $1,000 or less can be automatically cashed out, unless you elect to roll the money into an IRA on your own.

Not surprisingly, young workers tend to have low balances. So when they switch jobs, their savings may be cashed out by default.

"A big driver is the account balance," said Jeanne Thompson, a vice president at Fidelity.

Rob Arnott, founder of Newport Beach, Calif.-based Research Affiliates, worries that another trend is at play, too. In a recent paper he co-wrote, Arnott argues job insecurity leads 20-somethings to use their 401(k) as emergency savings.

From January 1990 to mid-2014, the average unemployment rate for workers ages 20 to 24 was 10 percent, compared with 6 percent for 25- to 34-year-olds and 5 percent for 35- to 44-year-olds.

"A lot of young people can't afford to set aside a rainy-day fund and fund their 401(k)," Arnott said. "So when bad things happen, you withdraw from it," referring to the 401(k).

Making the problem worse, young investors are more likely to lose their job during a recession, which typically follows a downturn in the stock market. As a result, you lock in losses. Taxes and a penalty of 10 percent, charged when you take money out of your 401(k) before age 591/2, further deplete your savings.

"It's not nice," Arnott said.

To minimize the financial hit, Arnott says young workers should have a starter portfolio when they first begin saving in their 401(k).

The starter portfolio would have an allocation to foreign and U.S. stocks of only 40 to 50 percent. Another 20 percent or so would be invested in bonds. The remaining amount (30 to 40 percent) should be kept in investments that protect against inflation and don't move in sync with stocks and bonds, such as Treasury inflation-protected securities and real estate investment trusts.

In contrast, most target-date funds, which own a mix of stock and bond funds appropriate for your retirement date, would have 80 percent or more in stocks for a young investor.

Arnott says your portfolio should have big doses of stocks only once your job prospects improve or you've built up some savings, either in your 401(k) or in a bank savings account.

One way to follow Arnott's advice would be to opt for a target-date fund in your 401(k) that's aimed at older workers. These funds will likely have less exposure to stocks.

With this approach, though, you have to remember to increase your stock holdings as your savings and job security grow.

Worried you may forget? Then start off with small contributions to your 401(k) and shift the bulk of your savings toward an emergency cash fund.

"Once you have an emergency fund, you're fine to take on more risk in your portfolio," Arnott said.