For option, roster, and reporting bonuses, repayment is required only if retirement happens in the year the money is earned. For signing bonuses, full repayment of all unearned portions of the money paid is required in the event of a retirement.
http://profootballtalk.nbcsports.com/2015/06/05/anthony-davis-will-pay-back-unearned-signing-bonus-money/