Downloads · 30 days
231
8% of all-time downloads
DZER-Studios/Create_Vexion-gpt
Create_Vexion-gpt is a text generation model from DZER-Studios. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Vexion-GPT is a classic dense language model engine built from scratch on PyTorch. The project was created to deeply understand the architecture of Transformers, optimize memory, and pretraining processes without the…
Downloads · 30 days
231
8% of all-time downloads
All-time downloads
2.9K
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json4.4 MB · 99%
From the Hugging Face model README
Vexion-GPT is a classic dense language model engine built from scratch on PyTorch. The project was created to deeply understand the architecture of Transformers, optimize memory, and pretraining processes without the use of heavy third-party frameworks.
Currently, the repository contains the architecture source code and base training graphs. Model weights will be published after completing extensive pretraining runs on large datasets.
Unlike many "training" models, Vexion-GPT is designed for real-world big data and maximum GPU utilization:
.bin), bypassing Python's garbage collector and Windows system caching. The token feed rate is static and does not degrade over long distances.config.json according to Hugging Face standards (full support for hidden_size, num_hidden_layers, etc.).Because Vexion-gpt is a classic, dense transformer without overloaded modern add-ons, it is incredibly resource-efficient. Integration Flash Attention and proper memory management allow model training from scratch even on budget home graphics cards.
The main secret to its low power consumption lies in its support for gradient accumulation. Training with batch_size = 4 and accumulate_steps = 24 results in a huge effective batch size (96), but the physical memory consumption remains at the level of a single pass. Gradient accumulation consumes computational time but does not inflate VRAM.
Memory Measurements (with a 1024-token context) Below are actual video memory consumption measurements for training from scratch (including weights, gradients, optimizer states, and PyTorch cache):
Nano / 117M parameters (Hidden size: 768, Layers: 12, Heads: 12)
Consumption: 2.2 GB of VRAM
Suitable for: RTX 3050 / RTX 4050 Laptop / Any NVIDIA RTX graphics card with 4 GB or more.
Medium / 345M parameters (Hidden size: 1024, Layers: 24, Heads: 16)
Consumption: 3.5 GB of VRAM
Suitable for: RTX 3050 / RTX 4050 / Any NVIDIA RTX graphics card with 4-6 GB or more.
Large / 646M parameters (Hidden size: 1280, Layers: 30, Heads: 20)
Consumption: 4.7 GB of VRAM
Suitable for: RTX 3060 / Any NVIDIA RTX graphics card with 6 GB or more.
XL / 1B parameters (Hidden size: 1536, Layers: 36, Heads: 12)
Consumption: 6.4 GB VRAM
Suitable for: RTX 3060 Ti / RTX 3050 / RTX 4060 / Any NVIDIA RTX graphics card with 8 GB or more.
XXL / 2.5B parameters (Hidden size: 2048, Layers: 48, Heads: 16)
Consumption: 12.9 GB VRAM
Suitable for: RTX 4060 Ti / RTX 5060 Ti / Any NVIDIA RTX graphics card with 14-16 GB or more.
XXXL / 3B parameters (Hidden size: 2176, Layers: 52, Heads: 17)
Consumption: 17 GB VRAM
Suitable for: RTX 3090 / RTX 4090 / Any NVIDIA RTX graphics card with 20+ GB or more.
Technically, 3 billion parameters can be trained on a 16GB GPU. BUT be prepared for the following:
Technically, in the model.py file, you can set the chunk size to 1024 instead of 2048 in the slicing process — but the speed will also drop, even though the consumption will also drop closer to 15.5 GB APPROXIMATELY. For example, the model’s speed on my computer is 48.64 s/it. So, do this ONLY WITH FULL AWARENESS that you will need a very long time to train the model.
**💡 Note: Power consumption is given for mixed precision (bfloat16 / float16).




Now let’s run tests with the models, but only by increasing the context. We’ll start with version 1024 and move forward. How much video memory will we need to, say, train it on a broader context than the original one?
Model: Vexion-gpt-NANO
| Context | VRAM consumption | better on VRAM |
|---|---|---|
| 1024 | 2.2GB | 3GB |
| 2048 | 3.5GB | 4GB |
| 3072 | 4.6GB | 6GB |
| 4096 | 5.8GB | 6GB |
| 5120 | 6.9GB | 8GB |
| 6144 | 8GB | 10GB |
| 7168 | 8.9GB | 10GB |
| 8192 | 10GB | 11GB |
| 9216 | 11.4GB | 12GB |
| 10240 | 12.5GB | 14GB |
| 11264 | 13.7GB | 14GB |
| 12288 | 14.8GB | 16GB |
Model: Vexion-gpt-Medium
| Context | VRAM consumption | better on VRAM |
|---|---|---|
| 1024 | 3.5GB | 4GB |
| 2048 | 4.6GB | 6GB |
| 3072 | 5.6GB | 6GB |
| 4096 | 6.9GB | 8GB |
| 5120 | 8.2GB | 10GB |
| 6144 | 9.8GB | 11GB |
| 7168 | 11.5GB | 12GB |
| 8192 | 12.6GB | 14GB |
| 9216 | 13.9GB | 16GB |
Model: Vexion-gpt-Large
| Context | VRAM consumption | better on VRAM |
|---|---|---|
| 1024 | 4.7GB | 6GB |
| 2048 | 6.1GB | 8GB |
| 3072 | 7.5GB | 8GB |
| 4096 | 8.7GB | 10GB |
| 5120 | 10.5GB | 11GB |
| 6144 | 12.3GB | 14GB |
| 7168 | 14GB | 16GB |
| 8192 | 15.6GB | 16GB |
Model: Vexion-gpt-XL
| Context | VRAM consumption | better on VRAM |
|---|---|---|
| 1024 | 6.4GB | 8GB |
| 2048 | 8.1GB | 10GB |
| 3072 | 9.5GB | 11GB |
| 4096 | 11.4GB | 12GB |
| 5120 | 13.1GB | 14GB |
| 6144 | 15.2GB | 16GB |
Model: Vexion-gpt-XXL
| Context | VRAM consumption | better on VRAM |
|---|---|---|
| 1024 | 12.9GB | 14GB |
Model: Vexion-gpt-3b
| Context | VRAM consumption | better on VRAM |
|---|---|---|
| 1024 | 17GB | 20+GB |
The attached graphs show the first stage of pre-training the base model.

The graph shows a steady drop in loss without spikes, confirming the absolute mathematical stability of the custom transformer and gradient mechanism. At control checkpoints, the model successfully generates grammatically correct encyclopedic text.
The architecture is ready for experimentation. You can easily scale the model from Nano to 1B+ parameters by simply changing config.json.
Example of initializing a pure model graph:
import json
with open("config.json", "r", encoding="utf-8") as f:
config = json.load(f)
vocab_size = config["vocab_size"]
hidden_size = config["hidden_size"]
num_layers = config["num_hidden_layers"]
num_heads = config["num_attention_heads"]
intermediate_size = config["intermediate_size"]
context = config["max_position_embeddings"]
token_embeddings = vocab_size * hidden_size
position_embeddings = context * hidden_size
attention = (
(hidden_size * 3 * hidden_size) + (3 * hidden_size)
+ (hidden_size * hidden_size) + hidden_size
)
mlp = (
(hidden_size * intermediate_size) + intermediate_size
+ (intermediate_size * hidden_size) + hidden_size
)
layer_norms = 4 * hidden_size
block = attention + mlp + layer_norms
transformer = block * num_layers
final_layer_norm = 2 * hidden_size
lm_head = vocab_size * hidden_size
total_parameters = (
token_embeddings
+ position_embeddings
+ transformer
+ final_layer_norm
+ lm_head
)
print("Vexion-GPT Parameter Calculator")
print("=" * 35)
print(f"Vocabulary: {vocab_size:,}")
print(f"Hidden size: {hidden_size:,}")
print(f"Layers: {num_layers}")
print(f"Attention heads: {num_heads}")
print(f"Intermediate size: {intermediate_size:,}")
print(f"Context: {context:,}")
print()
print(f"Parameters: {total_parameters:,}")
print(f"Parameters: {total_parameters / 1_000_000:.2f} M")
print(f"Parameters: {total_parameters / 1_000_000_000:.3f} B")
print(f"Parameters: {total_parameters / 1_000_000_000_000:.3f} T")
Running model training/retraining:
cd C:\Users\Username\Desktop\model folderTraining: python train.py --data_path train.bin --val_path val.bin --total_steps 30000 --save_every 1000 --batch_size 1 --accumulate_steps 256 --lr 1e-4 --dropout 0.0 --warmup_steps 500
Retraining: python train.py --data_path train.bin --val_path val.bin --total_steps 30000 --save_every 1000 --batch_size 1 --accumulate_steps 256 --lr 1e-4 --dropout 0.0 --warmup_steps 500 --resume checkpoints/gpt_step_1000.safetensors
CHECKPOINT_PATH = line, specify the path to the checkpoint. From lines 78-82, change the model settings. Don't touch anything ABOVE.To disable the scheduler for custom LR speed tuning, add the command --scheduler_type constant to the other settings in the CMD. To re-enable the scheduler, remove the command.
Use the chunk_size = setting in model.py to adjust the speed. The base number is 4096, but you should set it depending on your memory. If you have a couple of gigabytes of VRAM free, set the number higher. This will increase the speed, albeit not by much. And it may save hours of work.
Use the layer data storage setting in model.py: should_ckpt = (i % 2 == 0) to increase the speed in seconds. It’s better to use the setting for 16GB VRAM. If you want the minimum consumption, do: should_ckpt = (i % 1 == 0). If you want maximum speed, set: should_ckpt = (i % 2 == 0) and higher.