I had a similar problem on a very different vehicle (CBR 600) which turned out to be burnt wiring loom (caused by corrosion on a multiplug - high resistance - causing mini fire between legs - ouch!). One or more feedback wires to the ECU were damaged thus when the throttle position sensor feedback voltage got to a certain level the signal broke down tricking the ECU into thinking the bike was ticking over when it was running at about 5000 to 6000 RPM. Not terribly useful when your about to overtake something and need a little welly - not to mention slightly embarrassing. Open the throttle at some points and the bike would actually start to slow down!!
As Shaft said - worth checking out the basic electrics.