Skip to content

Add content-only token_emb to UnifiedMultimodalEmbeddingModel output#42

Open
Rian354 wants to merge 1 commit into
mainfrom
unified-token-emb
Open

Add content-only token_emb to UnifiedMultimodalEmbeddingModel output#42
Rian354 wants to merge 1 commit into
mainfrom
unified-token-emb

Conversation

@Rian354

@Rian354 Rian354 commented Jun 24, 2026

Copy link
Copy Markdown

forward() now also returns token_emb, the per-event content embedding before time/type embeddings are added, in the same temporally-sorted order as sequence. This is the right reconstruction target for masked modeling pretrainers (MAE/SimMIM): the time/type components are largely recoverable from event position, so reconstructing the sequence dilutes the content signal.

This PR s purely additive, all existing output keys are unchanged. Includes a test asserting sequence == token_emb + time_embed(time) + type_embedding(type_ids).

forward() now also returns "token_emb": the per-event content embedding
before the time and type embeddings are added, in the same temporally-sorted
order as "sequence".

This is the correct reconstruction target for masked-modeling pretrainers
(MAE/SimMIM). The time and type components of "sequence" are largely
recoverable from event position, so reconstructing the composed "sequence"
dilutes the content learning signal.

The change is additive and backward-compatible (a new output key only; all
existing keys are unchanged). Adds a test asserting
sequence == token_emb + time_embed(time) + type_embedding(type_ids).
@will-pang

Copy link
Copy Markdown

lgtm!

@will-pang will-pang self-requested a review June 24, 2026 14:06
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

Successfully merging this pull request may close these issues.

2 participants