There are a number of verses mentioning saum, and you can put in training,punishment or a period of character building with self denial etc with any of them, whatever suits your understanding. IF it is training, then why different times as it does not make sense that two months is needed for this.
2:196 (Peace cannot defend itself. Mankind have to guard it.) Therefore, join the Hajj and ‘Umrah Convention for God. If you are stranded, send in gifts that the congregation would utilize. Do not consider that by doing so you have relieved yourself of duty. Be with them at heart until the gifts have reached their destination. If someone is sick or has other compelling burdens preventing him from sending any contribution, then Abstinence for a few days at convenience, or an act of charity or fulfilling someone’s need shall be in order. If a person is present at the Convention but cannot afford to contribute, he should exercise Abstinence for a total number of ten days, three days there and seven days after coming home. This is for him whose people do not live in the vicinity of the Convention. Be mindful of God, remembering the noble objective. And know that God (His law) is Strict in grasping.
4:92 It is not conceivable that a believer will slay another believer unless it be by mistake. If one kills a believer by mistake, there is the duty of freeing a believing person from bondage; may it be slavery, extreme poverty, crushing debt or oppression. And pay compensation to the victim's family unless they forgo it by way of charity. In case the victim was a believer, and belonged to a tribe who are at war with you, free a believing person from bondage. If the victim was a believer, and belonged to a tribe with whom you have a peace treaty, you should pay the compensation to his family in addition to freeing a believing person from bondage. For those who find this settlement beyond their means, two consecutive months of Abstinence (from food, drink and sex during the daytime), as in the month of Ramadhan, are ordained by way of repentance from God. God is the Knower, the Wise. [2:183. The State will help if the violator is old, sick or poor. 4:64]
5:89 God will not call you to account for vain utterances of your oaths. He will hold you accountable for your deliberate and intentional oaths. If you violate such oaths, that would be a transgression against your own ‘self’. If you do violate an oath, the expiation for that is: Feeding ten needy persons of what is standard for your own family, or clothing them - Or, freeing one human being from bondage, whether it is slavery, extreme poverty, heavy debt, or oppression. If you do not have the means to do so, then observe Abstinence (from food, drink, and sex) for three days, as in Ramadhan. This is the expiation of your (breaking of) intentional oaths. But be mindful of your oaths. God explains His messages, so that you may have reason to be grateful. [See Abstinence in 2:183]
58:3 So, those of you who have made senseless declarations about their wives, estranged them, and then wish to go back on their utterance - they should free a human being from bondage before the couple may have intimate relations with each other. This you are admonished to perform. God is aware of all you do. [Freeing from bondage includes relieving someone from any kind of oppression and from a crushing burden of debt]
58:4 However, he who cannot find a bonded person, let him observe daytime Abstinence (from food, drink and sex as in the month of Ramadhan) for two consecutive months before the couple may intimately touch each other. And if he is unable to do that either, he should arrange the feeding of sixty needy ones. This is so that you may be true to your faith in God and His Messenger. These are the bounds ordained by God. For the deniers is a painful doom. [2:183. The State will help if the violator is old, sick or poor. 4:64]