CoolFace
Modelpublic

Nishef/SmolLM2-360M-Full_ENHANCED_KTO_20251225_074953-merged

sourceHugging Faceapache-2.0updated 9mo agoView on Hugging Face
0likes20downloads
Model Card

SmolLM2-360M - Enhanced KTO

<div align="center"> <img src="thesisplots/benchmarkresults.png" alt="Benchmark Results" width="700"/> </div>

Model Description

This model is a Merged Standalone Model fine-tuned from HuggingFaceTB/SmolLM2-360M using Enhanced KTO (Kahneman-Tversky Optimization) with authentic Prospect Theory components.

This model was developed as part of thesis research on LLM Alignment using Preference Optimization Methods.

Model Details

PropertyValue
Base ModelHuggingFaceTB/SmolLM2-360M
Training MethodEnhanced KTO
Model TypeMerged Standalone Model
Training DateDecember 2025
FrameworkPyTorch + Transformers + PEFT

Benchmark Results

BenchmarkScore
HellaSwag (10-shot)0.496
TruthfulQA (0-shot MC2)0.390
MMLU-Mini (5-shot)0.289

Enhanced KTO Components

This implementation incorporates multiple Prospect Theory-inspired components:

ComponentStatusDescription
Value FunctionActiveAsymmetric loss treatment reflecting loss aversion (losses weighted ~2x gains)
Probability WeightingActiveNon-linear transformation of model confidence scores
Odds Ratio IntegrationActiveORPO-inspired reference-free preference modeling
BCO ShiftImplemented but DisabledBaseline-corrected optimization (see note below)

Note on BCO Shift

The BCO (Baseline-Corrected Optimization) Shift component was fully implemented in the codebase following the approach described in recent preference optimization literature. However, it was disabled for final training due to the following observations during hyperparameter tuning:

  1. 1.Training Instability: Enabling BCO Shift in conjunction with the Value Function and Probability Weighting led to gradient instability in approximately 40% of training runs
  2. 2.No Significant Improvement: Preliminary experiments did not show meaningful performance gains when BCO was enabled
  3. 3.Complexity Trade-off: The added complexity did not justify the marginal (and inconsistent) benefits

The BCO Shift code remains in the implementation for transparency and future research. We hypothesize that a staged training approach (enabling BCO after initial convergence) or component-specific gradient clipping may enable stable integration.

Training Plots

Training Loss Curve

[image]

Rewards During Training

[image]

KL Divergence

[image]

Learning Rate Schedule

[image]

Training Configuration

ParameterValue
Epochs1
Batch Size2
Gradient Accumulation8
Effective Batch Size16
Learning Rate2e-4
Max Sequence Length512
LoRA Rank16
LoRA Alpha32
DatasetCombined Preference Dataset (HH-RLHF + SHP + OpenAssistant)
Beta (KTO)0.1

Combined Preference Dataset (kto_combined)

Training uses a Combined Preference Dataset built via Round-Robin Sampling from three sources:

SourceTotal SamplesInteractions
Anthropic HH-RLHF321,60061,568
Stanford Human Preferences (SHP)697,43638,984
OpenAssistant Conversations v116,8108,904
Total1,035,846109,456

Actual Training Statistics (subset split `train_prefs[:32090]`):

  • —Training samples: 13,300 (paired examples)
  • —Validation samples: 700 (5%)
  • —Round-Robin distribution: 1,130 interactions per source
  • —Seed: 42 (for reproducibility)

Usage

Direct Loading (Merged Model)

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("Nishef/SmolLM2-360M-Full_ENHANCED_KTO_20251225_074953")
tokenizer = AutoTokenizer.from_pretrained("Nishef/SmolLM2-360M-Full_ENHANCED_KTO_20251225_074953")

# Generate text
inputs = tokenizer("Hello, how are you?", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0]))

Methodology

Enhanced KTO vs Standard KTO

Enhanced KTO extends the standard KTO algorithm by incorporating additional components from Kahneman and Tversky's Prospect Theory:

  1. 1.Value Function: Standard KTO treats gains and losses symmetrically. Enhanced KTO applies an asymmetric value function where losses are weighted approximately 2x more than equivalent gains, reflecting the psychological phenomenon of loss aversion.
  1. 1.Probability Weighting: Instead of using raw model probabilities, Enhanced KTO applies a non-linear weighting function that overweights small probabilities and underweights large ones, as observed in human decision-making.
  1. 1.Odds Ratio: Borrowing from ORPO, the odds ratio component provides reference-free preference modeling, reducing memory requirements while maintaining alignment quality.

Citation

bibtex
@misc{smollm2_360m_enhanced_kto_2025,
  title = {SmolLM2-360M Fine-tuned with Enhanced KTO},
  author = {Thesis Research},
  year = {2025},
  publisher = {HuggingFace},
  note = {BCO Shift implemented but disabled for stability},
  url = {https://huggingface.co/Nishef/SmolLM2-360M-Full_ENHANCED_KTO_20251225_074953}
}

Acknowledgments

License

Apache 2.0


This model was created as part of thesis research on LLM alignment using preference optimization methods.