Open xdevfaheem opened 7 months ago
While I have not done this personally, it should be possible. You could devise a "legal token discipline loss" in which you look at the output that the LLM generates, and penalize it according to the weights it assigns to the illegal tokens.
So you would do something like:
The -inf kind of scares me, so you might want to replace the -inf with a negative number (like -100 which is the maximum in OpenAI API logits bias). This is all theoretical though, I haven't tried it in practice.
Cool, this makes sense. Is there any scripts available somewhere as of you your knowledge to get s quick overview of the implementation?
I tried, training the model with preferred json output for the input without any format enforcers. it performs good. Eventhough, i wants to use LMFE to increase it's reliability. Am i wrong?
There are no scripts that try to do this as far as I'm aware, this is brainstorming... Indeed, normal SFT training can work as well, and then you don't need LMFE in the training loop
@noamgat is it possible to train a model with constrained output tokens?