←back to thread

169 points constantinum | 2 comments | | HN request time: 0.001s | source
Show context
JakaJancar ◴[] No.40714866[source]
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): >>40714901 #>>40715217 #>>40717249 #
1. hellovai ◴[] No.40714901[source]
not a noob question, here's how the LLM works:

```

prompt = "..."

output = []

do:

  token_probabilities = call_model(prompt)

  best_token = pick_best(token_probabilities)

  if best_token == '<END>':

    break

  output += best_token
while true

return 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).

replies(1): >>40718510 #
2. PheonixPharts ◴[] No.40718510[source]
> things like chain-of-thought/reasoning perform way worse in structured responses

That is fairly well establish to be not true.