用线性复杂度编码3D空间关系,让大模型更懂物体位置逻辑。
Scalable Object Relation Encoding for Better 3D Spatial Reasoning in Large Language Models
- 用四元数向量表示3D坐标,实现空间关系的全局一致编码
- 通过注意力层内积计算成对关系,输入长度仅与物体数线性相关
- 新方法可插入现有大模型,不干扰原有位置感知能力
空间推理关注基于3D场景中的空间关系定位目标物体,对发展智能具身代理至关重要。由于缺乏足够的3D场景-语言配对数据,从零训练具备强推理能力的模型极具挑战。以往方法将3D场景表征注入大语言模型(LLM)输入空间,利用其预训练的理解与推理能力进行空间推理。然而,编码绝对位置的模型难以从过早融合的特征中提取空间关系;而显式编码所有空间关系(数量为物体数的平方)的方法则存在扩展性差的问题。为此,我们提出QuatRoPE,一种输入长度与物体数呈线性关系的新位置嵌入方法,通过注意力层中的点积显式计算成对空间关系。QuatRoPE对3D坐标的整体向量编码保证了高度的空间一致性,维持场景几何完整性。此外,我们引入孤立门控RoPE扩展(IGRE),有效将QuatRoPE的影响限制在与物体相关的标记上,从而最小化对LLM原有位置嵌入的干扰,保持其原始能力。大量实验验证了所提方法的有效性。代码与数据见https://github.com/oceanflowlab/QuatRoPE。
原文摘要 · Abstract (English)
Spatial reasoning focuses on locating target objects based on spatial relations in 3D scenes, which plays a crucial role in developing intelligent embodied agents. Due to the limited availability of 3D scene-language paired data, it is challenging to train models with strong reasoning ability from scratch. Previous approaches have attempted to inject 3D scene representations into the input space of Large Language Models (LLMs) and leverage the pretrained comprehension and reasoning abilities for spatial reasoning. However, models encoding absolute positions struggle to extract spatial relations from prematurely fused features, while methods explicitly encoding all spatial relations (which is quadratic in the number of objects) as input tokens suffer from poor scalability. To address these limitations, we propose QuatRoPE, a novel positional embedding method with an input length that is linear to the number of objects, and explicitly calculates pairwise spatial relations through the dot product in attention layers. QuatRoPE's holistic vector encoding of 3D coordinates guarantees a high degree of spatial consistency, maintaining fidelity to the scene's geometric integrity. Additionally, we introduce the Isolated Gated RoPE Extension (IGRE), which effectively limits QuatRoPE's influence to object-related tokens, thereby minimizing interference with the LLM's existing positional embeddings and maintaining the LLM's original capabilities. Extensive experiments demonstrate the effectiveness of our approaches. The code and data are available at https://github.com/oceanflowlab/QuatRoPE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。