Table of Contents
Fetching ...

Auto-Formula: Recommend Formulas in Spreadsheets using Contrastive Learning for Table Representations

Sibei Chen, Yeye He, Weiwei Cui, Ju Fan, Song Ge, Haidong Zhang, Dongmei Zhang, Surajit Chaudhuri

TL;DR

Auto-Formula addresses the challenge of recommending complex spreadsheet formulas by leveraging similar sheets within an organization. The method builds two dense representations (coarse-grained for similar-sheets and fine-grained for similar-regions) trained with a contrastive/triplet objective inspired by face recognition, and uses weak supervision to generate training data. In deployment, online inference uses FAISS ANN indexes to retrieve reference sheets/regions and adapt a reference formula to the target context, achieving top-1 precision over $0.9$ across four enterprise corpora and outperforming baselines in both quality and efficiency. The work enables low-latency, high-accuracy formula recommendations in real-world spreadsheets and provides a dataset for future research.

Abstract

Spreadsheets are widely recognized as the most popular end-user programming tools, which blend the power of formula-based computation, with an intuitive table-based interface. Today, spreadsheets are used by billions of users to manipulate tables, most of whom are neither database experts nor professional programmers. Despite the success of spreadsheets, authoring complex formulas remains challenging, as non-technical users need to look up and understand non-trivial formula syntax. To address this pain point, we leverage the observation that there is often an abundance of similar-looking spreadsheets in the same organization, which not only have similar data, but also share similar computation logic encoded as formulas. We develop an Auto-Formula system that can accurately predict formulas that users want to author in a target spreadsheet cell, by learning and adapting formulas that already exist in similar spreadsheets, using contrastive-learning techniques inspired by "similar-face recognition" from compute vision. Extensive evaluations on over 2K test formulas extracted from real enterprise spreadsheets show the effectiveness of Auto-Formula over alternatives. Our benchmark data is available at https://github.com/microsoft/Auto-Formula to facilitate future research.

Auto-Formula: Recommend Formulas in Spreadsheets using Contrastive Learning for Table Representations

TL;DR

Auto-Formula addresses the challenge of recommending complex spreadsheet formulas by leveraging similar sheets within an organization. The method builds two dense representations (coarse-grained for similar-sheets and fine-grained for similar-regions) trained with a contrastive/triplet objective inspired by face recognition, and uses weak supervision to generate training data. In deployment, online inference uses FAISS ANN indexes to retrieve reference sheets/regions and adapt a reference formula to the target context, achieving top-1 precision over across four enterprise corpora and outperforming baselines in both quality and efficiency. The work enables low-latency, high-accuracy formula recommendations in real-world spreadsheets and provides a dataset for future research.

Abstract

Spreadsheets are widely recognized as the most popular end-user programming tools, which blend the power of formula-based computation, with an intuitive table-based interface. Today, spreadsheets are used by billions of users to manipulate tables, most of whom are neither database experts nor professional programmers. Despite the success of spreadsheets, authoring complex formulas remains challenging, as non-technical users need to look up and understand non-trivial formula syntax. To address this pain point, we leverage the observation that there is often an abundance of similar-looking spreadsheets in the same organization, which not only have similar data, but also share similar computation logic encoded as formulas. We develop an Auto-Formula system that can accurately predict formulas that users want to author in a target spreadsheet cell, by learning and adapting formulas that already exist in similar spreadsheets, using contrastive-learning techniques inspired by "similar-face recognition" from compute vision. Extensive evaluations on over 2K test formulas extracted from real enterprise spreadsheets show the effectiveness of Auto-Formula over alternatives. Our benchmark data is available at https://github.com/microsoft/Auto-Formula to facilitate future research.
Paper Structure (24 sections, 3 equations, 12 figures, 5 tables, 2 algorithms)

This paper contains 24 sections, 3 equations, 12 figures, 5 tables, 2 algorithms.

Figures (12)

  • Figure 1: A pair of example spreadsheets that are "similar-sheets", with similar style and color that are easy for humans to spot (though the two have different data content, and different number of rows/columns). (Left) Target-sheet: a user is trying to author a new formula on this target-spreadsheet, in the target-cell (D41, left), where the ground-truth formula should be "=COUNTIF(C7:C37,C41)"; (Right) Auto-Formula learns-to-retrieve an existing sheet on the right as a “similar-sheet”, and adapts an existing formula from cell D354 (because D354's surrounding region is similar to that of D41 on the left), to the target-cell (D41, left), by using the same formulate-template but changing the parameters based on the local context of the target cell (D41, left).
  • Figure 2: Overall system architecture of Auto-Formula.
  • Figure 3: Weak-supervision using sheet-names. (a) Two files with two sequences of sheets, where all sheet-names are identical, which likely indicate that the sheets between the two files are similar-sheets. (b) Two files with only one sheet called "Sheet1" (a common name), for which weak-supervision is not confident that the two are similar-sheets. (c) Example similar-sheets that do not share the same sheet-name, which will be missed by our weak-supervision that performs hypothesis-tests on sheet-names.
  • Figure 4: Our model architecture for spreadsheet representations. The model branches into two towards the end, which are (1) a coarse-grained model $M_c$, for similar-sheet detection; and (2) a fine-grained model $M_f$, for similar-region detection.
  • Figure 5: Example of view windows. The blue box at the bottom represents a region centered at A120. The green-box uses the view-window at top-left to represent the entire sheet.
  • ...and 7 more figures