Tag: CV

  • DL0254 FLOPs-Throughput Paradox

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • DL0253 .contiguous() Implicit Copy

    After a transpose, your custom loss throws a contiguity error. Adding .contiguous() makes the error go away, but the profiler now shows a VRAM spike. What silent allocation did you trigger, how do strides and storage explain it, and when is .contiguous() free versus a full copy?

    A three-panel scenario card. The first panel shows fp32 logits of shape 8 by 2048 by 32768, a transpose of dimensions 0 and 1, and a view to minus one by 32768 that raises a RuntimeError about size and stride. The second panel shows the same code with contiguous added before view, a note that the loss now runs with unchanged values, and two bars of peak allocated memory per step, 19.4 GiB before and 21.4 GiB after, with the extra 2 GiB marked. The third panel lists three open questions about whether the transpose copied data, why view cannot flatten the result, and when contiguous is free or a full copy.

    The Problem: A custom token loss transposes fp32 logits of shape (8, 2048, 32768) into time-major order and crashes on .view(-1, 32768). Appending .contiguous() makes it run, but the profiler shows allocated memory jumping by 2.0 GiB at that line and the step peak rising from 19.4 to 21.4 GiB on a 24 GiB GPU.

    Answer

    A PyTorch tensor is a view: a flat storage buffer plus metadata giving sizes, strides, and an offset. transpose(0, 1) allocates nothing, because it only swaps two sizes and two strides, so the result walks the same storage in a jumping order. .view() may rewrite metadata but never data, and no single stride can merge two swapped axes, which is exactly the contiguity error your loss raised. .contiguous() then does the only thing left: it allocates a fresh storage of numel times element size and runs a strided gather into row-major order. For fp32 logits of shape (8, 2048, 32768) that silent buffer is exactly 2 GiB. In backward the gradient comes back as a transposed view, which the output layer’s reshape typically copies a second time.

    (1) Storage Versus Metadata: The bytes live in one flat storage, and sizes, strides, and offset only describe how to index it. Many tensors can share one storage.
    (2) Transpose Is Metadata-Only: Swapping two sizes and two strides is O(1), moves zero bytes, and leaves data_ptr() unchanged.
    (3) View Needs Mergeable Strides: Flattening adjacent dims k and k+1 requires s_k = s_{k+1} n_{k+1}. A transpose breaks that condition, so .view() errors instead of copying.
    (4) Contiguous Is Conditional: If the tensor is already row-major it returns self with no kernel and no allocation. Otherwise it is a full copy of every element plus a read and a write pass over HBM.
    (5) Reshape Hides The Same Copy: reshape() and flatten() return a view when they can and silently copy when they cannot, so the error you hit was the only loud warning.
    (6) Fix The Layout, Not The Symptom: Flatten the big tensor in its native order and reorder the small ones, or let a stride-aware or fused kernel read the transposed layout directly.

    Mathematical Formulation:
    \mathrm{addr}(i_0,\ldots,i_{d-1}) = o + \sum_{k=0}^{d-1} i_k s_k
    s_{d-1} = 1
    s_k = s_{k+1}\, n_{k+1}
    \mathrm{transpose}(a,b):\ (n_a, s_a) \leftrightarrow (n_b, s_b)
    M_{\mathrm{copy}} = e \prod_{k=0}^{d-1} n_k

    Where:

    • \mathrm{addr}(i_0,\ldots,i_{d-1}) is the position of an element inside the flat storage, counted in elements, o is the storage offset, and i_k is the index along dimension k.
    • s_k is the stride of dimension k (how many storage elements one step along that axis skips), n_k its size, and d the number of dimensions.
    • The two stride equations define row-major contiguity. Dimensions with n_k = 1 are ignored by the check, and the same equation is what .view() tests for every group of dimensions it merges.
    • \mathrm{transpose}(a,b) swaps the size and stride entries of axes a and b and touches no data.
    • M_{\mathrm{copy}} is the number of bytes .contiguous() allocates when the contiguity equations fail, and e is the element size (4 bytes for fp32, 2 for bf16).
    Two panels. The left panel shows one flat storage strip of six cells numbered 0 to 5, a 2 by 3 grid A with size 2 by 3 and stride 3 by 1, and a 3 by 2 grid A.t() with size 3 by 2 and stride 1 by 3, both shaded the same color as the storage to show they share it; a note says a row-major walk of A.t() reads storage at 0, 3, 1, 4, 2, 5. The right panel shows a new orange storage strip holding 0, 3, 1, 4, 2, 5 and a 3 by 2 grid B with stride 2 by 1, noting a fresh 24-byte buffer walked sequentially.

    Figure 1: Left, A and A.t() are two index maps over one 6-float storage, so the transpose allocates nothing and its row-major walk jumps through addresses 0, 3, 1, 4, 2, 5. Right, .contiguous() allocates a new buffer and gathers the values into that order, which buys strides (2, 1) at the price of a full copy.

    Worked Example (fp32 logits, batch 8, 2048 tokens, vocab 32768):
    L:\ n = (8,\ 2048,\ 32768)
    s(L) = (67108864,\ 32768,\ 1)
    X = \mathrm{transpose}(L, 0, 1)
    s(X) = (32768,\ 67108864,\ 1)
    s_0(X) = 32768 \neq 67108864 \cdot 8
    M = 4 \cdot 8 \cdot 2048 \cdot 32768
    M = 2^{31}\ \text{B} = 2\ \text{GiB}

    Nothing in the first four lines touched memory: X.data_ptr() == L.data_ptr(), and both tensors report the same 2 GiB storage. The failed merge test is the whole error message. Consecutive rows of a flattened X would sit 67,108,864 elements apart within a time step but jump backward when the time step advances, and one integer stride cannot express both. The copy also costs time: it reads 2 GiB and writes 2 GiB, about 4 GiB of HBM traffic, which is roughly 2 to 3 ms on an A100-class GPU before the uncoalesced strided reads slow it further. Once the loss function returns, the buffer goes back to PyTorch’s caching allocator rather than to the driver, so nvidia-smi keeps reporting it as used until torch.cuda.empty_cache() runs.

    Backward adds a second, less visible copy. Autograd treats contiguous as an identity, so the gradient of the copy passes straight through, but the transpose’s backward then hands the output layer a gradient that is a transposed view of a contiguous 2 GiB buffer. In the usual 3-D linear path the layer flattens that gradient to (16384, 32768) for its matrix multiply, the merge test fails again, and reshape quietly allocates another 2 GiB. The forward copy is the spike you see first, while the backward copy is what actually lifts the step peak.

    Line chart of allocated GPU memory in GiB against time within one training step. A blue curve for the native-layout loss rises from 9.4 to 13.4 during forward, steps to 15.4 for logits and 17.4 for the saved log-softmax, peaks at 19.4 in backward and falls back. An orange curve for transpose plus contiguous adds a 2 GiB step at the contiguous call in forward and another 2 GiB step in backward, reaching 21.4. A dashed gray reserved-memory curve climbs to 22 and stays there for the rest of the step.

    Figure 2: Schematic allocated memory for one step with the scenario’s logits. The .contiguous() copy adds 2 GiB in forward, the transposed gradient is copied again by reshape in backward to set the new 21.4 GiB peak, and reserved memory stays at the high-water mark because the caching allocator keeps freed blocks.

    .contiguous() is free whenever is_contiguous() already holds. It then returns self, launches no kernel, and allocates nothing. That covers fresh outputs of most ops, slices along the first dimension, a transpose that only moves a size-1 axis, and a double transpose that restores the original order. It becomes a full copy for any permutation of non-singleton axes, for inner or stepped slices, and for broadcast views, where the copy can be far larger than the source storage. The cheap fix here is to keep the 2 GiB tensor in its native order: logits.view(-1, 32768) and targets.view(-1) are both free, and any time-indexed weights can be flattened the same way.

    How the tensor was producedResulting layoutCost of .contiguous()
    Fresh op output, x[2:5], double transposeRow-major, possibly with a storage offsetFree: returns self, no kernel, no allocation
    (8, 1, V).transpose(0, 1)Still contiguous, since size-1 strides are ignoredFree
    transpose / permute of real axes, .T, .mTStrides out of decreasing orderFull copy of every element (2 GiB for the scenario logits)
    x[:, :100] or x[::2]Gaps between rows or a doubled strideCopy of the slice only, smaller than the storage
    x.expand(B, T, D) from (B, 1, D)Stride 0 on the broadcast axisMaterializes T times more memory than the source
    channels_last image batchNHWC strides on an NCHW shapeFull copy back to NCHW unless memory_format=torch.channels_last is passed

    Login to view more content
  • MSD0152 Video Intelligence for Investigations

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0142 Video Captioning under a Compute Budget

    Design the captioning system for a video platform with a billion-video catalog, where generating high-quality captions costs GPU time you do not have. This is the problem behind YouTube- and TikTok-scale auto-captioning. Captioning everything at max quality costs an order of magnitude more than the budget allows. Running the cheapest model on everything wastes budget on videos nobody watches and still fails on the content that matters. You must allocate a fixed daily compute budget across the catalog to maximize captioned value.

    How would you design this system? Cover the prioritization policy (which videos get captioned, and in what order, based on predicted views, accessibility needs, and content risk), the model cascade (cheap draft vs expensive quality pass, and when to upgrade), incremental coverage as budget arrives and backfill for the long tail, quality measurement without human transcripts at scale, and how allocation adapts when a video unexpectedly goes viral.

    Line-art scene: a grid of video thumbnails with wildly different view counts flows into a single GPU chip labeled with a daily budget, then to a question mark asking which videos get GPU time first, and on to a screen with an empty caption strip watched by a viewer who relies on captions

    The Problem: a billion videos with wildly skewed views, a daily GPU budget an order of magnitude too small for max-quality captions on everything, and viewers who need captions on whichever video they open.

    Answer

    Treat GPU time as a budget and every caption as a purchase. Each purchase is priced in GPU-seconds and valued as predicted watch-hours times the usable accuracy it adds, weighted for accessibility demand and content risk. An allocator buys actions in order of value per GPU-second until the daily budget clears, and the value ratio at that cut-off becomes a shadow price \lambda for every later decision. The models form a two-tier cascade: a draft model at 3 GPU-seconds per audio-hour covers the likely-watched majority at upload, and a 60 GPU-second quality model is bought only for the head and for drafts the estimator expects to fail. The long tail is drafted lazily on first caption request and backfilled off-peak, while a streaming view-velocity re-scorer pulls a sudden viral hit into a reserved hot lane within 30 minutes.

    (1) Value Model: score each video by predicted 7-day watch-hours times expected accuracy gain, multiplied by an accessibility weight (caption-on viewer share) and a risk weight (kids, news, medical).
    (2) Shadow-Price Allocator: greedily buy actions by value per GPU-second until the budget clears, then re-solve \lambda hourly and pace spend through the day.
    (3) Draft-Then-Upgrade Cascade: the cheap draft runs first and yields a confidence signal; a video upgrades to the quality pass only when its expected gain per GPU-second beats \lambda.
    (4) Tiered Coverage: draft at upload for the top 60% of new audio-hours, draft lazily on first caption request for the rest, and backfill the catalog off-peak in predicted watch-time order.
    (5) Reference-Free Quality: estimate WER from decoder confidence and draft-versus-quality disagreement on a short probe, calibrated on a small stratified human audit.
    (6) Velocity Re-Scoring: a streaming job re-scores accelerating videos every 15 minutes and routes them through a reserved 5% hot lane.

    Captioning pipeline: uploads and backlog feed a value scorer, then a budget allocator with a shadow price and hot lane, then a draft ASR model and a caption store; the draft upgrades to a quality ASR model when value per cost clears the shadow price, a quality estimator feeds estimated WER back to the allocator, and a view-velocity stream re-scores hot videos

    Figure 1: One value score drives every lane: drafts go wide, the quality pass is bought only above the shadow price, and estimated WER plus view velocity feed back into the next decision.

    Clarify Before Designing:
    (1) Budget Shape: is the 1,500 GPU-hour daily budget a hard cap or a rolling average, and can backfill borrow off-peak or spot capacity?
    (2) Popularity Skew: early YouTube measurements found the top 10% of videos drew about 80% of views; does a skew like that hold for our watch-hours?
    (3) Accessibility Contract: are there legal caption mandates (for example, content that aired on TV), and is a caption that appears within a second of a viewer’s request acceptable?
    (4) Quality Bar: what WER makes a caption usable, and is a wrong caption worse than none for some categories such as kids content?
    (5) Language Mix: what share of audio is in low-resource languages or music-heavy, where a cheap draft model collapses?
    (6) Downstream Consumers: do search, translation, and moderation also read the transcripts, which would raise the value of captioning unwatched but risky videos?


    Login to view more content
  • MSD0135 Video-Generation Serving on a Scarce GPU Pool

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0121 Laser Weeding Edge Vision

    Design the weed-targeting vision system for an agricultural robotics company whose field robot destroys weeds with lasers instead of spraying herbicide, in the spirit of laser weeders such as Carbon Robotics’ LaserWeeder. As the machine crosses the field at a few km/h, ‘predict’ cameras image the ground ahead of each weeding module. A plant-level crop/weed classifier on onboard GPUs must localize every weed and hand coordinates to ‘target’ cameras and the laser controller, which fires at the weed’s meristem, all within the tens of milliseconds before the plant leaves the firing zone.

    Everything runs on the machine. Rural fields have unreliable connectivity, dust and vibration shake the optics, and lighting spans noon glare to darkness (strobed LED illumination freezes motion and kills shadows). Missing weeds loses yield; hitting crop plants destroys revenue.

    How would you design this system? Cover the predict-to-target camera handoff (upstream detection, multi-camera tracking under vehicle motion, timing geometry from ground speed), the plant classifier under severe imbalance and growth-stage/region domain shift, the edge inference budget (per-module GPU, thermal/power limits, deterministic latency), the offline fleet-learning loop over intermittent links (hard-example upload, central retrain, OTA model rollout), and safe fallback when sensing or laser calibration degrades.

    Line-art side view: a wheeled toolbar travels right over a planted bed of crop seedlings and small weeds; a strobed predict camera looks at the ground ahead, a target camera and laser beam hit a weed behind, a question mark sits between them, and a zoom circle shows a weed's meristem

    The Problem: a weed seen by the predict camera ahead must be found again under the laser behind while the machine keeps moving, then hit on a millimeter-scale meristem without touching the neighboring crop.

    Answer

    The design is a two-stage sense-then-aim loop that runs entirely on the machine. A strobed predict camera feeds a per-module GPU detector that classifies every plant and locates its meristem. A ground-frame tracker fuses the 4-5 looks each plant gets, using wheel odometry, IMU, and visual odometry to carry it forward. The target camera then re-acquires the plant locally, refines the aim point, and steers the laser through its dwell while the plant keeps moving. Every shot passes an asymmetric fire gate (never inside a crop buffer, weeds only above a per-crop calibrated confidence), and a store-and-forward fleet loop plus a hold-fire supervisor keep the system improving and safe when links, optics, or calibration fail.

    (1) Strobed, Hardware-Timestamped Capture: a shrouded LED strobe with a 50 µs exposure freezes motion to about 0.04 mm and makes noon and midnight frames look alike; every frame carries its trigger time.
    (2) One-Pass Plant Detector: a single-stage network outputs meristem keypoint, box, size, and crop/weed class for all plants at once, so latency does not grow with weed density.
    (3) Ground-Frame Tracking And Handoff: detections become tracks in a shared machine frame, fused across looks and adjacent cameras, then handed to the target camera with a predicted position and uncertainty.
    (4) Asymmetric Fire Gate: no shot within a crop buffer, and weed thresholds calibrated per crop and growth stage against a 0.1% crop-hit cap.
    (5) Deterministic Edge Runtime: fixed-shape INT8 engines, locked GPU clocks, and a 60 ms p99 predict deadline where late frames are dropped, not queued.
    (6) Store-And-Forward Fleet Loop: onboard triage uploads only hard examples, central retraining passes a slice-level gate, and signed OTA engines roll out through shadow, canary, and automatic rollback.

    Per-module pipeline: predict camera with strobed LED, plant detector, ground tracker, fire gate, target camera re-acquisition, and laser in a row; below, a hard-example buffer sends data over an intermittent link to central retraining and OTA rollout back to the detector, and a safety supervisor watches the target camera and laser and can hold fire

    Figure 1: The per-module loop: a strobed predict camera feeds the detector and ground tracker, the fire gate hands survivors to the target camera and laser, and a store-and-forward fleet loop plus a safety supervisor sit beside it.

    Clarify Before Designing:
    (1) Speed And Geometry: what ground-speed range, how many modules, and how far ahead of the laser does each predict camera look? These set the dead-reckoning distance and the firing window.
    (2) Aim Tolerance And Dwell: how precisely must the beam land on the meristem, and how long must it dwell per weed at each size? Millimeter tolerance forces closed-loop re-acquisition, and dwell sets laser capacity.
    (3) Crops, Regions, Stages: which crops and growth stages, which regions and soils, and how much plant-level labeled data exists for each combination?
    (4) Cost Asymmetry: what crop-hit rate is tolerable (0.1% of plants?) versus what weed escape rate, and is a second pass or hand crew available for escapes?
    (5) Compute Envelope: one GPU per module or a shared box, and what power and thermal limits does a sealed, dusty enclosure impose?
    (6) Connectivity: how much cellular uplink exists in the field versus Wi-Fi at the yard, and how often?


    Login to view more content
  • MSD0089 Generative AV Simulation

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0080 Content Moderation System

    Design a content moderation system for a platform where users post 500 million text/image/video items per day. Policy-violating content (hate, harassment, adult, violence, misinformation) must be caught fast: some removed instantly, some routed to human reviewers. Legitimate edgy content must not be over-removed (press freedom, satire, news).

    Reviewer capacity is fixed at thousands of decisions per hour, so the system must triage: auto-action on confident cases, queue the rest by expected harm. Labels trickle in over days, policies change monthly, and adversarial posters constantly adapt (coded language, image perturbations).

    How would you design this system? Cover the multi-stage classifier cascade (cheap model, expensive model, human), the triage queue that ranks by expected harm and review value, the thresholding policy that trades precision for recall per content class, label collection and the reviewer-agreement loop, evaluation that reflects asymmetric costs (missed CSAM vs removed satire), and the adaptation cycle for policy changes and adversarial drift.

    Line-art scene: a stream of text, image, and video posts plus a news and satire card converges on a single question mark, a poster holds a card with a coded word, and three human reviewers stand on the right labeled with a few thousand decisions per hour

    The Problem: half a billion posts a day meet a few thousand human decisions an hour, and the same image can be a violation, a news report, or a joke.

    Answer

    The design is a three-stage cascade that feeds a harm-ranked review queue. Known-bad media is blocked by perceptual hash matching before any model runs. A distilled per-modality model then scores every item, and only the uncertain ~5% escalates to a heavy multimodal model that reads the whole post. Each policy class applies its own three-action rule (remove, review, leave), with thresholds derived from the cost of a wrongful removal, the cost of a miss, and the price of a reviewer’s decision. The queue is ordered by probability times severity times predicted reach, and reviewer decisions, audits, and appeals flow back as labels that retrain the models weekly.

    (1) Hash Match First: known CSAM and terrorist media is matched against perceptual-hash banks and blocked instantly, with mandatory reporting, so no model error can let it through.
    (2) Cheap-Then-Expensive Cascade: a distilled model scores 100% of uploads in ~40 ms, and only items in an uncertain region escalate to a heavy whole-post multimodal model.
    (3) Per-Class Three-Action Thresholds: each class gets its own remove, review, and leave bands computed from its cost asymmetry, so CSAM and satire are never judged by the same cutoff.
    (4) Harm-Ranked Triage Queue: reviewers see items in order of calibrated violation probability times severity times predicted reach, plus a small label-value bonus.
    (5) Reviewer Agreement Loop: blind second reviews measure per-policy agreement, disagreements go to expert adjudication, and the adjudicated gold set weights every reviewer’s labels.
    (6) Fast Adaptation Cycle: a policy-prompted LLM classifier bootstraps labels for new policy clauses within days, and weekly hard-example mining keeps pace with coded language and perturbed images.

    Moderation pipeline: uploads pass hash matching, which blocks and reports known-bad media; a cheap model scores all items and settles about 95 percent, the heavy whole-post model scores the uncertain 5 percent, per-class thresholds split traffic into auto-action and a harm-ranked review queue, human review produces labels, and a dashed retraining path returns to the cheap model

    Figure 1: The moderation path: hash hits are blocked outright, the cheap model settles ~95% of items, the heavy model scores the uncertain rest, and per-class thresholds split traffic into auto-action and a harm-ranked queue whose decisions retrain the models.

    Clarify Before Designing:
    (1) Modality and Language Mix: what share of uploads is text, image, and video, and how many languages need native-speaker reviewers? Video and low-resource languages drive both cost and recall gaps.
    (2) Pre- or Post-Publication: which classes must be blocked before anyone sees them, and how much latency may the upload path absorb? This sets the synchronous budget.
    (3) Cost Asymmetry and Law: which classes carry legal duties (CSAM reporting, takedown deadlines under laws like the EU DSA), and how does the business price a wrongful removal of news against a miss?
    (4) Reviewer Capacity: exactly how many decisions per hour, split across which languages and specialties, and can surge capacity be bought during crises?
    (5) Label Sources: do user reports, an appeal flow, and any random-sample labeling exist today, or only decisions on items a model already flagged?
    (6) Reach Signals: can an item’s likely audience (follower count, early engagement velocity) be predicted at scoring time? Without it the queue cannot rank by harm.


    Login to view more content
  • MSD0079 ML Data Flywheel

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0078 AV Behavior Prediction

    Design the behavior prediction module for an autonomous vehicle. Given the ego vehicle’s sensor history (multi-camera, LiDAR, radar) and HD map, predict trajectories for every surrounding agent (vehicles, cyclists, pedestrians) 3 to 8 seconds into the future.

    The planner consumes these predictions at a fixed 10Hz cadence with a hard 50ms compute budget on the vehicle’s chip. It needs uncertainty, not just a point estimate: per-step covariance or a small set of discrete modes (go straight, turn left, yield). A missed rare maneuver (sudden lane change, jaywalker) is far worse than a slightly off average trajectory.

    How would you design this system? Cover the scene representation (vectorized agents/lanes vs rasterized BEV), the prediction model architecture (how multimodality is expressed: anchors, diffusion, discrete modes), the uncertainty contract with the planner’s cost function, joint-vs-marginal prediction (agents interact), how you evaluate beyond average displacement error (miss rate on safety-critical maneuvers, calibration of the modes), and the on-vehicle latency budget split against the rest of the stack.

    Line-art intersection scene: the ego car approaches a crosswalk while an oncoming car, a crossing car, a cyclist, and a pedestrian at the curb each carry a question mark; side panels state the 10 Hz planner cadence, the 50 ms compute budget, the 3 to 8 s horizon, and that a missed jaywalker costs more than drift

    The Problem: four road users around one intersection each have several plausible futures (marked ?), and all of them must be forecast 3 to 8 s ahead for a planner that reads every 100 ms, inside a 50 ms compute slice.

    Answer

    The design is a vectorized, query-centric transformer: every tracked agent and lane segment becomes a token, local attention encodes the scene, and a decoder emits a handful of intention-anchored modes per agent. Each mode is a full 8 s trajectory with a per-step Gaussian covariance and a calibrated probability. Interaction is handled in two tiers, with marginal modes for every agent plus scene-level joint modes for the few groups whose futures actually conflict. The pivotal decisions are the planner contract (calibrated probabilities, honest covariance, a hard deadline with a stale-output fallback) and an evaluation regime gated on miss rate and calibration over safety-critical slices rather than average displacement error. Caching static map encodings and keeping attention local is what fits the nominal path into 40 ms of the 50 ms budget.

    (1) Vectorized Query-Centric Scene: agents and lane, crosswalk, and stop-line polylines become tokens in their own local frames, so static map tokens are encoded once per tile and reused every cycle.
    (2) Local Factorized Encoder: attention over time, agent-to-map, and agent-to-agent is restricted to each token’s 64 nearest neighbors, keeping cost linear in scene size.
    (3) Intention-Anchored Decoder: 64 learned endpoint anchors per agent type emit Gaussian trajectories, and endpoint NMS keeps 6 diverse modes instead of the 6 most probable near-duplicates.
    (4) Marginal Plus Joint: marginal modes for every agent, joint scene-level modes only for groups whose futures conflict, optionally conditioned on the planner’s candidate ego plans.
    (5) Calibrated Planner Contract: per-mode probability and per-step covariance with stated calibration guarantees, published every 100 ms with a deadline watchdog and physics fallback.
    (6) Rare-Maneuver Data Engine: mine and upweight cut-ins, jaywalks, and U-turns, and gate every release on miss rate for those slices.

    Behavior prediction pipeline: tracks and HD map become scene tokens, a local-attention encoder and an anchored mode decoder feed joint re-scoring, which publishes the planner contract to the 10 Hz planner; offline, fleet logs feed rare-maneuver mining and shadow-gated training that pushes new weights to the encoder

    Figure 1: The online path (scene tokens, local-attention encoder, anchored decoder, joint re-scoring) publishes the planner contract every 100 ms; offline, logged outcomes feed rare-maneuver mining and shadow-gated retraining.

    Clarify Before Designing:
    (1) Scene Density & Range: how many agents does the densest scene hold, and out to what range (80 m urban versus 200 m highway)?
    (2) Planner Interface: does the planner consume one unconditional prediction set, or query predictions conditioned on its own candidate plans, and does it want modes or an occupancy grid?
    (3) Compute Sharing: is the 50 ms on a dedicated accelerator partition or shared with perception, and does the chip run int8 transformers efficiently?
    (4) Input Quality: tracked boxes only or also BEV sensor features, and how often do tracks switch IDs or drop occluded pedestrians?
    (5) Safety Bar: which maneuver slices gate release at what miss rate, and how much over-caution (phantom braking) is acceptable in exchange?
    (6) Data Supply: how many hours of fleet logs exist, and how many rare maneuvers arrive per month?


    Login to view more content