Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about the loss compute #203

Open
jamesben6688 opened this issue Mar 4, 2025 · 0 comments
Open

question about the loss compute #203

jamesben6688 opened this issue Mar 4, 2025 · 0 comments

Comments

@jamesben6688
Copy link

Hi, the ar_loss is compute as:

loss, aux_losses = ar_loss(
                lengths=seq_features.past_lengths,  # [B],
                output_embeddings=seq_embeddings[:, :-1, :],  # [B, N-1, D]
                supervision_ids=supervision_ids[:, 1:],  # [B, N-1]
                supervision_embeddings=input_embeddings[:, 1:, :],  # [B, N - 1, D]
                supervision_weights=ar_mask.float(),
                negatives_sampler=negatives_sampler,
                **seq_features.past_payloads,
            )  # [B, N]

So the prediction is output_embeddings, and the supervision is supervision_ids[:, 1:] instead of target_id. However, the output_embeddings is computed using MultiHeadAttention rather than MaskedMultiHeadAttention. This means that the output_embeddings at time t can see the data after t. Will this be a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant