Loading…
Topic
Transformers
13 posts about Transformers. Every summary links to the original.
- 13 posts
- 4 companies
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
180B Parameters, 32GB of RAM: Pushing MoE Inference to the Limit with Transformers
The author modified Transformers to stream MoE experts from disk, enabling a 180B-parameter Qwen model to run on a 32 GB MacBook M5 at ~14 tok/s. Existing engines like llama.cpp and vLLM either thrash the page cache or copy all experts on every token. The key innovation is a slot-pool cache: one preallocated device tensor shared across layers, with a per-layer mapping from expert ID to slot, so that grouped_mm runs on the pool as if it were a regular expert bank. Experts are quantized to 3 bits, read by 8 I/O threads, and prefetched by running the next two layers’ routers early. The implementation closes the gap with Strata to about 6% on short decode, with slightly faster prefill. The author notes that closing the remaining gap would require deeper changes in PyTorch’s MPS stream control.
On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models
State Space Models (SSMs) offer constant memory and linear compute as an alternative to Transformers but lag on in-context learning and precise retrieval tasks. This work shows that the gating mechanism, common in modern recurrent networks, explains both the success and failure of SSMs in these domains. Through theory and experiments, the authors demonstrate that gating causes SSMs to first learn an in-weights memorization solution while delaying or preventing convergence to a correct in-context learning solution. This occurs even when the architecture has no fundamental limitations in memory capacity. However, gating is often beneficial for improving generalization to long sequence lengths, illuminating its crucial role in shaping training dynamics and generalization.
Decision Models in Hugging Face
Decision models evaluate a state against typed questions—choice, score, or noul—and return a probability distribution over predefined answers without generating text. Unlike traditional classifiers, they accept runtime-defined labels, and unlike zero-shot classifiers, they handle multiple typed questions per request. The interface is State + Questions + Allowed Answers → Decisions + Probabilities, with models like JEV-9B available on the Hugging Face Hub under a dedicated tag, and the ecosystem includes encoder-based and generative backbone models. Hugging Face’s transformers library supports inference via a pipeline and fine-tuning via the Trainer API, with a toy example fine-tuning JEV-9B to route support requests to billing, shipping, or technical categories using cross-entropy loss. Decision models make decisions and probabilities first-class outputs, optimized for reliable, calibrated decisions in software, and are designed to be more efficient than prompting LLMs for structured tasks.
StateBench: Testing how language models track state changes over long documents
StateBench is a benchmark for evaluating how language models track state changes in long documents, a capability underlying tasks from reading code to following stories. It defines four difficulty levels: R-trivial, aperiodic, soluble, and general finite, each permitting different types of variable assignment. Pretrained models performed well on R-trivial but lost accuracy on aperiodic problems as inputs grew and stayed at chance on general finite problems, with format affecting results. Frontier models like Gemini 3.8 Flash, Claude Opus 5.5, and GPT-6 Sol and Luna also struggled on harder levels, with accuracy dropping to 13% or lower. When trained directly, Gated DeltaNet and hybrid models generalized to sequences up to 250 times training length, while transformers never learned the hardest level, suggesting architectural limits; open questions remain about handling new entities over time.
Attention to Mamba: A Recipe for Cross-Architecture Distillation
State Space Models like Mamba offer lower memory and higher throughput than Transformers, but naive cross-architecture distillation from Transformers to Mamba fails to preserve teacher performance. The authors propose a principled two-stage distillation recipe: first distill a Transformer into a linearized Attention model via a kernel trick, then distill that into a Mamba model without any Attention blocks. The distilled Mamba model reaches a perplexity of 14.01, close to the teacher Pythia-1B Transformer’s 13.86. This performance largely carries over to downstream tasks, though gaps appear on tasks relying on in-context recall. The recipe is validated through ablations at 1B scale with 10B tokens, scaling analysis on model sizes and total distillation tokens, and sensitivity analysis on token allocation between stages.
Transformers Model Integration Contracts
Transformers enabled PyTorch scaled dot-product attention for T5 on July 30, 2026, letting UMT5’s decoder attend to future tokens during training. The bug stayed in main for almost two months, showing why full integration tests cannot run on every pull request across more than 750 model types. The proposed Model Integration Contract combines a shrunk fixture from a real checkpoint’s configuration, a runnable usage path, and human-reviewed baselines, and holds when that path still produces the baselines. Fixtures preserve tokenizer and processor files and the original weights format, keep different layer kinds, and shrink a 1,227 MB UMT5 checkpoint to 66 MB or Llama 4 Scout from 108.6 billion parameters to 44.7 million. A five-month replay showed the UMT5 fixture flagged the regression under SDPA, while eager attention missed it; the MIC CI job reports failures without blocking pull requests.
Unlocking Tensor Core Performance for Machine Learning Interatomic Potentials
Machine learning interatomic potentials (MLIPs) like the Point Edge Transformer (PET) bridge quantum and classical methods but often run in FP32, leaving Tensor Core throughput unused. Tensor Core FP32 methods decompose FP32 operands into lower-precision components, compute cross-products on Tensor Cores, and recombine with FP32 accumulation. On NVIDIA Blackwell GPUs, the BF16x9 path accelerated PET’s large GEMMs by up to 2.5x and the MD step by up to 1.7x, with force errors below model non-determinism. On Ampere GPUs, TF32x3 achieved up to 1.9x GEMM and 1.5x MD step speedup while preserving energy conservation and structural relaxation convergence. Neither strategy requires retraining, architecture changes, or custom kernels, allowing evaluation as independent performance layers across scientific workloads.
Does Your Model Run on AWS Trainium? Look It Up
The torch-neuronx model support Space on Hugging Face checks whether Transformer models run unmodified on AWS Trainium accelerators. It offers three views: Selected (curated top models), Trending, and Downloads, each showing the result, number of Trainium2 cores, wall time including compilation, and peak device memory. Users can look up a specific model by typing its name and select the Neuron compiler (neuronx-cc) and Transformers library versions to inspect compatibility. Each test loads the model on a trn2 instance, shards with tensor or expert parallelism, generates 32 tokens, and checks fluency against a CPU run or judge model. The underlying dataset is publicly available as Parquet files in the aws-neuron/torch-neuronx-model-support dataset, enabling direct querying with Pandas to retrieve results.
Hugging Face ❤️ TorchTPU: TPUs, Natively
TorchTPU adds a native PyTorch backend for Google TPUs, eliminating the need for torch_xla or JAX. Installing it on a TPU VM requires a single pip command with a CPU-only torch index. Users can load any Hugging Face model onto a TPU with device_map=“tpu” and run it in eager mode without code changes. Diffusers pipelines also support TPU natively, requiring only pipe.to(“tpu”) for eager execution or an optional compile call for deployment. The Kernels Hub provides ready-to-use TPU kernels written in Pallas, which can accelerate MoE models by over 20× at large batch sizes, as demonstrated with Qwen3-30B-A3B. The Hugging Face team is continuously testing TPU support, with 96.5% of tests passing and upstream fixes for discovered issues, including bugs in StaticCache and Qwen3 tensor-parallel plans.
Filter, reshape, and redact logs before export with Transformers
Cloudflare Logpush now supports Transformers, allowing teams to filter, redact, and reshape log streams using SQL before export to SIEMs, analytics platforms, or object storage. This eliminates the need for a separate processing service that teams would otherwise have to deploy, scale, and maintain. Transformers are SQL queries applied per batch within Logpush’s high-throughput pipeline, using Apache DataFusion and Arrow for columnar execution. The implementation embeds DataFusion in Bufstream, the Go-based delivery service, using cgo and Arrow IPC to pass typed batches across the language boundary without introducing network hops. Customers can create, preview, and version Transformers via the dashboard or API, and attach them to NDJSON Logpush jobs to reduce downstream data volume and cost.
NVIDIA Kumo Tabular Sets a New Accuracy-Efficiency Frontier for Tabular Prediction
NVIDIA Kumo Tabular is an open foundation model for tabular classification and regression that predicts labels in a single forward pass without training, tuning, or feature engineering. It uses a Transformer architecture with column, row, and in-context attention, including length-aware attention temperature to maintain sharp attention on large tables. Pretrained entirely on artificial tables generated from structural causal models with realistic imperfections such as missing values, coarsened features, and heavy-tailed targets, it comes in three sizes (28M to 215M parameters) and handles missing values without imputation. On the TabArena, BeyondArena, TALENT, and ScoringBench benchmarks, Kumo Tabular achieves top rankings and establishes a new accuracy-efficiency frontier, running 17x faster than LimiX-2. The model is available on Hugging Face under the OpenMDW-1.1 license and runs via NVIDIA’s open-source structured-data-models library.
Transformers now runs llama.cpp quants
Transformers now supports running GGUF quantized models locally, reusing llama.cpp’s ggml kernels for efficient inference on Apple Silicon. The GGUF format packages weights, tokenizer, and chat template in one file, with quantization levels like Q4_K_M that trade precision for memory. Users can load a checkpoint from the Hub with from_pretrained and generate text using the standard Transformers API, or serve it via an OpenAI-compatible endpoint. The initial focus is on the Qwen3.5 architecture, with benchmarks on a MacBook Pro M2 Max showing token-generation rates close to llama.cpp, including prefill time. The integration uses packed quantization kernels and generation-loop optimizations to reduce overhead, though it is currently limited to single conversations on MPS without batching support.
Jun Kim, oMLX creator and maintainer, joins Hugging Face to support the MLX community
Jun Kim, creator and maintainer of oMLX, has joined Hugging Face to support the MLX community. MLX is Apple’s framework for local AI, optimized for Apple Silicon, and Hugging Face is the Hub for MLX models. oMLX, staying Apache 2.0, will gain stability and faster development as a funded, maintained project, allowing Jun to guide contributors and build for the long term. The goal is to unblock the community to run local AI in any form, with oMLX serving as a testbed leveraging dependencies like mlx-lm and mlx-vlm, and collaborating with projects such as LMStudio. A key focus is streamlining the transition from transformers model definitions to reference MLX implementations for different engines, so each can focus on unique features.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.