flame-27m-base / README.md
lyonsn4's picture
Add flame-27m (300B-token base + SmolTalk instruct)
7356ff2 verified
|
Raw History Blame Contribute Delete
3 kB
metadata
license: apache-2.0
language:
  - en
library_name: transformers
pipeline_tag: text-generation
tags:
  - small-language-model
  - pretrained

flame-27m-base

A 27.1M-parameter English base language model, pretrained on curated educational web + synthetic textbooks + math. The largest of the ember/spark/flame family of deliberately tiny models for small-model research, fast experimentation, and as a lightweight decoder backbone. ~5× smaller than SmolLM-135M.

  • Architecture: Llama-style decoder — hidden 512, 8 layers, 8 heads / 2 KV heads (GQA), intermediate 1280, RoPE (θ=1e6), context 2048, vocab 12000 (English BPE).
  • Pretraining: 300B tokens (~11,070 tokens/param), mixture FineWeb-Edu-dedup 0.44 / Cosmopedia-v2 0.24 / ClimbMix 0.16 / FineMath-3+ 0.10 / FineMath-4+ 0.06. Decontaminated against the eval benchmarks.

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("ifx-pse-sys-ml/flame-27m-base", trust_remote_code=True)
tok = AutoTokenizer.from_pretrained("ifx-pse-sys-ml/flame-27m-base")

ids = tok("The moon is", return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=40, do_sample=True, temperature=0.8, top_p=0.9)
print(tok.decode(out[0], skip_special_tokens=True))

It also accepts inputs_embeds (pass exactly one of input_ids / inputs_embeds), so a vision projector can inject visual tokens — usable as a small VLM text backbone. The tokenizer keeps the Qwen2.5 multimodal special tokens (<|vision_start|> etc.) intact. A raw PyTorch checkpoint (pytorch_model.pth) is included alongside the safetensors weights.

Benchmarks

Accuracy (%) via lm-evaluation-harness 0.4, same harness and shots for every model, so columns are directly comparable.

Benchmark chance flame-27m-base SmolLM-135M
hellaswag 25 30.7 42.6
arc_easy 25 40.8 56.1
arc_challenge 25 24.5 28.9
piqa 50 61.6 68.4
winogrande 50 51.5 53.2
openbookqa 25 29.0 34.0
commonsense_qa 20 19.5 19.8
mmlu 25 25.8 25.2
average — 35.4 41.0

flame reaches 35.4 avg at 1/5 the parameters of SmolLM-135M and edges it on MMLU (25.8 vs 25.2). On the neutral Wikipedia holdout its bits-per-byte (the tokenizer-fair metric) is 1.140, a 15% reduction over the 13M spark and 24% over the 6.5M ember — the family's scaling curve is still steep at this size.

Honest limitations

At 27M parameters this model is near random chance on the hardest reasoning/knowledge benchmarks (ARC-Challenge, CommonsenseQA, most of MMLU). Generation is fluent and on-register but factually unreliable — it models how educational text reads, not what is true. A research/prototyping model and a lightweight decoder, not a knowledge model. English only. Trained with the Nexus codebase.