Dan-wanna-M / formatron

Formatron empowers everyone to control the format of language models' output with minimal overhead.
MIT License
163 stars 6 forks source link

Check opportunistic masking #6

Closed Dan-wanna-M closed 1 month ago

Dan-wanna-M commented 3 months ago

It is possible to sample a token first and check whether that token can be accepted by the formatter. This means we only need to compute the mask for the whole vocabulary if the token is not accepted. This nonetheless does not integrate well with existing pipelines. We probably need to get some PRs passed first.

Dan-wanna-M commented 1 month ago

We are already fast even without it.