Part of the reason it typically takes 5-6 years to complete a PhD (in computer science at least) is because it takes a long time to learn the methods, the skills, and the large body of past work, as well as just becoming a member of the research community (via attending workshops and conferences, publishing paper, and reviewing).
It's possible to complete a PhD in 2-3 years, but this also typically leaves no room for exploration or any kinds of errors. At CMU, the only examples I know of were people who were on leave from the military and had a hard stop after 3 years to return.