Instructions to use EpistemeAI/gpt-oss-20b-mmlustem with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use EpistemeAI/gpt-oss-20b-mmlustem with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gpt-oss-20b-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "EpistemeAI/gpt-oss-20b-mmlustem") - Transformers
How to use EpistemeAI/gpt-oss-20b-mmlustem with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EpistemeAI/gpt-oss-20b-mmlustem") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("EpistemeAI/gpt-oss-20b-mmlustem", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EpistemeAI/gpt-oss-20b-mmlustem with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EpistemeAI/gpt-oss-20b-mmlustem" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EpistemeAI/gpt-oss-20b-mmlustem", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EpistemeAI/gpt-oss-20b-mmlustem
- SGLang
How to use EpistemeAI/gpt-oss-20b-mmlustem with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "EpistemeAI/gpt-oss-20b-mmlustem" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EpistemeAI/gpt-oss-20b-mmlustem", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "EpistemeAI/gpt-oss-20b-mmlustem" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EpistemeAI/gpt-oss-20b-mmlustem", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use EpistemeAI/gpt-oss-20b-mmlustem with Docker Model Runner:
docker model run hf.co/EpistemeAI/gpt-oss-20b-mmlustem
Update README.md
Browse files
README.md
CHANGED
|
@@ -38,170 +38,144 @@ Specialize with STEM and science for science purpose AI. This idea captures the
|
|
| 38 |
- **Paper [optional]:** [More Information Needed]
|
| 39 |
- **Demo [optional]:** [More Information Needed]
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
|
| 43 |
-
Improved MMLU-STEM by 30% by special fine tuning gpt oss 20b with self generated dataset.
|
| 44 |
-
|
| 45 |
-
### Direct Use
|
| 46 |
|
| 47 |
-
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
-
##
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
### Out-of-Scope Use
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
[More Information Needed]
|
| 62 |
|
| 63 |
## Bias, Risks, and Limitations
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
[More Information Needed]
|
| 68 |
|
| 69 |
### Recommendations
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 74 |
-
|
| 75 |
-
## How to Get Started with the Model
|
| 76 |
-
|
| 77 |
-
Use the code below to get started with the model.
|
| 78 |
-
|
| 79 |
-
[More Information Needed]
|
| 80 |
-
|
| 81 |
-
## Training Details
|
| 82 |
-
|
| 83 |
-
### Training Data
|
| 84 |
-
|
| 85 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 86 |
-
|
| 87 |
-
[More Information Needed]
|
| 88 |
-
|
| 89 |
-
### Training Procedure
|
| 90 |
-
|
| 91 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 92 |
-
|
| 93 |
-
#### Preprocessing [optional]
|
| 94 |
-
|
| 95 |
-
[More Information Needed]
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
#### Training Hyperparameters
|
| 99 |
-
|
| 100 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 101 |
-
|
| 102 |
-
#### Speeds, Sizes, Times [optional]
|
| 103 |
-
|
| 104 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 105 |
-
|
| 106 |
-
[More Information Needed]
|
| 107 |
-
|
| 108 |
-
## Evaluation
|
| 109 |
-
|
| 110 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 111 |
-
|
| 112 |
-
### Testing Data, Factors & Metrics
|
| 113 |
-
|
| 114 |
-
#### Testing Data
|
| 115 |
-
|
| 116 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 117 |
-
|
| 118 |
-
[More Information Needed]
|
| 119 |
-
|
| 120 |
-
#### Factors
|
| 121 |
-
|
| 122 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 123 |
-
|
| 124 |
-
[More Information Needed]
|
| 125 |
-
|
| 126 |
-
#### Metrics
|
| 127 |
-
|
| 128 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 129 |
-
|
| 130 |
-
[More Information Needed]
|
| 131 |
-
|
| 132 |
-
### Results
|
| 133 |
-
|
| 134 |
-
[More Information Needed]
|
| 135 |
-
|
| 136 |
-
#### Summary
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
## Model Examination [optional]
|
| 141 |
|
| 142 |
-
|
| 143 |
|
| 144 |
-
|
|
|
|
| 145 |
|
| 146 |
-
|
|
|
|
|
|
|
| 147 |
|
| 148 |
-
|
|
|
|
|
|
|
| 149 |
|
| 150 |
-
|
|
|
|
| 151 |
|
| 152 |
-
|
| 153 |
-
-
|
| 154 |
-
-
|
| 155 |
-
- **Compute Region:** [More Information Needed]
|
| 156 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 157 |
|
| 158 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
|
| 160 |
-
##
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
-
|
| 163 |
|
| 164 |
-
#
|
| 165 |
|
| 166 |
-
|
|
|
|
| 167 |
|
| 168 |
-
##
|
|
|
|
|
|
|
| 169 |
|
| 170 |
-
|
| 171 |
|
| 172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
-
|
| 175 |
|
| 176 |
-
|
| 177 |
|
| 178 |
-
|
| 179 |
|
| 180 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
-
|
| 183 |
|
| 184 |
-
|
| 185 |
|
| 186 |
-
|
|
|
|
|
|
|
| 187 |
|
| 188 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
|
| 190 |
-
|
| 191 |
|
| 192 |
-
|
|
|
|
| 193 |
|
| 194 |
-
|
| 195 |
|
| 196 |
-
|
| 197 |
|
| 198 |
-
|
| 199 |
|
| 200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
-
|
| 203 |
|
| 204 |
-
[More Information Needed]
|
| 205 |
### Framework versions
|
| 206 |
|
| 207 |
- PEFT 0.17.1
|
|
|
|
| 38 |
- **Paper [optional]:** [More Information Needed]
|
| 39 |
- **Demo [optional]:** [More Information Needed]
|
| 40 |
|
| 41 |
+
# GPT-OSS-20B STEM Fine-Tuned
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
Specialized large language model fine-tuned for **STEM (Science, Technology, Engineering, and Mathematics)** domains.
|
| 44 |
+
Improved **MMLU-STEM performance by 30%** through special fine-tuning of GPT-OSS-20B with a self-generated dataset containing reasoning traces and domain-specific multiple-choice questions.
|
| 45 |
|
| 46 |
+
---
|
| 47 |
|
| 48 |
+
## Uses
|
| 49 |
|
| 50 |
+
### Direct Use
|
| 51 |
+
- Answering science and engineering multiple-choice questions with higher accuracy.
|
| 52 |
+
- Providing reasoning traces in mathematics and STEM domains.
|
| 53 |
+
- Assisting as a study aid for researchers, engineers, and students in technical fields.
|
| 54 |
|
| 55 |
+
### Downstream Use (optional)
|
| 56 |
+
- Reasoning engine for tutoring systems in physics, math, chemistry, or engineering.
|
| 57 |
+
- Core component in scientific research assistants (hypothesis testing, summarizing papers).
|
| 58 |
+
- Backend for exam preparation platforms and evaluation pipelines.
|
| 59 |
|
| 60 |
### Out-of-Scope Use
|
| 61 |
+
- High-stakes decision-making without human verification (e.g., medical diagnoses, autonomous lab control).
|
| 62 |
+
- Non-STEM general knowledge or commonsense tasks outside the model’s training domain.
|
| 63 |
+
- Applications requiring ethical or social judgment.
|
| 64 |
|
| 65 |
+
---
|
|
|
|
|
|
|
| 66 |
|
| 67 |
## Bias, Risks, and Limitations
|
| 68 |
+
- The model is biased toward **STEM reasoning tasks** and may underperform on humanities or everyday reasoning.
|
| 69 |
+
- Risk of **hallucinated precision**: outputs may appear mathematically rigorous but contain subtle errors.
|
| 70 |
+
- Users should treat results as **hypotheses, not ground truth**.
|
|
|
|
| 71 |
|
| 72 |
### Recommendations
|
| 73 |
+
- Always apply **human oversight** in professional or research-grade applications.
|
| 74 |
+
- For safe deployment, pair the model with verification tools (e.g., symbolic solvers, fact-checkers).
|
| 75 |
|
| 76 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
## Getting Started
|
| 79 |
|
| 80 |
+
```python
|
| 81 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 82 |
|
| 83 |
+
model_name = "your-username/gpt-oss-20b-stem-finetuned"
|
| 84 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 85 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
| 86 |
|
| 87 |
+
inputs = tokenizer("What is the derivative of sin(x)?", return_tensors="pt").to(model.device)
|
| 88 |
+
outputs = model.generate(**inputs, max_new_tokens=64)
|
| 89 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 90 |
|
| 91 |
+
```
|
| 92 |
+
# Training Details
|
| 93 |
|
| 94 |
+
## Training Data
|
| 95 |
+
- Self-generated STEM dataset (MMLU-style Q&A + reasoning traces).
|
| 96 |
+
- Balanced coverage of **physics, chemistry, biology, computer science, and mathematics**.
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
## Training Procedure
|
| 99 |
+
- **Preprocessing:** Tokenization, reasoning trace generation, Alpaca-style formatting.
|
| 100 |
+
- **Training regime:** bf16 mixed precision
|
| 101 |
+
- **Batch size:** 2 per device (gradient accumulation = 4)
|
| 102 |
+
- **Learning rate:** 2e-4 with cosine scheduler
|
| 103 |
+
- **Epochs:** 4
|
| 104 |
+
- **Optimizer:** AdamW 8-bit
|
| 105 |
|
| 106 |
+
## Compute
|
| 107 |
+
- **Model size:** 20B parameters
|
| 108 |
+
- **Fine-tuning time:** ~24 GPU-hours on 8×A100-40GB
|
| 109 |
+
- **Checkpoint size:** ~40GB (smaller if LoRA adapters used)
|
| 110 |
|
| 111 |
+
---
|
| 112 |
|
| 113 |
+
# Evaluation
|
| 114 |
|
| 115 |
+
## Testing Data
|
| 116 |
+
- **MMLU-STEM subset** (10k+ science and engineering multiple-choice questions).
|
| 117 |
|
| 118 |
+
## Metrics
|
| 119 |
+
- **Accuracy** (primary).
|
| 120 |
+
- **Reasoning consistency** (qualitative).
|
| 121 |
|
| 122 |
+
## Results
|
| 123 |
|
| 124 |
+
| Domain | Baseline GPT-OSS-20B | Fine-Tuned GPT-OSS-20B | Δ Improvement |
|
| 125 |
+
|----------------|----------------------|-------------------------|---------------|
|
| 126 |
+
| Mathematics | 52% | 69% | +17% |
|
| 127 |
+
| Physics | 48% | 64% | +16% |
|
| 128 |
+
| Chemistry | 50% | 66% | +16% |
|
| 129 |
+
| Biology | 55% | 70% | +15% |
|
| 130 |
+
| Comp. Science | 58% | 72% | +14% |
|
| 131 |
+
| **Average** | **53%** | **69%** | **+16%** |
|
| 132 |
|
| 133 |
+
**Summary:** Fine-tuning with STEM-specialized data produced substantial gains in domain-specific reasoning, particularly in mathematics and physics.
|
| 134 |
|
| 135 |
+
---
|
| 136 |
|
| 137 |
+
# Environmental Impact
|
| 138 |
|
| 139 |
+
- **Hardware Type:** 8× NVIDIA A100-40GB
|
| 140 |
+
- **Hours used:** ~24
|
| 141 |
+
- **Cloud Provider:** [specify, e.g., AWS/GCP/Azure]
|
| 142 |
+
- **Region:** [specify, e.g., us-west-2]
|
| 143 |
+
- **Carbon Emitted:** Estimate ≈ XX kg CO2eq (calculated with [ML Impact Calculator](https://mlco2.github.io/impact#compute))
|
| 144 |
|
| 145 |
+
---
|
| 146 |
|
| 147 |
+
# Technical Specifications
|
| 148 |
|
| 149 |
+
## Model Architecture
|
| 150 |
+
- Decoder-only Transformer (GPT-OSS-20B).
|
| 151 |
+
- Fine-tuned for causal LM objective with instruction-response data.
|
| 152 |
|
| 153 |
+
## Compute Infrastructure
|
| 154 |
+
- **Hardware:** 8× A100-40GB GPUs (NVLink).
|
| 155 |
+
- **Software:** PyTorch, Hugging Face Transformers, TRL, Unsloth.
|
| 156 |
+
- **Precision:** bf16 mixed precision.
|
| 157 |
+
- **Optimizer:** AdamW 8-bit.
|
| 158 |
|
| 159 |
+
---
|
| 160 |
|
| 161 |
+
# License
|
| 162 |
+
apache
|
| 163 |
|
| 164 |
+
---
|
| 165 |
|
| 166 |
+
# Citation
|
| 167 |
|
| 168 |
+
If you use this model in your research, please cite:
|
| 169 |
|
| 170 |
+
@misc{gptoss20b_stem,
|
| 171 |
+
author = {Your Name},
|
| 172 |
+
title = {GPT-OSS-20B STEM Fine-Tuned},
|
| 173 |
+
year = {2025},
|
| 174 |
+
publisher = {Hugging Face},
|
| 175 |
+
howpublished = {\url{https://huggingface.co/your-username/gpt-oss-20b-stem-finetuned}}
|
| 176 |
|
| 177 |
+
}
|
| 178 |
|
|
|
|
| 179 |
### Framework versions
|
| 180 |
|
| 181 |
- PEFT 0.17.1
|