sandkoan
sandkoan on Hacker News
Posted by
sandkoan on Tuesday January 09, 2024 @03:14PM
from the quorablog.quora.com dept.
Yeah, then it seems we agree. I was just pointing out that it's not necessary to finetune OSS models to behave like OpenAI functions if you're able to do something similar to what we did (no tuning involved!).
Ahh, no, the value of this isn't as much the model as it is the infrastructure enabling structure enforcement.
Posted by
sandkoan on Monday July 17, 2023 @07:24PM
from the automorphic.ai dept.
You wouldn't actually want to, because you'd be losing generalizability, and it's a lot of unnecessary work.
I think approach #1 outlined above is the better (more cost- and time-efficient) technique—where a pretrained model already understands JSON (among myriad other formats), and you merely constrain it at text-gen time to valid JSON (or other format).
Ahh, I've been meaning to try FLARE—was it a marked improvement over traditional RAG?
Thanks for the reminder—done!
This is model agnostic, actually—any model on HuggingFace is compatible. So if someone wanted to run this with their own model, they could.
Custom LLM—hence the self-hostability.
Costs add up surprisingly quickly. A quote-colon-space-quote combo alone is four tokens wasted. Now scale that up....
The prompt is given to our model as a guiding aid (a suggestion), and the cfg is used to constrain the model to generate only tokens that abide by the schema (an enforcement). That's how we ensure only valid outputs at text generation time.
We also prefill some tokens depending on the set of allowed tokens at a given state, so the model doesn't waste resources trying to predict them.
We have folks playing around with it mostly through the playground / raw HTTP endpoints as opposed to the Python API. And we've got some batch jobs running, which adds further traffic.
Problems with OpenAI:
1) You're wasting GPT tokens on outputting JSON instead of meaningful information.
2) GPT functions won't, with absolute, 100% certainty, return JSON in the schema you want. In 1% to 3% of cases it hallucinates fields, etc.
3) This also allows you to output data in arbitrary non-JSON formats.
4) You can't self-host OpenAI functions.
We enable conforming to arbitrary context free grammars in addition to regex patterns, and have a bunch of speed optimizations, as well.
Though it may not seem too fast right now on account of the hundreds of simultaneous requests we're getting :)
Ahh, that—due to compute limitations we're forced to run a very small model that isn't as capable of converting 5'8" to inches. The larger model is, though.
Posted by
sandkoan on Sunday July 16, 2023 @03:48PM
from the blog.govindgnana.com dept.
Posted by
sandkoan on Sunday July 16, 2023 @02:30PM
from the automorphic.ai dept.
Built a tool for transforming unstructured data into structured outputs using language models (with 100% adherence).
If you're facing problems getting GPT to adhere to a schema (JSON, XML, etc.) or regex, need to bulk process some unstructured data, or generate synthetic data, check it out.
We run our own tuned model (you can self-host if you want), so, we're able to have incredibly fine grained control over text generation.
Repository: https://github.com/automorphic-ai/trex
Playground: https://automorphic.ai/playground