π0.5 Leakage-Free Hybrid Action Attention
π₀.₅ · arXiv 2025 · Medium · 30 minutes
π0.5 Leakage-Free Hybrid Action Attention: implement the interfaces below and verify numerical, boundary and experimental behavior.
Implement Appendix E / Figure 18 training attention connectivity. Prefix, discrete FAST labels and continuous action-expert contents are supplied; omit model pretraining.
Functions to implement
hybrid_attention_mask(valid: Tensor, prefix_length: int, fast_length: int) -> Tensor
π0.5 Leakage-Free Hybrid Action Attention
1. Exercise goal
π0.5 Leakage-Free Hybrid Action Attention: implement the interfaces below and verify numerical, boundary and experimental behavior.
Implement Appendix E / Figure 18 training attention connectivity. Prefix, discrete FAST labels and continuous action-expert contents are supplied; omit model pretraining.
2. Core equations
$$ M_{qk}=\begin{cases}k<P&q<P\k<P\ \lor\ (P\le k\le q)&P\le q<P+F\k<P\ \lor\ k\ge P+F&q\ge P+F\end{cases},\quad M\leftarrow M\land v_q\land v_k. $$
3. From equations to code
hybrid_attention_mask(valid: Tensor, prefix_length: int, fast_length: int) -> Tensor
Prefix queries see prefix only. FAST queries see prefix and causal FAST tokens. Expert queries see prefix and all expert tokens. FAST carries clean action labels, so expert-to-FAST access leaks the flow-matching target. Mask padding on both query and key axes.
4. Contract and boundaries
Valid is bool (B,L), prefix_length>=1, fast_length>=0 and at least one expert token remains. Return bool (B,L,L), rows=query, columns=key. FAST inputs are shifted teacher-forcing tokens and may attend themselves; expert attention is bidirectional but cannot see FAST.
Validation helpers are provided. All floating inputs are finite CPU float32/float64; do not mutate inputs. Invalid shape, dtype, range or mask arguments raise ValueError.
5. Deterministic experiment and visualization
experiment.py calls every submitted interface on fixed inputs and records a learning or sampling curve and terminal metrics. T3 states the behavioral thresholds; the visualization uses the same outputs.
The visualization is generated by viz/gen.py; T3 runs the same experiment with your functions and records its actual metrics. These are small deterministic teaching results, not a robot benchmark.
6. Run your implementation
Complete the functions in the Python editor on the right, then click Run tests. Inspect each failed check, update your implementation, and run again. Passing every required check marks the problem as solved and unlocks the notes.
7. Sources and extensions
- π₀.₅: a Vision-Language-Action Model with Open-World Generalization — Appendix E, Figure 18: attention mask for discrete and continuous action training
- Verified source
Verified 2026-10-28. Extending this operator to the full paper requires the omitted model, data and environment described in the scope above.