An algorithm that approximates a sum over exponentially many terms by keeping only the highest-probability terms.