Project: Fine-tune for fraud detection

Objective

This is a continuation of the project work. At this time you have a model-neutral synthetic dataset that can be used for fine tuning any model. In this optional exercise, you would follow the steps below to fine tune a model for fraud detection.

Step-1 Select LLM and review fine-tuning requirements

  • Select an LLM to fine tune
  • Review the LLM’s dataset requirements

Step 2 Format the dataset per LLM requirment

  • Convert the following files to model specific format

ex-4-llm-generated-synthetic-data-files.png

  • The dataset will have each record contain instruction similar to the following
Predict whether the following credit card transaction is potentially fraudulent. Use the provided transaction details to determine the label (Fraud or Not Fraud) and add a brief comment explaining the reasoning.

**Transaction Details:**
- Transaction ID: `{transaction_id}`
- Amount: `{amount}`
- Merchant Type: `{merchant_type}` (e.g., Groceries, Electronics, Restaurants, Jewelry, Online Retail)
- Location: `{location}` (City, Country)
- Transaction Time: `{transaction_time}` (Date and Time)
- Device Type: `{device_type}` (Mobile, Desktop, Tablet)
- Customer Country: `{customer_country}`
- Customer State: `{customer_state}`

**Expected Output:**
{
   "transaction_label": `fraud | not_fraud`,
   "comment: `{comment}`
}

Step-3 Fine-tune the mode

  • Write code for fine-tuned model evaluation
  • Run fine tuning
  • Do some unit testing of the fine-tuned model

Step-4 Run the evaluation of model

  • Run evaluation on the model to determine its accuracy