Hacker GitHub

← All repos

newhouseb/clownfish

View on GitHub ↗ ★ 328 Python

Constrained Decoding for LLMs against JSON Schema

20 mentions on Hacker News by 9 people: 3 stories, 17 comments · first 2023-03-27 · latest 2023-08-14

Mentions per year 20 mentions · busiest year 2023 (20)
20082026
  1. https://github.com/newhouseb/clownfish Which I've been using for a while now, also restricts the sampling space to force correct generation, but does so as the result of a different process than yours.
  2. I'm not sure how this is different than: https://github.com/1rgs/jsonformer or https://github.com/newhouseb/clownfish or https://github.com/mkuchnik/relm or https://github.com/ggerganov/llama.cpp/pull/1773 or…
  3. …guarantees. A few months ago I built this anyway to suss out how much more expensive it was [1] [1] https://github.com/newhouseb/clownfish#so-how-do-i-use-this-...
    comment by newhouseb · 2023-06-14 · in Native JSON Output from GPT-4
  4. …is just fine tuning. There's no hard biasing applied :(. You were so close, but so far OpenAI! [1] https://github.com/newhouseb/clownfish [2] https://platform.openai.com/docs/guides/gpt/function-calling
    comment by newhouseb · 2023-06-13 · in Function calling and other API updates
  5. …to finish the blob { "name": "bob", "job": "programmer" } [1] https://github.com/1rgs/jsonformer https://github.com/newhouseb/clownfish Note: guidance is way more general of a tool than these Edit: spacing
    comment by evanmays · 2023-05-16 · in A guidance language for controlling LLMs
  6. I agree, it looks great. A couple similar projects you might find interesting: - https://github.com/newhouseb/clownfish - https://github.com/r2d4/rellm The first one is JSON only and the second one uses regular expressions, but they both…
    comment by killthebuddha · 2023-05-16 · in A guidance language for controlling LLMs
  7. …usage for a particular prompt but better prompting can definitely reduce this significantly. [1] https://github.com/newhouseb/clownfish#so-how-do-i-use-this-...
    comment by newhouseb · 2023-05-16 · in A guidance language for controlling LLMs
  8. https://github.com/newhouseb/clownfish Structural Alignment: Modifying Transformers (like GPT) to Follow a JSON Schema
  9. This seems extremely similar to https://github.com/newhouseb/clownfish
  10. Oh nice! I built a similar system a few weeks ago: https://github.com/newhouseb/clownfish I think the main differentiating factor here is that this is better if you have a simpler JSON schema without enums or oneOf constraints. If you do…
  11. You're basically describing https://github.com/newhouseb/clownfish/ , except there it tries to validate the output against JSON schema on the fly.
  12. …[2] "Structural Alignment: Modifying Transformers (like GPT) to Follow a JSON Schema" @ https://github.com/newhouseb/clownfish (full disclosure: this is my work)
  13. And on the other end, there's https://github.com/newhouseb/clownfish to force the model to produce structured output.
  14. …but when it comes to force structure on the output data, this approach looks interesting: https://github.com/newhouseb/clownfish TL;DR: it exploits the fact that the model returns probabilities for all the possible following tokens to…
  15. …be emitted, see "Structural Alignment: Modifying Transformers (like GPT) to Follow a JSON Schema" @ https://github.com/newhouseb/clownfish . Unfortunately, given OpenAI's current API this is only possible on locally run models. That is...…
  16. …try LLaMA. [1] "Structural Alignment: Modifying Transformers (like GPT) to Follow a JSON Schema" @ https://github.com/newhouseb/clownfish
  17. …give us the primitives one day to appropriately steer these models to do the right things (tm). [1] https://github.com/newhouseb/clownfish