Sarah Schaefer will make the move in the New Year after four years as a special adviser to Miliband.
The Foreign Secretary is said to be already actively recruiting to replace Schaefer, who is seen as his closest aide and most trusted media handler.
After previously declining to comment on rumours of Schaefer's appointment, Mars finally confirmed Schaefer's title today.
A spokesman for the firm said: ‘Mars Incorporated is pleased to confirm that Sarah Schaefer will be joining the company in the role of sustainability and science communications director.'
Miliband has been seen as a leading contender to succeed Gordon Brown as Labour leader.
Schaefer's decision to leave ahead of a possible leadership bid will raise eyebrows, but Labour sources insisted her departure did not reflect any change in the Foreign Secretary's leadership ambitions.
A Labour insider said: ‘Miliband will recruit soon... This is nothing to do with him and the leadership.'