The compression probably isn't the problem, but it's something that you'll want to check if you can't pinpoint it to the carb. You could have a ring that sticks when hot, a valve that sticks when hot and even a cylinder that goes a little out of round when hot. A compression test will help eliminate any of those as problems. Excess carbon in the chamber can also cause this problem.
If there's a steady stream of fuel out of the bowl, then I'd pull the carburetor and give it a good soaking. You could be losing air pressure in the bowl due to a partially clogged bowl vent. This will cause the engine to act like it's running out of fuel and it will do it quickly. Fuel won't be able to be pulled into the venturi and the engine starves out. This is the same thing that happens with a bad gas cap, with the bad cap causing the problem in the gas tank itself.
The other common cause is a coil that's gone bad. What I do to test this is to let the engine run until it dies, then quickly pull the ignition lead and hook it to a spark tester. Leave the plug in place, you don't want to pull a plug from a hot head. No spark and you have a bad ignition. Coils will often go bad and only show a fault after being run for a few minutes. Once they cool off they'll work until they get hot again. Generally the engine will die suddenly or run rough and then die. Thanks, PK.