Papers
Topics
Authors
Recent
Search
2000 character limit reached

TaFo: Neuro-Symbolic Table Formatting

Updated 8 July 2026
  • TaFo is a neuro-symbolic approach that automatically infers conditional formatting rules from tabular data without relying on user examples.
  • It combines symbolic synthesis with LLM-based semantic priors to jointly generate rule triggers and associated visual styles.
  • The method leverages execution-guided diversity ranking and corpus-grounded format learning to achieve superior prediction accuracy.

TaFo, introduced in "Tabularis Formatus: Predictive Formatting for Tables" (Singh et al., 14 Aug 2025), is a neuro-symbolic method for predictive suggestion of conditional formatting (CF) rules for tables and spreadsheets. Its defining objective is to remove the dependency on user specification used by existing techniques in the form of formatted examples or natural language instruction: given only a table and a target column, TaFo automatically learns both the rule trigger and the associated visual formatting. The system combines component-based symbolic synthesis, semantic knowledge from LLMs, execution-guided diversity-preserving ranking, and corpus-grounded format learning over 1.8 Million public workbooks with CF and manual formatting (Singh et al., 14 Aug 2025).

1. Task definition and formal rule space

TaFo targets value-based formatting rather than structural formatting. Structural formatting systems focus on layout and presentation, such as headers and groups, whereas value-based formatting is data-dependent and driven by predicates over values, including comparisons to constants, statistics, and aggregates. TaFo is designed for the latter setting, with the explicit goal of surfacing analytical insights such as outliers, recent dates, and status markers like "PASS" (Singh et al., 14 Aug 2025).

The formal object manipulated by the system is a table

E=[eij]i=1→nj=1→m,\mathbf{E} = [e_i^j]_{i = 1 \rightarrow n}^{j = 1 \rightarrow m},

with columns EiE_i, rows EjE^j, and headers HiH_i. A cell is represented as

e=(v,t,f),v∈V, t∈T, f:F→FF,e = (v, t, \mathbf{f}), \quad v \in \mathcal{V}, \ t \in \mathcal{T}, \ \mathbf{f}: F \rightarrow \mathcal{F}_F,

where v(e)v(e), t(e)t(e), and f(e)\mathbf{f}(e) denote value, type, and format. The types considered are text, numeric, and date; the formatting identifiers are fill color, font color, bold, italics, and underline; and f⊥=∅\mathbf{f}_\perp = \varnothing denotes no formatting (Singh et al., 14 Aug 2025).

A condition predicate is defined as

C:(V×T)n→B,C: (\mathcal{V} \times \mathcal{T})^n \rightarrow \mathbb{B},

with EiE_i0 denoting the value/type of the cell of the current row in column EiE_i1. A conditional formatting rule is then

EiE_i2

applied to a target column EiE_i3. The predictive formatting task is to generate a list of desirable EiE_i4 for a given EiE_i5 (Singh et al., 14 Aug 2025).

This formulation is technically significant because it requires joint inference over two coupled spaces: the predicate space and the style space. The paper emphasizes that prior systems either depend on user-authored examples or natural-language instructions, or focus on structural rather than value-based formatting. TaFo instead treats CF as a fully predictive problem, synthesizing both trigger and style directly from table context and corpus priors (Singh et al., 14 Aug 2025).

2. Neuro-symbolic architecture and condition generation

TaFo consists of three condition generators: a purely symbolic synthesis engine, a purely neural LLM generator, and a neuro-symbolic combination that allows bidirectional interaction between the two (Singh et al., 14 Aug 2025).

The symbolic path begins with a curated set of property templates tailored to CF. These include numeric statistics such as AverageValue, Percentiles, and Skew; datetime predicates such as InLastWeek, InLastMonth, Today, and Year; text profiles such as MostCommonValues(k), DuplicatesValues(k), Categories, FreeText, and AverageLength; and general counts such as NumErrors, NumLogicals, NumDate, NumBlanks, NumNA, NumDuplicates, NumUniques, NumFormatted, and Formulas(k) (Singh et al., 14 Aug 2025). These extracted properties provide the building blocks for subsequent synthesis.

Predicate enumeration is performed with bottom-up component-based synthesis. The smallest search elements include composed components such as [NOT](https://www.emergentmind.com/topics/neural-organ-transplantation-not)(Blanks()). For multi-valued properties, each output becomes an individual constant candidate. Complex conditions are expressed in DNF over predicates. Because naive enumeration yields more than 100K candidates per table, TaFo trains a ranker and uses it in a beam search to keep only promising partial and complete rules (Singh et al., 14 Aug 2025).

The ranker is a three-layer dense network trained with a logistic regression objective over features from table properties and rule execution, including percentage highlighted, rule type/category, and argument length. Its predicted logit is used as the node score during search. This design is not merely a ranking convenience: it is the main mechanism that makes large-scale DNF synthesis operational in the absence of explicit user intent (Singh et al., 14 Aug 2025).

The neural path uses an LLM prompt with multi-step reasoning. The prompt includes headers, types, sample values, and extracted properties, and asks the model to identify relevant columns, propose predicates/functions, list constants, and synthesize rule suggestions. The few-shot prompt contains three static examples annotated with reasoning steps (Singh et al., 14 Aug 2025).

The neuro-symbolic combination is the characteristic mechanism. Symbolic insights prime the LLM, while LLM outputs are imported back into symbolic synthesis. Columns and constants obtained from the LLM are added to the enumerator, and predicates using these receive a +10% reward to their node scores. The paper gives the example that a semantically meaningful arithmetic component such as [@Budget] - [@Cost] can thereby become a viable synthesis primitive (Singh et al., 14 Aug 2025). This suggests that TaFo uses the LLM less as a direct generator of final answers than as a semantic prior over a symbolic search space.

3. Execution-guided diversity ranking and automatic format learning

TaFo does not simply score candidate conditions independently. It also clusters them by execution behavior on the target column and interleaves selections across clusters to preserve diversity (Singh et al., 14 Aug 2025). For each candidate condition EiE_i6, execution over the column produces a boolean vector EiE_i7. Semantic equivalence classes are then defined by identical execution: EiE_i8 The score of a cluster is

EiE_i9

where EjE^j0 is the node score of a rule in the cluster. Round-robin sampling then orders clusters by EjE^j1 and, within each cluster, orders rules by EjE^j2 (Singh et al., 14 Aug 2025).

This mechanism is central to TaFo’s notion of useful suggestions. A list of syntactically different rules that all highlight the same cells would be redundant; TaFo instead aims to cover different execution behaviors. The paper explicitly links this to diversity both in rule space and output space (Singh et al., 14 Aug 2025).

Format learning is handled separately from condition synthesis. Candidate formats are drawn from

EjE^j3

where EjE^j4 are formats already present in the sheet and EjE^j5 are formats mined from similar tables and rules in the corpus (Singh et al., 14 Aug 2025). Table similarity is computed from headers and contained formulas, and rule similarity from predicates and constants, using weighted Hamming distance with weights learned via regression on 100 manually annotated table similarities. Mining retrieves up to EjE^j6 matches or stops when similarity falls below EjE^j7 (Singh et al., 14 Aug 2025).

Selection of individual format identifiers uses identifier frequency scoring, with EjE^j8 weighted double to bias toward in-sheet styles. Identifiers whose average score exceeds 0.5 are kept. Identifier values are selected by frequency ranking; colors are compared using the closest CSS color from the extended web color set based on Euclidean distance in RGB space. A final style-grounding rule aligns the suggestion with local sheet aesthetics: if ≥75% of existing formatted cells use a specific shade, TaFo adopts that shade for the suggested color (Singh et al., 14 Aug 2025).

A plausible implication is that TaFo treats style as a corpus-conditioned and sheet-conditioned retrieval problem rather than a purely generative one. This differs from generic LLM-based formatting proposals, which the paper notes tend to select saturated colors such as red and green without regard to local style conventions (Singh et al., 14 Aug 2025).

4. Data, training protocol, and evaluation methodology

TaFo is trained and evaluated on a corpus of 1.8 million public Excel workbooks, the same source used by Cornet and FormaT5 (Singh et al., 14 Aug 2025). From these workbooks, de-duplicated CF tasks yield 105K rule tasks, with 80K training tasks for ranker and synthesis and 25K evaluation tasks for CF. For manual-formatting tasks, where no CF rules are present, the corpus contains 683K tables discovered, of which 100K are randomly sampled for evaluation (Singh et al., 14 Aug 2025).

CF rules and aligned target columns are extracted from spreadsheets and parsed into abstract syntax trees over TaFo’s predicate grammar. Associated formats are also collected. Column data types are annotated as text, numeric, or date, consistent with spreadsheet usage distribution. On CF benchmarks, the ground truth is the user-authored rule and format; on manual-formatting benchmarks, formatted cells are treated as positives and predicted rules are evaluated against the observed formatted cells (Singh et al., 14 Aug 2025).

The baselines span symbolic, neural, and prompt-based systems. Symbolic baselines include Greedy Enumeration, which uses component-based enumeration plus the Cornet ranker with beam width 10, depth 5, and an adapted Cornet configuration using unsupervised clustering with two classes, formatted versus non-formatted. Neural table encoders include TAPAS and TUTA. Natural-language CF generation is represented by FormaT5 with its NL channel removed but its placeholder-filling mechanism retained. Code LLM baselines include CodeT5+, StarCoder, CodeLlama, and GPT-4; among CoT, ToT, and PoT prompting strategies, program-of-thought prompting worked best, using table information and five few-shot examples retrieved by CodeBERT similarity (Singh et al., 14 Aug 2025).

Evaluation distinguishes condition quality, format quality, and diversity. Condition quality uses exact match, sketch match, and execution match, where execution equivalence is

EjE^j9

Condition diversity uses average pairwise token-level edit distance, average pairwise cosine similarity of CodeBERT embeddings, and average pairwise Hamming distance over execution vectors. Format quality uses exact color match via closest CSS color mapping and property match at the identifier level regardless of value (Singh et al., 14 Aug 2025).

5. Empirical results and ablations

TaFo reports its strongest results on condition learning. For execution match, Top-1/3/5 scores are 36.7% / 46.8% / 64.3%. For exact match, the corresponding values are 18.6% / 24.5% / 30.1%. For sketch match, they are 54.2% / 73.3% / 84.8% (Singh et al., 14 Aug 2025). The paper states that TaFo bests GPT-4 and FormaT5 across all metrics, and that versus GPT-4 the execution match gains are +5.5% at Top-1, +7.7% at Top-3, and +6.0% at Top-5 (Singh et al., 14 Aug 2025).

For manual-formatting tasks without CF rules, TaFo could have automated ≈55% of column formatting with Top-3 suggestions measured by execution match (Singh et al., 14 Aug 2025). For format learning, exact color match at Top-1/3/5 is 13.2% / 18.9% / 21.3%, while property match is 26.5% / 47.2% / 55.4%. The paper reports improvements over GPT-4, CodeT5+, and FormaT5 of +4.8–9.1% for exact match and +9.4–23.7% for property match (Singh et al., 14 Aug 2025). End-to-end, TaFo reaches ≈50% execution match with Top-3 suggestions (Singh et al., 14 Aug 2025).

The diversity metrics reinforce the design rationale of execution-based clustering. For Top-5 suggestions, TaFo achieves 14.3 average pairwise edit distance, 0.87 average pairwise embedding similarity, where lower is better, and 0.65 average pairwise execution Hamming distance (Singh et al., 14 Aug 2025). The paper attributes lower diversity in LLM baselines to mode collapse.

The abstract summarizes the aggregate gain by stating that TaFo outperforms competing systems by 15.6\%--26.5\% on matching user added ground truth rules in tables (Singh et al., 14 Aug 2025).

The ablation studies isolate the major contributing components. Removing execution-guided ranking reduces Top-1/3/5 execution match to 19.8% / 34.5% / 56.4%. Removing symbolic property extraction yields 17.2% / 20.7% / 53.4%, described as the largest drop. Removing LLM multi-step reasoning yields 23.5% / 38.2% / 58.8%. Replacing neuro-symbolic interaction with simple pooling yields 25.8% / 40.0% / 59.6% (Singh et al., 14 Aug 2025). For format learning, removing corpus retrieval gives 17.5% / 28.1% / 34.8%, removing sheet properties alignment gives 23.1% / 40.0% / 48.2%, and removing style grounding gives 21.4% / 36.6% / 44.4%; the full format learner achieves 26.5% / 47.2% / 55.4% (Singh et al., 14 Aug 2025).

A concise summary of the headline numbers is as follows.

Evaluation target Metric TaFo
Condition learning Execution match Top-1/3/5 36.7% / 46.8% / 64.3%
Condition learning Exact match Top-1/3/5 18.6% / 24.5% / 30.1%
Condition learning Sketch match Top-1/3/5 54.2% / 73.3% / 84.8%
Format learning Exact color match Top-1/3/5 13.2% / 18.9% / 21.3%
Format learning Property match Top-1/3/5 26.5% / 47.2% / 55.4%
Manual-formatting automation Top-3 execution match ≈55%
End-to-end Top-3 execution match ≈50%

These results indicate that TaFo’s main empirical advantage lies not only in learning more accurate predicates, but in producing suggestion sets that are simultaneously diverse and stylistically grounded.

6. Failure modes, practical characteristics, and broader significance

TaFo’s qualitative analysis identifies several recurring failure modes. Neural-only candidates may exhibit low diversity or propose trivial predicates that highlight entire columns, such as "[Budget] > [Cost]" when true everywhere. Symbolic-only candidates lack semantic associations and therefore may fail to relate columns such as Budget and Cost in a meaningful arithmetic expression. Style misalignment remains possible because generic LLMs tend to choose saturated colors, although TaFo’s corpus mining and grounding reduce this effect. Large numeric and date spaces also remain difficult because thresholds and granular time windows produce expansive search spaces (Singh et al., 14 Aug 2025).

From a systems perspective, TaFo is relatively lightweight. Its average latency is 1218.5 ms, including GPT-4 API network latency, while the symbolic-only variant runs at 189.3 ms. Its memory footprint is Disk 4.5; CPU 8.3; GPU not applicable, since the LLM is accessed via API (Singh et al., 14 Aug 2025). The symbolic-only mode is therefore suitable for low-resource or offline environments.

Robustness results show that the method works across text, numeric, and date columns, with strongest performance on text and improved numeric/date performance as more suggestions are allowed. Under partial data availability, using only 5–10% of rows, TaFo maintains \>40% Top-3 execution match, outperforming GPT-4 in low-data settings (Singh et al., 14 Aug 2025). This suggests that execution-guided synthesis and corpus-grounded styles remain effective even under viewport-like constraints.

The paper also emphasizes usability and interface implications. Because suggestions are interleaved across distinct execution clusters, the presented list is non-redundant. Because styles are grounded to existing sheet aesthetics, the proposals are less likely to clash with the spreadsheet’s visual conventions. The reported outcome is that three suggestions suffice to automate ≈50–55% of tasks across CF and manual-formatting scenarios (Singh et al., 14 Aug 2025).

Future work in the paper extends the same neurosymbolic synthesis-plus-grounding paradigm to data cleaning, transformation, visualization, and querying. It also proposes richer domain-specific semantics, improved diversity objectives, smaller on-premise LLMs, and accessibility-aware personalization. The ethical discussion notes that corpus-driven priors may propagate conventions such as red/green semantics and may not address broader cultural or accessibility issues, including color-blindness, without explicit intervention (Singh et al., 14 Aug 2025).

In that sense, TaFo occupies a specific technical position within spreadsheet intelligence: it reframes conditional formatting as a predictive synthesis problem over executable predicates and grounded styles, rather than as a user-specification problem. Its significance lies in combining symbolic completeness, LLM-derived semantic bias, execution-based diversity control, and sheet-aware style grounding into a single CF generation pipeline (Singh et al., 14 Aug 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to TaFo.