If a more durable arrangement is desired, so the employee cannot leave tomorrow with no notice (thereby giving up the normal freedom to work only willingly for employers, and leave when it is no longer willing), then IMO it should be set out in advance and honored by both sides, e.g. by using a fixed-term or minimum-term contract, with penalties for early termination by either side. That way both sides can plan on the stability of the relationship (barring serious misconduct).
For example in my current job, either my employer or myself can terminate the employment with four months notice, after the first six months. This gives us both some guarantee that we will be able to plan for major changes— they will have time to find a replacement if I give notice, and I'll have time to find another job if they give notice.
Obviously, training benefits can be abused. "Here is a 'benefit' that is not really a 'benefit' but instead a job requirement for which we have assigned a nearly arbitrary value; if you leave within 12 months, you must pay us this random number back." But as long as "training" has some value assigned by the market with a reference price not controlled by the employer, what's the problem?
Employers always have to pay for experience. You either pay more for an experienced employee or pay for training.
With an experienced employee you can include actual benefits, like you mentioned, or you can pay to train someone who will take a lower salary.
It's uncomfortably close to indentured servitude to me to say: you can't work for anyone else until you pay off this up-front investment we made in you (working only for us until you do).
What does the contract specify as a remedy for the company if you quit early?