transformer_lens.model_bridge.generalized_components.pooler module

Pooler bridge component.

This module contains the bridge component for [CLS] pooling heads.

class transformer_lens.model_bridge.generalized_components.pooler.BertPoolerBridge(name: str | None, config: Any | None = None, submodules: Dict[str, GeneralizedComponent] | None = None, conversion_rule: BaseTensorConversion | None = None, hook_alias_overrides: Dict[str, str] | None = None, optional: bool = False)

Bases: GeneralizedComponent

Bridge component for BERT’s [CLS] pooler.

Wraps the whole pooler, so hook_out carries the post-tanh pooled [CLS] vector rather than the pre-activation projection — the tensor HookedEncoder’s BertPooler exposes as hook_pooler_out, which is aliased here so code migrated from the legacy stack keeps working.

hook_aliases: Dict[str, str | List[str]] = {'hook_pooler_out': 'hook_out'}
real_components: Dict[str, tuple]
training: bool