---
title: 'TableEG: Synthetic Error Generation in Tables'
url: https://www.emergentmind.com/topics/tableeg
type: topic
---

# TableEG: Synthetic Error Generation in Tables

TableEG is an instruction-tuned framework for synthetic error generation in relational tables that uses large language models to inject synthetic yet authentic errors into tabular data. It was introduced to address a persistent bottleneck in data cleaning research: numerous error detection algorithms exist, but the availability of diverse, real-world error datasets remains limited, while manual annotation is both time-consuming and inconsistent. TableEG learns from 12 real-world, manually annotated datasets spanning ten domains and generates errors in four major categories—outliers, missing values, rule violations, and pattern violations—while preserving two-dimensional structure and inter-cell dependencies such as functional dependencies or semantic relationships. In this role, it is positioned as a practical benchmark for subsequent error detection and correction tasks [2507.10934].

## 1. Definition and problem setting

TableEG is designed to bridge the gap between purely rule-based corruptions, which lack diversity, and authentic real-world error distributions, which are expensive to annotate. The framework treats synthetic error generation not as arbitrary perturbation of isolated cells, but as a table-level modeling problem in which row-column structure and cross-cell dependencies must be preserved. This emphasis is central to its claim of generating authentic errors rather than merely noisy variants of clean data.

The framework is trained on 12 real-world datasets spanning ten diverse domains. Examples listed for these tables include Rayyan, Company, Marketing, Movie, and Credit, with domains including Academic, Business, Finance, Hospitality, and Transportation. The stated objective is not only to synthesize plausible corruptions, but also to ensure that the resulting error patterns and column-wise error distributions faithfully reflect authentic error distributions. Experimental claims are correspondingly framed in terms of pattern similarity, distribution similarity, and downstream detector behavior, rather than only qualitative plausibility [2507.10934].

## 2. Triplet formalization of generation, detection, and correction

TableEG casts each table task as a triplet $(I, T, O)$. Here, $I$ is an instruction in natural language, $T$ is the input table serialized in Markdown, and $O$ is a structured output in JSON. The instruction $I$ is composed of three parts: a task description $d_\kappa$, an error-type description $d_E$, and a contextual suffix $d_s$. Examples given for these components include a task description such as “Error Generation: introduce realistic errors,” an error-type description such as “missing values in non-mandatory fields,” and a suffix such as “output JSON with row/column indices.”

The input table $T$ is constructed by sampling the annotated rows $j^{(s)}$ together with additional random rows $j^{(a)}$, then merging and shuffling them in order to bound token length. The output $O$ specifies, for each modified cell, its row index $r$, column index $c$, error type $E$, erroneous value $\hat v$, and, when available, the original correct value $v$.

The three principal task formulations are written as
$$
EGT(T) = (I^{EGT},\,T_{\text{clean}},\,O_{\text{dirty}})
$$
$$
EDT(T) = (I^{EDT},\,T_{\text{dirty}},\,O_{\text{detection}})
$$
$$
ECT(T) = (I^{ECT},\,T_{\text{dirty}},\,O_{\text{correction}})
$$

This formulation places error generation, error detection, and error correction within a single representational scheme. A plausible implication is that the framework is intended not merely as a generator of corrupted tables, but as a unified substrate for benchmark construction across multiple data-cleaning tasks [2507.10934].

## 3. Table-level fine-tuning strategy

The base model in TableEG is LLaMA 3.1–8B. Fine-tuning is performed with LoRA adapters applied to the projection layers $\{q\_proj, k\_proj, v\_proj, o\_proj\}$. The training curriculum combines three error-related tasks—EGT, EDT, and ECT—with five “table-unrelated” tasks: row augmentation, column augmentation, swapping, filtering, header matching, and summarization. These auxiliary tasks are explicitly included to instill structural awareness.

The training corpus consists of 12 manually annotated real-world tables. The split is 90% train and 10% validation. The reported hyperparameters are: 3 epochs, LoRA rank 16, batch size per device 1 with gradient accumulation 16 for an effective batch size of 16, and AdamW with learning rate $1\times10^{-4}$ and weight decay $0.02$. The implementation uses 4 NVIDIA RTX A6000 GPUs with PyTorch 2.4.1 and CUDA 12.2.

The paper’s characterization of this setup as a table-level fine-tuning strategy is consequential. Rather than adapting an LLM only through textual instructions, the method explicitly couples instruction tuning with structured table serialization and task diversity. This suggests that TableEG treats structural competence over two-dimensional tables as a prerequisite for authentic error generation, rather than as a by-product of generic language modeling [2507.10934].

## 4. Generation pipeline and evaluation methodology

The end-to-end pipeline is organized into four stages. In Stage 1, the Prompt Builder extracts $(I, T, O)$ triplets from the annotation corpus $J$ using Algorithm 1, constructs instructions with Algorithm 2, and constructs input tables with Algorithm 3. In Stage 2, the Trainer fine-tunes the LLaMA base model with LoRA on these triplets. In Stage 3, the Error Generator, described as Algorithm 5, takes a clean table $D^\*$, a desired error ratio $\rho$, an error-type distribution $E_r$, and a model $f_\theta$.

The generator computes
$$
N = |\text{rows}| \times |\text{cols}|,\qquad N_e = \lfloor \rho N \rfloor
$$
allocates $N_e$ across error types via $E_r$, and then iteratively samples a subtable $T_i \leftarrow \text{SelectSubTable}(D^\*)$, builds an instruction $I \leftarrow \text{Generate-Instruction}(EGT, e)$ for a chosen error type $e$, and infers $\hat O \leftarrow f_\theta(I, T_i)$. The parsed output yields $(r,c,\hat v,v)$. If $(r,c)$ is unseen and $\hat v \neq v$, the error is applied to the generated dirty table $G$ and recorded in the set $U$. The algorithm returns $G$ once the required number of errors has been generated.

Stage 4 is the Evaluator. It measures pattern alignment through Algorithm 8, producing $S_{EPA}$, and distribution alignment through weighted Jaccard $J^w_{col}$ and Jensen–Shannon divergence $D_{JS}$, in addition to downstream detection performance. For pattern alignment, TableEG uses hidden embeddings $\phi_\theta(\cdot)$ from the $(L-3)$th Transformer layer. For each generated error, it retrieves $k$ nearest real-error pairs in embedding space and compares the transformation vectors
$$
\delta_{\text{real}} = \phi_\theta(D^r_c) - \phi_\theta(D^g_e), \qquad
\delta_{\text{gen}} = \phi_\theta(G^r_c) - \phi_\theta(G^g_e)
$$
with cosine similarity, taking the maximum over neighbors and averaging to obtain $S_{EPA}$.

For column-level error distribution, the weighted Jaccard score is defined as
$$
J^w_{col} = \frac{1}{|C|}\sum_{c\in C}\frac{\min[p(c),q(c)]}{\max[p(c),q(c)] + \epsilon}
$$
where $p(c)$ and $q(c)$ are the real and generated error proportions in column $c$. The Jensen–Shannon divergence is
$$
D_{JS}(X\|Y) = \tfrac12 D_{KL}(X\|Z) + \tfrac12 D_{KL}(Y\|Z), \qquad Z = \frac{X+Y}{2}
$$
These metrics formalize authenticity as geometric similarity of contextual transformations and alignment of column-wise error frequencies, rather than only exact cell-level matching [2507.10934].

## 5. Comparative results and benchmark behavior

The principal experimental comparison is against a rule-based baseline denoted BART and against GPT-3.5 Turbo without fine-tuning. For pattern alignment with $k=20$, TableEG achieves average $S_{EPA}=77.76\%$, compared with $49.36\%$ for BART and $50.45\%$ for GPT-3.5 Turbo. The gains are reported as consistent across both seen and unseen datasets, with Soccer and Restaurant named as examples.

For column-level distribution alignment, two explicit examples are provided. On the Flight dataset, TableEG attains $J^w_{col}=82.3$, while GPT-3.5 reaches $44.7$ and BART $34.7$; for divergence, TableEG obtains $D_{JS}=7.96$, compared with $20.43$ for GPT-3.5 and $41.96$ for BART. On the Beers dataset, TableEG attains $J^w_{col}=40.4$, compared with $16.0$ for BART and $4.96$ for GPT-3.5; the corresponding divergences are $28.8$ for TableEG, $55.9$ for BART, and $60.8$ for GPT-3.5.

Downstream error detection is evaluated with Raha, Holistic, and Horizon using weighted precision $P^w$, recall $R^w$, and $F1^w$. Across Flight, Movie, Company, and Marketing, Raha on generated versus real data is reported at approximately $P^w\sim0.92/0.90$, $R^w\sim0.85/0.94$, and $F1^w\sim0.88/0.81$. Holistic and Horizon show similar relative gaps. The reported conclusion is that detectors perform nearly identically on TableEG-generated errors and on real-world errors, especially for machine learning based methods such as Raha. In the paper’s broader framing, TableEG-generated errors therefore function as a robust surrogate for expensive manual annotations in data-cleaning evaluation [2507.10934].

## 6. Role, constraints, and open directions

TableEG is presented as both a synthesis framework and a benchmarking substrate. Its benchmark value derives from the combination of table-level fine-tuning, structured triplet supervision, explicit control over error ratios and type distributions, and evaluation against authentic datasets. The paper’s overall conclusion is that it bridges the gap between synthetic and real-world errors while establishing a robust benchmark for error detection and correction tasks.

The stated limitations are also specific. First, the framework relies on user-specified error ratios $E_r$ and error types; future work is described as aiming for adaptive ratio prediction. Second, token-length constraints still require sub-table sampling, and scaling to very wide tables remains open. Third, current instruction templates are hand-crafted, and the paper identifies automating template design or meta-learning new instructions as possible routes to improved generalization. Fourth, the current formulation targets cell-level errors; extending to row-level or table-level corruption such as record duplication or deletion is left for future study.

These limitations delimit the current scope of the system. They suggest that TableEG’s fidelity claims are strongest for controlled cell-level corruption under specified error budgets, with realism demonstrated by alignment to observed patterns, distributions, and detector behavior rather than by unconstrained generation of every possible data-quality failure mode [2507.10934].

Source: https://www.emergentmind.com/topics/tableeg