Add retrieval phase analysis report
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101# Where multi-source BR and IWR retrieve from
This is a descriptive audit of the 70k-step three-task SAILOR retrieval forMug Cleanup O1 and Hammer Cleanup D0. It does not measure downstream policysuccess. Machine-readable counts and plots are in`results/multi_source_phase_analysis/`.
- [Source-task composition](../results/multi_source_phase_analysis/source_task_mix.png)- [Within-task phase distributions](../results/multi_source_phase_analysis/within_task_phases.png)
## Phase-label method
The source pool has 67,762 Coffee Preparation, 66,711 Pick Place, and 60,857Kitchen complete ten-step windows (195,330 total). Each selected window isassigned to a phase using its midpoint. We locate gripper-command closing andopening switches in each *individual* trajectory, then use the user's `demo_0`timestamps, scaled by trajectory length, for fixture interactions that do notclose the gripper (lid, drawer, stove, serving area). These are provisionallabels, especially where the video notes identify an object uncertainly.
The gripper event structure is fairly stable: all 100 Coffee Preparation demoshave two close/open cycles; all 100 Kitchen demos have three; all 25 Mug and25 Hammer demos have one. Pick Place has four cycles in 68 of 100 demos andfive in 32, so its cycles should not be forced into four fixed time bins.Gripper-commanded closed periods suggest transport, but are not proof that anobject is held throughout. Reported percentages are descriptive becauseadjacent windows and windows from the same episode are dependent.
## Source-task composition
The eligible candidate pool is 34.7% Coffee Preparation, 34.2% Pick Place,and 31.2% Kitchen. The table uses the **nonoverlap** selections, whose ten-stepsource clips share no timesteps within an episode.
| Target | Rule | Coffee Prep | Pick Place | Kitchen | Total clips ||---|---|---:|---:|---:|---:|| Mug O1 | BR | 247 (28.9%) | 39 (4.6%) | 569 (66.5%) | 855 || Mug O1 | IWR | 275 (32.2%) | 458 (53.6%) | 122 (14.3%) | 855 || Hammer D0 | BR | 13 (1.8%) | 3 (0.4%) | 691 (97.7%) | 707 || Hammer D0 | IWR | 192 (27.2%) | 23 (3.3%) | 492 (69.6%) | 707 |
The overlap selections are more concentrated. Mug IWR overlap contains **839of 855 clips from Pick Place** and covers only 2,205 unique source timestepsout of 8,550 nominal. Mug BR overlap covers 4,976 unique timesteps. Hammer BRoverlap contains 704 of 707 clips from Kitchen. The nonoverlap selectionscover 8,550 unique timesteps for Mug and 7,070 for Hammer by construction.
BR and IWR select quite different source material. For Mug nonoverlap, theirselected clips share only **99 unique source timesteps** out of 8,550 each;for Hammer they share 879 out of 7,070 each.
## Where inside each source task
**Mug O1.** Of BR's 247 Coffee Preparation clips, 162 fall in the roughapproach-to-pod interval after drawer opening and before the second gripperclose. That is 65.6% of its Coffee selections, versus 23.3% of eligible Coffeewindows. Another 55 occur while carrying/inserting the pod. BR's 569 Kitchenclips include 176 in the rough stove-on opening phase and 79 before the firstpot grasp. IWR instead draws 458 clips from Pick Place; **72.1%** of thesefall between a gripper close and release, versus 42.7% of eligible Pick Placewindows. In the overlap variant this rises to 89.9% of its 839 Pick Place clips.
**Hammer D0.** BR's 691 Kitchen clips span several phases: 160 in the roughbread-approach interval, 154 near the initial stove-on phase, 107 in thebread-to-pot transfer, and 105 before the second pot grasp. IWR's 492 Kitchenclips concentrate even more at the start: **271 (55.1%)** in the roughstove-on phase, compared with 13.0% of eligible Kitchen windows. Of IWR's192 Coffee Preparation clips, 85 (44.3%) are in the rough drawer-openingphase, compared with 18.1% of eligible Coffee windows. None of those 192Coffee clips has a closed-gripper command at its midpoint.
The BR nearest-query audit exposes possible semantic mismatches. For Mug,110 selected Kitchen stove-on clips have their nearest target query in therough drawer-opening phase, and another 64 in drawer closing. For Hammer,104 Kitchen bread-to-pot clips match the target's object-carry phase and 101Kitchen bread-approach clips match its object-approach phase. Those mappingsreflect latent-space proximity, not verified skill equivalence.
## Score mechanism
| Target | Selection | Median nearest-target distance | Median target log density | Median source log density ||---|---|---:|---:|---:|| Mug O1 | BR nonoverlap | 0.867 | -33.36 | -30.24 || Mug O1 | IWR nonoverlap | 2.305 | -33.78 | -31.05 || Hammer D0 | BR nonoverlap | 0.752 | -28.95 | -30.23 || Hammer D0 | IWR nonoverlap | 1.300 | -29.11 | -30.58 |
IWR's selected clips are farther from the nearest target window by BR'smetric. Their target KDE density is modestly lower, while their source KDEdensity is lower by more, increasing `log p_target - log p_source`. This is theexpected density-ratio mechanism, but it may favor rare source behaviors thatare not actually useful. The current retrieval diagnostics cannot settle thatquestion; representative clips and downstream policy results are needed.
## Next check
Review a small, episode-diverse sample of retrieved clips with a few seconds ofcontext on both sides, especially Kitchen stove-on clips matched to drawermotions, Coffee pod-approach clips matched to Mug phases, and Pick Placecarry/place clips selected by IWR. Record whether the action and object motionwould help the target, not just whether the scene looks similar.experiments/multi_source_3task/repro/multi_source_retrieval_phase_analysis.mdAdded+101