Edit model card

Model Card for SmolLM-360M-Instruct-finetuned-sft

This is a fine-tuned version of the SmolLM-360M model, optimized for instruction-following tasks. The model has been trained using the HelpSteer2 dataset to generate accurate, contextually appropriate, and helpful responses. The fine-tuning was performed on an NVIDIA A100 GPU, enabling efficient training.

Model Details

Model Description

The SmolLM-360M-Instruct-finetuned-sft model is a compact language model part of the SmolLM family, designed for computational efficiency and strong performance across various tasks. This specific version has been fine-tuned to excel at instruction-following scenarios, making it ideal for applications requiring clear and coherent responses based on detailed prompts.

  • Developed by: Hugging Face and fine-tuned by Amir Mohseni
  • Model type: Language Model
  • Language(s) (NLP): English
  • License: Apache 2.0
  • Finetuned from model: SmolLM-360M

Model Sources

Performance Improvements After Fine-Tuning

The fine-tuning process was evaluated using the NVIDIA Nemotron-4-340B-Reward model, which assesses AI-generated responses on five key attributes: helpfulness, correctness, coherence, complexity, and verbosity. Based on this reward model, the fine-tuning resulted in the following performance boosts:

  • Helpfulness: Increased from 0.413 to 0.576.
  • Correctness: Increased from 0.521 to 0.829.
  • Coherence: Slight decrease from 2.424 to 2.411.
  • Complexity: Decreased from 1.048 to 0.881.
  • Verbosity: Decreased from 1.348 to 1.040.

These results indicate that the fine-tuning process generally improved the model's ability to generate more helpful and correct responses, while making the outputs slightly less complex and verbose. The decrease in coherence is minimal, suggesting that the overall logical consistency of the responses remains strong.

image/png

Uses

Direct Use

The model can be directly used for generating coherent and contextually relevant responses to a wide range of prompts, particularly in scenarios where instruction-following is essential.

Out-of-Scope Use

This model should not be used for tasks that require deep reasoning or extensive context beyond the given prompt. Additionally, it is not suitable for applications requiring highly specialized knowledge unless further fine-tuned on relevant data.

Bias, Risks, and Limitations

As with all language models, this model may reflect biases present in its training data. Users should exercise caution when deploying the model in sensitive contexts and should consider further fine-tuning or bias mitigation strategies if needed.

How to Get Started with the Model

Use the code below to get started with the model:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "AmirMohseni/SmolLM-360M-Instruct-finetuned-sft"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

# Example usage
prompt = "Explain the process of photosynthesis."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)

Training Details

Training Data

The model was fine-tuned using the HelpSteer2 dataset, which consists of approximately 21,400 examples of instruction-based prompts and corresponding responses. The dataset is designed to enhance AI models' ability to generate helpful, correct, and coherent outputs.

Training Procedure

The fine-tuning was performed using the following hyperparameters:

  • Training regime: Mixed precision (FP16)
  • Epochs: 3
  • Learning Rate: 1e-5
  • Batch Size: 4 (per device for both training and evaluation)
  • Gradient Accumulation Steps: 2
  • Weight Decay: 0.01
  • Hardware: NVIDIA A100 GPU

Evaluation

Testing Data, Factors & Metrics

The model was evaluated using a validation subset of the HelpSteer2 dataset.

Metrics

  • Training Loss: Final loss was 5.4814.
  • Validation Loss: Final loss was 5.4625.

Results

The model demonstrated a consistent decrease in both training and validation losses, indicating effective learning and good generalization.

Environmental Impact

Carbon emissions for the training process were minimal due to the efficient use of the NVIDIA A100 GPU, which allowed for rapid fine-tuning within an hour.

  • Hardware Type: NVIDIA A100 GPU
  • Hours used: 1 hour
Downloads last month
2
Safetensors
Model size
362M params
Tensor type
F32
·
Inference Examples
Inference API (serverless) is not available, repository is disabled.

Dataset used to train AmirMohseni/SmolLM-360M-Instruct-finetuned-sft