luke
A RoBERTa-based text encoder that adds entity embeddings and entity-aware self-attention.
Language · 394 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Language
- Parameters
- 274.5M
- Operations
- 394
- Framework
- PyTorch
- Recurrent
- No
- Source
- transformers 5.18.0
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m5669
- Graph hash
- e530c130bf41871105ff98ad65df7056c86ad86a9dbddf0e18666b0064552cf3
- Skeleton hash
- 87db80f7ef28109fdb57ff2d185bef9d54c6d72d7a0f378e14d68f741c9c02a2
- Architecture hash
- 239bc8c59c44a7d3e463c5a13e011c1f082daffda5595f155ba27b4a3bb558c4
- Diagram SHA-256
- 8bc21b2143868a5250d68cc474750f1dc8c5034c93bf5793108ed51510c16e6d
- TorchLens version
- 2.35.3
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
How this diagram was made
transformers.AutoModel.from_config()
What it is
LUKE is a pretrained language model that produces contextualized representations of entities as well as words. It is based on RoBERTa and adds entity embeddings and an entity-aware self-attention mechanism. That attention mechanism considers whether each token is a word or an entity when it computes attention scores. Entities are treated as input tokens of their own, so the model takes entity ids and entity position ids as extra input next to the words.
Its pretraining task builds on the masked language model of BERT and involves predicting randomly masked words and entities in a large entity-annotated corpus retrieved from Wikipedia. The paper reports the best results published at the time on five datasets: Open Entity for entity typing, TACRED for relation classification, CoNLL-2003 for named entity recognition, ReCoRD for cloze-style question answering and SQuAD 1.1 for extractive question answering.
Key idea. LUKE treats the words and entities in a text as independent tokens and outputs a contextualized representation of each.
- luke
- entity-aware self-attention
- entity embeddings
- entity representations
- contextualized entity representations
- named entity recognition
- entity typing
- relation classification
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.