The distil labs platform allows anyone to benefit from state-of-the-art methods for model fine-tuning. You don’t need to be a machine learning expert to get a highly performant model customized to your needs in a matter of a day. The distil labs training job contains four stages:

  1. Data upload: We need a task description, a few dozen examples of the task the model is supposed to perform, and any additional unstructured data about the problem.
  2. Training: We use pre-trained large language "teacher" models to train smaller, specialized "student" models based on your problem definition.
  3. Evaluation: Once the student model is ready, we share accuracy benchmarks based on a test dataset we isolate from your training data.
  4. Deployment: We can share the model binaries with you, so you can deploy it on your own infrastructure.

<aside> 📌

In this document, we will focus on the Data upload part and provide concrete guidance on how to structure your dataset for a classification task.

</aside>

Data Components

Before the training can start, you need to upload all the necessary ingredients to start the training job. For this example, we will focus on classifying customer service requests into categories to streamline the support workflows in an imaginary banking system. To train a model for this purpose, we will need the following:

Task description

Describes the task you expect the model to perform; you can think of it as an LLM prompt that would help the model solve your task. In practice for a classification problem, we expect two components:

  1. task_description field that describes the main task
  2. classes_description field, which provides names and descriptions for all classes. In practice, it is a map from class names to their descriptions.

The expected format is a JSON blob, and for classifying banking service requests, we should have the following:

{
  "task_description": "Classify the bank customer service requests into one of the provided classes",
  
  "classes_description": {
    "balance_not_updated_after_bank_transfer": "Requests about a completed bank transfer not yet reflected in the account balance. The funds have been debited but not credited, indicating a delay in processing the outgoing transfer.",
    
    "balance_not_updated_after_cheque_or_cash_deposit": "Requests regarding a recent cheque or cash deposit not showing up in the available account balance. The customer's ledger balance does not reflect the deposit after some time has passed.",
    
    "card_payment_fee_charged": "Requests questioning an unexpected or additional fee charged for making a payment or purchase with a debit or credit card. The customer seeks clarification on the reason for the fee.",
    
    "cash_withdrawal_charge": "Requests related to being charged a fee for withdrawing cash from an ATM. The customer wants to know the reason, the exact fee amount, and if it can be waived.",
    
    "declined_cash_withdrawal": "Requests about attempting to withdraw cash from an ATM but having the transaction declined. The customer has tried multiple ATMs but still faces the same issue with their card.",
    
    "direct_debit_payment_not_recognised": "Requests regarding an unauthorized direct debit payment charged to the account. The customer claims they did not set it up and wants the bank to investigate its validity.",
 }
}

Test/Train data

We need a testing dataset that we can use to evaluate the performance of the fine-tuned model on your task. For the training stage, we need only a few dozen examples to fine-tune your model. Of course, the more diverse and bigger the dataset, the better.

The expected format is CSV or JSON-lines with (inputoutput) columns. The banking classification task should look like this:

JSON format

{"input": "Why is there a fee for getting cash?", "output": "cash_withdrawal_charge"}
{"input": "I was declined when I tried to take out cash!", "output": "declined_cash_withdrawal"}
{"input": "I deposited some money, but the balance has not changed.", "output": "balance_not_updated_after_cheque_or_cash_deposit"}
{"input": "It has been a couple of hours but I do not see my balance updated, can you help?", "output": "balance_not_updated_after_bank_transfer"}
{"input": "There is a payment showing on my app that I didn`t do. Will you please cancel this payment and refund my money ?", "output": "direct_debit_payment_not_recognised"}
{"input": "How do I know which payments I make will have additional fees? Where can I find this information online?", "output": "card_payment_fee_charged"}
{"input": "how come i was declined", "output": "declined_cash_withdrawal"}
{"input": "I deposited a cheque and its been days and I still haven`t received the cash!!", "output": "balance_not_updated_after_cheque_or_cash_deposit"}
{"input": "You promised no fees but now I`ve got one. What the hell!?", "output": "card_payment_fee_charged"}
{"input": "What is the amount of time transfers usually take from the UK? I had just completed a transfer and nothing seems to be showing up so I need to be sure things are alright.", "output": "balance_not_updated_after_bank_transfer"}
{"input": "Why is there a direct debit to my account? I didn`t do that.", "output": "direct_debit_payment_not_recognised"}
{"input": "Do cash withdrawals cost anything?", "output": "cash_withdrawal_charge"}