huggingface / huggingface/optimum-intel

Gemma3 Bidirectional Attention Mask Bug

Open
#1,304 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
620
Forks
270
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Based on https://huggingface.co/blog/gemma3, Images cannot attend to future images but current transformers implementation will unmask attention within all images
- Issue: https://github.com/huggingface/transformers/issues/38053
- PR: https://github.com/huggingface/transformers/pull/38080

Need to update following code for optimum-intel openvino export after [PR38080](https://github.com/huggingface/transformers/pull/38080) merged:
- https://github.com/eaidova/optimum-intel/blob/2c7ddedf2c1886abcd0a9ad3ac35373bfd85d498/optimum/exporters/openvino/model_patcher.py#L4428-L4474

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in optimum/exporters/openvino/model_patcher.py around lines 4428-4474 and compare the current logic with transformers PR 38080 and its linked issue. Update the OpenVINO export behavior to match the corrected Gemma3 bidirectional attention mask, then verify that the exported model no longer unmasks attention across all images.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.