Loom-Swift-Micro-3 / README.md
textilelabs's picture
One file, full precision (f16); Ollama template passes whole conversations
75c708c verified
|
Raw History Blame Contribute Delete
10.7 kB
---
license: mit
language: en
library_name: transformers
pipeline_tag: text-generation
base_model: textilelabs/Loom-Swift-Micro-2
tags:
- tiny-model
- gemma3
- from-scratch
- conversational
- tool-use
- agent-harness
- calculator
- humble-ai
- small-language-model
- muon
- gguf
- on-device
widget:
- text: "<tools:off>\n<user>\nmy name is Velmara\n<|eot|>\n<loom>\nNice to meet you, Velmara!<|eot|>\n<user>\nwhat's my name?\n<|eot|>\n<loom>\n"
example_title: "Remembers what you said"
- text: "<tools:off>\n<user>\nwho are you\n<|eot|>\n<loom>\n"
example_title: "Identity"
- text: "<tools:on>\n<user>\nwhat's 482 + 539?\n<|eot|>\n<loom>\n"
example_title: "Writes a calculator call"
---
<div align="center">
<img src="banner.jpg" alt="Loom Swift Micro 3" width="520">
</div>
# Loom Swift Micro 3
<img src="logo.jpg" alt="" width="20" height="20" style="border-radius:4px;vertical-align:middle;margin-right:6px;"> **1,172,832 parameters · 12 layers × 96d · 2K context · runs on phones · Textile Labs**
Loom Swift Micro 3 is the smallest Loom, now a **better talker**. It remembers what you told it earlier in the chat, answers follow-up questions,
says where an answer came from, and admits what it can't know, while still saying who it is, declining what it can't check, and writing
calculator and date calls. It runs in phone apps straight from the GGUF.
It continues [Loom Swift Micro 2](https://huggingface.co/textilelabs/Loom-Swift-Micro-2) (same size, same shape) with two more 5-minute
training rounds on Kaggle's two T4 GPUs. The Swift line was trained from scratch: randomly initialised weights, nothing fine-tuned from anyone's checkpoint.
> ## Read this first
> This is a **tiny model for tiny jobs**: about a million parameters, one 2.5 MB file. It chats briefly and kindly, knows its limits,
> and decides when a tool is needed. It is **not** a reader, a calculator or an extractor. The "Read this before you use it" section lists every miss we measured.
## What changed from Swift Micro 2
| | Loom Swift Micro 2 | **Loom Swift Micro 3** |
|---|---|---|
| everyday conversation (our 30-item chat test) | 7/30 | **18/30** |
| remembers what you told it | rarely | **often** |
| says it looked something up when asked | 0/5 | **2/5** (battery) · **4/4** (chat test) |
| size, shape, tokenizer, context | 1.17M · 12 × 96 · 4,096 · 2,048 | **unchanged** |
| training | 5 minutes from scratch | **+ 2 × 5 minutes**, continued from Swift Micro 2 |
## Measured against Swift Micro 2
Same tests, same scripts, same settings (repeat penalty 1.0, greedy), through Ollama. Every test prompt is scrubbed from the training data.
**The Loom acceptance battery**, row by row:
| row | Swift Micro 2 | **Swift Micro 3** |
|---|---:|---:|
| A · says its own name | 11/12 | 11/12 |
| B · its own name under rough typing | 11/12 | **12/12** |
| C · 5-turn conversation stays on thread | 5/5 | 5/5 |
| D · answers from a search result | 3/5 | 2/5 |
| E · follow-up answered from the same result | 0/5 | **1/5** |
| F · says it looked, after a lookup | 0/5 | **2/5** |
| G · **never** claims a lookup it didn't make | 16/16 | 16/16 |
| H · admits what it can't know about you | 5/8 | 4/8 |
| I · says when a result doesn't contain the answer | 3/5 | 3/5 |
| J · never leaks a search tag with tools off | 28/28 | 28/28 |
| K · stops on its own | 12/12 | 12/12 |
| L · searches when it should | 16/20 | 15/20 |
| **total** | **110/133** | **111/133** |
**Conversation** (new frozen test, 30 hand-written chats, written before any Swift 3 data):
| | Swift Micro 2 | **Swift Micro 3** |
|---|---:|---:|
| remembers what you told it (6) | 0 | **3** |
| follow-up from a search result (6) | 0 | 1 |
| says where an answer came from (4) | 0 | **4** |
| admits what it can't know (5) | 1 | **3** |
| kind, short replies (5) | 3 | **4** |
| who it is, rough typing (4) | 3 | 3 |
| **total** | **7/30** | **18/30** |
**The Swift jobs** (275 held-out items, the same frozen set Swift 2 was measured on):
| job | Swift Micro 2 | **Swift Micro 3** |
|---|---:|---:|
| everyday chat | 11/15 | **13/15** |
| declining an unknown fact, tools off | 18/20 | 17/20 |
| ignoring an instruction inside a passage | 4/10 | 2/10 |
| labelling (topic / language / sentiment / toxic / route) | 28/60 | **35/60** |
| calculator call correct | 13/40 | 11/40 |
| date arithmetic | 3/10 | **4/10** |
| reading a retrieved passage | 4/60 | **8/60** |
| typed extraction | 0/30 | 0/30 |
| redaction (exact match) | 0/30 | 0/30 |
| saying "(sure)" and being right | 22% | 47% of 34 |
No job fell by more than 2 items (our "lose nothing" rule for a new version).
**One file, full precision.** At this size a quantised file saves only a megabyte or so and loses a few items (we measured it), so we ship just the best version: `loom-swift-micro-3-f16.gguf`, 2.5 MB.
## Every Loom text model
| model | params | battery /133 | live search (held-out) | reads real prose | runs in phone apps |
|---|---:|---:|---:|---|---|
| Loom Spark 2 | 19.9M | ~97 | 2/20 | no | no |
| Loom Tapestry 2 | 22.8M | 107 | — | curated only | no |
| Loom Tapestry 3 Flash | 7.18M | 112 | 3/20 | curated only | no |
| Loom Spark 3 Flash | 7.18M | 119 | 5/20 | curated only | no |
| Loom Spark 3 | 12.2M | 120 | 7/20 | curated only | no |
| Loom Spark 3.2 | 22.8M | 122† | 7/20 | curated only | no |
| Loom Weave 3 | 31.5M | 120 | 6/20 | yes | no |
| Loom Tapestry 3 | 69.2M | 123 | 12/20 | yes + multi-hop | no |
| Loom Crucible Preview | 155.0M | 125† | 10/20 | yes — best curated reader | no |
| Loom Weave 4 | 55.6M | 127† | 10/20 | yes | yes |
| Loom Swift Mini (original) | 2.0M | 110‡ | — | no | no |
| Loom Swift Micro (original) | 1.16M | 110‡ | — | no | no |
| Loom Swift Mini 2 | 2.0M | 120 | not measured | barely (12%) | yes |
| Loom Swift Micro 2 | 1.17M | 110 | not measured | barely (7%) | yes |
| **Loom Swift Micro 3** | **1.17M** | **111** | not measured | barely (13%) | **yes** |
† scored on a battery with every test prompt scrubbed from training. ‡ the two original Swifts re-scored with the same script and settings as the Swift 2s. Earlier rows are each model's release score. Never compare scores from different command lines.
## Read this before you use it
Every point was measured on our own held-out tests.
- **It is a talker, not a worker.** Calculator calls 11/40, dates 4/10, reading a passage 8/60, extraction and redaction 0. Do not use it for calculation, extraction or redaction.
- **Two small slips against Swift Micro 2**, each within our 2-item allowance: ignoring an instruction hidden inside a passage (4/10 → 2/10) and calculator calls (13/40 → 11/40). On the battery it admits an unknowable 4/8 (was 5/8).
- **Its "(sure)" is still unreliable**: right 47% of the time it says it.
- It remembers what you said **within one chat** (2,048 tokens); it has no memory between chats. Its copying is imperfect: "I'm Tavira", "My name is Oskar" and "call me Bree" come back right, but "I am Tavira" comes back as "Your name is am Tavira".
- Replies are one or two short sentences.
## Usage — phone and desktop chat apps (PocketPal, LM Studio, Jan)
Download `loom-swift-micro-3-f16.gguf` (2.5 MB) and load it. The chat template and the stop token are inside the file.
Set **repeat penalty 1.0**. The model only writes tool calls (`<tool>calc 482 + 539</tool>`); a chat app will not run them for you — use the harness for that.
## Usage — the harness (search, calculator, date)
```bash
python3 harness.py "whats the capital of peru"
python3 harness.py "what is 482 + 539"
python3 harness.py --show "who wrote hamlet" # see what it searched and read
python3 harness.py --no-tools "who are you"
```
Stdlib only; Wikipedia needs no key. Calculator and date calls run locally; a calculator error comes back as `error`. **Never feed a failed lookup back as a result** — the model answers from the error text.
## Usage — Ollama / llama.cpp
```bash
ollama run hf.co/textilelabs/Loom-Swift-Micro-3 "who are you"
llama-cli -m loom-swift-micro-3-f16.gguf --jinja -cnv # uses the template in the GGUF
```
`template` (whole conversations, so it remembers earlier turns) and `params` are read automatically by Ollama. **Do not add a repetition penalty.**
## Usage — transformers (4.50 or newer)
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("textilelabs/Loom-Swift-Micro-3")
model = AutoModelForCausalLM.from_pretrained("textilelabs/Loom-Swift-Micro-3").eval()
prompt = tok.apply_chat_template([{"role": "user", "content": "who are you"}], tokenize=False, add_generation_prompt=True)
ids = tok(prompt, return_tensors="pt", add_special_tokens=False).input_ids
out = model.generate(ids, max_new_tokens=120, do_sample=False)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
```
Raw format (tools on or off): `<tools:off>\n<user>\n{message}\n<|eot|>\n<loom>\n`.
## How it was built
| | |
|---|---|
| architecture | Gemma-3 layout: 12 layers × 96d (10 sliding-window 512 + 2 global), 2 query heads / 1 KV head of 32, GeGLU 160, tied embeddings, QK-norm |
| parameters | 1,172,832 |
| vocabulary | 4,096 byte-level BPE, single digits, Qwen2-style pre-tokenizer (identical tokens in llama.cpp) |
| starting point | Loom Swift Micro 2 (5 minutes from random init) |
| round 1 | 5 minutes, 48M tokens: conversation skills plus four experimental jobs (commands, routing, form filling, privacy redaction) |
| round 2 | 5 minutes, 46M tokens: conversation skills plus every Swift 2 job in its own format; the round-1 jobs that missed their bars were removed |
| optimiser | continuation settings: Muon (≤ 0.01) on 2-D hidden matrices, AdamW (≤ 3e-4) on embeddings and norms, learning rate decaying from the start; per-conversation attention masking |
| attention check | before each run, the trainer's attention is checked against the reference implementation (loss and gradients identical) |
| hardware | Kaggle, 2 × NVIDIA T4 |
## Files
```
model.safetensors / config.json the model (transformers)
tokenizer.json / tokenizer_config.json tokenizer + chat template
loom-swift-micro-3-f16.gguf full precision GGUF (2.5 MB): phones, desktop apps, Ollama, llama.cpp
template / params / Modelfile Ollama
harness.py runnable harness — search, calculator, date; stdlib only
ATTRIBUTION.md required credits for the training data
```
## License
Model: MIT. Training data keeps its original licences — see ATTRIBUTION.md.