Downloads · 30 days
18
2% of all-time downloads
matsant01/STEMerald-2b
STEMerald-2b is a text generation model from matsant01. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
18
2% of all-time downloads
All-time downloads
1.1K
Public
Parameters
2.5B
10 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors10 GB · 100%
From the Hugging Face model README
Model name: STEMerald-2b
Model description: STEMerald-2b is a fine-tuned version of the Gemma-2b model, designed specifically for answering university-level STEM multiple-choice questions. This model leverages advanced fine-tuning techniques, including Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO), to enhance its accuracy and reliability in providing educational support.
<p align="center"> <img src="STEMerald_pic.jpeg" alt="STEMerald picture" width="400"/> </p>Base Model: Gemma-2b
Architecture: Decoder-only Language Model (Causal)
Parameters: 2.51 billion
Quantized Version: STEMerald-2b-4bit (with 4-bit NormalFloat)
Training Framework: PyTorch with Hugging Face Transformers
The model was fine-tuned on a variety of datasets tailored for STEM education, including:
The training process for STEMerald-2b involved multiple steps:
The performance of STEMerald-2b was evaluated using various metrics:
| Model Version | Accuracy (Non-Quantized) | Accuracy (Quantized) |
|---|---|---|
| it-ORCA-DPO-MCQA (STEMerald-2b) | 0.750 | 0.720 |
| it-DPO-MCQA | 0.744 | 0.720 |
| it-MCQA | 0.736 | 0.700 |
| it-ORCA-MCQA | 0.722 | 0.714 |
| MCQA | 0.702 | 0.654 |
| DPO-MCQA | 0.694 | 0.674 |
| Gemma-it-OneShot | 0.546 | 0.520 |
| Gemma-it | 0.518 | 0.518 |
Micro-averaged accuracy over three MCQA test sets(EPFL MCQA, ScienceQA and ARC).
STEMerald-2b can be utilized as a STEM course assistant, providing support in areas such as:
While STEMerald-2b aims to provide accurate and helpful responses, it is important to consider potential ethical implications:
STEMerald-2b offers a promising solution for enhancing STEM education through advanced language model capabilities. By leveraging fine-tuning techniques and comprehensive datasets, it aims to provide accurate and accessible learning support for students.
You can use the model directly with the transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("matsant01/STEMerald-2b")
model = AutoModelForCausalLM.from_pretrained("matsant01/STEMerald-2b")
input_text = "Question: What is the derivative of x^2? \nOptions: A. 4x B. 2*x^2 C. 2x D. 2\nAnswer:"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
For the quantized version, use:
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_quant_type="nf4"
)
tokenizer = AutoTokenizer.from_pretrained("matsant01/STEMerald-2b-4bit")
model = AutoModelForCausalLM.from_pretrained("matsant01/STEMerald-2b-4bit", quantization_config=quantization_config)
We acknowledge the contributions of the EPFL and Stack Exchange communities for their invaluable datasets, and the Hugging Face team for their support and tools that made this project possible.
For any questions or feedback, please contact: