Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If the current position in the structure only has one possibility (like a comma, bracket, etc.) do you just force that as the next token and continue?


We do enable forcing these sequences of tokens in guidance, and find that it significantly speeds up structured generation. There are tricky alignment issues to make sure you pick the right sequence of tokens, but you can often proxy this well by using the model's native tokenizer. Some details here in an old blog: https://guidance.readthedocs.io/en/latest/example_notebooks/...


I don't think so, because multiple tokens might match. If it needs a comma as the next character, but you have tokens for `, "blah` and `, "foo` you still want to leave those on the table.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: