SmolLM2-1.7B-Instruct-Sports-Analytics

This model is a high-accuracy, parameter-efficient domain-specialized version of HuggingFaceTB/SmolLM2-1.7B-Instruct adapted into a specialized Sports Knowledge and Sports Analytics Assistant. It was fine-tuned using QLoRA (rank-32 adapters on all linear layers) with strict response-only completion masking.

Model Details

  • Model Architecture: SmolLM2 (1.7 Billion Parameters, Transformer Decoder)
  • Base Model: HuggingFaceTB/SmolLM2-1.7B-Instruct
  • Methodology: QLoRA (4-bit NF4 quantized training fused into standalone FP16 weights via merge_and_unload())
  • LoRA Configuration: Rank $r=32$, Alpha $\alpha=64$, Dropout $0.05$
  • Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj (All Linear Layers)
  • Training Dataset: Smol-Sports-Instruct (2,000 training samples, 250 validation samples) combining:
    1. Factual Sports QA (Basketball, Soccer, American Football) from PedroCJardim/QASports
    2. Multi-Step Sports Analytics & Statistical Math (True Shooting %, Expected Goals differential, NFL Passer Rating, Win Percentage, Pythagorean Wins)
    3. General Alignment Regularization (Alpaca subset) to prevent catastrophic forgetting
  • Evaluation Dataset: 250 strictly held-out test samples with zero overlap and verified prompt masking
  • Training Budget: 300 steps (effective batch size: 8, 2,400 training samples seen), AdamW optimizer, cosine learning rate decay with 5% warmup

Quantitative Benchmark Results (250 Strictly Held-Out Samples)

Metric Base Model (SmolLM2-1.7B-Instruct) Fine-Tuned Sports Model Absolute Delta Relative Delta
Average Loss 1.5818 0.4500 -1.1317 -71.55%
Perplexity 4.8635 1.5684 -3.2952 -67.75%
Token-Level Accuracy 67.97% 87.15% +19.18% +28.21%

Note: Token-Level Accuracy measures next-token prediction under teacher-forcing over valid assistant response tokens only.

How to Use

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_id = "your-username/SmolLM2-1.7B-Instruct-Sports-Analytics"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.float16,
    device_map="auto"
)

prompt = "Calculate the True Shooting Percentage (TS%) for an NBA player who scored 32 points on 20 field goal attempts and 10 free throw attempts. Show all steps."
messages = [
    {"role": "system", "content": "You are an expert sports analyst and statistician. Provide accurate factual answers, comprehensive statistical breakdowns, and clear domain insights."},
    {"role": "user", "content": prompt}
]

inputs = tokenizer(tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True), return_tensors="pt").to(model.device)
prompt_len = inputs["input_ids"].shape[1]

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=256,
        temperature=0.7,
        top_p=0.9,
        pad_token_id=tokenizer.eos_token_id
    )

response = tokenizer.decode(outputs[0][prompt_len:], skip_special_tokens=True).strip()
print(response)

Limitations & Scope

  • Factual sports data represents information up to the respective dataset benchmarks; real-time in-season scores or player trades require retrieval-augmented generation (RAG).
  • Statistical formulas assume official standard league definitions (e.g. FIBA vs NBA 3-point distances, NFL passer rating formula coefficient caps).
Downloads last month
-
Safetensors
Model size
2B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Salmahaitham/SmolLM2-Sports-Analytics

Adapter
(74)
this model

Datasets used to train Salmahaitham/SmolLM2-Sports-Analytics