Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-opus-4-20250514· AnthropicHugging Face LMArena Human Preference 140K

if i have an einsum: gamma = gamma.permute(0, 2, 1). cond = torch.einsum("bts,bsd->btd",…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Amazon Novaamazon.nova-pro-v1:0’s answer.
  1. User

    if i have an einsum:

    gamma = gamma.permute(0, 2, 1).
    cond = torch.einsum("bts,bsd->btd", gamma, self.conditioner(txt_pd[:, 1:]))
    

    is that the same as:

    cond = torch.einsum("bst,bsd->btd", gamma, self.conditioner(txt_pd[:, 1:]))
    

    ?

  2. Claude Assistant

    No, these are not the same. The key difference is in how the gamma tensor dimensions are interpreted in the einsum operation.

    In the first version:

    • gamma is permuted from shape [b, s, t] to [b, t, s]
    • The einsum "bts,bsd->btd" expects gamma to have dimensions [b, t, s]
    • This performs: sum over s of gamma[b,t,s] * conditioner[b,s,d]

    In the second version:

    • gamma keeps its original shape [b, s, t]
    • The einsum "bst,bsd->btd" expects gamma to have dimensions [b, s, t]
    • This performs: sum over s of gamma[b,s,t] * conditioner[b,s,d]

    The mathematical operations are different:

    • First version: cond[b,t,d] = Σ_s gamma[b,t,s] * conditioner[b,s,d]
    • Second version: cond[b,t,d] = Σ_s gamma[b,s,t] * conditioner[b,s,d]

    Since gamma[b,t,s] ≠ gamma[b,s,t] in general (unless gamma happens to be symmetric in those dimensions), these will produce different results.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.