arXiv:2409.19700cs.CL2024-09被引 5

2D-TPE让大模型更好理解表格的二维结构,提升推理准确率。

2D-TPE: Two-Dimensional Positional Encoding Enhances Table Understanding for Large Language Models

  • 提出2D-TPE编码,动态选择表格遍历顺序,保留空间关系。
  • 在5个基准上超越强基线,大表格下表现更优。
  • 适合需要精准表格理解的场景,如数据问答、信息抽取。

表格在各领域广泛用于简洁呈现结构化信息。让大语言模型(LLMs)具备表格推理能力是当前研究热点。然而,主流LLMs仅支持一维输入,现有方法常将二维表格展平为词元序列,严重破坏空间关系并导致关键上下文信息丢失。本文通过两个精心设计的代理任务,首次实证证明展平操作对捕捉表格空间信息具有显著负面影响。为此,我们提出一种简单有效的位置编码方法——2D-TPE(二维表格位置编码),使每个注意力头可动态选择词元的排列顺序,对应不同遍历模式(如列优先或行优先)。2D-TPE有效缓解了重要空间信息丢失问题,同时保持计算效率,更完整保留表格结构。在五个基准上的大量实验表明,2D-TPE优于多个强基线,凸显保留表格结构对准确理解的重要性。综合分析进一步揭示其在处理大表格时具有显著更强的可扩展性。

原文摘要 · Abstract (English)

Tables are ubiquitous across various domains for concisely representing structured information. Empowering large language models (LLMs) to reason over tabular data represents an actively explored direction. However, since typical LLMs only support one-dimensional~(1D) inputs, existing methods often flatten the two-dimensional~(2D) table structure into a sequence of tokens, which can severely disrupt the spatial relationships and result in an inevitable loss of vital contextual information. In this paper, we first empirically demonstrate the detrimental impact of such flattening operations on the performance of LLMs in capturing the spatial information of tables through two elaborate proxy tasks. Subsequently, we introduce a simple yet effective positional encoding method, termed ``2D-TPE'' (Two-Dimensional Table Positional Encoding), to address this challenge. 2D-TPE enables each attention head to dynamically select a permutation order of tokens within the context for attending to them, where each permutation represents a distinct traversal mode for the table, such as column-wise or row-wise traversal. 2D-TPE effectively mitigates the risk of losing essential spatial information while preserving computational efficiency, thus better preserving the table structure. Extensive experiments across five benchmarks demonstrate that 2D-TPE outperforms strong baselines, underscoring the importance of preserving the table structure for accurate table comprehension. Comprehensive analysis further reveals the substantially better scalability of 2D-TPE to large tables than baselines.

表格理解位置编码大模型结构化数据

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