Keeping your weight down is not easy — especially as we get older, but there is a way to stop those pounds from piling up as the years go by. The key, according to a new Harvard study on long-term weight gain, is to pay attention to the kinds, more than the amount, of carbohydrates we eat.

“The quality of the carbohydrates in a person's diet is much more important than the amount,” the study's senior author, Walter Willett, a professor of epidemiology and nutrition at the Harvard T.H. Chan School of Public Health, said in a press release. “You want to increase whole grains and limit starchy vegetables.”

The sugars and starches in high fiber foods take longer to be absorbed by the body, which means they have a much smaller immediate impact on blood sugar and thus lead to less fat being produced and stored.

Folks who ate refined, low-fiber carbs gained more weight — often much more — over time. Here are some examples of the carbs to cut back on to keep middle-age spread under control:

  • Foods made from refined grains, especially white flour products
  • Starchy vegetables such as white potatoes, corn, beets and turnips
  • White rice
  • Sugar-sweetened beverages

All the foods above have a high glycemic index (GI), a measure of the increase in our blood sugar after we eat certain starchy foods. Let's say you eat a white potato — a food with a high glycemic index. This means the starch in the potato will be absorbed quickly, and it will cause a spike in your blood sugar which leads to more fat being produced and stored in your body. To compound the problem, starchy foods are also low in fiber.

To look at the relationship between carbohydrate type on weight gain, Willett and his team analyzed more than two decades of data from almost 137,000 people enrolled in one of three long-term studies: the Nurses' Health Study I & II (focusing on women's health), and the Health Professionals Follow-up Study (developed to track men's health).

People in the study were in their 40's to 60's and were followed for at least two decades. At the start, all were free of chronic health conditions like diabetes, cancer and heart disease. Questionnaires about their medical history, lifestyle and other health-related factors were filled out every two to four years from the beginning of the study. In addition, every four years, participants were asked to complete a form that assessed their diet.

The average weight gain every four years among participants overall was a little over three pounds, but here's where diet made a big difference. Eating refined carbs and starchy vegetables fueled weight gain, while more fibrous carbohydrates protected against it. Replacing refined grains, potatoes and other starchy vegetables, as well as sugar-sweetened beverages, with equal servings of whole grains, fruit or non-starchy vegetables was associated with less weight gain.

Eating about 100 grams or 3.5 ounces a day of starchy vegetables — think bread, corn, French fries or baked potatoes — meant that people gained about 5.7 pounds over four years. In contrast, those who reported they tended to consume an equal amount of non-starchy vegetables daily gained little or no weight over the same four-year period.

People who ate refined, low-fiber, carbs gained more weight — often much more — over time.

Sugary drinks also added pounds. Drinking two to three cans of sugar-sweetened drinks a day was associated with nearly two extra pounds of weight gain over the same four-year period, or 12 pounds over the 24-year average study period.

So, what should we eat instead? Willet advises people to put more of these carbohydrates in their diet:

  • Whole fruits. Fruit juices should be avoided because the good-for-you fiber has been removed. This means smoothies are also less desirable than whole fruit.
  • Non-starchy veggies, including spinach, kale, broccoli and carrots
  • Whole grains. You can tell if a food is made from whole grains by checking the label. Foods made from whole grains include whole wheat bread, whole grain pasta and oatmeal, as well as popcorn, quinoa, barley and farro.
Other healthy carbohydrate choices include bananas, millet, chickpeas, barley, black beans and lentils. Willett explained that the sugars and starches in these foods take longer to be absorbed by the body, which means they have a much smaller immediate impact on blood sugar and thus lead to less fat being produced and stored.

The study is published in BMJ, the British Medical Journal.