[论文解读] SpreadsheetCoder: Formula Prediction from Semi-structured Context
SpreadsheetCoder 是一种基于 BERT 的神经模型,通过编码行和列的关联结构,利用包括表头和单元格值在内的半结构化表格上下文,预测电子表格公式。其全公式 top-1 准确率达到 42.51%,在 Google Sheets 中比基于规则的系统多协助 82% 的用户,证明了丰富表格上下文在公式预测中的价值。
Spreadsheet formula prediction has been an important program synthesis problem with many real-world applications. Previous works typically utilize input-output examples as the specification for spreadsheet formula synthesis, where each input-output pair simulates a separate row in the spreadsheet. However, this formulation does not fully capture the rich context in real-world spreadsheets. First, spreadsheet data entries are organized as tables, thus rows and columns are not necessarily independent from each other. In addition, many spreadsheet tables include headers, which provide high-level descriptions of the cell data. However, previous synthesis approaches do not consider headers as part of the specification. In this work, we present the first approach for synthesizing spreadsheet formulas from tabular context, which includes both headers and semi-structured tabular data. In particular, we propose SpreadsheetCoder, a BERT-based model architecture to represent the tabular context in both row-based and column-based formats. We train our model on a large dataset of spreadsheets, and demonstrate that SpreadsheetCoder achieves top-1 prediction accuracy of 42.51%, which is a considerable improvement over baselines that do not employ rich tabular context. Compared to the rule-based system, SpreadsheetCoder assists 82% more users in composing formulas on Google Sheets.
研究动机与目标
- 解决现有公式预测方法仅依赖输入-输出示例、忽略电子表格中结构和语义上下文的局限性。
- 开发一种神经模型,利用表头和半结构化表格数据作为公式生成的隐式规范。
- 通过建模真实世界中结构较不严谨的电子表格中行与列之间的依赖关系,提升公式预测的准确性。
- 通过支持广泛的运算符和单元格引用,超越受限的领域特定语言(DSL),实现更灵活的公式生成。
- 通过在真实世界电子表格上进行评估,展示实际应用价值,并证明相比基于规则的系统在用户协助方面有可衡量的提升。
提出的方法
- 在电子表格表格上微调基于 BERT 的编码器,为每个单元格生成上下文嵌入,通过独立的编码路径整合行和列的上下文信息。
- 通过在多个前向传播中拼接多行多列,处理超出 BERT 512 个标记限制的大型表格。
- 采用两阶段解码过程:首先生成不含具体单元格引用的公式草图,然后预测合适的单元格范围以完成公式。
- 在英文语料库上进行预训练,以更好地编码自然语言表头,增强对表格元数据的语义理解。
- 该架构支持超过 100 种电子表格运算符和灵活的单元格引用方式,可生成完整且可执行的公式。
- 在组织内部真实公开共享的电子表格大规模基准数据集上进行训练和评估。
实验结果
研究问题
- RQ1将表格表头和半结构化数据纳入上下文,是否能超越仅依赖输入-输出示例的公式预测性能?
- RQ2基于 BERT 的架构在建模半结构化电子表格中的二维关系结构方面效果如何?
- RQ3建模跨行和跨列依赖关系在多大程度上提升了公式预测的准确性?
- RQ4神经模型是否能在真实世界的公式构建任务中超越基于规则的系统?
- RQ5与传统的编程示例(Programming-by-Example)相比,丰富表格上下文在实际用户协助方面有何优势?
主要发现
- SpreadsheetCoder 实现了 42.51% 的 top-1 全公式准确率,显著优于未使用丰富表格上下文的基线方法。
- 模型在 top-1 公式草图准确率上达到 57.41%,表明其在预测公式结构形式方面表现优异。
- 与基于规则的系统相比,SpreadsheetCoder 在 Google Sheets 中帮助了多出 82% 的用户完成公式构建,展现出实际应用中的显著影响。
- 将表格表头作为输入上下文的一部分,显著提升了预测性能,凸显了其作为语义提示的重要性。
- 两阶段解码过程(先生成草图,再预测单元格引用)实现了准确且灵活的公式生成。
- 该模型对多样化电子表格结构具有良好的泛化能力,包括行模式不一致和非独立数据块的表格。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。