⚡ Vigyan-125M 1.58-BitNet Ternary Base: Pretrained from Token Zero
Vigyan-125M-158bit-Canary is a sovereign experimental research release of a native 1.58-bit ternary foundation model pretrained from scratch from token zero.
Unlike post-training quantized models or fine-tunes of existing open models, Vigyan-125M was initialized with random weights and trained from the ground up using BitNet straight-through estimators (STE), restricting synaptic weights strictly to ${-1, 0, +1}$.
🔬 Experimental Research Profile
- Pretraining Paradigm: Cold-Start Pretrained from Token Zero (not a fine-tune, distillation, or quantization of Llama or any external checkpoint).
- Weight Representation: Native ternary ${-1, 0, +1}$ with per-tensor RMS scaling factors. Matrix multiplications ($\mathbf{W} \cdot \mathbf{x}$) reduce to integer additions and subtractions: $$\mathbf{W} \in {-1, 0, +1}^{d_{out} \times d_{in}}$$
- Ultra-Low Execution Footprint: Executes in ~40–60 MB RAM, enabling deterministic inference on microcontrollers, ARM Cortex-A CPUs, Raspberry Pi, and Rockchip RK3588 NPUs without discrete GPUs.
- Ecosystem Interoperability: Serialized with standard transformer causal LM architecture (
LlamaForCausalLMserialization container) for seamless loading into standard Hugging Face pipelines,transformers,llama.cpp, and embedded C runtimes without custom C++ kernel patches. - Compute Infrastructure: Pretrained cloud-to-cloud on Google Cloud TPU v3-8 (128 GB HBM) via PyTorch/XLA PJRT with non-blocking asynchronous checkpointing and strict static shape compilation.
🏛️ Architecture Specifications
| Hyperparameter | Value | Description |
|---|---|---|
| Parameters | 125 Million | Lightweight edge canary scale |
| Hidden Dimension ($d_{model}$) | 768 | High representational density |
| Attention Layers | 12 | Transformer decoder blocks |
| Attention Heads | 12 | Query heads (Head dim: 64) |
| Key/Value Heads | 12 | Full Multi-Head Attention |
| Intermediate Size ($d_{ffn}$) | 2,048 | SwiGLU activation feedforward |
| Context Length | 2,048 tokens | Rotary Position Embeddings (RoPE $\theta = 100,000$) |
| Vocabulary Size | 151,669 | STEM & Indic-optimized BPE vocabulary |
| Active Memory Footprint | ~50 MB | Standalone inference RAM |
🚀 Quickstart & Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "shreyansh12183/vigyan-125m-158bit-canary"
# Load tokenizer and base weights
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
prompt = "Explain the physical principle of conservation of momentum:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=128,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
📦 Quantized Edge Binaries (GGUF)
Pre-compiled edge binaries (iq1_s, iq2_xxs, q2_k, q4_k_m, fp16) optimized for llama.cpp and standalone microcontroller daemons are available at shreyansh12183/vigyan-125m-158bit-gguf.
📜 Legal & Non-Commercial Licensing
This experimental research release is distributed under the PolyForm Noncommercial License 1.0.0:
- Academic & Non-Commercial Research: Free to download, benchmark, inspect, and evaluate for academic research, edge hardware experimentation, and educational purposes.
- Section 8 AI Model Distillation Restriction: You may not use this model or its outputs to train, fine-tune, distill, or evaluate competing artificial intelligence or commercial foundation models without prior written permission from ExperimentLab AI.
- Commercial Enterprise Licensing: For commercial licensing, hardware OEM integration, or proprietary deployments, contact support@experimentlab.in.