Skip to content

Colbert Interaction correct? #1515

@approximated-intelligence

Description

Thank you very much for BGE-M3!

I am implementing something similar, i found a line in your code that puzzles me a bit:

token_scores = torch.einsum('qin,pjn->qipj', q_reps, p_reps)

might it be that the colbert interaction is incorrect?

the einsum includes the CLS token:

token_scores = torch.einsum('qin,pjn->qipj', q_reps, p_reps)

the scaling mask does not:

q_mask[:, 1:].sum(-1, keepdim=True)

in the limit n->\infy this works out correctly, for small sequence length this can become significant.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions