Defining Grader Schema - RTF [Reinforcment Fine-Tuning] - Foundry

Eli Kling 5 Reputation points
2025-06-11T14:30:01.6133333+00:00

I am struggling to get the RFT to run. My guess is that I am getting the definition of the Grader schema wrong.
Example for record in the training/validation set:
"""
{"messages": [{"role": "user", "content": " Answer with the correct answer. keep it short and to the point. do not expain the reasoning. Additionally provide a confidence between 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, of how sure you are the answer is correct. A value close to 0 means you think there is a high probability that the answer is wrong. The closer the value is to 10, the higher you think is the probability that the answer is correct. The output should have the format 'Answer: <answer>, Confidence: <confidence>' and nothing else.\n Question: please classify the product described as 'MegaXmar Car Battery Jump Starter - 2000A Peak 18000mAh(Up to 8.0L Gas and 7.5L Diesel Engine) PD60W Fast Charging,Portable Jump Starter with Smart Clamp Cables, LED Flashlight Jump Box' "}], "final_answer": "Automotive Tools & Equipment"}
"""

I delibreatly do not have a system role as the documentation sais it is not supported.

graders I tried:

{
"name": "text_similarity_sample_grader",
 "type": "text_similarity",
 "input": "{{item.reference_answer}}",
 "reference": "{{sample.output_text}}", "evaluation_metric":"fuzzy_match"
}


{
"name": "string_check_sample_grader",
 "type": "string_check", 
"input": "{{item.Answer}}",
 "reference": "{{sample.output_text}}", 
"operation": "eq"
}

I guess I am getting something wrong either in the structure of the JASONL or the definition of the input and reference in the grader

Azure OpenAI in Foundry Models

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

1 answer

Sort by: Most helpful
  1. Saideep Anchuri 9,470 Reputation points Moderator
    2025-06-12T01:23:45.8166667+00:00

    Hi Eli KlingIt seems like you're facing issues with the Grader schema for Reinforcement Fine-Tuning (RFT).

    Here are some steps:

    To choose the appropriate grader for your task, consider its nature. If you need specific answer classification, a string-check grader is the right choice. Each line in your JSONL file must contain a valid JSON object, ensuring that the messages field is formatted correctly and that the final message is from the user. Additionally, your grader should have the correct input and reference fields.

    {
        "type": "string_check",
        "name": "product_classification_grader",
        "input": "{{item.reference_answer}}",
        "reference": "{{sample.output_text}}",
        "operation": "eq"
    }
    

    If you wish to include a confidence score in your output, make sure your model is trained to provide it, as the grader itself does not handle this feature. Before running your training job, it is essential to test your grader using a validation dataset to confirm its expected behavior. You can also leverage the grader check API to validate your configuration and ensure accuracy.

    Kindly refer below link: graders

    Thank You.

    Was this answer helpful?

    1 person found this answer helpful.