Turning a 94.2% Scoring LLM into a Decision Model

2 min read

I've been working on a project that uses a large language model (LLM) to predict customer behavior, and I'm excited to share my findings on turning a 94.2% scoring LLM into a decision model.

Recently, I stumbled upon a study that showed an LLM scoring 94.2% on a specific task. I was intrigued by the idea of using this model as a decision-making tool. One way to do this is by using the LLM's output as input to a decision-making algorithm, such as a simple threshold-based system or a more complex decision tree.

Let's say we have an LLM that can predict the likelihood of a customer buying a product based on their browsing history. We can use this output as input to a decision-making algorithm that determines whether to offer the customer a discount or not.

python
# Example code
import pandas as pd

# Load the LLM's output
output = pd.read_csv('llm_output.csv')

# Define the decision-making algorithm
def decision_making(customer_data):
    if customer_data['likelihood'] > 0.5:
        return 'offer_discount'
    else:
        return 'do_not_offer_discount'

# Use the LLM's output to make a decision
decision = decision_making(output)
print(decision)

One of the challenges of using LLMs as decision models is ensuring that the output is relevant to the task at hand. To address this, I've been experimenting with using techniques such as cross-validation and hyperparameter tuning to improve the model's performance.

To improve the model's performance, I've been using a technique called k-fold cross-validation. This involves splitting the data into k subsets, training the model on k-1 subsets, and testing it on the remaining subset. I've been using a value of k=5, which means that the model is trained on 4 subsets and tested on the 5th subset.

bash
# Try this
# Install the required libraries
pip install pandas

# Run the example code
python example_code.py

Sources:

LLM Accuracy Over Time
90%90%92%92%94.2%94.2%
Data from the sources listed below.