{"record":{"id":"b05bfcc2187c7383","repo":"tensorflow/models","slug":"block-sparse-attention-does-not-support-talking-he","errorCode":null,"errorMessage":"Block sparse attention does not support talking heads. Please set enable_talking_heads to False.","messagePattern":"Block sparse attention does not support talking heads\\. Please set enable_talking_heads to False\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/modeling/layers/transformer_encoder_block.py","lineNumber":332,"sourceCode":"        value_dim=self._value_dim,\n        dropout=self._attention_dropout_rate,\n        use_bias=self._use_bias,\n        kernel_initializer=self._attention_initializer,\n        bias_initializer=tf_utils.clone_initializer(self._bias_initializer),\n        attention_axes=self._attention_axes,\n        output_shape=self._output_last_dim,\n        softmax_robust_masking=self._softmax_robust_masking,\n        name=\"self_attention\",\n    )\n    common_kwargs = dict(\n        bias_regularizer=self._bias_regularizer,\n        activity_regularizer=self._activity_regularizer,\n        kernel_constraint=self._kernel_constraint,\n        bias_constraint=self._bias_constraint,\n    )\n    if self._src_block_size is not None:\n      if self._enable_talking_heads:\n        raise ValueError(\n            \"Block sparse attention does not support talking heads. Please\"\n            \" set enable_talking_heads to False.\"\n        )\n      attention_layer_kwargs.update(\n          src_block_size=self._src_block_size,\n          tgt_block_size=self._tgt_block_size,\n          use_sigmoid_attn=self._use_sigmoid_attn,\n          sigmoid_attn_bias=self._sigmoid_attn_bias,\n          num_kv_heads=self._num_kv_heads,\n          name=\"block_sparse_attention\",\n      )\n      attention_fn = block_sparse_attention.MultiHeadAttention\n    elif self._num_kv_heads is not None:\n      attention_layer_kwargs.update(\n          num_kv_heads=self._num_kv_heads,\n          enable_gqa_optimization=self._enable_gqa_optimization,\n          name=\"multi_query_attention\",\n      )","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/transformer_encoder_block.py#L314-L350","documentation":"Error \"Block sparse attention does not support talking heads. Please set enable_talking_heads to False.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/modeling/layers/transformer_encoder_block.py:332 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}