AI noob question:
Why do OpenAI/Anthropic/... not support constraining token generation? I'd imagine producing valid structured output would be at the top of their feature request lists.
replies(3):
Why do OpenAI/Anthropic/... not support constraining token generation? I'd imagine producing valid structured output would be at the top of their feature request lists.
```
prompt = "..."
output = []
do:
token_probabilities = call_model(prompt)
best_token = pick_best(token_probabilities)
if best_token == '<END>':
break
output += best_token
while truereturn output
```
basically to support generation they would need to modify pick_best to support constraining. That would make it so they can't optimize the hot loop at their scales. They support super broad output constraints like JSON which apply to everyone, but that leads to other issues (things like chain-of-thought/reasoning perform way worse in structured responses).
That is fairly well establish to be not true.