research30 min studyLesson 819 in Engineering

Version video embeddings together with their temporal meaning

Count vector payload, retain source intervals, define metric normalization, and validate retrieval against the same eligible cohort and encoder/index versions.

On this page

What you’ll understand

  • Specify the provenance and compatibility contract of a video embedding record.
  • Count raw vector and interval-ID payload with explicit byte units.
  • Distinguish cosine similarity, inner product, squared L2 and approximate retrieval recall.

A video embedding is not just a row of floating-point numbers. It summarizes a particular sampled interval under a particular decoder, preprocessing pipeline, model, and pooling rule. Retrieval needs that interpretation to return the right source moment and to compare vectors meaningfully. Equal dimensions do not establish compatibility between encoders. Treat embedding and index versions as linked artifacts, measure storage in stated units, and test approximate search against a defined exact-search cohort before interpreting retrieved neighbors as evidence of semantic quality.

Make an embedding record a reproducible temporal claim

Store stable source identity and version, stream selection, interval endpoints with their rational timebase, and the sampling/preprocessing versions. Include encoder weights, output dimension, dtype, pooling rule, and whether normalization occurred before storage or search. A single vector can summarize many sampled frames, so its interval is not necessarily one frame timestamp. Re-embedding after a decoder or sampling change can alter the representation even if the encoder's parameter file remains unchanged.

An index generation should reference the exact embedding manifest and metric configuration it contains. Do not mix vectors from incompatible encoder versions simply because both have 512 coordinates. A migration can build a new generation, run compatibility and retrieval checks, then switch a declared query/encoder/index tuple together under the deployment's actual atomicity contract. Retain enough provenance to roll back and to trace a hit to its source interval; an index identifier alone cannot reconstruct missing preprocessing history.

Mvectors=NdbM_{\rm vectors}=Ndb
N is the number of stored vectors, d their dimension, and b bytes per element, giving payload bytes. This excludes IDs, intervals, timebase dictionaries, index structures, allocator overhead, replicas, metadata, and original video. Compression or mixed storage formats require their actual encoded size instead of this dense-array count.↔ Scroll wide equations horizontally.

Choose one metric contract and handle normalization explicitly

FAISS's official metric documentation distinguishes squared Euclidean distance from inner product. Inner-product rankings are not automatically cosine rankings when vector magnitudes differ. To implement cosine through inner product, normalize both database and query vectors under a declared nonzero-vector policy. Reject, specially represent, or otherwise handle zero vectors rather than dividing by zero. Store the normalization convention with the index and verify it on the query path as well as the offline embedding job.

For unit vectors, squared L2 and inner product are related by a simple identity, so their rankings correspond with opposite ordering. That relationship does not apply unchanged to arbitrary unnormalized vectors. Quantization and approximate indexes introduce additional retrieval behavior that should be measured against exact search over the same eligible records. Recall at k of an approximate search answers whether exact neighbors were recovered, not whether neighbors have correct action labels or temporal localization for a downstream task.

∥u−v∥22=2−2uTvif∥u∥2=∥v∥2=1\|u-v\|_2^2=2-2u^{\mathsf T}v\quad\text{if}\quad\|u\|_2=\|v\|_2=1
u and v are compatible nonzero embeddings normalized to unit Euclidean norm, so these quantities are dimensionless. FAISS L2 reports squared distance and smaller is better; inner product is larger-is-better. The identity does not establish semantic usefulness or approximate-index recall.↔ Scroll wide equations horizontally.

Validate storage, temporal resolution, and retrieval separately

Estimate vector payload and required provenance before choosing an index strategy. An index may store graph links, coarse centroids, compressed codes, or other overhead, so measure its actual serialized and resident sizes separately. Test that every returned interval decodes to the intended source moment under the recorded selection policy. A semantically related clip with an incorrect timestamp can fail a moment-retrieval task even when its vector score is high. Retention and deletion procedures must account for both payload and index generations.

The vector lab illustrates compatible two-dimensional metric arithmetic. Reset, set both angle=60°,magnitude=1, predict components (0.5,approximately 0.8660), then Play or Step. With unit query (1,0), the dot product is 0.5 and squared L2 is one. Reset and set both angle=0°,magnitude=1 for dot product one and squared L2 zero. It contains no video encoder, searchable collection, quantization, eligibility filtering, or nearest-neighbor index; it checks the geometry rather than retrieval quality.

Count dense vectors and minimal per-record fields

A fictional store holds one million 512-dimensional float32 embeddings. Each record additionally stores one 64-bit ID and two 64-bit interval ticks. Timebases are stored in a separate source dictionary. Count only these dense payloads, excluding every index and replication overhead.

  1. Vector payload is 1,000,000×512×4=2,048,000,000 bytes, or 2.048 decimal GB. This is approximately 1.90735 GiB using 2³⁰ bytes per GiB.

  2. The declared ID and two ticks add 8+8+8=24 bytes per record, totaling 24,000,000 bytes. They do not include the separate timebase dictionary or other provenance fields.

  3. The counted total is 2,072,000,000 bytes, or 2.072 decimal GB. Measure index files, resident search structures, replicas, and source media separately before making a physical capacity or deployment-memory claim.

The result

The explicitly counted payload is 2.072 GB in decimal units. An embedding/index system needs additional capacity and versioned temporal provenance beyond that count.

Explore the model

Interactive lab

Interactive lab · vectors

Check unit-vector metric arithmetic

Reset → set both angle=60°,magnitude=1 predicts vector (0.5,approximately 0.8660), dot with query (1,0) of 0.5 and squared L2 of 1. Reset → set both angle=0°,magnitude=1 predicts dot 1 and squared L2 0. Play/Step contains no encoder, vector database, approximate search, or semantic-quality measurement.

Check unit-vector metric arithmeticPlayback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Current readings: x component: 1.393; y component: 0.975; Magnitude: 1.7. All parameters are adjustable with the labeled controls below.−7.46−3.7303.737.46−3.5−1.7501.753.5xyvvₓ = 1.39
Vectorx / y projectionsTrace marker
x component
1.393
y component
0.975
Magnitude
1.7
t = 0 s

Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forCompatible normalization makes metric identities usable; semantic and index quality need separate evaluation.

Check your understanding

A new encoder also produces 512-dimensional vectors. Can those rows safely join an existing cosine index solely because the dimensions match?

Try it yourself

Let unit query q=(1,0) and unit vector v=(0.6,0.8). Compute cosine and squared L2. If v is instead stored as (6,8), does its raw inner product with q still equal cosine?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use the unit-vector identity only for normalized inputs, and explicitly compute the scaled vector's norm.

Compare with the solution

For v=(0.6,0.8), cosine=q·v=0.6 and squared L2 is 2−2×0.6=0.8. The scaled vector (6,8) has norm ten and raw inner product six, while cosine remains 6/10=0.6. Normalizing both compatible nonzero vectors restores the cosine-through-inner-product contract. A raw inner-product index over varying magnitudes would answer a different ranking question.

Take it with you

  • Embedding records need source intervals and the complete representation-version contract.
  • Dense vector payload is one capacity term, with index and replication overhead measured separately.
  • Metric arithmetic, approximate-search recall, and downstream temporal relevance are different tests.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.