Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LLM Classification Finetuning

kaggle_66631_logos_header

Context & Objective

This notebook performs an in-depth Exploratory Data Analysis (EDA) on the LLM Chatbot Arena dataset from Kaggle. The goal is to understand the structure of the data, and identify patterns that influence human preference between two model responses.

Notebook Structure & Workflow

  1. Data Loading & Inspection: Loading training and test data, exploring basic statistics and missing values.
  2. Text Parsing & Feature Extraction: Parsing JSON-like prompt and response fields, computing text lengths and basic quality signals.
  3. Target Variable Analysis: Distribution of winners (model_a, model_b, tie) and class balance.
  4. Prompt & Response Length Analysis: Length distributions, length difference between responses, and its correlation with the winner.
  5. Baseline Model: A simple TF-IDF + Logistic Regression baseline with log loss evaluation.
  6. Submission Generation: Predicting probabilities and saving the submission file.

Key Insights

  • The dataset is reasonably balanced between model_a, model_b, and tie, but ties are often the hardest class to predict.
  • Response length difference is a strong signal: longer responses tend to win more often, but this is not a universal rule.
  • Prompt length varies widely, meaning models must handle both short and long contexts effectively.
  • Semantic quality and relevance (not just length) are likely the real drivers of preference.

Key takeaway:

A strong model should combine semantic understanding of prompt-response pairs with relative comparison features.

Tech Stack & Libraries

  • Language: Python

  • Data Manipulation: Pandas

  • Text Processing: scikit-learn JSON

  • Visualization: Matplotlib Seaborn

  • Modeling: Logistic Regression

  • Environment: Jupyter Notebook Kaggle


To explore the detailed code, feel free to download the notebook file on this repo, or check out my Kaggle.

About

The goal here is to predict which chatbot response users will prefer in a head-to-head comparison. The analysis covers data structure, model and label distributions, and text-length characteristics.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages