GPT-1900 Instruct v3 (Safe)

GPT-1900 instruction-tuned on a filtered corpus with strong opinions, political positions, and period-inappropriate moral judgments removed. This variant is the foundation for the physics reasoning models, as it focuses on scientific inquiry over editorial commentary.

Starting from the physics-domain continued pretraining checkpoint, then fine-tuned on the safe conversation pairs.

Training

  • Base checkpoint: GPT-1900 base → physics CLM expanded (continued pretraining on pre-1905 physics texts)
  • Data: mhla/gpt1900-instruct-v3-data — 32,489 conversation pairs (safe subset, no opinions)
  • Steps: 44
  • Val BPB: 0.707

Training Chain

GPT-1900 base (22B tokens pre-1900 text)
  → Physics CLM expanded (continued pretraining on physics texts)
    → Instruct v3 safe (SFT on filtered conversations)  ← you are here
      → Contradiction RL v6 / v11 (reinforcement learning on physics problems)

Architecture

Custom GPT with RoPE, QK-norm, ReLU² activation, value embeddings (ResFormer), and per-layer residual/skip scalars. Built with the nanochat framework.

Parameter Value
Parameters 3.29B
Layers 34
Hidden dim 2176
Attention heads 17 (query) / 17 (kv)
Head dim 128
Context length 2048 tokens
Vocab size 32,768 (BPE, GPT-4 style split pattern)

Quick Start

import torch, json
from nanochat.gpt import GPT, GPTConfig
from nanochat.tokenizer import RustBPETokenizer

tokenizer = RustBPETokenizer.from_directory("tokenizer")

with open("meta_000044.json") as f:
    meta = json.load(f)

config = GPTConfig(**meta["model_config"])
with torch.device("meta"):
    model = GPT(config)
model.to_empty(device="cuda")
model.init_weights()

state_dict = torch.load("model_000044.pt", map_location="cuda")
state_dict = {k.removeprefix("_orig_mod."): v for k, v in state_dict.items()}
model.load_state_dict(state_dict, strict=True, assign=True)
model.eval()

Chat

bos = tokenizer.get_bos_token_id()
user_start = tokenizer.encode_special("<|user_start|>")
user_end = tokenizer.encode_special("<|user_end|>")
assistant_start = tokenizer.encode_special("<|assistant_start|>")

tokens = [bos, user_start]
tokens += tokenizer.encode("What is the nature of light?")
tokens += [user_end, assistant_start]

with torch.amp.autocast(device_type="cuda", dtype=torch.bfloat16):
    for token in model.generate(tokens, max_tokens=500, temperature=0.8):
        print(tokenizer.decode([token]), end="", flush=True)

Dependencies

torch>=2.9
tiktoken
rustbpe

Related

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including mhla/gpt1900-d34-v3-sft-physics