News for hackers. Stuff that matters.
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by mritchie712 on Monday April 08, 2024 @02:07PM (#39972249)
Not sure when they implemented this, but ollama now has a JSON mode [0]. Not function calling, but one of the simpler ways to get JSON in a local LLM. I'm using it with `knoopx/hermes-2-pro-mistral:7b-q8_0` and it's worked well for me so far.

    response = ollama.chat(model=OLLAMA_MODEL, 
        messages=[
            {
                'role': 'system',
                'content': system_message,
            },
            {
                'role': 'user',
                'content': user_prompt,
            },
        ],
        format='json',
        options = {
            #'temperature': 1.5, # very creative
            'temperature': 0.0
        }
        )
0 - https://github.com/ollama/ollama/blob/main/docs/api.md#json-...
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by Joschkabraun on Monday April 08, 2024 @02:08PM (#39972258)
Interesting. Do you have any benchmarks?
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by mritchie712 on Monday April 08, 2024 @02:11PM (#39972295)
No benchmarks, just my anecdotal experience trying to get local LLM's to respond with JSON. The method above works for my use case nearly 100% of the time. Other things I've tried (e.g. `outlines`[0]) are really slow or don't work at all. Would love to hear what others have tried!

0 - https://github.com/outlines-dev/outlines

Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by Joschkabraun on Monday April 08, 2024 @02:14PM (#39972325)
Ah yes. Have you tried out instructor [0] or Guidance [1]?

[0]: https://github.com/jxnl/instructor/

[1]: https://github.com/guidance-ai/guidance/tree/main

Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by yinser on Monday April 08, 2024 @02:02PM (#39972205)
This is great to see another player enter the tool use arena but anecdotally I'm having issues getting function calls to Anthropic to return proper JSON. Still feels a little fragile but hopefully they continue improving.
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by fudoshin2596 on Monday April 08, 2024 @03:57PM (#39973117)
Yea, new tool calling now in public beta is way better. And avoids all of that XML they had before.
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by Joschkabraun on Monday April 08, 2024 @02:05PM (#39972229)
Have you tried the new beta tool use API? In the experiments I ran there were almost no issues parsing the function call response (similar to GPT-3.5-turbo & GPT-4 turbo)
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by airocker on Monday April 08, 2024 @02:03PM (#39972210)
Are tools fine tuned in both or just prompt based? For a fair comparison
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by fudoshin2596 on Monday April 08, 2024 @03:59PM (#39973133)
No fine tuning. Looks like he's do raw model capabilities with simple prompt. repo: https://github.com/parea-ai/tool-use-benchmark
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by Joschkabraun on Monday April 08, 2024 @02:06PM (#39972238)
All models got the same prompt fed which was essentially "Question: {question}". And then the API's accept the function call definition
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by airocker on Monday April 08, 2024 @02:12PM (#39972302)
But what if there is a bad model that fine tunes with only tools?
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by Joschkabraun on Monday April 08, 2024 @02:19PM (#39972379)
What do you mean with being a bad model?

If the model is really good at tool use, then it will broadly useful as it needs capabilities to generate the tool definition. So, there should be some transferability.

Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by ec109685 on Monday April 08, 2024 @10:25PM (#39975761)
If the exact tools test was part of the training of the model, wouldn’t that throw off the results and not generalize?
Re:Anthropic's Haiku Beats GPT-4 Turbo in Tool Use by waldrews on Monday April 08, 2024 @10:01PM (#39975651)
Now if only Claude had JSON mode.