I mean during the stalemate. Between the start of trench warfare in 1914, to the breakthrough in 1918. How far did the front line deviate from its initial placement during the Battle of the Aisne in September1914? 50 miles? 100?
I'm going to not so much just list off every amount of territorial gain because that's boring and would take 5 minutes and a bunch of map links with no context. Instead I'm going to go through the major offensives and what they accomplished and through that you'll get context for those territorial gains. So bear with me because the lines on the map don't tell the whole story.
I take some exception with how you worded your question, namely, lumping the entire "front line" together. We can't look at it as the perspective of "the entire front" but rather in pretty localized sectors. A quick overview of how the war worked was that there would be a small holding force across the front line and significant amounts of reserves. If there was an enemy offensive you threw the reserves into that sector of trenches to beef them up and pull them back afterward. Same goes for offensives. Because of this major offensives only occurred in one localized area of the entire front and pretty much only once per year as it required significant planning to organize these things.
So first things first an introduction for those who are not as learned in battle names. The Battle of Aisne, or more commonly known as "the race to the sea", was an Entente counter-offensive in response to the success at the Marne. As you'll see the battles moved progressively more Northern as the dates go on. What was essentially happening was the Entente forces were trying to outflank the Germans and reinvigorate maneuver warfare. The Germans however were running parallel to them and basically stopping them, building defensive works along the way. You'll notice it also moves gradually Eastward. Something the Germans were very keen on doing was, because of their incredible depth in foreign territory already, giving up a few miles of land if it meant better defensive positioning as they realized the war was going to drag out. This is also why, generally, the Germans had better defensive positions and less wet trenches; they the luxury to choose where to build theirs.
After this is the infamous stalemate we are all familiar with. 1915 was a largely uneventful year for the Western Front. It's certainly an exciting year elsewhere (namely Gallipoli and the Eastern Front) but this was basically the stalemate many people refer to when they call the Great War a 'stalemate'. There was a German offensive in the First Battle of Ypres which was the first time Chlorine Gas was used and they gained a small parcel of land but it was nothing significant and certainly not a distance measured in miles.
1915 was also arguably the worst year to fight in the Western Front and maybe even the war as a whole depending on your personal leanings. It was by all accounts a stalemate and it was both sides learning how to handle the situation in front of them. It was terrifying. Gas was used for the first time as I mentioned, the trenches were still new and dingy and poorly maintained. This was the time where Kitchner's Army began being filtered into the front as well. So if you were British you were poorly trained (see my post here w.r.t. to that) for the reality of trench warfare and were being thrown into the meatgrinder headfirst. It was horrifying and the worst part was you weren't doing anything. From the hundreds of personal accounts I have read of trench life absolutely the most recurring theme is the concept that the men were at all times feeling helpless. At least in the Somme's and the Verdun's and the Passchendaele's, they say themselves, they were attacking the enemy and actually doing something and had some agency. It was the other 364 days of the year though where a man was sitting in a trench being bombarded with artillery and sniper fire that made it so horrible.
After 1915 however to refer to the Western Front as a 'stalemate' is a faux pas in my opinion as this is when things really started to get wild. It is in my educated opinion that 1916 was the year in which Germany lost the war and it would also experience, at least with respect to the war being fought, great territorial change in two major sectors of the front. The Battle of the Somme was to take place where the French and British lines would meet and was originally intended to be a combined Anglo-French offensive in combination with the Italians and Russians to "squeeze" Germany in. The plan was if they could all hit Germany at the same time from all directions it would strain her enough that they could perform the 'killing blow' of sorts in 1917 or 1918. That plan went almost immediately to the bin however as the plan was supposed to go into action in July but the French were attacked at Verdun at the onset of 1916, February 21st. The Battle of Verdun was a plan by the Germans to rapidly seize high ground advantage in the Verdun region with a quick strike and then hold it, forcing the French to expend significant amounts of men trying to retake said high ground as they were bled out. They would have intended success with this early on but as French reinforcements arrived and the defense gained depth and the French were ordered to stop performing counter-attacks, the German offensive ground to a halt as well as it turned into an artillery slug match between the two. It would be the first time flamethrowers would be used in war as well with devastating consequences. [You can see the results here](http://www.firstworldwar.com/maps/graphics/maps_33_wfront_verdun_(1600).jpg) and they were, honestly, staggering. Despite massive losses on both sides, the French were losing more and the Germans were steadily gaining ground.
The British could no longer rely on significant French support in their upcoming offensive, they would be totally alone. To make matters worse, as said above, France was losing that battle. The British were told straight up if they don't start the offensive immediately and relieve German pressure there won't be a French army left at the end of 1916. Considering the French took up a significant majority of the front this was seen as a problem. The Battle of the Somme had thus turned from part one in a two part plan to squeeze the Germans into submission but into a desperation rescue mission to relieve German pressure in Verdun and give the French a chance to collect themselves. It was also the testing ground of Kitchner's New Army, an army not based off of professional regulars but volunteer conscripts trained in a matter of weeks; this would be their first offensive and they would be all on their own.
Now this is where the reader expects me to trash General Haig, "the brass", and those idiots who let 20,000 men die and 40,000 get injured and captured on the first day. Probably the most unfortunate thing about the study of WWI is the writings of regular soldiers following the war and their popularity. Too many people have only the experience of these writings w.r.t. these conflicts but not a more removed, objective stance we can now have 100 years later. This was a period in which the average man was critical (to put it lightly) of the higher ups as they could not cope with the significant loss of human life. These attitudes would be popularized and normalized in Western culture and the star player in this smear campaign was the Somme as it was the greatest loss of life of the war for both the British and the Germans. However with the benefit of retrospect we can confidently make two conclusions:
There was no other option. It was either perform this offensive or lose the war.
The British could not have hoped for a more strategically successful operation.
Whatever the British lost, the Germans lost even more. Let me emphasize that -- the combined British Commonwealth coalition were attacking in World War I and they, combined, lost less men than the defenders. Even on the infamous first day on the Somme with 60,000 casualties there was noticeable gain in the fighting.
If you don't believe me let's look at the territorial gain. It would be the greatest territorial gain of the war since September 1914; 6 miles of penetration would be attained from the fighting. That alone should attest to the strategic success of this battle but like I mentioned above we also need to look at casualty counts. The United Kingdom would lose approximately 350,000 men and the combined Commonwealth coalition (ie: Canada, Australia, South Africa, etc.) would have between 400,000-430,000 with just a pinch under 100,000 killed. The Germans would have 460,000-500,000 casualties and 160,000+ killed. Even further it did the exact intended job it was meant to; the Germans would be forced to relieve significant amounts of men from the Verdun offensive, basically put it on hold, and throw their weight into the Somme. As you'll see in the picture I linked for Verdun above the French would retake a significant portion of land in response to this.
What is most important though is that the Somme ripped the initiative from the Germans. They gained it in February that year but the Somme would put them on the perpetual defensive for the remainder of 1916 and 1917, only to be temporarily reinvigorated in 1918 for a last ditch all in offensive which would fail shortly (we'll speak on that later). The Somme terrified the German high command. They could not suffer another Somme under the current conditions without capitulating. They would thus begin construction of a massive defensive fortification called the Siegfriedstellung, the Hindenburg Line. It was a massive defensive 'line in the sand' with, literally, barbed wire fields hundreds of meters deep and support trenches and tunnels and concrete pillboxes and so forth. It was a force to be reckoned with. In early 1917 the Germans would withdrawal to this line called Operation Alberich. This would cede even more territory to the Anglo-French forces.