Kestrel-330M-Chat

The chat-tuned version of Kestrel-330M. Kestrel-330M is a 336M-parameter model trained from scratch by one person on a single GPU, on 6B tokens.

How it was tuned

  • Data: one epoch of supervised fine-tuning on smol-smoltalk, about 298M tokens. Loss was computed on the assistant turns only.
  • Optimizer: AdamW at learning rate 1e-4 with a cosine schedule.
  • Identity: a short second pass taught it its name. It now says it is Kestrel, an AI language model made by an independent developer.

Chat format

The format is plain text, and the bundled chat template produces it:

User: Why is the sky blue?
Assistant: <answer><|endoftext|>
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("MSDDDD/Kestrel-330M-Chat")
model = AutoModelForCausalLM.from_pretrained("MSDDDD/Kestrel-330M-Chat", trust_remote_code=True)
msgs = [{"role": "user", "content": "Write a Python function that reverses a string."}]
x = tok.apply_chat_template(msgs, return_tensors="pt")
out = model.generate(x, max_new_tokens=200, do_sample=True, temperature=0.6, top_k=40, repetition_penalty=1.1)
print(tok.decode(out[0, x.shape[1]:], skip_special_tokens=True))

trust_remote_code=True is required. It adds the final logit soft-cap that the model was trained with.

Example answers (unedited)

User: Why is the sky blue? Assistant: The sky appears blue due to the scattering of light by molecules in Earth's atmosphere. … This process is known as Rayleigh scattering.

User: Write a Python function that reverses a string. Assistant:

def reverse_string(s):
    return s[::-1]

User: What is the capital of Japan? Assistant: The capital of Japan is Tokyo, …

Limitations

This is a very small model, and these limitations are serious:

  • Facts: it often invents facts, names, dates and places, even right after a correct answer.
  • Arithmetic and reasoning: these are unreliable. For example, it gets simple additions wrong.
  • Questions about itself: beyond its name, it can still role-play a human, such as a programmer, a parent or a student.
  • Unsafe content: no safety tuning or preference tuning (RLHF/DPO) was applied. It can produce inappropriate, biased or crude content.
  • Length: answers can drift off topic when they run long.

It is meant for research and experimentation only. Do not use it for advice or for anything important.

License

The model weights are released under Apache-2.0. The training data is under its own licenses.

Downloads last month
9
Safetensors
Model size
0.3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for MSDDDD/Kestrel-330M-Chat

Finetuned
(1)
this model

Dataset used to train MSDDDD/Kestrel-330M-Chat