How are bad first year marks (i.e., ranked around average among my peers) but outstanding 2nd-4th year marks (i.e., top 2%) perceived by PhD admissions committees in the U.S.? What emphasis is placed onto first year marks?
There's no absolute universal standard as to how this will be perceived, but it's definitely better to be in the situation you describe than the reverse (good in general courses, mediocre in the major)!
One of the issues is where the first-year grades are bad. If you have some poor grades in "general education" classes unrelated to your major (for example, an engineer who gets a "C" in American history and English literature), that hopefully won't matter too much if the admissions committee is actually looking at the transcript, rather than just the overall GPA.
Ultimately, it comes down to how rigid the admissions committee is about reviewing things, as you can see in this thread.