Model and tokeniser
paperkiln
A Llama-style decoder: 12 layers, width 768, 12 heads, rotary position
embeddings, SwiGLU and RMSNorm, 97.5M parameters and a 512-token
context. The tokeniser is byte-level BPE in the Llama 3 scheme (16,384
tokens, with chat role markers); paperkiln's encoder is ported from
llama.cpp's, and the trainer and the engine share it.
Pretraining
C++ · CUDA
120,000 steps (0.98 billion tokens) on a cloud L4 GPU, on a mix of
FineWeb-Edu educational web text and dialogue (SODA, UltraChat,
OpenAssistant, everyday conversations): 27% dialogue for most of the
run and 47% over the last 15%. Validation loss reached 2.68. The run
survived a reclaimed machine by resuming from a checkpoint with its
optimiser state.
Post-training
SFT
Supervised fine-tuning on 313,606 conversations in the chat template
(463,695 replies, every assistant turn in the loss), from
smol-smoltalk, TinyChat and everyday conversations, each checked
against the evaluation sets first: 18,620 steps in BF16, one pass over
the data, held-out loss 1.51. I chose it over three other fine-tuned
models and the previous model here for its question answering.
Evaluation
frozen prompts
On a 60-question probe of facts, science, arithmetic and follow-up
turns it answers 21: 44% of the facts and a third of the science
questions, no arithmetic. The previous model here, trained on
conversation alone, answered 2. The full-precision file runs unchanged
in llama.cpp and Ollama, with the same greedy replies on the frozen
prompts.
Serving
ember.cpp
The trained weights are exported to GGUF and loaded by ember.cpp, an
inference engine written separately from the trainer. Greedy output
is checked token for token against the trainer's own sampler. On a
GPU each decoding step is replayed as a captured CUDA graph. Here the
same engine runs as WebAssembly in your browser (with the forward pass
on your GPU through WebGPU where the browser has it) and gives the same
greedy replies as the native build; the 16-bit file gives the same
greedy replies as the full-precision one.
What comes next
roadmap
Preference training: replies sampled from this model, ranked by a
judge model, then DPO, gated on the same probes. Alongside it, a
research programme on how small a model can be and still hold a
conversation across many turns, trained on human-written text only.