The entire guaranteed contract must be paid. If it goes for multiple years, the team must pay for all the years, either at once or over time.
"The team and player may negotiate a revised payment schedule to be utilized in the event the player is waived. This revised payment schedule may call for the guaranteed portion of the player's contract to be paid over a longer or shorter period of time than originally specified in the contract, or even as a lump sum. This is often referred to as a "spread provision." Also see question numbers 59 and 60. Even if the payment schedule is altered, the team's team salary is charged for the same number of seasons as specified in the original contract."
A waived player may sign with another team, which is the point of the waiver, and that reduces the commitment the original team has. It gets complicated, you can read up on it here:
http://members.cox.net/lmcoon/salarycap.htm#54