Downloads · 30 days
0
ZTFlynn/LFM2-350M-ENJP-MT-Cascadia-ternary3
LFM2-350M-ENJP-MT-Cascadia-ternary3 is a text generation model from ZTFlynn. Use it when you need the model to write or continue text. It is set up for cascadia. The card lists the license as other.
LiquidAI/LFM2-350M-ENJP-MT compressed to 241 MB with Cascadia — a spline manifold plus per-band lookup tables at 0.675 bytes per weight — and executable on CPU by a C runtime whose entire dependency list is libc, libm…
Downloads · 30 days
0
Access
Public
Updated Sep 2, 2026
Repo size
466 MB
Likes
0
Public
Click a slice to open those files.
.bin241 MB · 100%
From the Hugging Face model README
LiquidAI/LFM2-350M-ENJP-MT compressed to 241 MB
with Cascadia — a spline manifold plus per-band lookup tables at 0.675 bytes
per weight — and executable on CPU by a C runtime whose entire dependency
list is libc, libm and libgomp.
| Base model | LiquidAI/LFM2-350M-ENJP-MT |
| Parameters | 16 layers, hidden 1024 |
| Checkpoint → package | 676 MB → 241 MB (2.96x) |
| Bits per weight | 5.40 |
| Tensors compressed | 16 |
| Resident memory | 298 MB on CPU, 355 MB on GPU — 1.24x the package |
| Architecture | 16 blocks, GQA 16q/8kv, gated short convolutions |
| perplexity | |
|---|---|
LiquidAI/LFM2-350M-ENJP-MT (bf16) | 268.61 |
| This package (ternary-3) | 259.95 |
| Result | -3.22% (95% CI [0.9542x, 0.9823x], t = -4.37) |
Measured on a Jetson AGX Thor: CPU is 12 threads of a 14-core Arm part, GPU is the integrated Blackwell. Decode is the median of five runs; prefill is from a 162-token prompt. Both backends produce byte-identical output.
| CPU (12 threads) | GPU | |
|---|---|---|
| decode | 8.0 tok/s | 63.23 |
| prefill | 47.6 tok/s | 228.4 |
Load takes 0.29 s on CPU and 0.28 s on GPU, the latter including the host-to-device upload.
117,530 paired tokens of FineWeb-Edu in 229 independent 512-token windows. Both models score identical tokens and are compared per token, which cuts the standard error 4.8x versus two independent means.
The window is the unit of inference, not the token: tokens inside one window share a context, and counting them as independent samples inflates the t-statistic several-fold. Resolving a difference of a few percent takes hundreds of windows.
Perplexity came out below the uncompressed checkpoint, and at 229 windows the difference resolves. This is not a claim that the package is a better model: a compressed copy cannot acquire capability its source lacked.
What it shows is that perplexity on this corpus is not a measure of how faithful a copy is. The corpus is general web text, and a small perturbation of the weights can move a model's likelihood on out-of-domain text in either direction — here it moved down. Reconstruction fidelity below puts this package in the same band as every other model in the family, which is the fact about the compression.
Perplexity measures how good a model is on a corpus, not how faithful a copy is, and the two disagree here: models compressed to identical reconstruction error differ by 16 percentage points of measured perplexity. Fidelity has no sampling uncertainty and no dependence on corpus domain, so it is measured directly and reported alongside.
| Relative L2 error vs the bf16 checkpoint | 0.0549 |
| Systematic gain (1.0000 is faithful) | 0.9993 |
| Measured over | 93 of 93 tensors, 100% of parameters |
By tensor class:
| class | rel L2 | share of model |
|---|---|---|
| linear | 0.0582 | 287M params |
| embedding | 0.0275 | 67M params |
The tied embedding, the tensor whose error reaches the logits undamped, reconstructs at 0.0275.
The cost is concentrated in one tensor. The tied embedding, which also
serves as lm_head, is compressed by a single global codebook — no bands,
no spline manifold, no exact outliers — while every linear tensor gets 32
bands, a spline, and 0.5% of its weights kept exact. Its error is the only
error in the model that reaches the logits with nothing downstream to
absorb it.
Measured on LFM2-350M, relative L2 reconstruction error:
| tensor | codebook | rel L2 |
|---|---|---|
| tied embedding, 27 entries | 27 | 0.078 |
| tied embedding, 81 entries | 81 | 0.027 |
| a typical linear (32 bands x 27) | 864 | 0.057 |
At 27 entries the embedding is the worst-reconstructed tensor in the model. This package uses 81 entries for it, which costs about 6% in size and makes it the best-reconstructed tensor instead.
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-350M-ENJP-MT-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.
The same package runs entirely on the GPU, with byte-identical output and roughly 14-16x the throughput. Opt-in, so the default build is unchanged:
cmake -S src/c -B build -DCASCADIA_CUDA=ON -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build -j
./build/cascadia_generate_cuda ./pkg 512 --chat "Explain gradient descent."
Same arguments, same tokens. Needs CUDA and sm_75 or newer.
from transformers import AutoModelForCausalLM
from cascadia import load_compressed
model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2-350M-ENJP-MT", dtype="bfloat16")
model, stats = load_compressed(model, "./pkg", model_id="LiquidAI/LFM2-350M-ENJP-MT")
Prompt: "How many eggs are in a baker's dozen?"
パン屋の12個入りの卵の中には、何個の卵が入っていますか?
Greedy, generated to natural completion.
| file | size |
|---|---|
weights.bin | 239 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.
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.
transformers directly.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.
@software{cascadia,
title = {Cascadia: Spline Manifold LUT Compression for Language Models},
author = {Josserand-Austin, Tripp},
year = {2026},
url = {https://github.com/EntroMorphic/cassie}
}