TinyBrainBot-53M-A9M-Hybrid-Instruct

A tiny chat model with thinking and tool calling, trained from scratch. It's the first TinyBrainBot on a new hybrid architecture: gated short-convolution blocks plus a few attention blocks, with a mixture of experts. 53.4M parameters in total, 9.3M active per token. The layout matches LiquidAI's LFM2-MoE, so it runs natively in llama.cpp, LM Studio and Ollama, and in transformers >= 5 as Lfm2MoeForCausalLM: no custom code.

It's the small-scale test of the recipe and architecture planned for a larger TinyBrainBot. Expect a tiny model: fluent and quick, often right on simple facts, unreliable on arithmetic and multi-step instructions.

Benchmark (0-shot, full test sets) This model Base before fine-tuning Change
ARC-Easy (acc_norm) 49.71 49.66 +0.04
  (raw acc) 55.47 55.81
ARC-Challenge (acc_norm) 30.29 29.44 +0.85
  (raw acc) 26.96 26.71
HellaSwag (acc_norm) 30.10 30.13 -0.03
  (raw acc) 28.18 28.23
PIQA (acc_norm) 64.04 63.22 +0.82
  (raw acc) 63.66 63.76
OpenBookQA (acc_norm) 32.40 32.80 -0.40
  (raw acc) 20.60 21.20
SciQ (acc_norm) 63.90 63.70 +0.20
  (raw acc) 72.90 72.90
WinoGrande (acc) 49.41 49.33 +0.08
BoolQ (acc) 58.72 58.26 +0.46
LAMBADA (OpenAI) (acc) 22.88 21.00 +1.88
MMLU (acc) 24.82 23.42 +1.40
CommonsenseQA (acc) 21.70 20.15 +1.56
Social IQa (acc) 37.67 38.08 -0.41
ArithMark-3 (acc_norm) 43.90 52.90 -9.00
  held-out arithmetic (our probe: skills ArithMark-3 doesn't test) 40.94 40.80 +0.14

EleutherAI lm-eval-harness v0.4.13, float32, every example of every task. Fine-tuning used expert-specialized fine-tuning (ESFT): only the 35 experts (of 352) that the chat data routes to most were trained, plus the chat and tool token embeddings. Across these 12 tasks it moved the scores by +0.54 on average versus the base; a normal full fine-tune on the same data and steps moved them by -1.51 (BoolQ alone fell 12 points).

About ArithMark-3: the base's 52.9 was inflated by synthetic arithmetic drills in its last training stage; arithmetic problems outside ArithMark-3's templates stayed at ~41 before and after fine-tuning. Fine-tuning removed the template-specific boost, not arithmetic skill (a full fine-tune showed the same drop).

Quick start

llama.cpp (the chat template, thinking and tool calls are built into the GGUF):

llama-server -m tinybrainbot-53m-a9m-hybrid-instruct-F16.gguf --jinja --reasoning-budget 0      # thinking off: chat, knowledge, tools
llama-server -m tinybrainbot-53m-a9m-hybrid-instruct-F16.gguf --jinja                            # thinking on

With thinking on, llama.cpp returns the thinking as reasoning_content, separate from the answer. Tool calls come back as standard OpenAI tool_calls (pass your tools in the request). Per request you can also send "chat_template_kwargs": {"enable_thinking": false} or "reasoning_effort": "low" | "medium" | "high".

transformers >= 5:

from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "nkthebass/tinybrainbot-53m-a9m-hybrid-instruct"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)

msgs = [{"role": "user", "content": "Why is the sky blue?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")   # thinking off by default
out = model.generate(ids, max_new_tokens=200)       # sampling defaults from generation_config.json
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))

Pass enable_thinking=True (or reasoning_effort="low") to apply_chat_template to turn thinking on, and tools=[...] for tool calling.

Recommended: thinking off for conversation, knowledge questions and tool use, on for small math word problems; temperature 0.4, top-p 0.9, repetition penalty 1.1. Use the F16 GGUF (109 MB): it matches transformers token for token. The Q8_0 file (59 MB) is included but drifts noticeably at this size (e.g. picks the wrong tool more often).

Samples

Unedited, from the F16 GGUF in llama.cpp. More in sample_chats.md, mistakes included.

User: hey! how's it going? TinyBrainBot: I'm doing well, thanks for asking. How about you?

User: Why is the sky blue? TinyBrainBot: The sky is blue because sunlight scatters in Earth's atmosphere, and blue light is scattered away.

User: What's the weather in Boise right now? Tool call: web_search({"query":"Boise"}) tool result: Today: 48F, light rain, wind NW 9 mph. Tonight: 36F. TinyBrainBot: The weather in Boise is extremely humid. It's very rainy and wind NW 9 mph.

User: If I have 4 boxes with 3 books each, how many books do I have? (thinking on) thinking: "each is" means multiplication. So multiply 4 * 3. [...] So the answer is 12. TinyBrainBot: The answer is 12.

Model

Architecture LFM2-MoE layout (Lfm2MoeForCausalLM / llama.cpp lfm2moe): 12 blocks, 8 gated short-convolution (kernel 7) + 4 GQA attention (every third block)
Width hidden 320, 5 query heads / 1 KV head of 64, QK-norm, RoPE theta 1M
Feed-forward block 1 dense SwiGLU (896); blocks 2-12: 32 experts of width 96, top-4, sigmoid router with load-balancing bias
Parameters 53.43M total (15.73M tied embedding), 9.31M active non-embedding per token
Context 2,048 tokens
Tokenizer tbb-49k: 49,152-token byte-level BPE trained for this model line; Qwen2-style pre-tokenizer, digits split, indentation kept, no unknown tokens; ChatML plus <think>, <tool_call>, <tool_response> single tokens
Chat format ChatML; <think> blocks; XML tool calls (<tool_call><function=NAME><parameter=ARG>value</parameter></function></tool_call>), the format of Qwen3.5+ and LFM3

Training

All from scratch on 2x Tesla V100 16GB, fp16 with fp32 master weights, AdamW, 131k tokens per step.

Stage Tokens Data
Pretraining 2.06B web (FineWeb-Edu, DCLM), Wikipedia, books, code, math, synthetic textbooks, Q&A
Continued pretraining 5.12B the same mix, fresh text
Decay (TinyBrainBot v5.1 recipe) 1.52B school-level textbooks, high-quality FineWeb-Edu, science Q&A, DCLM-Ultra, Wikipedia, distilled Q&A / facts / commonsense writing, GooAQ, FactBase-DCLM, finephrase FAQ, ELI5, a little math
Chat fine-tune (ESFT) 262M 92% general instruction data (chat, math, reasoning with thinking, instruction following, safety) + 8% tool calling (Hermes function calling, plus "tools available, not needed" chats), rendered in the chat format above

No benchmark train or test data was used. Some instruction sets carry their own terms (e.g. WildChat, Tulu 3); check them before commercial use.

Limitations

  • 9.3M active parameters: it makes things up, gets arithmetic wrong (even with thinking), drifts off long instructions (asked for a two-sentence story, it wrote several paragraphs) and sometimes calls the wrong tool or garbles arguments.
  • With thinking on for casual chat it can misread harmless messages as risky and refuse; keep thinking off for chat.
  • English only; 2,048-token context.
Downloads last month
669
Safetensors
Model size
53.4M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train nkthebass/tinybrainbot-53m-a9m-hybrid-instruct

Collection including nkthebass/tinybrainbot-53m-a9m-hybrid-instruct

Evaluation results