Dissecting AI
From the paper: VideoJev: System One Model for Video Understanding and Interaction

VideoJev: Shared Candidate Scoring for Video Decisions

Video question answering and event timing require different outputs; VideoJev scores answer options and timestamped intervals with one shared candidate-scoring head, then applies task-specific decisions.

Read the paper ↗
The short version

What it is

  • Shared candidate scoring The model scores each possible answer or time interval against the video and question using the same learned scoring component.
  • Different decisions from the same scores For a question, it ranks answer choices. For event timing, it judges which intervals belong to the event and selects one continuous stretch.

Why it matters

You can separate judging candidates from choosing an output format. Answer selection and event timing share a scoring interface, while keeping the different training signals and decision rules each task needs.

VideoJev treats written answers and possible stretches of video as candidates for the same scoring mechanism. I find the useful distinction is what happens afterward: an answer question needs a winning option, while a timing question needs a continuous event span.

  1. Structured answers: If the question is “What is drizzled onto the waffles?”, the candidates might be chocolate, jam, and cream. Scoring those choices directly matches the requested output better than asking for an unrestricted sentence.

  2. A common interface: Ask instead “When is chocolate added to the waffles?” and the candidates become timestamped intervals. The content changes, but the basic job remains judging each candidate against the clip and question.

  3. Whole-event coverage: Chocolate being added may occupy several neighboring intervals. Recognizing one relevant piece is not enough; the prediction should cover the event without swallowing unrelated footage.

How can the same scorer handle words and times?

Each candidate gets a marker whose hidden state acts as its readout. A final marker supplies a decision readout after the complete list. The scorer compares transformed, normalized versions of those representations—think similarity lookup, except the candidate representations already incorporate preceding context rather than coming from an independent lookup table.

For the waffles question, “chocolate” is therefore evaluated in the context of the video and question. A timestamp candidate gets the same treatment. The final decision readout sees the whole list, while each candidate readout sees only the context available before it. What changes when several candidates can all be correct?

Why membership is not enough

For timing, each candidate corresponds to a frame pair and its associated interval. Training checks whether the mean timestamp of those two frames falls inside an annotated event. That is a precise representative-time test, not a test of whether any part of the interval overlaps the event.

Return to the chocolate example: several frame pairs can lie inside the pouring event, so several candidates should receive positive judgments. Independent membership training allows that. But it does not directly reward covering the whole pour.

A second objective compares predicted coverage with event coverage, weighting intervals by duration. It rewards covering the event and penalizes spillover into unrelated time. I like this division of labor: local classification answers “does this piece belong?”, while coverage asks “did you capture the event?” The coverage term is skipped when no candidate’s representative timestamp is positive. How do those separate judgments become one span?

Why the decoder chooses a run

The decoder adjusts the interval scores using a probability threshold, then searches for the contiguous run with the strongest total support. In the waffles clip, that can join neighboring pieces of the pour rather than returning disconnected detections. If all adjusted scores are negative, it keeps the strongest single interval instead.

Written answer options need no such temporal constraint: their scores are normalized across the choices, and the strongest option wins. The separation is useful, but not free of limits. Options restrict what answer can be selected, and the temporal interval partition supplies the initial span boundaries before postprocessing. Is one continuous span the output your application actually needs?

Read the deep dive

Why People Wanted It

A video question can ask for a word-sized answer—what was added?—or a time-sized answer—when did the event happen? A generative video-language model can express either answer as text, but these tasks need structured decisions, not necessarily an unconstrained response.

Both tasks ask the model to judge candidates against a video and a query. The real question was whether one scoring mechanism could make those judgments while leaving the final decision rule to the task.

The Core Move

Represent each possible answer or time interval as a candidate, score it against the video-and-query context with one shared head, and change how the scores are interpreted by task:

si=10 u⊤vi+bs_i = 10\,u^\top v_i + b

Here, uu is the normalized query-level decision representation and viv_i is the normalized representation for candidate ii. The score is their scaled similarity plus a learned scalar bias. Written options compete for selection; temporal intervals receive membership judgments that are combined into a span.

Quiz
VideoJev uses the same candidate scorer for timestamp intervals and written answer options. What changes between these two tasks?
The shared head predicts event boundaries directly instead of scoring candidates.
The output rule: sigmoid-based interval membership and span decoding for grounding, versus softmax ranking for answer options.
The video encoder is replaced by a separate model for each task.
Temporal candidates are free-form generated answers, while text options are represented as timestamps.

Why Candidate Readouts Can Share a Scorer

Now the version for readers who want more of the machinery: sharing the head requires a common readout interface, not identical candidate contents.

The final MLP is removed from the causal language backbone, and a candidate scorer replaces the language-model output head. The input places the video first, followed by the task instruction, query, and candidate list. Each candidate ends with an <|option_end|> readout token; the list ends with a <|decide|> readout token.

Separate learned linear projections map the candidate and decision hidden states to 512 dimensions, then normalize each to unit length. Those normalized vectors are viv_i and uu in the shared scoring equation. The scale is fixed at 10, while the scalar bias is learned.

The causal layout makes the readouts asymmetric. A candidate readout can use the video, query, and preceding candidates. The final decision readout sees the full candidate list. These are contextual representations, not independently embedded answer strings.

Temporal candidates are timestamp texts identifying frame-pair intervals; answer candidates are ordinary text options. For answer selection, the output rule is:

pi=softmax⁡(s)ip_i = \operatorname{softmax}(s)_i

The logits become probabilities over the supplied options, and the highest-scoring option is selected. But an event can occupy several intervals, so why force its temporal candidates to compete for a single winning slot?

Why Temporal Grounding Needs Membership and Coverage

Here is the part that gets technical: temporal labels depend on the mean timestamp of each frame pair, while coverage supervision also accounts for interval duration.

The backbone groups frames into pairs through temporal compression. Each pair defines a candidate interval. Internal interval boundaries lie halfway between the previous pair’s last frame and the next pair’s first frame; the outer boundaries are the start and duration of the video. Timestamp strings identify candidates, but labels and boundaries use unrounded times.

A candidate is positive when the mean of its two frame timestamps lies in the union of annotated event intervals. This mean need not be the midpoint of the candidate’s boundary-defined interval. Membership probabilities use:

pi=σ(si)p_i = \sigma(s_i)

Each candidate receives an independent sigmoid probability rather than a share of one option distribution. Binary cross-entropy supervises these local judgments over valid candidates.

Local membership alone does not directly reward covering the event as a whole. A duration-weighted soft intersection-over-union loss adds that pressure: its numerator rewards event coverage, and its denominator penalizes predicted coverage outside the event. Duration weighting accounts for unequal interval lengths. The soft-IoU term is omitted when no candidate’s mean frame timestamp is positive.

The two objectives therefore have different jobs: identify relevant pieces and reward event-level coverage. Even with both, the output remains a list of interval scores. How does that become one continuous prediction?

Why Contiguous-Span Decoding Matches the Output

Now for the structured-decoding detail: a valid prediction is a nonempty contiguous range, not an arbitrary collection of independently selected intervals.

The decoder adjusts logits using a probability threshold, then chooses the contiguous range with the largest sum of adjusted logits. The threshold is fixed at 0.250.25, with smoothing window 1, in the reported experiments. This makes the decision depend on accumulated support across a range rather than simply retaining every interval above a cutoff.

Kadane’s algorithm finds the maximum-sum range in O(K)O(K) time for KK candidate intervals. If every adjusted logit is negative, the decoder returns the strongest candidate’s interval. Otherwise, the selected range’s first left boundary and last right boundary define the prediction. Lightweight boundary postprocessing makes the result valid and nonempty.

The scorer supplies local evidence; the decoder imposes the output shape. What flexibility does that separation buy, and what does it constrain?

Minimal Causal Code

This plain PyTorch loop implements only contiguous-span selection. Its input is the decoder’s threshold-adjusted logits in temporal order; threshold adjustment, training losses, and boundary postprocessing are outside this snippet. The running state is deliberately visible.

import torch


def select_span(adjusted_logits, left, right):
    # One adjusted logit and boundary pair per valid interval.
    assert adjusted_logits.ndim == 1
    assert adjusted_logits.numel() > 0

    if torch.all(adjusted_logits < 0).item():
        i = int(torch.argmax(adjusted_logits).item())
        return left[i], right[i]

    running_sum = adjusted_logits.new_zeros(())
    best_sum = adjusted_logits.new_tensor(float("-inf"))
    start = 0
    best_start = best_end = 0

    for i in range(adjusted_logits.numel()):
        value = adjusted_logits[i]
        if running_sum.item() <= 0:
            # Start a new range rather than carry negative support.
            running_sum = value
            start = i
        else:
            # Extend the current contiguous range.
            running_sum = running_sum + value

        if running_sum.item() > best_sum.item():
            best_sum = running_sum
            best_start, best_end = start, i

    return left[best_start], right[best_end]

What You Gain, and What You Lose

A shared candidate scorer lets temporal intervals and written answer options use one interface over multimodal representations. It separates judging candidates from deciding what shape the answer must take. Neither task requires the head to generate an unconstrained textual answer.

The shared interface does not make the tasks identical. Temporal grounding needs interval labels, coverage supervision, and contiguous-span decoding. Multiple-choice answering needs supplied options and normalization across them.

Candidate construction also limits the decision space. Answer selection cannot return an answer outside the supplied list. Grounding initially selects boundaries from its interval partition, followed by boundary postprocessing; it is not unrestricted boundary generation. And a single contiguous prediction cannot directly express several disjoint spans, even though the membership labels can refer to a union of annotated intervals.

Core Takeaway

One shared scorer can judge both answers and time intervals; task-specific supervision and decoding turn those scores into the right kind of decision.