arXiv:2602.08517cs.AIcs.SE2026-02

提出树形张量TreeTensor,高效处理复杂嵌套数据。

TreeTensor: Boost AI System on Nested Data with Constrained Tree-Like Tensor

  • 用约束树结构建模嵌套数据关系,支持灵活操作
  • 在AlphaStar等复杂系统中实现零开销运算
  • 兼容主流库,适合多模态、变长数据场景

张量是现代人工智能系统最基本的数据结构,其内存连续性和切片独立性使系统能借助GPU在批量、空间或时间维度上并行处理。然而,在感知任务之外,复杂的认知型AI系统常包含具有层次结构的异构嵌套数据,难以用固定形状的传统张量高效表示和编程。为此,本文归纳了嵌套数据的两类主要计算模式,提出通用嵌套数据容器TreeTensor。通过一系列约束与实用工具,用户可对嵌套数据近乎零成本地应用任意函数与操作,包括Scikit-Learn、Numpy和PyTorch等知名机器学习库。该方法基于约束树结构系统建模数据关系,易于集成异步执行、变长数据计算等扩展能力。详细案例与基准测试表明,TreeTensor不仅在当前最复杂的AI系统之一——AlphaStar(星际争霸II)中展现出强大实用性,且运行效率优异,无额外开销。项目开源地址:https://github.com/opendilab/DI-treetensor。

原文摘要 · Abstract (English)

Tensor is the most basic and essential data structure of nowadays artificial intelligence (AI) system. The natural properties of Tensor, especially the memory-continuity and slice-independence, make it feasible for training system to leverage parallel computing unit like GPU to process data simultaneously in batch, spatial or temporal dimensions. However, if we look beyond perception tasks, the data in a complicated cognitive AI system usually has hierarchical structures (i.e. nested data) with various modalities. They are inconvenient and inefficient to program directly with conventional Tensor with fixed shape. To address this issue, we summarize two main computational patterns of nested data, and then propose a general nested data container: TreeTensor. Through various constraints and magic utilities of TreeTensor, one can apply arbitrary functions and operations to nested data with almost zero cost, including some famous machine learning libraries, such as Scikit-Learn, Numpy and PyTorch. Our approach utilizes a constrained tree-structure perspective to systematically model data relationships, and it can also easily be combined with other methods to extend more usages, such as asynchronous execution and variable-length data computation. Detailed examples and benchmarks show TreeTensor not only provides powerful usability in various problems, especially one of the most complicated AI systems at present: AlphaStar for StarCraftII, but also exhibits excellent runtime efficiency without any overhead. Our project is available at https://github.com/opendilab/DI-treetensor.

张量计算嵌套数据AI系统

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。