33 karma · joined Feb 7, 2017 (9y ago) · 47 submissions
comment 2y ago · link · parent
I'm a main contributor of Tanuki (formerly MonkeyPatch).
The purpose of Tanuki is to reduce the time to ship your LLM projects, so you can focus on building what your users want instead of MLOps.
You define patched functions in Python using a decorator, and the execution of the function is delegated to an LLM, with type-coercion on the response.
Automatic distillation is performed in the background, which can reduce the cost and latency of your functions by up to 10x without compromising accuracy.
The real magic feature, however, is how you can implement alignment-as-code, in which you can use Python's `assert` syntax to declare the desired behaviour of your LLM functions. As this is managed in code, and is subject to code-review and the standard software-lifecycle, it becomes much clearer to understand how an LLM feature is meant to behave.
Any feedback is much appreciated! Thanks.
8.
Tanuki: Alignment-as-Code for LLM Applications(github.com ↗)
8 points · by JackHopkins · 2y ago · 1 comment
comment 3y ago · link · parent
A new name is definitely in order. I will think about it over the weekend.
Thanks for the feedback, I appreciate it.
comment 3y ago · link · parent
1) The data for finetuning currently is saved on disk for low latency reading and writing. Both test statements and datapoints from the function execution are saved to the dataset. We also are aware that saving to disk is not the best option and limits many use-cases so we're currently working on creating persistence layers to allow communication with S3 / Redis / Cloudflare as the external data storage.
2) Currently starting the fine-tuning job happens after the dataset has at least 200 datapoints from GPT-4 executions and align statements. Once the finetuning is completed, the execution model for the function is automatically switched to the finetuned GPT 3.5 turbo model. Whenever the finetuned model breaks the constraints, the teacher (GPT4) is called upon to fix the datapoint and this datapoint will be saved back to the dataset for future iterative finetuning and improvements. We are also working on adding in ways for the user to include a "test-set" which could be used to evaluate if the finetuned model achieves the required performance before switching it as the primary executor of the function
Hope this makes it more clear, if you have any additional questions, let me know!
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
Finally, other persistence layers like S3 and Redis, to support running on execution targets (like AWS Lambda and CloudFlare workers) that don’t have persistent storage.
I think it could be really interesting to support Vercel more tightly too. We currently support Vercel with Python, but I think Typescript + Redis would really enable serverless AI functions - which is where I think this project should go!
comment 3y ago · link · parent
MonkeyPatch ensures reliability through what we call ‘test-driven alignment’, in which the tests that reference the patched functions are guaranteed to pass. The more align ‘tests’ you create, the more rigorous a contract that the functions have to fulfil.
The other way to increase consistency is using more constrained type annotations (i.e using pydantic field annotations), which is a similar concept to MarvinAI and Magentic.
comment 3y ago · link · parent
https://github.com/monkeypatch/monkeypatch.py/blob/master/sr...
comment 3y ago · link · parent
Right now any ‘plug-in’ model needs to conform to the OpenAI API.
(P.S Carthago delenda est)