SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.15796 · CVPR · 2023

KERM: Knowledge Enhanced Reasoning for Vision-and-Language Navigation

Zihan Wang, Yaowei Wang, Jiahao Yang, Xiangyang Li, Shuqiang Jiang

arXiv · PDF · Open in the Atlas

Code that ran

1 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 9 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2303.15796.json · badge: /api/ran/2303.15796.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
XiangyangLi20/KERM community
Papers with Code archive
1 ran · 9 no recorded run
FunctionStatusWhere it lives
BertSelfAttention Ran
ran on a synthesized input
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("8e5c1f482d9ee1e0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math
import torch
from torch import nn

class BertSelfAttention(nn.Module):

    def __init__(self, config):
        super().__init__()
        if config.hidden_size % config.num_attention_heads != 0:
            raise ValueError('The hidden size (%d) is not a multiple of the number of attention heads (%d)' % (config.hidden_size, config.num_attention_heads))
        self.output_attentions = config.output_attentions
        self.num_attention_heads = config.num_attention_heads
        self.attention_head_size = int(config.hidden_size / config.num_attention_heads)
        self.all_head_size = self.num_attention_heads * self.attention_head_size
        self.query = nn.Linear(config.hidden_size, self.all_head_size)
        self.key = nn.Linear(config.hidden_size, self.all_head_size)
        self.value = nn.Linear(config.hidden_size, self.all_head_size)
        self.dropout = nn.Dropout(config.attention_probs_dropout_prob)

    def transpose_for_scores(self, x):
        new_x_shape = x.size()[:-1] + (self.num_attention_heads, self.attention_head_size)
        x = x.view(*new_x_shape)
        return x.permute(0, 2, 1, 3)

    def forward(self, hidden_states, attention_mask, head_mask=None):
        """
        hidden_states: (N, L_{hidden}, D)
        attention_mask: (N, H, L_{hidden}, L_{hidden})
        """
        mixed_query_layer = self.query(hidden_states)
        mixed_key_layer = self.key(hidden_states)
        mixed_value_layer = self.value(hidden_states)
        query_layer = self.transpose_for_scores(mixed_query_layer)
        key_layer = self.transpose_for_scores(mixed_key_layer)
        value_layer = self.transpose_for_scores(mixed_value_layer)
        attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))
        attention_scores = attention_scores / math.sqrt(self.attention_head_size)
        if attention_mask != None:
            attention_scores = attention_scores + attention_mask
        attention_probs = nn.Softmax(dim=-1)(attention_scores)
        attention_probs = self.dropout(attention_probs)
        if head_mask is not None:
            attention_probs = attention_probs * head_mask
        context_layer = torch.matmul(attention_probs, value_layer)
        context_layer = context_layer.permute(0, 2, 1, 3).contiguous()
        new_context_layer_shape = context_layer.size()[:-2] + (self.all_head_size,)
        context_layer = context_layer.view(*new_context_layer_shape)
        outputs = (context_layer, attention_scores) if self.output_attentions else (context_layer,)
        return outputs


class Config:
    def __init__(self, hidden_size, num_attention_heads, attention_probs_dropout_prob, output_attentions):
        self.hidden_size = hidden_size
        self.num_attention_heads = num_attention_heads
        self.attention_probs_dropout_prob = attention_probs_dropout_prob
        self.output_attentions = output_attentions


INIT_ARGS = {
    'config': Config(
        hidden_size=8,
        num_attention_heads=2,
        attention_probs_dropout_prob=0.1,
        output_attentions=True
    )
}

ARGS = {
    'hidden_states': torch.randn(2, 5, 8),
    'attention_mask': torch.zeros(2, 2, 5, 5),
    'head_mask': None
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
BertAttention Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("fac097958060a4ef")
How it ran

no invocation recorded.

BertLayer Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("4f346f98c56af683")
How it ran

no invocation recorded.

CrossmodalEncoder Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("5d4abfd8c5d282c2")
How it ran

no invocation recorded.

GlobalMapEncoder Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("a682281dc8aec812")
How it ran

no invocation recorded.

GlocalTextPathNavCMT Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("0168560180b1658b")
How it ran

no invocation recorded.

GraphLXRTXLayer Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("5200f9c8c78c7002")
How it ran

no invocation recorded.

ImageEmbeddings Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("8b331938aeb8317c")
How it ran

no invocation recorded.

LanguageEncoder Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("a2c5bd71c672f5d0")
How it ran

no invocation recorded.

LocalVPEncoder Not yet run
unverified (harvested, no recorded run)
XiangyangLi20/KERM/knowledge_nav_src/models/vilmodel.py
code served (permissive licence) · get_code("06a18c71562f7bcf")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 7 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 7 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
BertAttention
brick of this paper's assembly: model
3 other papers
3 later · 1 only as an assembly brick
2305.03602 (2023-05)
A Dual Semantic-Aware Recurrent Global-Adaptive Network for Vision-and-Language Navigation
2501.17403 (2025-01)
General Scene Adaptation for Vision-and-Language Navigation
2601.21751 (2026-01)
Dynamic Topology Awareness: Breaking the Granularity Rigidity in Vision-Language Navigation
BertLayer
brick of this paper's assembly: model
3 other papers
3 later · 1 only as an assembly brick
2305.03602 (2023-05)
A Dual Semantic-Aware Recurrent Global-Adaptive Network for Vision-and-Language Navigation
2501.17403 (2025-01)
General Scene Adaptation for Vision-and-Language Navigation
2601.21751 (2026-01)
Dynamic Topology Awareness: Breaking the Granularity Rigidity in Vision-Language Navigation
GlobalMapEncoder
brick of this paper's assembly: model
2 other papers
2 later
2501.17403 (2025-01)
General Scene Adaptation for Vision-and-Language Navigation
2601.21751 (2026-01)
Dynamic Topology Awareness: Breaking the Granularity Rigidity in Vision-Language Navigation
GraphLXRTXLayer
brick of this paper's assembly: model
2 other papers
2 later
2305.03602 (2023-05)
A Dual Semantic-Aware Recurrent Global-Adaptive Network for Vision-and-Language Navigation
2501.17403 (2025-01)
General Scene Adaptation for Vision-and-Language Navigation
LanguageEncoder
brick of this paper's assembly: model
2 other papers
2 later · 1 only as an assembly brick
2501.17403 (2025-01)
General Scene Adaptation for Vision-and-Language Navigation
2601.21751 (2026-01)
Dynamic Topology Awareness: Breaking the Granularity Rigidity in Vision-Language Navigation
ImageEmbeddings
brick of this paper's assembly: helper
1 other paper
1 later
2501.17403 (2025-01)
General Scene Adaptation for Vision-and-Language Navigation
LocalVPEncoder
brick of this paper's assembly: model
1 other paper
1 later
2501.17403 (2025-01)
General Scene Adaptation for Vision-and-Language Navigation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Vision-and-language navigation (VLN) is the task to enable an embodied agent to navigate to a remote location following the natural language instruction in real scenes. Most of the previous approaches utilize the entire features or object-centric features to represent navigable candidates. However, these representations are not efficient enough for an agent to perform actions to arrive the target location. As knowledge provides crucial information which is complementary to visible content, in this paper, we propose a Knowledge Enhanced Reasoning Model (KERM) to leverage knowledge to improve agent navigation ability. Specifically, we first retrieve facts (i.e., knowledge described by language descriptions) for the navigation views based on local regions from the constructed knowledge base. The retrieved facts range from properties of a single object (e.g., color, shape) to relationships between objects (e.g., action, spatial position), providing crucial information for VLN. We further present the KERM which contains the purification, fact-aware interaction, and instruction-guided aggregation modules to integrate visual, history, instruction, and fact features. The proposed KERM can automatically select and gather crucial and relevant cues, obtaining more accurate action prediction. Experimental results on the REVERIE, R2R, and SOON datasets demonstrate the effectiveness of the proposed method. The source code is available at https://github.com/XiangyangLi20/KERM .

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2303.15796")
get_code_for_paper("2303.15796")
have("2303.15796")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2303.15796.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2303.15796.svg)](https://syntology.ai/paper/2303.15796)

Connect an agent — have() is free.