A training-free architectural port of Qwen2.5-Coder-1.5B-Instruct with KeyStack transforms.
ForgeLM v1 is not a trained model. It is a weight-transformed port of Qwen2.5-Coder-1.5B-Instruct, created by applying a series of closed-form mathematical transforms (called "Keys") that restructure the architecture without losing the original model's knowledge.
⚠️ Disclaimers
Port Notice
This model is a port of Qwen2.5-Coder-1.5B-Instruct, not an independently trained model. All of the model's knowledge, capabilities, and limitations come from the original Qwen model. The KeyStack transforms are mathematically lossless or near-lossless at initialization — they restructure the architecture but do not add new knowledge. The original Qwen2.5-Coder-1.5B-Instruct model is licensed under Apache 2.0 by Alibaba/Qwen Team.
Vibe-Coded Notice
This model and its entire codebase were vibe-coded via Devin Desktop — an AI coding agent by Cognition. No human wrote the transform code, inference engine, or model architecture. The project was directed through natural language prompts and the AI agent implemented everything: weight porting, KeyStack transforms, inference engine, fine-tuning scripts, and this documentation.
System Support Disclaimer
Tested on: Windows 11, NVIDIA RTX 5070 (12GB VRAM), CUDA 13.1, Python 3.11, PyTorch 2.8
GPU: Requires NVIDIA GPU with ≥8GB VRAM for fast path. CPU-only or <8GB VRAM uses AirLLM layer-streaming (slow but works).
OS: Windows 11 tested. Linux/macOS should work but are untested.
torch.compile: Works on GQA attention. MoE + torch.compile hits a Triton bug on Windows (use without compile for MoE).
No warranty: This is a research project. Do not use in production without thorough testing.
Architecture
Component
Original (Qwen)
ForgeLM v1
Transform
Attention
GQA (12 Q heads, 2 KV heads)
MLA (d_c=512)
SVD-based GQA→MLA
FFN
Dense SwiGLU (8960 intermediate)
MoE (4 routed + 1 shared, d_ff=1792)
Weight splitting
Norm
RMSNorm
RMSNorm (unchanged)
Direct copy
Embedding
151936 vocab, 1536 dim
Same (unchanged)
Direct copy
LM Head
Tied with embedding
Same (unchanged)
Direct copy
RoPE
θ=1,000,000
Same (unchanged)
Direct copy
KeyStack Transforms Applied
All transforms are lossless at initialization (cosine similarity ≥ 0.9998 vs original Qwen):
Key
Type
Effect
Cosine Sim
MLA
FULL
GQA→MLA via SVD, 4x KV cache compression
1.0000 (100% energy)
MoE
FULL
Dense FFN→5 experts, 60% active FLOPs
1.0000 (exact split)
MRL
FULL
Matryoshka dimension reordering
1.0000 (permutation)
QuaRot
FULL
Hadamard rotation on V/O
1.0000 (rotation)
ValueResidual
FULL
V0 stored + 28 gates (init=0)
1.0000 (no-op at init)
RotorQuant
FULL
Givens rotation matrices stored
1.0000 (no-op at init)
MTP
FULL
4 prediction heads from LM head
1.0000 (identity init)
AirLLM
TRIVIAL
Streamable flag for low-VRAM
N/A (runtime)
What Was NOT Applied (and why)
Technique
Reason
GQA→MQA
Catastrophic degradation without 5% pretraining compute
Wanda pruning
Needs calibration data post-MRL
SliceGPT
Needs calibration data
BitNet
Needs native ternary training
ShortGPT
Available as key, not applied to v1
Performance
Quality
Cosine similarity vs Qwen2.5-Coder-1.5B: 0.9998–1.0000 across all layers
Generation: Identical output to original Qwen on all test prompts
No quality loss from any KeyStack transform
Speed (NVIDIA RTX 5070, 12GB VRAM)
Configuration
tok/s
KV Compression
Notes
Standard
21
1x
Baseline
Hadamard INT4 KV
21
4x
Lossless
Streaming KV
12
∞ (sinks+window)
Infinite context
RotorQuant KV
13
3.88x
0.94% error
MTP self-spec
11
1x
Correct output, needs batch verify
Memory
Checkpoint: 3.4 GB (bf16)
GPTQ INT4: 2.3 GB (63% of original, cos=0.99)
VRAM (inference): ~6 GB (model + KV cache)
Min VRAM: 4 GB (AirLLM streaming, very slow)
KeyStack System
The KeyStack is a system of Keys — closed-form mathematical transforms that convert weights between architectures without training. Each Key implements:
forward(data) → weights — replace training with instant transform
reverse(weights) → data — extract what was learned
classify() → KeyClass — FULL (reversible+composable), PARTIAL (lossy), TRIVIAL (no weights)