Tree Cross Attention
Leo Feng, Frederick Tung, Hossein Hajimirsadeghi, Yoshua Bengio, Mohamed Osama Ahmed
Abstract
Cross Attention is a popular method for retrieving information from a set of context tokens for making predictions. At inference time, for each prediction, Cross Attention scans the full set of tokens. In practice, however, often only a small subset of tokens are required for good performance. Methods such as Perceiver IO are cheap at inference as they distill the information to a smaller-sized set of latent tokens on which cross attention is then applied, resulting in only complexity. However, in practice, as the number of input tokens and the amount of information to distill increases, the number of latent tokens needed also increases significantly. In this work, we propose Tree Cross Attention (TCA) - a module based on Cross Attention that only retrieves information from a logarithmic number of tokens for performing inference. TCA organizes the data in a tree structure and performs a tree search at inference time to retrieve the relevant tokens for prediction. Leveraging TCA, we introduce ReTreever, a flexible architecture for token-efficient inference. We show empirically that Tree Cross Attention (TCA) performs comparable to Cross Attention across various classification and uncertainty regression tasks while being significantly more token-efficient. Furthermore, we compare ReTreever against Perceiver IO, showing significant gains while using the same number of tokens for inference.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 1f317436-60cc-4590-a4e6-21dee4ee3864Builds on8
- Perceiver IO: A General Architecture for Structured Inputs & OutputsAndrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch et al.ICLR 2022 · 797 citations
- Multi-Time Attention Networks for Irregularly Sampled Time SeriesSatya Narayan Shukla, Benjamin M. MarlinICLR 2021 · 301 citations
- Set Functions for Time SeriesMax Horn, Michael Moor, Christian Bock, Bastian Rieck et al.ICML 2020 · 199 citations
- Transformer Neural Processes: Uncertainty-Aware Meta Learning Via Sequence ModelingTung Nguyen, Aditya GroverICML 2022 · 148 citations
- Tree-Structured Attention with Hierarchical AccumulationXuan-Phi Nguyen, Shafiq R. Joty, Steven C. H. Hoi, Richard SocherICLR 2020 · 79 citations
Related papers
- Treeformer: Dense Gradient Trees for Efficient Attention ComputationLovish Madaan, Srinadh Bhojanapalli, Himanshu Jain, Prateek JainICLR 2023
- Hierarchical Retrieval at Scale: Bridging Interpretability and EfficiencyShubham Gupta, Zichao Li, Tianyi Chen, Cem Subakan et al.ICML 2026
- Perceiving Longer Sequences With Bi-Directional Cross-Attention TransformersMarkus Hiller, Krista A. Ehinger, Tom DrummondNeurIPS 2024 · 23 citations
- Efficient Length-Generalizable Attention via Causal Retrieval for Long-Context Language ModelingXiang Hu, Zhihao Teng, Jun Zhao, Wei Wu et al.ICML 2025
- Fcaformer: Forward Cross Attention in Hybrid Vision TransformerHaokui Zhang, Wenze Hu, Xiaoyu WangICCV 2023 · 10 citations
