{"notes":[{"id":"multimodality/ernie-vil","category":"multimodality","legacyPath":"multimodality/2006-ernie-vil","legacySlug":"2006-ernie-vil","legacyPaths":["multi-model/ernievil"],"title":"ERNIE-ViL","subtitle":"The Double-Edged Sword of Knowledge","author":"Z. Yuan","paperDate":"2020-06-30","publishedOn":"2024-04-05","paperTitle":"ERNIE-ViL: Knowledge Enhanced Vision-Language Representations Through Scene Graph","paperUrl":"https://arxiv.org/abs/2006.16934","bibliography":{"title":"ERNIE-ViL: Knowledge Enhanced Vision-Language Representations Through Scene Graph","authors":["Fei Yu","Jiji Tang","Weichong Yin","Yu Sun","Hao Tian","Hua Wu","Haifeng Wang"],"url":"https://arxiv.org/abs/2006.16934","pdfUrl":"https://arxiv.org/pdf/2006.16934","codeUrl":null,"preprint":{"id":"2006.16934","submittedOn":"2020-06-30","url":"https://arxiv.org/abs/2006.16934"},"publication":{"venue":"AAAI","year":2021,"kind":"conference","url":"https://arxiv.org/abs/2006.16934"},"citation":"@misc{multimodalityernievil2020,\n  title = {{ERNIE-ViL: Knowledge Enhanced Vision-Language Representations Through Scene Graph}},\n  author = {Fei Yu and Jiji Tang and Weichong Yin and Yu Sun and Hao Tian and Hua Wu and Haifeng Wang},\n  year = {2020},\n  eprint = {2006.16934},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2006.16934}\n}\n","citationPath":"/content/papers/citations/multimodality/ernie-vil.ae54a4ffdeb6.bib"},"thumbnail":{"src":"/content/papers/assets/e59513b3c738e3b5a4f5fa4775c355f3e400801648d5a94e8695db61d024556e.jpg","width":1680,"height":776},"locale":"en","path":"/content/papers/en/multimodality/ernie-vil.ec9d93eff1d7.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"solution","text":"Solution","depth":2},{"id":"ernie-vil-model-design","text":"ERNIE-ViL Model Design","depth":3},{"id":"dual-stream-cross-modal-network","text":"Dual-Stream Cross-Modal Network","depth":3},{"id":"scene-graph-prediction-tasks","text":"Scene Graph Prediction Tasks","depth":3},{"id":"semantic-alignment","text":"Semantic Alignment","depth":3},{"id":"encoding-methods","text":"Encoding Methods","depth":3},{"id":"pre-training-tasks","text":"Pre-Training Tasks","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"advantage-of-out-of-domain-training-data","text":"Advantage of Out-of-Domain Training Data","depth":3},{"id":"importance-of-scene-graph-prediction","text":"Importance of Scene Graph Prediction","depth":3},{"id":"cloze-tests","text":"Cloze Tests","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"multimodality/oscar","relation":"comparison","topic":"Objects and structured semantics in vision-language pretraining"}]},{"id":"multimodality/oscar","category":"multimodality","legacyPath":"multimodality/2004-oscar","legacySlug":"2004-oscar","legacyPaths":[],"title":"Oscar","subtitle":"The Anchors of Oscar","author":"Z. Yuan","paperDate":"2020-04-13","publishedOn":"2024-06-04","paperTitle":"Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks","paperUrl":"https://arxiv.org/abs/2004.06165","bibliography":{"title":"Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks","authors":["Xiujun Li","Xi Yin","Chunyuan Li","Pengchuan Zhang","Xiaowei Hu","Lei Zhang","Lijuan Wang","Houdong Hu","Li Dong","Furu Wei","Yejin Choi","Jianfeng Gao"],"url":"https://arxiv.org/abs/2004.06165","pdfUrl":"https://arxiv.org/pdf/2004.06165","codeUrl":null,"preprint":{"id":"2004.06165","submittedOn":"2020-04-13","url":"https://arxiv.org/abs/2004.06165"},"publication":{"venue":"ECCV","year":2020,"kind":"conference","url":"https://arxiv.org/abs/2004.06165"},"citation":"@misc{multimodalityoscar2020,\n  title = {{Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks}},\n  author = {Xiujun Li and Xi Yin and Chunyuan Li and Pengchuan Zhang and Xiaowei Hu and Lei Zhang and Lijuan Wang and Houdong Hu and Li Dong and Furu Wei and Yejin Choi and Jianfeng Gao},\n  year = {2020},\n  eprint = {2004.06165},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2004.06165}\n}\n","citationPath":"/content/papers/citations/multimodality/oscar.f753816326f7.bib"},"thumbnail":{"src":"/content/papers/assets/a3a3bdfd3ba2e6387f71c701021f8048603307f1ed8674c75f2fae390cd34238.jpg","width":1224,"height":484},"locale":"en","path":"/content/papers/en/multimodality/oscar.1e7424bf62aa.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"solution","text":"Solution","depth":2},{"id":"oscar-model-design","text":"Oscar Model Design","depth":3},{"id":"pre-training-objectives","text":"Pre-training Objectives","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"parameter-efficiency-comparison","text":"Parameter Efficiency Comparison","depth":3},{"id":"model-performance-comparison","text":"Model Performance Comparison","depth":3},{"id":"qualitative-study","text":"Qualitative Study","depth":3},{"id":"ablation-study","text":"Ablation Study","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"multimodality/vinvl","relation":"next","topic":"Object information in image-text pretraining"},{"id":"multimodality/ernie-vil","relation":"comparison","topic":"Objects and structured semantics in vision-language pretraining"}]}],"text":"You have probably heard a few stories about the models that followed BERT and could name some differences. For example, Baidu's ERNIE uses phrase- and entity-level masking to learn knowledge during pre-training, and ERNIE 2.0 adds further pre-training tasks. This is different from directly feeding an external entity knowledge graph into the model.\n\nSince ERNIE improved on BERT's way of learning, it is hardly surprising that researchers would try to carry the same idea into other domains. Could an image–text model pay more attention to the words that determine what a scene means?\n\n## Problem Definition\n\nThe authors focus on a shortcoming of vision-language pre-training models: aligning detailed semantics across images and language. Random subword masking does not explicitly distinguish ordinary words from words describing objects, their attributes or the relationships between them. Yet “a cat on a car” and “a cat under a car” differ in a small phrase and describe different scenes.\n\nThe authors define three points they want to address:\n\n1. **A limitation of current vision-language pre-training**: Randomly masking and predicting subwords does not emphasize the words that carry object, attribute and relationship information.\n2. **The importance of detailed semantic alignment**: Without emphasizing these distinctions across the two modalities, a model may fail to capture subtle differences in real scenes. The new objective addresses this training bias.\n3. **The data challenge**: Vision-language pre-training needs well-aligned image–text pairs, which are hard to obtain at high quality and scale.\n\n## Solution\n\n### ERNIE-ViL Model Design\n\n![ERNIE-ViL dual-stream model and scene graph prediction; original paper Figure 2](/content/papers/assets/e59513b3c738e3b5a4f5fa4775c355f3e400801648d5a94e8695db61d024556e.jpg)\n\n*Original paper [Figure 2](https://arxiv.org/html/2006.16934v3): the right side parses objects, attributes and relationships from the caption; the left masks the corresponding text spans for a dual-stream model that also sees image regions.*\n\n### Dual-Stream Cross-Modal Network\n\nThe dual-stream cross-modal Transformer combines information from the two modalities into a joint vision-language representation:\n\n1. **Two streams**: Text and image regions have their own Transformer paths, so each can process the features of its own modality.\n2. **Text and image inputs**: Text arrives as a sequence of subwords, while a detector supplies a sequence of visual region features. The visual Transformer does not directly consume the full two-dimensional RGB image.\n3. **Cross-modal blocks**: The paths exchange information through cross-modal attention. They do not remain independent throughout, nor must both finish all their processing before fusion begins.\n\nThe aim is easier to picture with an example: if the text says “red ball,” ideally the model will connect those words to the red ball in the image.\n\n### Scene Graph Prediction Tasks\n\nA scene graph is a representation of objects, attributes and relationships; the parser producing it is a separate component. **ERNIE-ViL parses its scene graphs from the paired captions**, not from images. The proposed architecture does not include a GNN.\n\nFor “a red apple on a table,” the graph identifies the objects *apple* and *table*, the attribute *red*, and the relationship *on*. The authors turn those nodes into three prediction tasks:\n\n| Task | Prediction target in the text | Retained context |\n| --- | --- | --- |\n| Object prediction | Select 30% of the parsed object nodes and predict their corresponding text spans, such as “apple” | Other text and image regions |\n| Attribute prediction | Select 30% of object–attribute pairs and predict the attribute text, such as “red” | The associated object word, other text and image regions |\n| Relationship prediction | Predict a selected relationship span, such as “on” | Both object words, other text and image regions |\n\nFor selected nodes, the paper uses an 80% `[MASK]`, 10% random-token and 10% unchanged-token strategy. The targets are still the original text spans. By practicing these three tasks, the model is encouraged to connect objects, attributes and relations in the description to the visual scene, yielding a richer joint representation.\n\nLook back at Figure 2: the little white cat, blue dress, car and “on top of” are separated in the same way. Mask *blue* and *dress* remains; mask *on top of* and *cat* and *car* remain. Image regions can then help select the missing detail. The graph is not a second picture directly fed into the encoder.\n\n### Semantic Alignment\n\nBoth “on the car” and “under the car” could fit the surrounding grammar. Looking at the image can help eliminate the option inconsistent with the scene. This is the fine-grained alignment the authors want to encourage.\n\nWhen you see a cat on a car, the useful connection is not just that the caption contains *cat* and *car*; it also matters that the cat is *on* the car. The object, attribute and relationship tasks push the model toward that more precise connection. They encourage visual grounding.\n\n### Encoding Methods\n\nEncoding means producing representations the model can process, not necessarily reducing dimensionality.\n\n1. **Text**: WordPiece tokens receive word, segment and position embeddings, with `[CLS]` and `[SEP]`. Splitting depends on the vocabulary: `playing` is not guaranteed to become `play` and `##ing`.\n2. **Image**: Detector region features are combined with position encodings describing normalized coordinates and area. `[IMG]` uses mean-pooled region features and a whole-image position encoding.\n\n### Pre-Training Tasks\n\nPre-training gives the model practice before it is adapted to specific tasks. Here are the tasks and why the author draws attention to each one. The first three are Scene Graph Prediction (SGP) tasks: **they predict text tokens, not erased image pixels**.\n\n1. **Object prediction**: Objects are central to a visual scene. For an image of an apple on a table, the task hides *apple* or *table* in the caption and predicts the word using the remaining text and image regions. It does not hide the apple region in the image.\n2. **Attribute prediction**: Color, size and shape tell us more about an object. For “red apple,” the task keeps *apple*, hides the attribute *red* in the text, and predicts it using the object, other words and image regions.\n3. **Relationship prediction**: In “the apple is on the table,” *on* describes a relative position. The task keeps *apple* and *table* in the text, hides the relationship span and predicts it from the remaining context and image regions.\n4. **Masked language modeling (MLM)**: Separately from graph-selected SGP targets, MLM randomly selects 15% of text tokens. For “the apple is red,” it could hide *red* and predict it using the remaining words and image.\n5. **Masked region prediction and image–text matching**: Masked Region Prediction (MRP) selects visual region features and predicts them; Image–Text Matching (ITM) classifies whether a picture and caption belong together. These are separate from SGP's text targets. Token and region prediction losses are calculated only for correctly paired image–text examples.\n\n## Discussion\n\nERNIE-ViL reports strong results across several vision-language tasks against its contemporary pre-trained models. These are historical comparisons from the cited paper, not current model rankings.\n\n### Advantage of Out-of-Domain Training Data\n\n![ERNIE-ViL downstream comparison; original paper Table 3](/content/papers/assets/93433c53b7ce9d8a961e2d30a0771510f61e5942904a94002fc80b6403460a2a.jpg)\n\n*Original paper [Table 3](https://arxiv.org/html/2006.16934v3): the upper half covers VCR and RefCOCO+; the lower half covers VQA and Flickr30K retrieval. Parenthesized VCR numbers denote the private test split.*\n\nIn Table 3, among methods pre-trained on comparable out-of-domain data such as CC and SBU, ERNIE-ViL leads on the five downstream tasks considered.\n\n- ERNIE-ViL-large scores 66.3% on VCR Q→AR **test**, versus VLBERT-large’s 59.7%: **+6.60 percentage points**. VQA test-std rises from 72.22 to 73.96: **+1.74 points**.\n- RefCOCO+ testA/testB rise from 78.57/62.30 to 80.97/64.70, both **+2.40 points**. This is referring-expression grounding: locating an image region from text.\n- Compared with Unicoder-VL-base, ERNIE-ViL-base gains **2.94/0.50 points** in Flickr30K image/text retrieval R@1.\n- With both out-of-domain and in-domain pre-training data, ERNIE-ViL-large remains ahead of UNITER, OSCAR and VILLA on several tasks. Individual columns still need checking.\n\n### Importance of Scene Graph Prediction\n\n![ERNIE-ViL scene graph prediction and initialization ablation; original paper Table 4](/content/papers/assets/dffdccd969daebdbf36127702b64a2ac3d552250cedf0d61aea1811374fdf957.jpg)\n\n*Original paper [Table 4](https://arxiv.org/html/2006.16934v3): the first two rows both use BERT initialization and isolate SGP; the third also changes initialization to ERNIE 2.0.*\n\nWith BERT text initialization held fixed, the first two rows show improvements across VCR, VQA, RefCOCO+, image retrieval and text retrieval after adding SGP. For example, VCR Q→AR dev rises from 59.06 to 59.92; RefCOCO+ val rises from 72.81 to 73.50 (+0.69 percentage points), and Flickr30K image-retrieval dev R@1 from 70.74 to 72.96 (+2.22 points). This comparison isolates the objective more clearly than mixing initialization settings.\n\nKeeping SGP but switching text initialization from BERT to ERNIE 2.0 raises VCR Q→AR dev from 59.92 to 61.24. The authors suggest that ERNIE 2.0's other pre-training tasks may supply useful commonsense knowledge; this is an interpretation, not a separately measured causal mechanism. The gains in tasks that require referring expressions and cross-modal retrieval make the scene-graph objective worth examining.\n\n### Cloze Tests\n\n![ERNIE-ViL visually conditioned cloze examples; original paper Table 5](/content/papers/assets/078907accdb941702e6734dd39d37f57e3af40b1bcae7846cde7244166affa5d.jpg)\n\n*Original paper [Table 5](https://arxiv.org/html/2006.16934v3): a black dog catching a disc, red jackets and a boy kicking a ball illustrate top-five predictions with and without SGP. The aggregate accuracy figures below come from the separate **Table 6**.*\n\nThe test samples 15,000 Flickr30K image–text pairs and selects 5,000 targets each for objects, attributes and relationships. ACC@1 measures whether the first prediction is correct; ACC@5 whether the correct answer appears among the first five.\n\nBoth models use BERT initialization. SGP improves object, attribute and relationship ACC@1 by **1.20, 1.84 and 3.08 percentage points**, and overall ACC@1 rises from 49.75 to 51.75. In some illustrated cases the model without SGP misses the target; in another it makes a plausible prediction with lower confidence. Those examples help explain the difference.\n\n## Conclusion\n\nERNIE-ViL's contribution is to use structured language analysis to suggest which cross-modal relationships deserve extra attention during training. That structure may also bring costs and limits. ERNIE-style models can demand substantial computation and storage, with the scene-graph objectives’ additional cost still requiring measurement. Generalization to rare cross-modal scenes is another question worth testing.\n\nThe scene-graph tasks invite a practical question. Suppose a caption says “a person standing beside a tree,” but its parser records a mistaken relationship such as *sitting*. Could that wrong signal affect a downstream task? This is a hypothetical parser error; the paper does not quantify its cost.\n\n\n> [!TIP]\n> \n> The accuracy and completeness of a scene graph may affect what the model learns from it. That is a risk to test, not a measured failure in this paper.\n\n\nThis adds uncertainty in practice. Imagine a blurry silhouette or several overlapping objects: the system may struggle to decide whether a shape is a person, a shadow or something else. Such ambiguity could matter where precise recognition or scene interpretation is required. These remain risks to test rather than measured failures from this experiment.\n\nUsing a scene graph also seems to imply that the human way of organizing knowledge can guide a model better than what it learns on its own. But is that necessarily a good thing? I would invite you to think about where that guidance helps and where it might constrain the model. That is how we can see both the opportunities and difficulties in the paper's “knowledge enhancement” technique.\n\nEven so, ERNIE-ViL offers a useful direction for cross-modal pre-training by improving the reported fine-grained alignment results. The authors suggest image-derived scene graphs and graph neural networks (GNNs) as future avenues for adding structured knowledge; neither is implemented in this model. The question of how best to use that knowledge remains open for later work.\n","imageSizes":{"/content/papers/assets/e59513b3c738e3b5a4f5fa4775c355f3e400801648d5a94e8695db61d024556e.jpg":{"width":1680,"height":776},"/content/papers/assets/93433c53b7ce9d8a961e2d30a0771510f61e5942904a94002fc80b6403460a2a.jpg":{"width":1024,"height":656},"/content/papers/assets/dffdccd969daebdbf36127702b64a2ac3d552250cedf0d61aea1811374fdf957.jpg":{"width":1024,"height":151},"/content/papers/assets/078907accdb941702e6734dd39d37f57e3af40b1bcae7846cde7244166affa5d.jpg":{"width":1024,"height":398}}}
