Looking at your current model configuration, let me calculate the parameter count:
Current Model Parameters:
- Token embedding: 30,000 × 256 = 7,680,000
- Positional embedding: 256 × 256 = 65,536
- Transformer layers (4 layers):
- Attention per layer: 4 × (256 × 256) = 262,144
- FFN per layer: (256 × 1024) + (1024 × 256) = 524,288
- Layer norms per layer: 2 × 256 = 512
- Total per layer: 786,944
- All 4 layers: 3,147,776
- Final layer norm: 256
- Output projection: 256 × 30,000 = 7,680,000
Total: ~18.6M parameters
For a 500M+ parameter model optimized for mathematics, here's a suggested configuration:
json
{
"batch_size": 32,
"num_epochs": 50,
"lr": 1e-4,
"seq_len": 2048,
"d_model": 1200,
"N": 24,
"h": 20,
"train": "dataset/math_train.jsonl",
"test": "dataset/math_test.jsonl",
"d_ff": 4800,
"dropout": 0.1,
"model_folder": "math_model_537M",
"model_basename": "math-537M-",
"preload": "",
"tokenizer_file": "math_model.tokenizer.json",
"experiment_name": "runs/math_537M",
"dataset": "dataset/math_dataset.jsonl",
"loss_file": "math_model_537M/losses.jsonl",
"fine_dataset": "dataset/math_fine_tune.jsonl",
"fine_epochs": 10,
"vocabulary": 50000
}
Key changes for mathematics:
- Larger vocabulary (50K): Better coverage of mathematical symbols, operators, and notation
- Longer sequences (2048): Handle complex mathematical proofs and multi-step solutions
- Deeper architecture (24 layers): Better reasoning capabilities for mathematical logic
- Wider model (d_model=1200, d_ff=4800): More representational capacity
- Lower learning rate: More stable training for the larger model
Estimated parameters: ~537M
This configuration should provide strong mathematical reasoning capabilities while staying in the 500M+ parameter range you requested.