AmirMohseni's picture
Update README.md
ed742ed verified
|
raw
history blame
4.93 kB

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

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-v2 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 improvements:

  • Helpfulness: Increased from 0.4343 to 0.6166.
  • Correctness: Increased from 0.5546 to 0.8130.
  • Coherence: Increased from 2.4018 to 2.5711.
  • Complexity: Decreased from 1.0023 to 0.9118.
  • Verbosity: Decreased from 1.4032 to 1.1779.

These results indicate that the fine-tuning process improved the model's ability to generate more helpful, correct, and coherent responses. The reduction in complexity and verbosity means that the model's outputs are easier to understand and use fewer words to convey the same message, which is a positive improvement.

Difference in Average Ratings Before and After Fine-tuning

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-v2"
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: 5
  • Learning Rate: 1e-5
  • Batch Size: 16 (per device for both training and evaluation)
  • Gradient Accumulation Steps: 4
  • Weight Decay: 0.02
  • Hardware: NVIDIA A100 GPU

Evaluation

Metrics

  • Training Loss: Final loss was 4.3768.
  • Validation Loss: Final loss was 4.1602.

Results

The model demonstrated a consistent decrease in both training and validation losses over the epochs, 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 a few hours.

  • Hardware Type: NVIDIA A100 GPU
  • Hours used: 1 hour