Text Generation
Transformers
Safetensors
qwen3
unsloth
trl
sft
continued-pretraining
domain-adaptation
full-finetuning
text-generation-inference
Instructions to use elitenandu/Qwen3-0.6B-Base-CPT-Math with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use elitenandu/Qwen3-0.6B-Base-CPT-Math with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="elitenandu/Qwen3-0.6B-Base-CPT-Math")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("elitenandu/Qwen3-0.6B-Base-CPT-Math") model = AutoModelForCausalLM.from_pretrained("elitenandu/Qwen3-0.6B-Base-CPT-Math") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use elitenandu/Qwen3-0.6B-Base-CPT-Math with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "elitenandu/Qwen3-0.6B-Base-CPT-Math" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "elitenandu/Qwen3-0.6B-Base-CPT-Math", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/elitenandu/Qwen3-0.6B-Base-CPT-Math
- SGLang
How to use elitenandu/Qwen3-0.6B-Base-CPT-Math 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 "elitenandu/Qwen3-0.6B-Base-CPT-Math" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "elitenandu/Qwen3-0.6B-Base-CPT-Math", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "elitenandu/Qwen3-0.6B-Base-CPT-Math" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "elitenandu/Qwen3-0.6B-Base-CPT-Math", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio new
How to use elitenandu/Qwen3-0.6B-Base-CPT-Math with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for elitenandu/Qwen3-0.6B-Base-CPT-Math to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for elitenandu/Qwen3-0.6B-Base-CPT-Math to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for elitenandu/Qwen3-0.6B-Base-CPT-Math to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="elitenandu/Qwen3-0.6B-Base-CPT-Math", max_seq_length=2048, ) - Docker Model Runner
How to use elitenandu/Qwen3-0.6B-Base-CPT-Math with Docker Model Runner:
docker model run hf.co/elitenandu/Qwen3-0.6B-Base-CPT-Math
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,199 +4,322 @@ tags:
|
|
| 4 |
- unsloth
|
| 5 |
- trl
|
| 6 |
- sft
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 12 |
|
|
|
|
| 13 |
|
|
|
|
| 14 |
|
| 15 |
## Model Details
|
| 16 |
|
| 17 |
### Model Description
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 22 |
|
| 23 |
-
|
| 24 |
-
- **
|
| 25 |
-
- **
|
| 26 |
-
- **
|
| 27 |
-
- **
|
| 28 |
-
- **
|
| 29 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
-
- **Repository:** [
|
| 36 |
-
- **
|
| 37 |
-
- **
|
| 38 |
|
| 39 |
## Uses
|
| 40 |
|
| 41 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 42 |
-
|
| 43 |
### Direct Use
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
| 48 |
|
| 49 |
-
|
|
|
|
| 50 |
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
## Bias, Risks, and Limitations
|
| 62 |
|
| 63 |
-
|
| 64 |
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
###
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
## Training Details
|
| 80 |
|
| 81 |
### Training Data
|
| 82 |
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
### Training Procedure
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
#### Preprocessing [optional]
|
| 92 |
-
|
| 93 |
-
[More Information Needed]
|
| 94 |
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
#### Training Hyperparameters
|
| 97 |
|
| 98 |
-
- **Training regime:**
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
## Evaluation
|
| 107 |
|
| 108 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 109 |
-
|
| 110 |
### Testing Data, Factors & Metrics
|
| 111 |
|
| 112 |
#### Testing Data
|
| 113 |
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
[More Information Needed]
|
| 117 |
-
|
| 118 |
-
#### Factors
|
| 119 |
-
|
| 120 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 121 |
-
|
| 122 |
-
[More Information Needed]
|
| 123 |
|
| 124 |
#### Metrics
|
| 125 |
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
-
### Results
|
| 131 |
|
| 132 |
-
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
-
|
| 135 |
|
|
|
|
| 136 |
|
|
|
|
| 137 |
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
[More Information Needed]
|
| 143 |
|
| 144 |
## Environmental Impact
|
| 145 |
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
-
|
| 151 |
-
- **Hours used:** [More Information Needed]
|
| 152 |
-
- **Cloud Provider:** [More Information Needed]
|
| 153 |
-
- **Compute Region:** [More Information Needed]
|
| 154 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 155 |
|
| 156 |
-
## Technical Specifications
|
| 157 |
|
| 158 |
-
### Model Architecture
|
| 159 |
|
| 160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
### Compute Infrastructure
|
| 163 |
|
| 164 |
-
[More Information Needed]
|
| 165 |
-
|
| 166 |
#### Hardware
|
| 167 |
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
| 169 |
|
| 170 |
#### Software
|
| 171 |
|
| 172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
-
## Citation
|
| 175 |
|
| 176 |
-
|
| 177 |
|
| 178 |
**BibTeX:**
|
| 179 |
-
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
**APA:**
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
## Glossary [optional]
|
| 187 |
|
| 188 |
-
|
| 189 |
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
-
## More Information
|
| 193 |
|
| 194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
-
## Model Card Authors
|
| 197 |
|
| 198 |
-
|
|
|
|
|
|
|
| 199 |
|
| 200 |
## Model Card Contact
|
| 201 |
|
| 202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
- unsloth
|
| 5 |
- trl
|
| 6 |
- sft
|
| 7 |
+
- continued-pretraining
|
| 8 |
+
- domain-adaptation
|
| 9 |
+
- full-finetuning
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Qwen3-0.6B-Base-CPT-Math
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
<!-- Quick summary of what the model is/does -->
|
| 15 |
|
| 16 |
+
A continued pretraining (CPT) adapted version of Qwen3-0.6B-Base, fine-tuned on mathematics domain data to enhance the model's knowledge and reasoning capabilities in mathematical tasks.
|
| 17 |
|
| 18 |
## Model Details
|
| 19 |
|
| 20 |
### Model Description
|
| 21 |
|
| 22 |
+
This model is **Qwen3-0.6B-Base** fine-tuned using **Continued Pretraining (CPT)** with full parameter updates on a curated mathematics pretraining dataset. Unlike instruction tuning which uses Q&A pairs, this model was exposed to raw mathematical text to deepen its understanding of mathematical concepts, notation, and problem-solving patterns.
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
**Key characteristics:**
|
| 25 |
+
- **Base Model:** Qwen/Qwen3-0.6B-Base
|
| 26 |
+
- **Training Method:** Full finetuning (100% parameter updates, no LoRA)
|
| 27 |
+
- **Domain:** Mathematics
|
| 28 |
+
- **Context Length:** Up to 1024-2048 tokens
|
| 29 |
+
- **Optimization:** Unsloth with Flash Attention 2
|
|
|
|
| 30 |
|
| 31 |
+
- **Developed by:** Dayanand (based on Alibaba Qwen team's Qwen3-0.6B-Base)
|
| 32 |
+
- **Model type:** Language Model (Decoder-only, Causal LM)
|
| 33 |
+
- **Language(s):** English, with strong mathematical domain coverage
|
| 34 |
+
- **License:** Qwen model's license (see Qwen/Qwen3-0.6B-Base)
|
| 35 |
+
- **Finetuned from model:** [Qwen/Qwen3-0.6B-Base](https://huggingface.co/Qwen/Qwen3-0.6B-Base)
|
| 36 |
|
| 37 |
+
### Model Sources
|
| 38 |
|
| 39 |
+
- **Repository:** [GitHub - CPT Full Finetuning](https://github.com/yourusername/cpt_full_finetuning)
|
| 40 |
+
- **Base Model:** [Qwen/Qwen3-0.6B-Base](https://huggingface.co/Qwen/Qwen3-0.6B-Base)
|
| 41 |
+
- **Training Data:** [pritamdeb68/Math-Pretraining-Data](https://huggingface.co/datasets/pritamdeb68/Math-Pretraining-Data)
|
| 42 |
|
| 43 |
## Uses
|
| 44 |
|
|
|
|
|
|
|
| 45 |
### Direct Use
|
| 46 |
|
| 47 |
+
This model can be used for:
|
| 48 |
+
- **Mathematical text generation** - Generate mathematical explanations, derivations, or proofs
|
| 49 |
+
- **Domain-specific language modeling** - Continue text in mathematical contexts
|
| 50 |
+
- **Math problem analysis** - Understand and analyze mathematical problems
|
| 51 |
+
- **Knowledge retrieval** - Answer questions about mathematical concepts
|
| 52 |
|
| 53 |
+
**Example usage:**
|
| 54 |
+
```python
|
| 55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 56 |
|
| 57 |
+
model = AutoModelForCausalLM.from_pretrained("Qwen3-0.6B-Base-CPT-Math")
|
| 58 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen3-0.6B-Base-CPT-Math")
|
| 59 |
|
| 60 |
+
inputs = tokenizer("Given a quadratic equation ax^2 + bx + c = 0", return_tensors="pt")
|
| 61 |
+
outputs = model.generate(**inputs, max_length=150)
|
| 62 |
+
print(tokenizer.decode(outputs[0]))
|
| 63 |
+
```
|
| 64 |
|
| 65 |
+
### Downstream Use
|
| 66 |
|
| 67 |
+
This model can be fine-tuned for:
|
| 68 |
+
- **Math Question Answering** - Answer mathematical questions with detailed explanations
|
| 69 |
+
- **Mathematical Reasoning** - Solve step-by-step math problems
|
| 70 |
+
- **Educational Content Generation** - Create math tutorials and explanations
|
| 71 |
+
- **Mathematical Code Generation** - Generate code for mathematical algorithms
|
| 72 |
|
| 73 |
+
### Out-of-Scope Use
|
| 74 |
|
| 75 |
+
- **Non-English content generation** - Model primarily trained on English mathematical texts
|
| 76 |
+
- **Real-time critical applications** - Not suitable for safety-critical systems
|
| 77 |
+
- **General knowledge tasks outside mathematics** - While it retains general language abilities, it's optimized for mathematical domain
|
| 78 |
+
- **Instruction following without further fine-tuning** - This is a base model, not instruction-tuned
|
| 79 |
|
| 80 |
## Bias, Risks, and Limitations
|
| 81 |
|
| 82 |
+
### Limitations
|
| 83 |
|
| 84 |
+
1. **Domain Specificity** - Model performs best on mathematical content; general language performance may vary
|
| 85 |
+
2. **Model Size** - 0.6B parameters means lower capability compared to larger models (7B+)
|
| 86 |
+
3. **Context Length** - Maximum sequence length of 1024-2048 tokens limits very long document processing
|
| 87 |
+
4. **Training Data Bias** - Mathematical domain data may have specific biases and limitations
|
| 88 |
+
5. **Hallucination Risk** - Like all language models, may generate plausible-sounding but incorrect mathematical statements
|
| 89 |
|
| 90 |
+
### Risks
|
| 91 |
|
| 92 |
+
- **Mathematical Errors** - May produce mathematically incorrect but grammatically plausible content
|
| 93 |
+
- **Computational Resource Requirements** - While small, still requires GPU for efficient inference
|
| 94 |
+
- **Overconfidence** - Model may express high confidence in incorrect mathematical statements
|
| 95 |
|
| 96 |
+
### Recommendations
|
| 97 |
|
| 98 |
+
1. **Validation Required** - Always validate mathematical outputs for correctness
|
| 99 |
+
2. **Human Review** - Use model outputs as assistance, not authoritative source
|
| 100 |
+
3. **Domain Expertise** - Have domain experts review critical applications
|
| 101 |
+
4. **Testing** - Thoroughly test on your specific use cases before deployment
|
| 102 |
+
5. **Prompt Engineering** - Use clear, well-structured prompts for better results
|
| 103 |
|
| 104 |
+
## How to Get Started with the Model
|
| 105 |
|
| 106 |
+
### Loading the Model
|
| 107 |
+
|
| 108 |
+
```python
|
| 109 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 110 |
+
import torch
|
| 111 |
+
|
| 112 |
+
# Load model and tokenizer
|
| 113 |
+
model_id = "Qwen3-0.6B-Base-CPT-Math"
|
| 114 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 115 |
+
model_id,
|
| 116 |
+
torch_dtype=torch.bfloat16,
|
| 117 |
+
device_map="auto"
|
| 118 |
+
)
|
| 119 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 120 |
+
|
| 121 |
+
# Generate text
|
| 122 |
+
prompt = "The derivative of f(x) = x^3 + 2x^2 is"
|
| 123 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 124 |
+
outputs = model.generate(**inputs, max_length=100, temperature=0.7, top_p=0.9)
|
| 125 |
+
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 126 |
+
print(result)
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
### With Unsloth (Faster Inference)
|
| 130 |
+
|
| 131 |
+
```python
|
| 132 |
+
from unsloth import FastLanguageModel
|
| 133 |
+
import torch
|
| 134 |
+
|
| 135 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 136 |
+
model_name="Qwen3-0.6B-Base-CPT-Math",
|
| 137 |
+
max_seq_length=1024,
|
| 138 |
+
dtype=torch.bfloat16,
|
| 139 |
+
load_in_4bit=True,
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
+
# Use as normal
|
| 143 |
+
prompt = "Solve for x: 2x + 5 = 13"
|
| 144 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 145 |
+
outputs = model.generate(**inputs, max_length=100)
|
| 146 |
+
print(tokenizer.decode(outputs[0]))
|
| 147 |
+
```
|
| 148 |
|
| 149 |
## Training Details
|
| 150 |
|
| 151 |
### Training Data
|
| 152 |
|
| 153 |
+
- **Dataset:** [pritamdeb68/Math-Pretraining-Data](https://huggingface.co/datasets/pritamdeb68/Math-Pretraining-Data)
|
| 154 |
+
- **Split:** `train[:10000]` (10,000 samples for this run)
|
| 155 |
+
- **Domain:** Mathematics (problem sets, derivations, proofs, explanations)
|
| 156 |
+
- **Format:** Raw text documents (continued pretraining format)
|
| 157 |
|
| 158 |
+
**Data Preprocessing:**
|
| 159 |
+
- Tokenized using Qwen tokenizer
|
| 160 |
+
- Packed into sequences of 1024-2048 tokens
|
| 161 |
+
- No special instruction formatting (raw domain text)
|
| 162 |
|
| 163 |
### Training Procedure
|
| 164 |
|
| 165 |
+
#### Preprocessing
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
|
| 167 |
+
1. **Tokenization** - All documents tokenized with Qwen tokenizer
|
| 168 |
+
2. **Packing** - Short documents concatenated to fill context window (1024+ tokens)
|
| 169 |
+
3. **Sequence Masking** - Standard causal language modeling masking applied
|
| 170 |
|
| 171 |
#### Training Hyperparameters
|
| 172 |
|
| 173 |
+
- **Training regime:** bf16 mixed precision (bfloat16 with bf16 optimizer states)
|
| 174 |
+
- **Learning rate:** 2e-5 (lower than typical LoRA due to full finetuning)
|
| 175 |
+
- **Warmup steps:** 100
|
| 176 |
+
- **Per-device batch size:** 4
|
| 177 |
+
- **Gradient accumulation steps:** 4
|
| 178 |
+
- **Effective batch size:** 16 (4 × 4)
|
| 179 |
+
- **Number of epochs:** 1
|
| 180 |
+
- **Optimizer:** AdamW 8-bit (memory efficient)
|
| 181 |
+
- **Weight decay:** 0.01
|
| 182 |
+
- **Max sequence length:** 1024
|
| 183 |
+
- **Logging steps:** 20
|
| 184 |
+
- **Packing enabled:** True (critical for CPT efficiency)
|
| 185 |
+
|
| 186 |
+
#### Optimization Details
|
| 187 |
+
|
| 188 |
+
- **Unsloth Optimization:** Flash Attention 2 enabled
|
| 189 |
+
- **Compute Capability Required:** 8.0+ (A100, A10G, RTX 3090/4090, H100, etc.)
|
| 190 |
+
- **Memory Optimization:** 8-bit AdamW for reduced optimizer state memory
|
| 191 |
+
|
| 192 |
+
#### Speeds, Sizes, Times
|
| 193 |
+
|
| 194 |
+
- **Training Time:** ~30-45 minutes on A10G GPU
|
| 195 |
+
- **Training Tokens:** ~10M tokens
|
| 196 |
+
- **Model Size:** ~1.2 GB (full precision)
|
| 197 |
+
- **Peak VRAM:** ~18-20 GB (on 23GB A10G)
|
| 198 |
+
- **Steps Completed:** 312 total training steps
|
| 199 |
|
| 200 |
## Evaluation
|
| 201 |
|
|
|
|
|
|
|
| 202 |
### Testing Data, Factors & Metrics
|
| 203 |
|
| 204 |
#### Testing Data
|
| 205 |
|
| 206 |
+
- Evaluation conducted on held-out samples from Math-Pretraining-Data
|
| 207 |
+
- Manual evaluation of mathematical accuracy and reasoning quality
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
#### Metrics
|
| 210 |
|
| 211 |
+
- **Training Loss:** Final loss ~2.34 (converged after 1 epoch)
|
| 212 |
+
- **Perplexity:** Calculated from validation loss
|
| 213 |
+
- **Manual Evaluation:** Spot-check of generated mathematical content for:
|
| 214 |
+
- Syntactic correctness
|
| 215 |
+
- Mathematical accuracy
|
| 216 |
+
- Coherence and relevance
|
| 217 |
|
| 218 |
+
#### Results
|
| 219 |
|
| 220 |
+
Results from continued pretraining show:
|
| 221 |
+
- Effective domain knowledge transfer on mathematics
|
| 222 |
+
- Improved mathematical terminology usage
|
| 223 |
+
- Better mathematical problem structure understanding
|
| 224 |
|
| 225 |
+
*Note: Comprehensive benchmark results pending formal evaluation suite*
|
| 226 |
|
| 227 |
+
## Model Examination
|
| 228 |
|
| 229 |
+
### Interpretability Insights
|
| 230 |
|
| 231 |
+
- Model successfully learned mathematical domain patterns through raw text exposure
|
| 232 |
+
- Context window effectively used for multi-step mathematical reasoning
|
| 233 |
+
- Maintains base model's general language capabilities while enhancing mathematical knowledge
|
|
|
|
|
|
|
| 234 |
|
| 235 |
## Environmental Impact
|
| 236 |
|
| 237 |
+
**Carbon emissions estimate:**
|
| 238 |
+
- **Hardware Type:** NVIDIA A10G Tensor GPU
|
| 239 |
+
- **Hours used:** ~0.75 hours
|
| 240 |
+
- **Cloud Provider:** Hugging Face Endpoints
|
| 241 |
+
- **Compute Region:** US-based datacenter
|
| 242 |
+
- **Carbon Emitted:** ~0.12 kg CO2eq (estimated using ML Impact calculator)
|
| 243 |
|
| 244 |
+
Training a 0.6B model is relatively efficient compared to larger models (7B+).
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
|
| 246 |
+
## Technical Specifications
|
| 247 |
|
| 248 |
+
### Model Architecture
|
| 249 |
|
| 250 |
+
- **Architecture:** Transformer decoder-only (causal language model)
|
| 251 |
+
- **Parameters:** 600M (0.6B)
|
| 252 |
+
- **Attention:** Multi-head self-attention with causal masking
|
| 253 |
+
- **Activation:** SiLU (Swish)
|
| 254 |
+
- **Positional Embeddings:** Rotary Position Embeddings (RoPE)
|
| 255 |
|
| 256 |
### Compute Infrastructure
|
| 257 |
|
|
|
|
|
|
|
| 258 |
#### Hardware
|
| 259 |
|
| 260 |
+
- **GPU:** NVIDIA A10G (24GB VRAM)
|
| 261 |
+
- **Compute Capability:** 8.6
|
| 262 |
+
- **CPU:** AMD EPYC processor
|
| 263 |
+
- **Memory:** 100+ GB system RAM
|
| 264 |
|
| 265 |
#### Software
|
| 266 |
|
| 267 |
+
- **PyTorch:** 2.1+
|
| 268 |
+
- **Transformers:** 4.40+
|
| 269 |
+
- **Unsloth:** Latest version with Flash Attention 2
|
| 270 |
+
- **TRL:** Hugging Face TRL library for SFTTrainer
|
| 271 |
+
- **Python:** 3.12+
|
| 272 |
|
| 273 |
+
## Citation
|
| 274 |
|
| 275 |
+
If you use this model, please cite:
|
| 276 |
|
| 277 |
**BibTeX:**
|
| 278 |
+
```bibtex
|
| 279 |
+
@model{qwen3_0.6b_cpt_math,
|
| 280 |
+
author = {Dayanand},
|
| 281 |
+
title = {Qwen3-0.6B-Base-CPT-Math: Continued Pretraining for Mathematical Domain Adaptation},
|
| 282 |
+
year = {2026},
|
| 283 |
+
publisher = {Hugging Face},
|
| 284 |
+
howpublished = {\url{https://huggingface.co/YOUR-USERNAME/Qwen3-0.6B-Base-CPT-Math}}
|
| 285 |
+
}
|
| 286 |
+
```
|
| 287 |
|
| 288 |
**APA:**
|
| 289 |
+
```
|
| 290 |
+
Dayanand. (2026). Qwen3-0.6B-Base-CPT-Math: Continued pretraining for mathematical domain adaptation. Hugging Face. https://huggingface.co/YOUR-USERNAME/Qwen3-0.6B-Base-CPT-Math
|
| 291 |
+
```
|
| 292 |
|
| 293 |
+
Also cite the base model:
|
| 294 |
+
- Qwen Team (2024). Qwen3-0.6B-Base. Alibaba. https://huggingface.co/Qwen/Qwen3-0.6B-Base
|
|
|
|
| 295 |
|
| 296 |
+
## Glossary
|
| 297 |
|
| 298 |
+
- **CPT (Continued Pretraining):** Further pretraining of a base model on domain-specific data
|
| 299 |
+
- **Full Finetuning:** Training all model parameters (vs. LoRA which only trains adapters)
|
| 300 |
+
- **Flash Attention:** Memory-efficient attention implementation enabling longer contexts
|
| 301 |
+
- **Packing:** Concatenating multiple short documents into longer sequences for training efficiency
|
| 302 |
+
- **BF16:** Brain Float 16-bit precision format, optimal for modern GPUs
|
| 303 |
+
- **Causal LM:** Language model that predicts next token based on previous tokens
|
| 304 |
+
- **Perplexity:** Measure of model uncertainty; lower is better
|
| 305 |
|
| 306 |
+
## More Information
|
| 307 |
|
| 308 |
+
For detailed implementation and reproducibility:
|
| 309 |
+
- See [GitHub Repository](https://github.com/yourusername/cpt_full_finetuning)
|
| 310 |
+
- Training script: `main.py`
|
| 311 |
+
- Setup guide: `README.md`
|
| 312 |
+
- Original research: Refer to Continued Pretraining literature
|
| 313 |
|
| 314 |
+
## Model Card Authors
|
| 315 |
|
| 316 |
+
- **Card Author:** Dayanand
|
| 317 |
+
- **Model Developer:** Dayanand
|
| 318 |
+
- **Based on:** Qwen Team (Alibaba Qwen3-0.6B-Base)
|
| 319 |
|
| 320 |
## Model Card Contact
|
| 321 |
|
| 322 |
+
For questions or issues:
|
| 323 |
+
- GitHub Issues: [GitHub Repository Issues](https://github.com/yourusername/cpt_full_finetuning/issues)
|
| 324 |
+
- Email: [Your Email Here]
|
| 325 |
+
- Hugging Face Discussions: [Model Page Discussions](https://huggingface.co/YOUR-USERNAME/Qwen3-0.6B-Base-CPT-Math/discussions)
|