I don't know what the US thinks its mission is in Afghanistan. If it's to rid the country of Al Qaeda, then congratulations to the US on its victory. You can bring your troops home now. If it's to create a stable, pro-US country with a legitimate central government, then good luck with that. That will take decades and zillions of dollars and tens of thousands of casualties and hundreds of thousands of troops. The end result is certainly desirable, especially if you're an Afghan, but the enormous costs greatly outweigh the benefits in terms of US interests and can't be justified politically. Or maybe the goal is to keep Afganistan from becoming a breeding ground for anti-modern, authoritarian extremism. If so, we have failed by making it more of such a breeding ground than ever. The best we can do is contain the extremists and counter them with, say, cash.
The way I figure it, the US should set as its goals (a) keeping Pakistan from falling to the Taliban or other nutjobs, (b) keeping Al Qaeda and its ilk from reasserting itself in the region, and (c) establishing effective networks of intelligence and propaganda dissemination in the area to protect and promote US interests. A huge military presence is not required to meet these aims. A huge military presence, unless it's huge enough to maintain a police state, may even be counterproductive.
It was a dumb idea to invade Afghanistan in the first place. Let's not compound the error. If the US leaves and the Taliban returns to power, then Afganistan is the same as it was when we invaded it, no better or worse.