🧠 Vexion-GPT: Custom Dense LLM Architecture

VEXION-GPT-MEDIUM

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.

⚙️ Key Features of the Engine (Under the Hood)

Unlike many "training" models, Vexion-GPT is designed for real-world big data work and maximum GPU utilization:

  • Pure Dense Architecture: Classic, mathematically pure GPT architecture without additives (no MoE, no RoPE). Only the proven Causal Attention and GELU/SiLU activation functions.
  • Flash Attention Integrated: Full support for Fused Kernels for on-the-fly attention computation. VRAM consumption has been dramatically reduced (the model can easily train on consumer GPUs with batch sizes that previously caused OOMs).
  • Ultra-fast Custom DataLoader: The dataloader has been rewritten to stream binary data (.bin), bypassing Python's garbage collector and Windows system caching. The token feed rate is static and does not degrade over long distances.
  • HF-Compatible Config: The architecture is completely decoupled from hardcoded data. Model configuration is implemented via config.json according to Hugging Face standards (full support for hidden_size, num_hidden_layers, etc.).
  • Adaw: Standard Adaw allows the model to store all its values ​​in 32-bit format, which helps achieve lower LOSS and higher-quality models.

📊 Vexion Model Family

The project's development is divided into several stages, from compact test versions to fully-fledged billion-dollar vehicles.

Model Parameters Context YaRN Status Train_Loss Val_Loss Vocab_Size Total_Steps
Vexion-gpt 117M 1024 - Base model 3.21 3.1 40960 220000
Vexion-gpt-medium 345M 1024 - learning from scratch 2.58 2.53 40960 382500
Vexion-gpt-1.3B 1.3B 1024 - - - - 32000 -

📊 Model training dynamics

Снимок экрана (435)

Снимок экрана (438)

Technical details:

  • Hardware: 1x RTX 3060 Ti 8GB or later on 1x RTX 4060 Ti 16GB.
  • Settings: batch_size - 12, accumulate_steps - 8 at ctx 256. Batch_size - 8, accumulate_steps - 32 at ctx 1024.
  • Number of tokens in pre-train - 39 BILLION
  • Total training time: 570 hours
  • Pre-train dataset: CulturaX

📊 News (temporarily)

This is called “Return-3,” because this description can be applied to the improvement of the Vexion-gpt architecture. We couldn’t justify WPE — but that’s actually great; together with you, we’ve taken a step forward to three stages at once: Basic WPE, RoPE (which, unfortunately, you didn’t get to experience), and the release of a full YaRN. Along with the updated architecture, you get the cleaned train.py and model.py files (Yarn version), where you have control — and the ability to pull out gigantic contexts even on super‑limited hardware. Example? Vexion-gpt-medium, which consumes only 3.5 GB of VRAM when fully checkpointed — without significantly increasing VRAM, you can set the context to 8192, 12288, or 16384 tokens. Why is it so small? We’re limited by the model itself: the smaller the model, the worse it works with a large context; “hallucinations” increase, and it may forget the middle of the dialogue. It may remember that there was a discussion about cars in the middle of the dialogue, but it won’t recall specific details, for example, about a scratch on the front right fender or about the mirror. That’s why you can expand the context by looking at the model. And that’s precisely why Vexion‑gpt‑nano comes with an original context of 2048 tokens — and with YaRN, 6144 tokens; Medium comes with an original context of 3072–4096 tokens and comes with YaRN of ~12288 tokens; XL will get an original context of up to 2048 tokens and YaRN with possibly 32768 tokens of context — but this depends on the model’s behavior and LOSS metrics.

At the moment, a full retraining is underway for the smaller models — NANO and then Medium. This is due to the need to check how YaRN behaves on larger contexts. Plus, training XL is somewhat challenging because of the relatively long step time of 30 seconds. Therefore, to make any progress at all, a full retraining of the smaller versions is being carried out, and only then will the larger models be used.

⚠️ Important compatibility warning

This model is built on a completely custom architecture written in pure PyTorch. It DOES NOT support the Hugging Face transformers library (Transformer API). You will not be able to load it through standard classes like AutoModelForCausalLM. For inference and retraining, use only the scripts provided in this repository (model.py, generate.py, generation.py).

🚀 Code Usage

Running/Retraining the Model:

  • Before training the model, launch the command prompt (CMD) as administrator and enter the following command: cd C:\Users\Username\Desktop\model folder
Training: 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

Communication: python generate_base.py --checkpoint checkpoints/gpt_step_180000.safetensors --prompt "What's dangerous about artificial intelligence?" --temperature 0.7 --rep_penalty 1.2 --max_new_tokens 400 --device cuda
Downloads last month
546
Safetensors
Model size
0.3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train DZER-Studios/Vexion-gpt-medium

Collection including DZER-Studios/Vexion-gpt-medium