Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 21 min read Deep dive hardMaster

Perceiver IO: a scalable, fully-attentional model that works on any modality

Perceiver IO avoids the quadratic cost of self-attention by running attention over a small fixed set of latent variables (e.g. 256×1280). Inputs of any modality enter only through cross-attention, where the latents supply the queries, and outputs are produced by cross-attention with trainable decoder queries. Walking through the Hugging Face Transformers implementation, the post traces tensor shapes through preprocessors, the latent encoder, decoders and postprocessors. Examples cover byte-level text classification and masked language modeling, which reaches 81.8 on GLUE without a tokenizer, and image classification with learned, Fourier or convolutional preprocessing.

Assumes: Transformer self-attentionPyTorch tensorsBERT-style pretraining

Related posts

  • Welcome Gemma 4: Frontier multimodal intelligence on device

    Hugging Face mediumAdept

    Google DeepMind's Gemma 4 is an Apache 2-licensed multimodal model family in five sizes: E2B, E4B, a 12B encoder-free Unified model, a 31B dense model and a 26B MoE with 4B active parameters. The models take text, image, video and in some sizes audio, with context windows up to 256K. The architecture combines alternating sliding-window and global attention, dual RoPE configurations, Per-Layer Embeddings that feed a small per-layer residual signal, and a shared KV cache in which the final layers reuse earlier layers' key/value tensors to save memory and compute. Practical guidance covers modality ordering in prompts (images before text, audio after), native JSON bounding-box output on a 1000x1000 grid, and running or fine-tuning the models with transformers, llama.cpp, MLX, transformers.js, Mistral.rs and TRL.

  • Meta is back with Muse Glimmer: local, agentic, multimodal, and open source

    Hugging Face mediumAdept

    Muse Glimmer is Meta's new open-source (Apache 2.0) 30B dense multimodal model, distilled from Muse and built for local agentic use cases such as coding, document analysis and personal assistants. It pairs a 2B Perception Encoder vision tower with a 28B text decoder. The decoder repeats a (SWA, SWA, SWA, Full) attention pattern across 52 layers, using RoPE on the sliding-window layers and NoPE on the full-attention layers. It also uses gated GQA with 16 query heads per KV head and QK-norm with extra query scaling. Images are reduced 4x via pixel shuffle, and video is sampled at 2 fps up to 96 frames. Day-0 support covers transformers, llama.cpp, vLLM and a DFlash block-diffusion speculative decoding drafter, with code for text, image, video, tool-calling and object-detection inference.

  • PaliGemma – Google's Cutting-Edge Open Vision Language Model

    Hugging Face mediumAdept

    PaliGemma is Google's open vision-language model family that pairs a SigLIP-So400m image encoder with a Gemma-2B text decoder through a linear projector. It ships as pretrained, mix and task-specific fine-tuned checkpoints at 224, 448 and 896 resolutions. Behaviour is steered with task prefixes such as "detect" and "segment", and detections come back as <loc> tokens normalized to 1024. Images become 256 to 4096 prefix tokens with full attention over the image and prompt, so higher resolutions cost much more memory while helping mainly fine-grained tasks like OCR. The post includes transformers code for inference, 4-bit loading, and fine-tuning the decoder with full training or QLoRA, plus big_vision transfer configs.

  • Falcon Perception

    Hugging Face hardMaster

    Falcon Perception is a 0.6B-parameter early-fusion Transformer that handles open-vocabulary grounding and segmentation in one backbone. A hybrid attention mask makes image tokens attend bidirectionally and text/task tokens causally. Each instance is decoded through a coord → size → seg token chain using Fourier-feature heads and a dot-product mask head, which avoids Hungarian matching. It scores 68.0 Macro-F1 on SA-Co versus 62.3 for SAM 3 and leads by wide margins on the new PBench capability benchmark (spatial +21.9, OCR-guided +13.4, dense +14.2), but trails SAM 3 on presence calibration (MCC 0.64 vs 0.82). Training uses DINOv3/SigLIP2 multi-teacher distillation, a 54M-image dataset with 1:1 hard negatives, a three-stage curriculum and Muon for the heads, and a 0.3B Falcon OCR variant reuses the same architecture.

  • Universal Image Segmentation with Mask2Former and OneFormer

    Hugging Face mediumAdept

    Instance, semantic and panoptic segmentation have converged on "universal" architectures that treat every task as binary mask classification rather than per-pixel classification, a line running from DETR through MaskFormer to Mask2Former. Mask2Former passes backbone features through a pixel decoder and uses a Transformer decoder to turn queries into mask and class predictions, but still needs separate training per task. OneFormer adds a text encoder conditioned on the task, so a single panoptic training run matches state of the art on all three tasks, at the cost of extra latency. Code shows panoptic inference and post-processing with Mask2Former in 🤗 transformers, plus the class changes needed to fine-tune from MaskFormer notebooks.

The quest for software engineering knowledge.

Look:
Layout: