The "programmable pasta" has gelatine mixed in with the starch. Gelatine naturally expands upon absorbing water, giving the researchers a way to manipulate the foodstuff.
As with flat-pack furniture, the main benefit of the invention would be to save money on food shipping costs.
By having macaroni that stores flat instead of in its individual curls, for instance, distributors could fit a greater amount of the food into the same space, while still allowing the end user to eat a textured, three-dimensional meal.
"We did some simple calculations, such as for macaroni pasta, and even if you pack it perfectly, you still will end up with 67 per cent of the volume as air," said Wen Wang, one of the team's research scientists.
"We thought maybe in the future our shape-changing food could be packed flat and save space."
Wang led the project, titled Transformative Appetite, together with Lining Yao. They were backed up by research from Chin-Yi Cheng, Daniel Levine, Teng Zhang and Hiroshi Ishii, who heads the Tangible Media Group.
The researchers are able to control the shapes the pasta takes in a few ways. They can create a simple macaronic-like arch by using two layers of gelatine – a more dense top layer over a thinner bottom layer.
The top layer absorbs more water, growing larger and slowly curling over the bottom.
For more irregular shapes, the team 3D prints thin strips of edible cellulose in various patterns over the gelatine layer. These strips act as a barrier to the absorption of water.
"This way you can have programmability," Yao said. "You ultimately start to control the degree of bending and the total geometry of the structure."
The researchers said the pasta they produced for Transformative Appetite "had great texture and tasted pretty good". They even worked with a chef at a Boston restaurant to test high-end versions of the pasta flavoured with plankton and squid ink.
Based on the group's experiments, Cheng also authored a modelling software for users to design their own shape-shifting pasta.
The MIT Media Lab has produced a number of shape-shifting projects of late. Earlier this year one of its teams presented Aeromorphs, inflatables that automatically fold from flat into complex forms.
Another team in 2015 demonstrated a "bio-skin" fabric that peels back in reaction to sweat and humidity.