The recent Taliban assault on a U.S. outpost that killed nine American and four Afghan soldiers also left "scores" of Taliban dead. While this isn't the first time that Taliban forces have accepted high casualties in an attack on a fixed defensive position, as far as I know it is the closest that they've come to overrunning a large Allied concentration (the outpost included 45 American and 25 Afghan soldiers). If the attack had been marginally more successful at penetrating the base, American dead might have spiraled into the dozens.
One purpose of such attacks is the demonstration effect -- the Taliban accepts large casualties to indicate to locals that it is willing to and capable of accepting large casualties and that it can fight the American on their own terms. Another purpose, I suspect, is to create a mass casualty event that might shift the political debate inside the U.S. and other members NATO. Suffering 35 dead in one day has a more dramatic political impact that suffering 35 dead over a two month period, and to the extent that the Taliban are trying to win the war they need to attack NATO's will to continue the fight. Of course, withdrawal from Afghanistan doesn't appear to even be on the table in the United States, but it's certainly being widely discussed in the rest of the NATO alliance.
--Robert Farley