PhillipGre/llama2-7b-sctt-classification
Llama-2-7b-chat-hf SCTT Creativity Classifier
A LoRA fine-tuned Llama-2-7b-chat-hf model for pairwise creativity ranking using sequence classification.
Model Details
- Base model:
meta-llama/Llama-2-7b-chat-hf - Fine-tuning method: LoRA (PEFT) via curriculum learning (SCTT — 3 phases, 10 epochs)
- Task: 3-class pairwise classification — predict which of two responses (A / B / Equal) is more creative
- Labels:
0=A,1=B,2=Equal
ELO Ranking Results
Pairwise classification outputs are converted into continuous creativity scores via an adaptive ELO rating system. For each item (prompt), all response pairs are repeatedly sampled and the classifier's A/B/Equal verdict drives standard ELO updates with tie support. A linearly decaying K-factor (high → low) ensures fast initial separation followed by stable convergence. Iteration stops when Pearson r against human ground-truth plateaus (patience-based early stopping). The final ELO ratings are min-max normalised to [0, 1] per item.
The choice of ranking algorithm is flexible. Any ranking method will work as long as it consumes this model's pairwise classification outputs (A/B/Equal) as input.
Usage
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("PhillipGre/llama2-7b-sctt-classification")
base_model = AutoModelForSequenceClassification.from_pretrained(
"meta-llama/Llama-2-7b-chat-hf",
num_labels=3,
torch_dtype=torch.bfloat16,
device_map="auto",
)
base_model.resize_token_embeddings(len(tokenizer))
base_model.config.pad_token_id = tokenizer.pad_token_id
model = PeftModel.from_pretrained(base_model, "PhillipGre/llama2-7b-sctt-classification")
model = model.merge_and_unload()
model.eval()
prompt = "experiment: testing bird's understanding of human speech\nA: response one\nB: response two"
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=180)
with torch.no_grad():
logits = model(**inputs).logits
label_map = {0: "A", 1: "B", 2: "Equal"}
print(label_map[logits.argmax().item()])