gpt-oss-1.5B-A1.4B-small

This is a small version of unsloth/gpt-oss-20b-BF16 created for testing and development. It keeps all hidden dimensions and hyperparameters of the base model identical, reducing only the number of layers, the layer-type layout, and the number of MoE experts, so it exercises the same architecture (gpt-oss MoE with alternating sliding/full attention, attention sinks, YaRN rope, tanh-limited SwiGLU experts with grouped per-expert tensor storage) at a fraction of the size.

Model Details

  • Base Model: unsloth/gpt-oss-20b-BF16
  • Architecture: gpt_oss (GptOssForCausalLM)
  • Total Parameters: 1.51B (1,510,118,220)
  • Activated Parameters: 1.41B (1,410,550,860; top-4-of-6 experts per MoE layer)

Configuration Changes

Only the three allowed categories of changes were made (layer counts, layer-type layout, expert count); every other hyperparameter is identical to the base:

Parameter Base Small
num_hidden_layers 24 2
layer_types 24 layers alternating sliding_attention / full_attention sliding_attention, full_attention
num_local_experts 32 6

The 2 layers are the minimal set covering every distinct attention layer type (sliding_attention with sliding_window 128, full_attention), mirroring the base's alternating pattern; all base layers are MoE. 6 experts >= num_experts_per_tok 4 (topk+2 for non-degenerate routing). Everything else — hidden size 2880, intermediate size 2880, vocab 201088, 64 Q heads / 8 KV heads / head_dim 64, attention bias + attention sinks, YaRN rope parameters (theta 150000, factor 32, beta_fast 32, beta_slow 1), sliding_window 128, swiglu_limit 7.0, router settings, tie_word_embeddings: false (this base checkpoint has an untied lm_head.weight), max_position_embeddings 131072 — is unchanged from the base.

Checkpoint Structure

Single-file model.safetensors (bf16, ~3.0GB), unsharded. Tensor naming follows the base checkpoint exactly (validated: all 20 tensor-name patterns and both per-layer key sets match the base model.safetensors.index.json modulo layer count), including the gpt-oss "transformer" layout specifics: grouped 3D expert tensors mlp.experts.gate_up_proj / gate_up_proj_bias / down_proj / down_proj_bias, mlp.router.{weight,bias}, self_attn.sinks, and biased q/k/v/o_proj.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("inference-optimization/gpt-oss-1.5B-A1.4B-small", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("inference-optimization/gpt-oss-1.5B-A1.4B-small")

input_ids = tokenizer("According to all known laws", return_tensors="pt").input_ids.to(model.device)
output = model.generate(input_ids, max_new_tokens=20)
print(tokenizer.decode(output[0]))

Creation Process

This model was created using the llm-compressor create-tiny-model skill.

The config was derived from the base AutoConfig applying only the changes in the table above, the model was built with random init (skip_weights_download + init_weights()), and then fine-tuned on the skill's toy copypasta dataset (8 texts, ~160 steps, lr 1e-4, bf16) until the perplexity stopping criterion was reached.

Validation

  • Perplexity on the toy dataset text: 1.0001141 (target <= 10)
  • Greedy generation reproduces the training text ("According to all known laws of aviation, there is no way a bee should be able to fly.")
  • Checkpoint tensor-name structure matches the base index.json (20/20 patterns; per-layer key sets identical)

Notes

  • The base unsloth/gpt-oss-20b-BF16 is unquantized bf16 (no quantization_config), so no quantization handling was needed; this small model is plain bf16.
  • The base has untied embeddings (tie_word_embeddings: false with a separate lm_head.weight in the checkpoint; note the original openai/gpt-oss-20b release is tied, but this unsloth BF16 conversion is not). The untied 201088 x 2880 embedding + lm_head matrices alone cost ~1.16B parameters, which pushes the minimal covering model to 1.51B total.
  • num_nextn_predict_layers is not present in this architecture; no MTP weights exist.
Downloads last month
38
Safetensors
Model size
2B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for inference-optimization/gpt-oss-1.5B-A1.4B-small

Finetuned
(57)
this model

Collection including inference-optimization/gpt-oss-1.5B-A1.4B-small