Skip to content

[LUKE] Tie the masked LM decoder to the word embeddings - #50043

Open
tarekziade wants to merge 2 commits into
mainfrom
tarekziade-fix-luke-tied-lm-head
Open

tarekziade wants to merge 2 commits into
mainfrom
tarekziade-fix-luke-tied-lm-head

Conversation

@tarekziade

@tarekziade tarekziade commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

🤗 Transformers CI

LukeForMaskedLM._tied_weights_keys lost the lm_head.decoder.weight -> luke.embeddings.word_embeddings.weight entry when it was converted to a dict in the v5 weight-loading refactor (#41580). LUKE/mLUKE checkpoints don't store lm_head.decoder.weight, so loading studio-ousia/luke-base reports it as missing and the LM head is randomly initialized. "The capital of France is ." predicts ['airline', 'arbitrary', 'Tom', ...]. With the entry restored it predicts ['Paris', 'Lyon', 'Nancy', 'Nice', 'Brussels'].

Fix: restore the tied-weights entry, with the same mapping as RoBERTa. The bias and the entity prediction head were already tied.

Found by a model integration contract (transformers-mic) run on studio-ousia/luke-base.

🤖 Generated with Claude Code

LukeForMaskedLM._tied_weights_keys lost the lm_head.decoder.weight entry in the
v5 weight-loading refactor, so checkpoints that do not store it load a randomly
initialized LM head. Add the entry and a regression test.
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment thread tests/models/luke/test_modeling_luke.py Resolved
@tarekziade

Copy link
Copy Markdown
Collaborator Author

run-slow: luke

@github-actions

Copy link
Copy Markdown
Contributor

CI (Nvidia + AMD)

Nvidia · ✅ No new failures 🎉👏 · ⚙️ Workflow · 📊 Dashboard

Failures (2 pre-existing)

    Pre-existing failures (still failing) — 2 total:

        Same error (2):

        - luke:
            tests/models/luke/test_modeling_luke.py::LukeModelIntegrationTests::test_inference_base_model
            tests/models/luke/test_modeling_luke.py::LukeModelIntegrationTests::test_inference_large_model

AMD · ✅ No new failures 🎉👏 · ⚙️ Workflow · 📊 Dashboard

Failures (2 pre-existing)

    Pre-existing failures (still failing) — 2 total:

        Same error (2):

        - luke:
            tests/models/luke/test_modeling_luke.py::LukeModelIntegrationTests::test_inference_base_model
            tests/models/luke/test_modeling_luke.py::LukeModelIntegrationTests::test_inference_large_model

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants