guidance-ai / guidance

A guidance language for controlling large language models.
MIT License
18.14k stars 1.01k forks source link

[PoC] Select grammar in GPT-4 #841

Open amir-abdi opened 1 month ago

amir-abdi commented 1 month ago

A proof of concept work on the possibility of supporting the select grammar for OpenAI models. The mini experiment was conducted on GPT-4.

Idea: The idea is to extremely boost the logit_bias of tokens of all select choices to discourage any other token.

Flaw: It is not a fool-proof idea because a mixture of those tokens can still be selected to generate a new word which may not be among the choices.