LFM2.5 Encoder 230M + SigLIP2: A Compact Multimodal Encoder

TL;DR

We augment Liquid AI’s LFM2.5 Encoder 230M — a 230M-parameter bidirectional masked-language encoder — with a SigLIP2 vision tower and 32 learned soft tokens to build an encoder-only multimodal model for retrieval and image-text matching. Clean image-only retrieval on 12,500 held-out MONET pairs reaches 0.1194 image→text R@1 with the BF16 reference; the GPTQ INT4 release retains 0.1091 while shrinking the package from 923.65 MB to 370.46 MB (−59.9%). Cyclic-negative matching AUROC is 0.9733; text-nearest hard negatives and image-conditioned masked-token prediction remain at chance, and the model does not generate.

Introduction

Liquid AI’s LFM2.5 Encoder 230M is a compact bidirectional masked-language encoder: 229.7M parameters, hidden width 1,024, 14 layers, and a 65,536-row vocabulary. It is an excellent text representation model, but it is not natively multimodal — there is no vision tower in the checkpoint. This post records an external vision augmentation: we bolt a SigLIP2 base vision encoder onto the frozen LFM2.5 body through a learned 32-token soft-visual projector, adapt the stack for retrieval and image-text matching, and ship the result as a GPTQ INT4 package at 370.46 MB — 59.9% smaller than the original FP32 checkpoint package.

The claim is deliberately scoped. This is an encoder-only model: it produces image/text representations and image-text matching scores for retrieval, matching, and representation extraction. It does not generate captions or chat responses. The evaluation is decoder-free and leakage-free: for retrieval, the image representation is built from BOS + image marker + visual tokens only, and the candidate caption is never fed into the image branch.

These are recorded run summaries from the LFM2.5 encoder lab (reports under reports/ in the lab repository), not general benchmarks.

Architecture

The image path runs through three frozen-or-trainable stages. The vision tower is frozen, the projector is the only trainable bridge into the frozen text body, and the final blocks of the body carry LoRA adapters for task alignment.

Image
  ↓
SigLIP2 base patch16 256            [batch, 256, 768]   ← frozen vision tower
  ↓
Learned 32-token projector          [batch, 32, 1024]   ← trainable bridge
  (+ modality embedding)
  ↓
LFM2.5 bidirectional encoder        [batch, seq, 1024]  ← frozen body + LoRA (layers 10–13)
  ↓
Image/text embedding  ·  image-text matching score

The image branch is BOS + image marker + 32 visual tokens inserted at position 1 of the text sequence. The text branch is a caption-only LFM2.5 encoding. During clean retrieval evaluation the two branches never share the candidate caption; the matching head is the only component that may receive image and candidate text together, which is correct for image-text matching.

Dataset and training

Training uses a 100,000-pair MONET subset materialized from jasperai/monet (revision baae102c4c96c6571f248b86784c67c5af4fd57a) with a seeded streaming shuffle and quality filters: source == laion, aesthetic_jasperai > 0.5, nsfw_jasperai < 0.1. An exact-byte audit found 0 duplicate images and 0 cross-split duplicates.

SplitPairs
Train73,000
Calibration holdout (reserved, unused for weights)2,000
Validation12,500
Test (held out)12,500

Seeded stream split (seed 42). The calibration holdout is reserved for fused multimodal quantization calibration only.

Training is two stages with different frozen/trainable splits. Projector alignment freezes the vision tower and the entire LFM2.5 body; task adaptation then trains LoRA on the final blocks plus the matching head:

  • Projector alignment — symmetric InfoNCE (temperature 0.07), 1,000 steps, batch 8, learning rate 1e-4, FP32, seed 42. Initial loss 2.08 → 0.15.
  • Task adaptation — retrieval InfoNCE plus binary image-text matching loss (weight 0.5), with LoRA on the final four LFM2.5 blocks (layers 10–13, rank 8 / alpha 16, 24 Linear modules), 1,000 steps, learning rate 5e-5.

The adapted weights live in a separate task adapter (projector + LoRA + matching head); the original checkpoint is never modified.

A leakage correction that changed the evaluation

The first training branch extracted the image representation from a fused image + positive-caption sequence. That is valid for image-text matching, but invalid for image-to-text retrieval — the image branch had already seen the target caption. A 2,048-pair diagnostic with an image-only representation exposed the problem: retrieval collapsed to near chance.

BranchPairsImage→text R@1Text→image R@1Hard-negative AUROC
Original paired-caption branch2,0480.00240.00000.5420
Clean retrained branch (image-only representation)12,5000.11940.15780.4974

Recorded diagnostic. The paired-caption adapter’s earlier high retrieval numbers were caption-leakage artifacts; the clean row is the full 12,500-pair BF16 evaluation.

The clean branch retrains with an image-only representation for contrastive alignment and retrieval — the caption is never sent through the image branch — while the matching loss still uses the fused image-plus-caption representation, which is correct for ITM. This clean branch is the publication branch, and the earlier paired-caption artifact is retained only as a leakage diagnostic.

GPTQ INT4 with fused multimodal calibration

The merged LoRA-adapted body is compressed with GPTQ INT4 (W4A16). The calibration pass is fused: it uses 256 samples of actual projected visual tokens plus caption embeddings — not text-only inputs — so the quantization reflects the real multimodal path.

Compression settingValue
MethodGPTQ INT4
Weight / activation formatW4A16
Quantized layersLinear layers; lm_head excluded
Block size128
Activation order / dampeningStatic / 0.01
Calibration256 fused multimodal inputs_embeds samples
Max calibration sequence length160 tokens
Compressor revision8cec0acc1931de6f8f73257151ab7007c14dbf4e

Recorded run summary. The overlay used compressed-tensors 0.17.2a20260729 with the lab’s LFM2-specific SwiGLU mapping.

ArtifactModel weightsFull packageRelative to original
Original LFM2.5 Encoder 230M FP32918.79 MB923.65 MB100%
Clean BF16 reference459.40 MB474.81 MB51.4%
Clean GPTQ INT4 release355.03 MB370.46 MB40.1%

Recorded artifact sizes. The GPTQ release is 59.9% smaller than the original package and 22.0% smaller than the clean BF16 package. The external SigLIP2 vision tower is downloaded separately and is not included.

Fidelity metricGPTQ INT4 vs BF16
Hidden-state cosine0.9427
Logit cosine0.9654
Logit top-1 agreement0.8485

Text smoke prompts; hidden/logit cosine is a secondary diagnostic, task quality is primary.

Evaluation

All retrieval below uses the clean image-only representation, on the full 12,500-pair MONET test split (bootstrap 95% CIs over pair-level ranks) plus a bounded 2,000-example external CC3M subset. The 12,500-way random R@1 baseline is 0.00008; the 2,000-way baseline is 0.0005.

ModelImage→text R@1 (95% CI)Text→image R@1 (95% CI)i→t R@5t→i R@5Mean rank i→t / t→i
MONET BF16 reference0.1194 [0.1134, 0.1244]0.1578 [0.1515, 0.1632]0.30890.359858.66 / 50.04
MONET GPTQ INT40.1091 [0.1036, 0.1147]0.1460 [0.1399, 0.1511]0.29590.341863.38 / 53.78
CC3M external, GPTQ INT40.0865 [0.0735, 0.0995]0.1145 [0.1010, 0.1310]0.21900.2835137.34 / 112.76

Clean retrieval, recorded run. GPTQ INT4 retains ~91% of the BF16 image→text R@1 on MONET; CC3M shows expected domain degradation but stays far above random.

Matching is evaluated against two negative families: cyclic in-batch negatives (easy) and text-nearest hard negatives chosen by independent text-only embedding similarity (hard).

ModelCyclic AUROCCyclic AUPRCHard AUROCHard AUPRCHard positive wins
MONET BF160.97470.96340.49740.49740.4861
MONET GPTQ INT40.97330.96190.49610.49740.4914
CC3M external GPTQ0.80650.79320.52560.52170.5665

Recorded run. The head recognizes coarse compatibility but does not reliably resolve semantically close captions — an important limitation.

Visual ablation on 512 MONET pairs swaps the visual input to isolate how much of the image representation comes from the learned tokens.

Visual inputBF16 i→t R@1BF16 t→i R@1GPTQ i→t R@1GPTQ t→i R@1
Trained visual tokens0.49220.54490.48830.5352
Zero visual tokens0.00200.00000.00200.0000
Random visual tokens0.00200.00000.00200.0000
Shuffled visual tokens0.01170.01950.01170.0215
No-image (fixed zero control)0.00200.00000.00200.0000

Recorded run, 512 pairs. Cosine to the trained image representation: zero 0.0094, random 0.0247, shuffle 0.1111 (BF16).

Robustness on 256 MONET examples: retrieval stays well above random under blur, grayscale, darkening, and center-crop perturbations (GPTQ image→text R@1: 0.5938 / 0.5742 / 0.6367 / 0.5391; BF16 similar). Image-conditioned masked-token prediction does not beat zero-image or text-only controls (BF16 trained loss 2.20 vs 1.90 zero-image vs 2.00 text-only), so MLM is not yet evidence of fine-grained visual grounding.

Limitations

  • Encoder-only. No generation, no decoder, no captioning. The model is for retrieval, matching, and representation learning.
  • Hard negatives are near chance. Text-nearest hard-negative AUROC is ~0.50 on MONET and ~0.53 on CC3M; cyclic negatives (AUROC 0.9733) are substantially easier.
  • No fine-grained grounding signal yet. Image-conditioned masked-token prediction does not outperform zero-image/text-only controls on the current caption data.
  • Bounded external evaluation. External generalization uses a 2,000-example CC3M subset, not full COCO / Flickr30k / Winoground (gated or legacy-script blocked); its source terms require review before redistribution.
  • Duplicate audit is exact-byte only. Perceptual duplicates are not covered.
  • Size-oriented compression. On the tested L4 the generic compressed-tensors backend makes INT4 slower and more VRAM-hungry than BF16; the release targets artifact size.
  • Single recorded runs. Point estimates except retrieval CIs carry unknown single-run noise.

Reproducibility

The compact release is on Hugging Face at konic-labs/LFM2.5-multimodal-encoder-230M, with the GPTQ weights, the bidirectional runtime implementation, the task adapter (projector + matching head), the quantization recipe, and a saved evaluation/ directory containing the BF16, GPTQ, and external CC3M metrics. Every step — dataset preparation, projector and task training, compression, structural surgery, and the deep evaluation harness — is reproducible end-to-end, with step-by-step reports under reports/ and reports/deep_eval/.

One deterministic example:

python run_multimodal.py \
  --model . \
  --image /path/to/image.jpg \
  --text "A photograph of a small red vehicle beside a building." \
  --device cuda:0 --dtype float32

Tested environment: NVIDIA L4 (23,034 MiB), PyTorch 2.11.0+cu128, Transformers 5.14.1, Datasets 5.0.1, llm-compressor at revision 8cec0acc, compressed-tensors 0.17.2a20260729 overlay.

Conclusion

A 230M bidirectional text encoder can be turned into a useful multimodal encoder without touching the original checkpoint: a frozen SigLIP2 tower, 32 learned soft tokens, and LoRA adaptation produce image/text representations that retrieve held-out MONET pairs far above random, survive moderate visual perturbations, and depend on the actual visual tokens (ablations collapse without them). GPTQ INT4 with fused multimodal calibration keeps ~91% of the BF16 retrieval R@1 in a package 59.9% smaller than the original FP32 checkpoint.

The honest boundary is equally important: this is an encoder for retrieval and matching, not a generator; fine-grained hard-negative discrimination and visual grounding are open problems; and the quantized artifact is a size win, not yet a runtime win. Teams considering this stack should measure on their own distribution rather than extrapolate from these recorded runs.

Sources

  • Hugging Face release: konic-labs/LFM2.5-multimodal-encoder-230M — GPTQ INT4 weights, task adapter, recipe, and saved metrics.
  • Base model: Liquid LFM2.5 Encoder 230M — 229,693,184 parameters, bidirectional masked-language encoder, hidden width 1,024, 14 layers.
  • Vision tower: google/siglip2-base-patch16-256 — 256 patch tokens at 768 width, projected to 32 × 1,024.
  • Dataset: MONET 100k subset of jasperai/monet (revision baae102c), filters source == laion, aesthetic_jasperai > 0.5, nsfw_jasperai < 0.1.
  • External subset: 2,000 bounded pixparse/cc3m-wds examples; source terms require review before redistribution.
  • Compression: GPTQ INT4 W4A16 via llm-compressor revision 8cec0acc, 256 fused multimodal calibration samples.

Key takeaways

370 MB

GPTQ INT4 release (from 923.65 MB, −59.9%)

0.1194

Clean image→text R@1, BF16, 12,500 MONET pairs

0.1091

GPTQ INT4 image→text R@1 — ~91% retained

0.9733

Cyclic-negative matching AUROC (hard negatives: near chance)

More research

Optimized LFM2.5-VL-3B: FFN Width Pruned, Distillation Aligned, INT4 Quantized

We surgically compress Liquid AI’s LFM2.5-VL-3B — an architecture-searched hybrid conv+attention vision-language model — by cutting FFN width where the search never optimized it: joint-SwiGLU Wanda pruning (10752→8192 and →7168), distillation-to-baseline LoRA recovery, and hand-rolled W4A16 GPTQ + W8 mixed-precision quantization. All three tiers are near-lossless against the base on our paired eval shards — PPL ratios at or below baseline (0.79–0.85), top-5 token agreement ≥ 0.95, quantization adding only +0.02–0.06 nats — across 5.30 GB (−15%), 4.92 GB (−21%), and 1.93 GB packed / 2.22 GB (Konic Optimized) — native INT4/INT8 compressed-tensors in vLLM (−69%). Live comparison on the smallest tier preserves scenes, facts, and tool calling — 10/10 tool rounds, including correct abstention where the base over-triggered. Recorded runs, not general benchmarks.

Read article

Two Stages, Much Smaller MoE: REAP Expert Pruning Followed by AWQ INT4 Quantization

We chain two complementary compression stages on Liquid LFM2.5-8B-A1B — REAP CUDA expert pruning (32→16 experts across 22 MoE layers) then external AWQ INT4 quantization (W4A16_ASYM, group 128). The published packed artifact is 1.15B packed-weight equivalent / 2.79 GB; recorded MATH500 and BFCLv3 results use a separate 9.18 GB AWQ-scaled BF16 derivative for vLLM evaluation, not direct packed-INT4 runtime. These are recorded run summaries, not general benchmarks.

Read article

From-Scratch AWQ INT4 Quantization on Qwen3-8B

We validate a from-scratch, pure-PyTorch AWQ implementation on Qwen3-8B: group-wise INT4 with per-channel AWQ scaling produces a 4.0× smaller model (13.9 GB → 3.5 GB linear weights) at 1.034× FP16 perplexity on WikiText-2 (10.08 vs 9.75), loaded and run in a real INT4 GEMM runtime. The decisive factor is norm-folding the AWQ scale — 20× more accurate per weight than weight-dequantization.

Read article

REAP Expert Pruning for On-Device MoE Models

We present REAP-MLX, an Apple Silicon implementation of Router-weighted Expert Activation Pruning (REAP) for Mixture-of-Experts language models. We evaluate quality retention across compression ratios on the LFM2.5-8B architecture: REAP preserves 96.8% of code generation performance at 25% compression and 91.4% at 50% compression, with less than 0.4 percentage point variance across independent calibration draws.

Read article