Skip to content

VPT only injects layer-0 prompt tokens (prompt_tokens[0] hardcoded), leaving per-layer prompts untrained #3

Description

@IvanSobko

Hi,
Awesome work, thank you very much!
While skimming through VPT injections paths, I noticed that the VPT implementation for MoGe in moge/model/dinov2/models/vision_transformer.py allocates a separate set of prompt tokens per transformer block (deep VPT):

line 187-197: self.prompt_tokens = nn.Parameter(torch.empty(len(self.blocks)...)

but the forward pass hardcodes index 0:

line 333: x = torch.cat([x[:, :1], self.prompt_tokens[0].expand(x.shape[0], -1, -1), x[:, 1:]], dim=1)

so only the first layer's prompts are used.
The remaining per-layer prompt parameters never participate in the forward pass and therefore receive no gradients.

Since, in the paper you do not mention the type of VPT (deep/shallow) you are aiming for, I decided to notify you of this inconsistency/bug and maybe get your comment if this was intentional.

Cheers,
Ivan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions