Raptor / README.md
Voyager466920's picture
Update Raptor with SmolTalk instruction-tuned checkpoint at SFT step 7500
d332a62 verified
|
Raw
History Blame Contribute Delete
2.79 kB
metadata
tags:
  - text-generation
  - causal-lm
  - mixture-of-experts
  - custom-code
  - conversational
  - instruction-tuned
language:
  - en
pipeline_tag: text-generation
library_name: transformers
base_model: Voyager466920/Raptor

Raptor

Raptor is a 1.027B-parameter decoder-only causal language model with approximately 404M active parameters per token. It uses multi-head latent attention and six SwiGLU experts per layer with top-2 routing.

This revision contains the English instruction-tuned checkpoint. It was initialized from the Raptor step-35,000 pretrained checkpoint and supervised fine-tuned for one epoch on a curated SmolTalk mixture. The retained checkpoint is SFT step 7,500, selected by validation loss.

Architecture

  • 18 layers
  • hidden size 1,024
  • latent attention dimension 256
  • 16 attention heads
  • six experts per layer, top-2 routing
  • expert hidden size 2,816
  • context length 2,048
  • 35,000-token SentencePiece vocabulary
  • 1.027B total parameters, about 404M active per token

Fine-tuning

  • Base checkpoint: pretraining step 35,000
  • Training examples: 511,721
  • Validation examples: 2,000
  • SFT epochs: 1
  • Best checkpoint: step 7,500
  • Best validation loss: 1.0597
  • Best validation perplexity: 2.8855
  • Training format: assistant-only loss over ### User: and ### Assistant: conversations

Usage

The architecture and tokenizer use custom code, so loading requires trust_remote_code=True.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Voyager466920/Raptor"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [{"role": "user", "content": "What is the capital of France?"}]
inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt",
).to(model.device)
output = model.generate(
    inputs,
    max_new_tokens=128,
    do_sample=True,
    temperature=0.7,
    top_p=0.9,
)
print(tokenizer.decode(output[0, inputs.shape[1]:], skip_special_tokens=True))

Limitations

  • This is an experimental 1B-scale model and may fail simple reasoning or arithmetic tasks.
  • Multi-turn memory and role consistency are unreliable.
  • Responses may become verbose, repetitive, inaccurate, biased, or unsafe.
  • The model is English-focused. The tokenizer has poor Korean coverage and maps many Korean words to the unknown token.
  • The architecture currently recomputes the full prefix during generation and does not implement a KV cache.

License

No model license has been selected yet. Public availability does not grant additional usage rights beyond applicable law.