ZTFlynn/LFM2-1.2B-Cascadia-ternary3
LiquidAI/LFM2-1.2B compressed to 747 MB
with Cascadia β a spline manifold plus per-band lookup tables at 0.60 bytes
per weight β and executable on CPU by a C runtime whose entire dependency
list is libc, libm and libgomp.
| Base model | LiquidAI/LFM2-1.2B |
| Parameters | 16 layers, hidden 2048 |
| Checkpoint β package | 2.23 GB β 747 MB (3.14x) |
| Bits per weight | 5.09 |
| Tensors compressed | 16 |
| Architecture | 16 blocks, GQA 32q/8kv, gated short convolutions |
Quality
| perplexity | |
|---|---|
LiquidAI/LFM2-1.2B (bf16) |
80.26 |
| This package (ternary-3) | 92.02 |
| Result | +14.65% perplexity (95% CI [1.1303x, 1.1630x], t = +18.77) |
8,176 paired tokens, FineWeb-Edu, 512-token windows. Scoring both models on identical tokens and comparing per token cuts the standard error 5.5x versus two independent means, which is what makes this resolution achievable.
A measured cost. At this size the ternary-3 rate is a real trade: 3.14x compression for 14.7% higher perplexity. Larger models in this family pay far less β see the table below.
How compression cost scales with model size
Measured across the family with the same corpus and method:
| model | parameters | perplexity cost |
|---|---|---|
| LFM2.5-230M | 0.23B | +7.7% |
| LFM2-350M | 0.35B | +3.5% |
| LFM2-24B-A2B | 24B | no detectable cost (< 0.3%) |
Redundancy grows faster than the format's error, so larger models compress more nearly losslessly. Below roughly 350M parameters the ternary-3 rate becomes a visible trade rather than a free one.
Usage
Executed by the Cascadia C runtime.
This is a compressed package, not a transformers checkpoint.
git clone https://github.com/EntroMorphic/cassie && cd cassie
cmake -S src/c -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j
huggingface-cli download ZTFlynn/LFM2-1.2B-Cascadia-ternary3 --local-dir ./pkg
./build/cascadia_generate ./pkg 512 --chat "Explain gradient descent."
Sampling is --temp / --top-k / --top-p / --seed; the default is greedy
and seed-reproducible. Generation stops at <|im_end|>, so max_new is a
ceiling.
Python
from transformers import AutoModelForCausalLM
from cascadia import load_compressed
model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2-1.2B", dtype="bfloat16")
model, stats = load_compressed(model, "./pkg", model_id="LiquidAI/LFM2-1.2B")
Sample output
Prompt: "How many eggs are in a baker's dozen?"
A baker's dozen is a term used in baking, and it traditionally refers to a dozen eggs, which is equal to 12 eggs. So, there are 12 eggs in a baker's dozen. However, if you're asking about a modern or playful interpretation, some bakers might joke that a baker's dozen could contain anywhere from 10 to 20 eggs, depending on how many eggs they're using and how they're counting. But strictly speaking, a baker's dozen always counts as 12 eggs.
Greedy, generated to natural completion.
Package contents
| file | size |
|---|---|
weights.bin |
745 MB |
manifest.json |
per-tensor geometry and offsets |
aux.bin |
RMSNorm scales, conv kernels, architecture constants |
tokenizer.bin |
vocabulary, merges, Unicode tables |
Format specified in docs/package_format.md and machine-verified against every package.
How it works
A B-spline surface is fitted to each weight matrix to capture large-scale structure. Each weight is assigned to one of 32 bands by its spline value, and a k-means codebook is learned per band over the residuals. The top 0.5% of errors are kept exactly as f32. Codebook indices pack in base 3, five trits per byte, since 3β΅ = 243 fits a byte.
Reconstruction is W = spline(j,c) + codebook[band][index], evaluated inside
the matvec so no dense weight matrix is ever built. Because the spline
carries dynamic range, the residual tables need no per-block scale
factors.
Limitations
- Runs under the Cascadia C runtime rather than
transformersdirectly. - The runtime executes ternary-3 packages; other presets convert but are not yet supported by the kernel.
- Batch-1 CPU inference, suited to edge and batch workloads.
- Greedy and sampled decoding; no beam search.
Acknowledgements
Deeply inspired by Magneato/deepseek-r1-qwen-7b-lutc, which demonstrated LUT-cascade compression of a 7B model at 5.45 bits per weight. The Guanaco LUT cascade β no-scale residuals, variable bit rate, and f32 outlier preservation β is the foundation this builds on. Cascadia adds a spline manifold for band selection and a Harmonic Collapse step that removes per-block scale factors entirely. Our thanks to Magneato for publishing both the approach and the weights that made it concrete.
Base model by Liquid AI, used under the LFM Open License.
Citation
@software{cascadia,
title = {Cascadia: Spline Manifold LUT Compression for Language Models},
author = {Josserand-Austin, Tripp},
year = {2026},
url = {https://github.com/EntroMorphic/cassie}
}
Model tree for ZTFlynn/LFM2-1.2B-Cascadia-ternary3
Base model
LiquidAI/LFM2-1.2B