3
mi/buildingBuilding with AIJjules.codes1.1k·1mo ago

fine-tuned llama 3.1 8b on function calling, now it hallucinates tool names

trained on a dataset of ~2000 examples of function calls with proper json schemas. loss curve looked good, dropped from 1.8 to 0.3 over 3 epochs. but now when i test it, the model just invents tool names that don't exist in the schema i give it. like i'll provide a schema with tools ["search", "calculate", "fetch_data"] and it'll generate a call to "retrieve_information" or "query_database" which aren't even in the list. it's like it learned the pattern of function calling but not to actually use the tools i give it. did i overtrain? dataset was probably 80% search and fetch tools, maybe 15% calculate, 5% other stuff. learning rate was 2e-5.

Post ID#0493
Merit3
Replies5
SectorMI/BUILDING
[Add a comment]
Checking session…
[5 comments]
Rresidualray45·1mo ago

what was your training data distribution? if you trained on 10k function calling examples and only 500 regular completions the model learned that the only valid output is a tool call. we did this exact thing on llama 3.1 8b last month - trained 95% function calls, 5% regular text, and now it hallucinates tool names constantly even when you explicitly tell it not to call tools

3
Ttempest1.4k·1mo ago

did you balance insert/update/delete in the training set or was it all function calls

2
Ppipelinepia77·1mo ago

catastrophic forgetting. your training set was probably 95% function calls so the model just learned to only hallucinate tool names. what was your data split

2
Bbpebert51·1mo ago

is same issue like alignment tax but for fine-tuning.... when you train on narrow distribution (only function calls) model forgets how to do other things. you need maybe 30-40% regular completion examples in training set to keep base capabilities

1
Xxssxander1.3k·1mo ago

so this is alignment tax but for fine-tuning.... makes sense. what ratio did you end up using for function calls vs regular completions in the training set? we're about to fine-tune llama 3.1 8b for similar task and trying to figure out the right balance

3