Abstract
Effective data analytics on data collected from the real world usually begins with a notoriously expensive pre-processing step of data transformation and wrangling. Programming By Example (PBE) systems have been proposed to automatically infer transformations using simple examples that users provide as hints. However, an important usability issue—verification—limits the effective use of such PBE data transformation systems, since the verification process is often effort-consuming and unreliable. We propose a data transformation paradigm design CLX (pronounced "clicks") with a focus on facilitating verification for end users in a PBE-like data transformation. CLX performs pattern clustering in both input and output data, which allows the user to verify at the pattern level, rather than the data instance level, without having to write any regular expressions, thereby significantly reducing user verification effort. Thereafter, CLX automatically generates transformation programs as regular-expression replace operations that are easy for average users to verify. We experimentally compared the CLX prototype with both FlashFill, a state-of-the-art PBE data transformation tool, and Trifacta, an influential system supporting interactive data transformation. The results show improvements over the state of the art tools in saving user verification effort, without loss of efficiency or expressive power.
Introduction
Data wrangling—the process of cleaning and reformatting messy data—is notoriously the most time-consuming part of data science. While PBE systems like Excel’s FlashFill have made this easier by allowing users to provide examples instead of writing code, they suffer from a major "verification bottleneck." In traditional PBE, a user provides an example, the system guesses the logic, and the user must then scroll through potentially thousands of rows to ensure the system didn't make a mistake. This is often described as "finding a needle in a haystack." Furthermore, because the underlying logic is often hidden or written in complex domain-specific languages, users have no way of knowing if the transformation will fail on new, unseen data.
The CLX Framework
The authors propose the Cluster-Label-Transform (CLX) framework, which shifts the PBE workflow from verifying individual rows to verifying high-level data patterns.
The framework consists of three main stages:
- Pattern Clustering: Instead of treating every row as a unique string, CLX tokenizes data into structural patterns (e.g., "Bob123" becomes
[Upper, Lower2, Digit3]). It uses an agglomerative refinement algorithm to build a hierarchy of patterns, grouping similar data formats together. - Labeling: The user interacts with these high-level patterns rather than individual rows. They can quickly identify which patterns are "messy" and specify a single "target pattern" that all data should conform to.
- Program Synthesis: CLX uses a new internal language called UniFi. It employs a Minimum Description Length (MDL) approach—essentially a mathematical version of Occam’s Razor—to find the simplest, most logical transformation that maps a source pattern to the target.
Crucially, CLX translates these UniFi programs into standard regular expression (regex) replace operations. Since regex is a "lingua franca" for many data workers, the logic becomes explainable and verifiable. If a user can read the logic, they can predict where it might fail without needing to see the failure happen.
Evaluation and Results
The researchers evaluated CLX using a benchmark of 47 data transformation tasks, real-world messy datasets, and user studies to measure verification effort. The core insight is that humans are much better at verifying 5-10 structural patterns than 10,000 individual rows.
Key results include:
- Verification Speedup: In a user study where the data size grew by 30x, the time users spent verifying results in CLX only grew by 1.3x. In contrast, verification time for FlashFill grew by 11.4x.
- Better Understanding: CLX users were twice as successful as FlashFill users at correctly predicting how the system would handle new, tricky inputs.
- Competitive Power: Despite focusing on simplicity, CLX solved 90% of the benchmark tasks, compared to FlashFill’s 96%.
- Efficiency: For 79% of the test cases, CLX inferred a perfect transformation in just two steps (selecting the target and one repair).
Conclusion and Future Work
CLX demonstrates that explainability is a critical feature for data transformation tools. By treating the synthesized "code" as a user interface, CLX makes data wrangling more scalable and trustworthy. While CLX currently focuses on syntactic structure and lacks support for semantic transformations (e.g., converting "March" to "03") or loops, future work aims to extend the paradigm to other wrangling operations like "Split" and "Fold" and incorporate semantic knowledge into the pattern discovery process.
Summary updated