Cbot, compiled into transformer weights

Cbot is a rule-based chatbot in C. It uses expert modules and an arbiter in the style of PyBot, and has no neural network. These GGUF files are Cbot's rules compiled into a one-block GPT-2 by Cbot's c2w tool. Nothing is trained: every weight is set by construction from the rules, lexicon, knowledge base and replies. They exist to show what a 1.5 MB C program costs as dense matrices, and that an ordinary LLM engine runs it.

cbot.gguf cbot-flash.gguf
source variant cbot (full knowledge base) cbot-flash (facts only)
rules compiled 5861 3552
n_embd (= attention heads, size 1) 2400 2080
n_ff 24800 17280
vocab 8948 6326
parameters 186.3 M (9.4% nonzero) 116.6 M (10.7% nonzero)
file (f16) 373 MB 233 MB
size vs the C binary 246x (binary: 1.52 MB) 158x (binary: 1.48 MB)

Run

llama-cli -m cbot.gguf -fa on -c 256 -ub 32 --temp 0 -st -p "what is the capital of france"
The capital of France is Paris.
  • -fa on is required. With attention heads of size 1, llama.cpp's non-flash attention path aborts while building the graph.
  • One turn per conversation (-st). The model ignores order and history, so earlier turns left in the context would trigger rules too.
  • --temp 0 always gives the first variant of a reply. With sampling, variants of the same reply have equal logits and are picked at random, as Cbot itself does.

How it works

  • Prompt format: the chat template writes <|bos|> text<|bot|>. The model first emits a control token naming the chosen reply (the intent), then the reply text, then <|end|>.
  • Residual dimensions: one per rule element: a word, a set of alternatives, a word class, or a number.
  • Attention: each element has a head of size 1 that asks "does the prompt contain it?".
  • Rule neurons: one FFN neuron per rule ANDs its elements and writes the rule's rank into its reply's logit. The sampler's argmax is the arbiter.
  • Speech neurons: one per reply token maps (reply, current token) to the next token.
  • Tokenizer: llama.cpp's rwkv greedy longest match over every byte, the words the rules use (" word", " Word") and the reply pieces.

What it can and can't do

  • Compiles: everything that depends only on the current message: small talk, safety replies, jokes, facts (capitals, authors, languages, currencies, chemical elements, continents), definitions and the Q&A table.
  • Doesn't compile: arithmetic and unit conversion on arbitrary numbers, the clock, memory of earlier turns, and replies that quote the user. Use the Space for the whole bot.
  • Looser matching than Cbot: rules match their words in any order, there is no spell correction, and a word the vocab lacks counts as nothing.

Checks

Each eval*.tsv line holds: set, prompt, the replies Cbot accepts (separated by 0x1f), and the compiled program's reply. There is one canonical prompt per sampled rule, plus every input of Cbot's golden test transcripts.

cbot cbot-flash
network = compiled program, in llama.cpp 413/413 415/415
network = compiled program, c2w's C reference, all rules 5861/5861 + 119/119 golden 3552/3552 + 119/119
same reply as Cbot, one prompt per rule 98.5% 97.8%
same reply as Cbot, golden inputs 45/119 48/119

Most golden inputs exercise the modules that don't compile. For 46 of them (49 for flash), Cbot's reply is one the model can produce, and it matches on all but one.

Measured speed in llama.cpp on 4 CPU cores: about 34 tokens/s for cbot and 55 for cbot-flash.

Downloads last month
174
GGUF
Model size
0.1B params
Architecture
gpt2
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using amshimba/Cbot-GGUF 1