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

Note that if going the constrained grammar route, at least ChatGPT (haven't tested on smaller models) understands BNF variants very well, and you can very much give it a compact BNF-like grammar and ask it to "translate X into grammar Y" and it works quite well even zero-shot. It will not be perfect on its own, but perhaps worth testing whether it's worth actually giving it the grammar you will be constraining its response to.

Depending on how much code/json a given model has been trained on, it may or may not also be worth testing if json is the easiest output format to get decent results for or whether something that reads more like a sentence but is still constrained enough to easily parse into JSON works better.



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

Search: