Text Generation
Transformers
Safetensors
PyTorch
English
vortex
sft
cybersecurity
cryptography
conversational
custom_code
Instructions to use VTXAI/vortex-50m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VTXAI/vortex-50m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VTXAI/vortex-50m", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("VTXAI/vortex-50m", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use VTXAI/vortex-50m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VTXAI/vortex-50m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VTXAI/vortex-50m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/VTXAI/vortex-50m
- SGLang
How to use VTXAI/vortex-50m 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 "VTXAI/vortex-50m" \ --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": "VTXAI/vortex-50m", "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 "VTXAI/vortex-50m" \ --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": "VTXAI/vortex-50m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use VTXAI/vortex-50m with Docker Model Runner:
docker model run hf.co/VTXAI/vortex-50m
Update README with comprehensive architecture and benchmark scores
Browse files
README.md
CHANGED
|
@@ -5,45 +5,154 @@ language:
|
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
- vortex
|
|
|
|
| 8 |
- cybersecurity
|
| 9 |
- cryptography
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
- sft
|
| 13 |
---
|
| 14 |
|
| 15 |
# Vortex-50M (Cybersecurity & Cryptography Specialist)
|
| 16 |
|
| 17 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
##
|
| 22 |
-
- **Parameters**: 49,846,528 (~49.85M, within 50M budget)
|
| 23 |
-
- **Layers**: 18
|
| 24 |
-
- **Hidden dimension**: 512
|
| 25 |
-
- **Intermediate dimension**: 1072
|
| 26 |
-
- **Attention heads**: 8 query heads, 2 key/value heads (Grouped Query Attention)
|
| 27 |
-
- **Context length**: 2048
|
| 28 |
-
- **Vocabulary size**: 16,387 (tied embeddings)
|
| 29 |
-
- **Positional Embeddings**: RoPE (Rotary Position Embeddings)
|
| 30 |
-
- **Normalization**: RMSNorm with QK-Norm
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
```python
|
|
|
|
| 35 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 36 |
|
| 37 |
model_id = "VTXAI/vortex-50m"
|
|
|
|
|
|
|
| 38 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 39 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
|
|
|
| 41 |
messages = [
|
| 42 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
]
|
|
|
|
| 44 |
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 45 |
-
inputs = tokenizer(prompt, return_tensors="pt")
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
- vortex
|
| 8 |
+
- sft
|
| 9 |
- cybersecurity
|
| 10 |
- cryptography
|
| 11 |
+
- pytorch
|
| 12 |
+
- transformers
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# Vortex-50M (Cybersecurity & Cryptography Specialist)
|
| 16 |
|
| 17 |
+
A **49,846,528-parameter** instruction-tuned decoder-only Transformer, built from first principles on `torch.nn` and fine-tuned for specialized **cybersecurity, network defense, threat analysis, and cryptographic protocols**.
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
49,846,528 params · 512d × 18L · 8Q/2KV GQA · vocab 16,387 (tied)
|
| 21 |
+
17% embedding / 83% transformer blocks · Strictly within 50M parameter budget
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
| Specification | Value |
|
| 25 |
+
|:---|:---|
|
| 26 |
+
| **Base Pretrained Model** | [`VTXAI/vortex-50m-16k`](https://huggingface.co/VTXAI/vortex-50m-16k) (trained from scratch on 1B tokens) |
|
| 27 |
+
| **Total Parameters** | **49,846,528** (99.69% of the 50,000,000 competition budget) |
|
| 28 |
+
| **Fine-Tuning Dataset** | [`VTXAI/cyber-crypto-balanced-qa`](https://huggingface.co/datasets/VTXAI/cyber-crypto-balanced-qa) |
|
| 29 |
+
| **Architecture Design** | Custom `VortexForCausalLM` (`trust_remote_code=True`), tied embeddings, QK-Norm, RoPE, ChatML |
|
| 30 |
+
| **Domain Focus** | Network security, CVE triage, symmetric/asymmetric cryptography, reverse engineering, web security |
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## Benchmark Results
|
| 35 |
+
|
| 36 |
+
Evaluated directly via EleutherAI's `lm-evaluation-harness` across 4 standard multiple-choice and reasoning tasks using length normalization where applicable:
|
| 37 |
+
|
| 38 |
+
| Task / Benchmark | Primary Metric | Score | Stderr | Evaluation Grader |
|
| 39 |
+
|:---|:---:|:---:|:---:|:---|
|
| 40 |
+
| **PIQA** | `acc_norm` | **54.13%** | ±1.16% | Physical commonsense reasoning |
|
| 41 |
+
| **WinoGrande** | `acc` | **52.41%** | ±1.40% | Pronoun disambiguation & commonsense |
|
| 42 |
+
| **ARC-Easy** | `acc_norm` | **35.52%** | ±0.98% | Grade-school science question answering |
|
| 43 |
+
| **HellaSwag** | `acc_norm` | **27.23%** | ±0.44% | Hard commonsense NLI / continuation |
|
| 44 |
+
| **Scored Average** | - | **42.32%** | - | **Mean across all 4 competition tasks** |
|
| 45 |
+
|
| 46 |
+
> **Evaluation Methodology**: All benchmarks are scored using `src/eval_competition.py` with the official EleutherAI harness. No hosted inference APIs were touched during training or evaluation.
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## Parameter Accounting & Budget
|
| 51 |
+
|
| 52 |
+
The parameter budget is verified from the live module tree using `src/param_count.py`:
|
| 53 |
+
|
| 54 |
+
```
|
| 55 |
+
==================================================================
|
| 56 |
+
vortex-50m
|
| 57 |
+
==================================================================
|
| 58 |
+
hidden 512
|
| 59 |
+
layers 18
|
| 60 |
+
heads 8Q / 2KV
|
| 61 |
+
head_dim 64
|
| 62 |
+
intermediate 1072
|
| 63 |
+
context 2048
|
| 64 |
+
vocab 16,387 (tied=True)
|
| 65 |
+
------------------------------------------------------------------
|
| 66 |
+
TRAINABLE PARAMS 49,846,528
|
| 67 |
+
budget 50,000,000
|
| 68 |
+
verdict [PASS] 49.847M (99.69% of budget)
|
| 69 |
+
------------------------------------------------------------------
|
| 70 |
+
embedding 8,390,144 16.8%
|
| 71 |
+
attention 11,798,784 23.7%
|
| 72 |
+
mlp 29,638,656 59.5%
|
| 73 |
+
norm 512 0.0%
|
| 74 |
+
--- ---
|
| 75 |
+
in transformer blocks 41,456,384 83.2%
|
| 76 |
+
==================================================================
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
`lm_head` is tied to the input embedding table, ensuring maximum capacity is directed into the 18 transformer layers (83.2% of weights inside transformer blocks).
|
| 80 |
|
| 81 |
+
---
|
| 82 |
|
| 83 |
+
## Architectural Principles at 50M Parameters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
+
- **Depth over Width via Compact Vocab**: A custom 16,384 BPE vocabulary costs only ~8.4M parameters in the embedding table (17% of budget). In contrast, standard 32K or 150K vocabularies consume 35% to 150%+ of a 50M budget before a single layer can be placed. This allows Vortex-50M to run **18 deep layers** at 512 hidden dimension.
|
| 86 |
+
- **Grouped-Query Attention (GQA 8/2)**: 8 query heads and 2 key/value heads provide a 4× KV cache reduction for fast on-device inference without sacrificing reasoning quality.
|
| 87 |
+
- **QK-Norm (RMSNorm on Q and K)**: Applied per head before attention computation to prevent attention entropy collapse and numerical instability at small scales.
|
| 88 |
+
- **SwiGLU MLP**: Intermediate dimension of 1,072 (2.09× hidden dimension) with SwiGLU activation for superior non-linear representation capacity.
|
| 89 |
+
- **ChatML Format & Special Control Tokens**: Native support for `<|im_start|>` and `<|im_end|>` sequence markers with assistant-only loss masking during instruction tuning.
|
| 90 |
+
|
| 91 |
+
---
|
| 92 |
+
|
| 93 |
+
## Quickstart & Inference
|
| 94 |
+
|
| 95 |
+
Vortex-50M runs natively with Hugging Face `transformers` using `trust_remote_code=True`:
|
| 96 |
|
| 97 |
```python
|
| 98 |
+
import torch
|
| 99 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 100 |
|
| 101 |
model_id = "VTXAI/vortex-50m"
|
| 102 |
+
|
| 103 |
+
# Load tokenizer and model
|
| 104 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 105 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 106 |
+
model_id,
|
| 107 |
+
torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32,
|
| 108 |
+
device_map="auto",
|
| 109 |
+
trust_remote_code=True
|
| 110 |
+
)
|
| 111 |
|
| 112 |
+
# Format prompt using ChatML
|
| 113 |
messages = [
|
| 114 |
+
{
|
| 115 |
+
"role": "system",
|
| 116 |
+
"content": "You are Vortex-50M, an expert cybersecurity and cryptography assistant."
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"role": "user",
|
| 120 |
+
"content": "Explain why AES-GCM is preferred over AES-CBC with HMAC in modern network protocols."
|
| 121 |
+
}
|
| 122 |
]
|
| 123 |
+
|
| 124 |
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 125 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 126 |
|
| 127 |
+
# Generate response
|
| 128 |
+
with torch.no_grad():
|
| 129 |
+
outputs = model.generate(
|
| 130 |
+
**inputs,
|
| 131 |
+
max_new_tokens=96,
|
| 132 |
+
do_sample=True,
|
| 133 |
+
temperature=0.3,
|
| 134 |
+
repetition_penalty=1.15,
|
| 135 |
+
pad_token_id=tokenizer.pad_token_id,
|
| 136 |
+
eos_token_id=tokenizer.eos_token_id
|
| 137 |
+
)
|
| 138 |
+
|
| 139 |
+
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
|
| 140 |
+
print(response)
|
| 141 |
```
|
| 142 |
+
|
| 143 |
+
---
|
| 144 |
+
|
| 145 |
+
## Training & Fine-Tuning Pipeline
|
| 146 |
+
|
| 147 |
+
1. **Pretraining**: Pretrained from random initialization on 1 Billion tokens of curated high-quality web text (`cosmopedia-v2` + `fineweb-edu-dedup`) using cosine decay down to 10% peak LR.
|
| 148 |
+
2. **Supervised Instruction Tuning (SFT)**: Fine-tuned with ChatML masking on [`VTXAI/cyber-crypto-balanced-qa`](https://huggingface.co/datasets/VTXAI/cyber-crypto-balanced-qa) using AdamW (`lr=1.8e-5`, weight decay `0.01`, cosine scheduler).
|
| 149 |
+
3. **Loss Masking**: User prompts and system instructions are masked out of the loss calculation; gradients are computed strictly on assistant generation tokens.
|
| 150 |
+
|
| 151 |
+
---
|
| 152 |
+
|
| 153 |
+
## Verification & Integrity
|
| 154 |
+
|
| 155 |
+
The model passes all pre-flight and runtime consistency suites in `src/`:
|
| 156 |
+
- **Parity Check** (`src/test_hf_modeling.py`): Bit-exact agreement between custom `torch.nn` training code and Hugging Face `AutoModelForCausalLM`.
|
| 157 |
+
- **Roundtrip Check** (`src/test_export_hf.py`): Verified export, weight reload, and token generation consistency in clean environments.
|
| 158 |
+
- **Budget Compliance** (`src/param_count.py`): Verified 49,846,528 params ≤ 50,000,000 budget.
|