freenode
AI & ML

Transformers adds early Gemma 4 logits and hidden-state support

A broad patch set enables boolean control over retained logits and exposes last hidden states for the model family.

Hugging Face Transformers is gaining Gemma 4 support, beginning with boolean masks for which logits to keep during generation and with direct exposure of the model's last hidden state.

jp1924 authored the work and reported that it spanned roughly 300 files, most of them small parallel edits. Local tests and repository checks already passed, though self-review continues given the scale. Maintainers including Arthur Zucker were notified as the changes opened for inspection.

The logits mask is an efficiency control when only a subset of token scores is required. Surfacing the final hidden state lets downstream code build on intermediate representations rather than vocabulary outputs alone, which matters for anyone running Gemma 4 through the standard library stack.