Improving Numerical Accuracy in Fine-Tuned SLM on Azure AI Foundry / Azure ML Studio

Sebastian Buzdugan 40 Reputation points
2025-02-03T16:27:30.1866667+00:00

I’m fine-tuning a Small Language Model (SLM) using Azure AI Foundry / Azure ML Studio on a dataset of 5,000 Q&A pairs related to financial data. The goal is to make the model accurately answer numerical questions (e.g., percentages, financial figures). After fine-tuning, when I ask the model a question it was explicitly trained on (e.g., “What was the inflation rate in 2022?”), it retrieves an incorrect percentage. If I repeat the same question multiple times, the answer changes each time, suggesting a bias toward prior knowledge rather than the fine-tuned dataset. Thanks in advance for any insights!

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,108 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. kothapally Snigdha 1,260 Reputation points Microsoft Vendor
    2025-02-03T20:48:15.86+00:00

    Hi Sebastian Buzdugan

    Greetings & Welcome to the Microsoft Q&A forum! Thank you for sharing your query.

    I understand you're encountering a common issue with fine-tuning language models, where the model's responses are influenced by its pre-existing knowledge rather than the fine-tuned dataset. If the temperature is set too high, it makes the model's predictions more random, which is why you're seeing different answers each time. Lowering the temperature will make the model's outputs more consistent and reliable.

    • Try setting the temperature between 0 and 0.5. A lower temperature makes the model more focused and less random, which should help stabilize the answers. Experiment with different values in this range to see if the results improve. Using Azure AI Foundry or a similar platform, you can usually find the temperature setting in the generation settings. Lower it and see if the model gives more accurate and consistent responses.

    I hope this helps you. Thank you!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.