All models

TRAR

Transformer for visual question answering whose visual layers route each example through different attention spans.

Multimodal · 889 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (28 KB)

Open in a new tab

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

Parameters
58.6M
Operations
889
Framework
PyTorch
Recurrent
No
Published
ICCV 2021
Authors
Yiyi Zhou, Tianhe Ren, Chaoyang Zhu and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m20834
Graph hash
49399d0b4bda196b06830f5a2b2daa977161f4e977c48e4d1bac03bdcbdf6f69
Skeleton hash
b994d7d88e6b6bb05e20d76238aee7320275786e983ec99182115c9aaf62c110
Architecture hash
3236c20be81808665bb52702e047f73ebd833f2983f75e0161fbacc675e783e5
Diagram SHA-256
3cadbf75e839526f880072e673386673c41d211bc5457e0f66417ef877e6024b
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

TRAR, short for TRAnsformer Routing, is a Transformer for visual question answering that decides, example by example, how wide an area each visual layer should attend to. The paper's motivation is that tasks like Visual Question Answering (VQA) and Referring Expression Comprehension (REC) often need visual information from macro- to micro-views. That makes scheduling global and local dependency modeling inside a Transformer the problem to solve.

In TRAR, each visual Transformer layer is equipped with a routing module with different attention spans. The model selects among these attentions dynamically, based on the output of the previous inference step, so each example gets its own routing path. In the code's configuration the spans are given as a list of local attention window sizes, with 0 standing for global attention.

The authors state that, with careful design, the additional computation and memory overhead can be reduced to almost negligible. The paper reports experiments on five benchmark datasets of VQA and REC, with performance gains over standard Transformers. The official implementation covers training on the VQA2.0 and CLEVR datasets.

Key idea. TRAR gives each visual Transformer layer a routing module with different attention spans and selects among them dynamically for each example.

  • TRAR
  • TRAnsformer Routing
  • visual question answering
  • VQA
  • attention span routing
  • dynamic routing
  • referring expression comprehension
  • CLEVR

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@article{trar2021,
  title = {TRAR: Routing the Attention Spans in Transformer for Visual Question Answering},
  author = {Yiyi Zhou and Tianhe Ren and Chaoyang Zhu and Xiaoshuai Sun and Jianzhuang Liu and Xinghao Ding and Mingliang Xu and Rongrong Ji},
  year = {2021},
  journal = {ICCV 2021}
}