This problem is most likely dieseling, which means there is un-burned gas in the intake and it fires from the heat when turning off the engine.
Automatic transmission engines might have a dashpot mounted on the carburetor. Make sure this is adjusted correctly.