Initially, the Variable Speed Limit (VSL) will operate west of the Brynglas tunnels as far as junction 28.
Sensors in the road detect traffic build-ups and automatically adjust the speed limit to keep vehicles flowing.
Speed limit changes are displayed to drivers via electronic signs on the verge of the motorway.
From June the system will operate over eight miles between J24 (Coldra) and J28 (Tredegar Park).
Tim Shallcross of the Institute of Advanced Motorists said the system was already working well in other parts of the UK, including the M25 near London and the M42 in the Midlands.
"The idea is it stops people trying to switch lanes to overtake and it smooths the traffic flow, everybody carries on travelling at a lower speed," he said.
"These are mandatory speed limits so if you exceed them then you will be prosecuted."
The assembly government said the eight mile stretch of motorway was the busiest road in Wales and suffered from an above average accident rate.
Deputy First Minister Ieuan Wyn Jones said: "Ultimately, it will improve connectivity for Wales and this is essential to the economy.
"It will not only make for better travelling now, but will also encourage more sustainable travelling in the future."
Average speed cameras have been in operation along the stretch of the M4 since September 2009.
The cameras trigger penalty notices when the 50mph limit is exceeded.
More than 6,500 drivers have been issued with tickets according to figures in December 2010.

"No-one should expect that relations will suddenly deteriorate completely because of this decision," Binali Yildirim said.
Turkey recalled its envoy to Germany in protest against the resolution passed by German MPs on Thursday.
It promised to take "necessary steps".
Armenians say up to 1.5 million of their people died in the atrocities committed by Ottoman Turks in 1915, during World War One.
Turkey says the toll was much lower and rejects the term "genocide".
More than 20 countries, including France and Russia, recognise the 1915 massacre as "genocide", as do most non-Turkish scholars of the period.
Q&A: Armenian genocide dispute
Armenian 'genocide' vote ignites press
The Bundestag [German lower house] vote heightens German-Turkish tensions at a time when Turkey's help is needed to control migrant arrivals.
The resolution - adopted overwhelmingly - uses the word "genocide" in the headline and text. It also says Germany, at the time an ally of the Ottomans, bears some guilt for doing nothing to stop the killings.
The condemnation by Turkish politicians was widespread, including a joint statement by the ruling AK Party and two opposition parties which spoke of "indignation in the Turkish nation".
However, Mr Yildirim stressed that "Germany and Turkey are two very important allies". An estimated three million people of Turkish origin live in Germany.
The Turkish President, Recep Tayyip Erdogan, said the resolution would seriously affect relations with Germany, and that the government would consider further measures in response to the vote.
In a clear reference to Germany's Nazi past, Turkey's Foreign Minister Mevlut Cavusoglu tweeted: "The way to close the dark pages in your own history is not by besmirching the history of other countries with irresponsible and groundless parliamentary decisions."
But German Chancellor Angela Merkel said: "There is a lot that binds Germany to Turkey and even if we have a difference of opinion on an individual matter, the breadth of our links, our friendship, our strategic ties, is great."
Armenian tragedy still raw in Turkey

Mark Yeates twice threatened for Blackpool before the break, with his second effort tipped onto the bar.
A fine run from Stephen Darby set Reid up to fire low into the bottom corner.
Blackpool's Will Aimson saw red in injury time for a second caution after a clash with James Henson.
Defeat sees Blackpool slip to within one spot of the relegation places, with the Seasiders only above Shrewsbury in 21st on goal difference.
A system to keep traffic moving along a busy stretch of the M4 near Newport has begun by varying speed limits in response to road conditions.
[NEXT_CONCEPT]
Turkey's prime minister has condemned as a "historic error" Germany's vote to recognise the 1915 massacre of Armenians as genocide, but said it will not wreck the two countries' ties.
[NEXT_CONCEPT]
Kyel Reid scored the only goal of the game as Bradford City moved to within a point of the play-off spots with victory over relegation-threatened Blackpool at Bloomfield Road.