Elamur Research

Solving Data-centric Tasks using Large Language Models

Paper · 2024 · Shraddha Barke, Christian Poelitz, Carina Negreanu et al.

Summary

A short request can describe a spreadsheet operation clearly while leaving out details that determine whether the resulting program will work. Suppose a user wants to build usernames from people’s first initials and last names. If the examples all contain a given name followed immediately by a surname, a program might take the second word as the surname. That program will appear to work until it encounters a middle name. Barke and colleagues study what happens when a request for code includes examples from the actual table, and how to choose those examples when the table is too large to send in full.

The authors build SOFSET, a benchmark of 201 tasks drawn from highly rated StackOverflow posts about spreadsheet formulas. They rewrite the requests, extend the small input tables with additional cases, and prepare expected results and Pandas solutions. They classify tasks by where the information needed to solve them resides. Some requests specify the operation fully in words, some require details from the table, and some also require outside knowledge. The experiments assess generated code by running it on the entire evaluation table and comparing the result with the expected output. A program prompted with a single row still has to work on the remaining rows.

The authors test GPT-4 with requests that carry no table rows, the first row, or ten rows. The reported gap in pass@5 between no data and the first row is larger for the tasks that depend on table details or outside knowledge than for tasks whose instructions are sufficient by themselves. Pass@5 measures the chance that at least one of a sample of five candidate programs produces the expected result. The authors also expand the data-dependent tasks to tables of 1000 rows and compare two ways to choose examples. Their cluster-then-select method groups values by written format and picks intact rows that represent those groups. Random sampling can work well, but representative selection has an advantage in the comparison focused on tables with greater format variation.

The preferred row count changes with the set of tasks being tested. Ten representative rows give the highest reported pass@5 in the higher-variation subset, reaching 0.32. Across all 44 expanded data-dependent tasks, five representative rows give the highest reported pass@1 and pass@5 among the settings in that comparison. A separate test sends the entire table in different orders and obtains different success rates even with greedy generation. Together, the experiments show that a table contributes evidence about how a program should behave, and that the amount, choice, and order of that evidence can affect what code is produced.

Deep dive: Solving Data-centric Tasks using Large Language Models

How Barke and colleagues select representative table rows to help GPT-4 generate Pandas code, and what their benchmark reveals about row choice. · about 34 minutes to read

The problem and its context

A request describes an operation, and a table supplies its particulars

The paper studies a familiar kind of code generation. A person has a table, wants to derive a column from it, and describes the intended result in ordinary language. A large language model writes code that the person could use to perform the transformation. Spreadsheet formulas, computational notebooks, and tabular data cleaning motivate the work. The experimental target is Pandas, with the generated program expected to compute new values for the rows of an input dataframe.

Consider a request for the elapsed time between dates in two columns. It expresses a recognizable calculation, but the program still needs a way to refer to the inputs and interpret their contents. The words of the request might omit the column names. A sample value might show how dates are written, with consequences for the parsing step that comes before subtraction. If the transformation involves several operations, an early assumption can carry through to the end. A plausible expression for taking a difference offers little help if it starts from the wrong columns or interprets the dates incorrectly.

The username example brings out a different gap between the instruction and the data. The words “last name” already suggest extracting the final component, but the examples available to the code generator can influence how it implements that idea. Both the second word and the final word yield the right result on a two-part name. Names with additional components distinguish the two programs. The value of such a row comes from the behavior it can reveal. An extra example of the common format repeats an observation the generator already has, while an example of a longer format supplies evidence about which rule will generalize.

Some requests specify both the field and the rule. The paper gives the example of extracting the opening characters of a filename. Here a reader can write the core operation using the query alone. The authors still have a reason to test whether example data helps. Having enough information to deduce an operation and generating an executable implementation of it are separate matters. A row can make the expected relation between the named field, the dataframe, and the new column more concrete even when it supplies no missing rule.

Other tasks require information that lives outside both the prompt’s verbal instruction and the table. For a request that counts United States holidays between two dates, the rows can establish the endpoints and show their representation. The task also calls for knowledge about holidays. This gives the authors a reason to distinguish tables that complete a specification from tables that make a specification more concrete while leaving some knowledge to be supplied elsewhere. The distinction concerns the information the task requires and gives the paper a way to organize the eventual comparison.

Earlier uses of table context

The paper places the work alongside research on code generation and tabular data. It discusses Codex, InCoder, and PaLM as examples in the landscape of systems used for code-related generation. It also notes work adapting code generation to SQL. Those studies give context for asking a system to translate a verbal objective into an executable operation. The present paper concentrates on transformations that may parse, combine, or compute values before attaching a new column to the original data. Codex evaluation · InCoder · PaLM · Text-to-SQL evaluation

The authors describe earlier efforts in which systems work directly with tables to detect errors, match entities, or predict a class. Earlier work on notebook code generation offers another connection, since a notebook is a setting where a user may already have data loaded and want a transformation expressed as code. Barke and colleagues make the examples accompanying the instruction an explicit experimental variable. They ask what happens when the same kind of request reaches the generator with a different view of its input.

Several related methods already put data in a prompt. The paper describes Jigsaw as supplying input and expected output tables. An output example can reveal what the user wants the transformation to produce, but someone asking for help on a new table may only have the inputs and an instruction. SOFSET keeps expected outputs for checking the generated program. This separation allows the experiments to ask how much the raw inputs contribute when the expected answers are withheld from the generation prompt.

Other earlier approaches select or transform a table for question answering. In the paper’s account, one approach removes rows that are irrelevant to a particular question. Another reduces a large table and breaks its question into simpler pieces. Each responds to the fact that presenting the entire input can be impractical. The distinction here comes from the role of the resulting program. A question about a table can depend on a limited region of it. A derived-column program must handle the rows it will process, including rows whose format differs from the most familiar example.

Earlier work on tabular classification also represents structured data as text. That representation matters because a code generation prompt must convey both prose and table values through a textual interface. The paper’s contribution centers on what should be represented within that interface. A text representation can preserve useful structure in the values while still omitting examples that reveal a distinct format. Making the table legible to the generator and choosing which parts of the table to show are different decisions.

Why the benchmark needed both tasks and data

The authors distinguish SOFSET from general Python programming benchmarks such as APPS and HumanEval. A collection of programming problems can test whether generated code meets a specification. For this study, the benchmark must also make it possible to vary what evidence about the input accompanies the specification. SOFSET pairs each request with a concrete table and a checkable result, so the authors can change the preview while executing candidate programs against a common input. APPS · HumanEval

The paper also positions its benchmark against existing collections for data-centric programming and against Spider, which focuses on relational querying. Here the authors want tasks in which individual values can need interpretation before a new column can be produced. The source posts provide a practical starting point because they describe operations that users actually asked how to perform. The experimental task takes that operation out of the forum exchange and gives it a consistent representation, with a compact request, a dataframe, and an expected result.

Table size creates two distinct questions. Small examples, like those users post when seeking spreadsheet help, make it possible to ask whether seeing any rows improves code generation. Larger tables motivate a separate question about how to spend a limited row budget. Sending everything can be expensive or impractical, and the authors also consider the possibility that a long input makes it harder to use the relevant evidence. Those motivations lead to an experiment about the presence of data and another about the choice of data.

The method, step by step

Turning spreadsheet questions into executable tasks

The authors start from highly rated StackOverflow posts tagged “ExcelFormulas,” taking the ranking as of March 2022. The sampling rule is deterministic. They manually screen the posts to confirm that each describes a genuine task and remove identifying information about the posts. This procedure yields 201 tasks. The rating criterion directs the collection toward questions that drew strong interest on the forum, while manual review establishes that the selected posts can serve as programming requests.

For each task, the authors write a concise query that preserves the requested operation. A forum post can communicate through a mixture of prose, examples, and replies. The benchmark query is the verbal part that can be sent alongside varying amounts of data. At least three internal annotators annotate and verify each query. This matters because a comparison of row settings depends on the query remaining stable and expressing the same intended transformation throughout.

When an original post contains a table, the authors use it as the basis for the benchmark input. They add rows and corner cases manually until the input reaches at least 10 rows. The additional cases can expose programs that agree with the visible examples but diverge elsewhere. For instance, a program that extracts the wrong component of a name can appear correct on a table restricted to the simplest name format. A suitably varied execution table can distinguish the implementation that follows the intended rule from one that works only on the most obvious examples.

Each record has an input table, an expected result in the form of added columns, a Pandas solution, and metadata, as well as the rewritten query. The data is organized as a flat, column-oriented table. Pandas gives the experiment a consistent target in Python, which the authors choose because of the generation systems’ ability to write it. They regard the general procedure as independent of the output programming language. The distinction is between the experimental implementation, which runs Pandas code, and the idea of selecting which input examples to include, which operates before code is generated.

The dataset construction also changes several features of the material relative to the source posts. The instructions are rewritten, the tables can include newly authored rows, and the requested code is in Pandas rather than the spreadsheet formula language of the forum tag. These changes give the benchmark its own combination of request, data, and executable target. The authors use them to argue that the evaluation records are unlikely to occur in training in the form used for the experiments.

Classifying tasks by the information they require

The paper’s taxonomy gives each task one of three labels. A data-independent task, labeled IND, supplies enough detail in the query to write a solution. The filename example specifies both the input field and the extraction rule. An actual filename can illustrate the transformation, but the request already identifies what to take from it.

A data-dependent task, labeled DEP, needs facts from the input table. The example about the interval between dates belongs here when the query leaves the column names and date representation implicit. Access to a table can supply those facts. The class concerns required information, so it can include a straightforward operation whose implementation hinges on a few details in the inputs. Conversely, a more involved operation can be data-independent if the query specifies those details fully.

An external-dependent task, labeled EXT, needs outside knowledge in addition to access to its inputs. The holiday example calls for a holiday calendar as well as dates to count between. A sample can show what form the dates take and which values the code will process. Supplying that sample still leaves the calendar requirement. The taxonomy therefore gives the experiment a way to distinguish the contribution of visible table evidence from the other demands a request places on the generator.

Learning which formats occur in the table

The input to cluster-then-select is the full table, together with a budget for the number of rows to show. The algorithm looks at that table before the code generator receives the prompt. Its purpose is to identify written patterns in the input values and then choose a small set of rows that makes those patterns visible. In the running example, the relevant patterns include names with different numbers of middle components and names with a hyphenated surname.

To find patterns, the method uses an existing regular-expression synthesis tool from Padhi and colleagues. A regular expression describes a family of strings by specifying what kinds of characters can occur and how they may be arranged. One of the patterns illustrated by the paper describes two capitalized alphabetic components separated by whitespace. Related patterns recognize names with additional components or a hyphen. The synthesis tool works within a restricted family of expressions and produces a set that covers its input strings.

The expressions give the method its groups, or clusters. Values associated with the same pattern supply evidence of a shared written format. A column of names can consequently have several clusters even though every cell has the same broad meaning. The distinction is useful because code may handle all the values as strings and still require different care when it splits or extracts parts of those strings. The method profiles their structure before deciding which actual values a prompt will contain.

With a single column, the relationship between a cluster and a row is easy to see. Choosing a row from one cluster shows the generator a value of that cluster’s format. The procedure favors the most populous clusters under the row budget, taking a representative from each of the highest-ranked groups when the budget allows. A dominant format can therefore be shown early in selection, while additional slots can add patterns that the first example leaves out.

With several columns, the sample has to account for different clusterings at once. A row might pair an ordinary name with an unusual date format, while another combines an unusual name with an ordinary date format. Selecting the most common name formats on their own does not determine which combination of complete rows will cover the date formats too. The paper treats a row as an indivisible choice whose cells can jointly represent several column-specific groups.

From an input table and query to candidate programs

The steps in order.

From an input table and query to candidate programsStep 1: Synthesize regular expressions for column values1. Synthesize regular expressions for column valuesStep 2: Group values by their written formats2. Group values by their written formatsStep 3: Select rows that increase weighted cluster coverage3. Select rows that increase weighted cluster coverageStep 4: Combine selected rows with the user query4. Combine selected rows with the user queryStep 5: Generate candidate Pandas code5. Generate candidate Pandas codeStep 6: Execute candidates on the entire input table6. Execute candidates on the entire input tableStep 7: Return distinct programs with valid outputs7. Return distinct programs with valid outputs

Within a row budget, cover the most input values

The authors formulate multi-column selection as weighted maximum coverage. Each row covers the clusters to which its cells belong. A cluster’s weight is its size, so covering a cluster represents the input values associated with that group. Once the selected rows have represented a cluster, finding another example of that cluster does not add new coverage under this objective. The value of selecting a row can therefore change after another row enters the sample.

The exact optimization can require considering many combinations of rows. The paper uses a greedy approximation. It starts with an empty selection and considers the rows that are still available. At each step it chooses a row that adds the greatest weighted coverage, then repeats with the selected row included. “Greedy” describes this local choice. The procedure chooses what looks best at the current step and uses the resulting selection as the starting point for the next one.

The paper’s coverage rule can be written in terms of the clusters that a candidate would add to the current selection.

r* ∈ argmaxᵣ ∑꜀ |c|, for r ∈ T ∖ R and c ∈ M[r] ∖ ⋃ᵤ∈R M[u]

Here T is the input table viewed as a collection of rows, and R is the set of rows already selected. r denotes a candidate row, r* a maximizing choice, and u a row already in R. M maps each row to the set of clusters its cell values cover. Thus M[r] denotes the clusters represented by the candidate, and the union over M[u] contains the clusters already represented. The symbol ∈ means membership, and ∖ removes the elements of the set on its right from the set on its left. The sum adds the sizes |c| of the remaining clusters c. The notation argmax identifies the candidate rows with the largest sum. The procedure adds a chosen maximizing row and continues until it reaches the budget n, the number of rows to select.

The weighting gives populous clusters more influence than sparsely populated ones. It is an objective about covering the data in its observed formats. It has no scoring term for the semantics of the request. If a particular cell format is important to the user’s operation, its influence in selection comes from the clusters it induces and the other coverage available in the same row. This point matters when interpreting the experiments. The method profiles what is in the table before the query and the selected rows are assembled into a prompt.

Prompting with real rows

The prompt combines the natural-language request with the selected rows expressed as a Pandas dataframe. This shows the generator the table’s column names, the association between cells in a row, and literal examples of the values it will manipulate. In the paper’s timestamp example, the dataframe defines start and end fields and displays their timestamp strings. The accompanying instruction asks for their difference as hours, minutes, and seconds in a specified format. The code generator thus receives examples of what it has to parse alongside a description of what it has to produce.

The distinction between raw input examples and demonstrations of solutions is important here. The preview shows the inputs for the current task. The expected transformed columns stay available to the evaluator. When the authors change the number or selection of rows, they vary the evidence about the program’s input while keeping the target operation fixed.

GPT-4 supplies the main generations. The paper also evaluates Code Llama as an open alternative and reports those comparisons separately. The row selection procedure precedes generation in both cases. The paper’s intervention involves preparing the prompt and processing the resulting code. There is no task-specific fine-tuning stage in the procedure. Code Llama

Sampling and keeping usable completions

The prototype takes a verbal query, a Pandas dataframe, and a target for the number of distinct completions to return. It computes the clusters and the selected rows, builds the prompt, and samples code. It runs each completion on the full table. If the execution gives a structurally valid result and the code is new to the accumulated list, the prototype saves both the completion and its output. It can stop once it reaches the requested number or spends the generation budget.

kₘₐₓ = 8k

Here k is the requested cardinality of the list of distinct completions in the prototype, and kₘₐₓ is the completion budget. The coefficient 8 is the multiplier the authors use to set that budget. The budget makes room for invalid or duplicate completions while bounding how much generation the procedure requests.

|C| = |O| ≤ k

C is the returned list of code completions, and O is the corresponding list of execution outputs. The vertical bars give the length of a list. The equality means that each retained completion has one retained output in the same position. The inequality limits both lists to the requested cardinality k. If the budget runs out first, the lists can be shorter.

Requesting completions separately has a cost because the prompt has to be submitted repeatedly. Batching can improve efficiency, but a batch that is too large can generate extra output after the procedure has enough usable candidates. The authors describe an adaptive batch size based on an estimate of how frequently a completion proves valid. They update that estimate using the valid and invalid outcomes of each batch.

r = k − |C|

In this equation r denotes the number of completions still needed, a separate use of the letter from the candidate row in the coverage rule. k is the requested total, and |C| is the number the procedure has already kept. Subtraction gives the remaining target.

n = min(⌈r/p⌉, B, L)

Here n denotes the batch size in the generation procedure. The letter serves a different purpose from the row budget in selection. r is the remaining target, and p is the estimated probability that the next completion will be valid. The ratio r/p gives a batch size based on that estimate, and the ceiling brackets ⌈ ⌉ round it up to a whole number. B denotes the remaining completion budget and L the API’s limit on parallel requests. The minimum operation caps the requested batch by both limits.

The implementation also uses stop sequences to keep the generator from continuing beyond a usable code response. The authors describe a sequence involving a line comment and another marking the end of a code block. They clean up formatting artifacts such as escaped comparison operators or quotation marks. These steps are part of the experimental pipeline because the response comes back as text. A correct idea can otherwise be lost at the syntax stage when formatting from the generated response is treated as Python code.

Identifying what the code produced

Generated answers can present a result in several ways. One program might assign a dataframe to a variable, another might add a column directly to an existing dataframe, and another might end by printing or displaying an expression. The authors use rewrite rules to expose a consistent output. The procedure searches backward for the last suitable top-level statement and arranges for its result to be stored in a fresh variable called var_out.

For a plain assignment, the selected output is the variable that receives the assignment. For an assignment to a dataframe element, the rewrite exposes the dataframe that was updated. A final print call or expression can be converted to an assignment to the output variable. The procedure can also insert imports for familiar libraries. The resulting code is combined with the definition of the full input dataframe, run, and read through the designated output variable.

Execution takes place in a sandbox using Pyodide, which runs Python in WebAssembly. The paper distinguishes this execution step from checking the result’s meaning. The sandbox offers filesystem isolation, and the authors report that the Python code retains access to network resources. The prototype checks whether execution succeeded and whether the result is a dataframe of the appropriate dimensions. Passing that check makes a completion valid for retention.

Benchmark correctness uses the expected output as an additional test. A candidate can be executable and return a dataframe of the intended shape while calculating the wrong values. The evaluator allows some representational differences that can accompany an otherwise correct solution. It can accommodate intermediate columns, different column ordering or headers, and certain equivalent representations of numbers and truth values. A case-only difference in a string can also be accepted. The default relative error tolerance for numerical comparisons is 0.01, with options to change tolerances, accepted truth-value strings, or case sensitivity for individual tasks.

These checks separate the question “Can this code return a usable table?” from “Did this code carry out the requested transformation on the evaluation rows?” The prototype can perform the first kind of check on a new user table. The benchmark can perform the second because the dataset includes expected outputs.

Measuring success across several candidates

The paper uses pass@k to quantify the chance that a sample of candidate programs contains a correct one. It adopts the estimator used in earlier work on evaluating generated code. For each task, the evaluator collects valid completions and counts the completions whose execution matches the expected result. It estimates the probability of a successful sample by taking the complement of the probability of drawing only incorrect programs from the collected set. Evaluating Large Language Models Trained on Code

pass@k = 1 − choose(m − s, k) / choose(m, k)

In this formula pass@k is the task-level estimate. k is the sample size being assessed, m is the number of collected valid programs, and s is the number of those programs judged correct. choose(a, b) counts subsets of size b from a items. The denominator counts possible samples of k collected programs. The numerator counts samples made entirely from the m − s incorrect programs. Division gives the fraction of samples with no correct candidate, and subtracting from 1 gives the fraction containing a correct candidate.

m = 20 × k

m here is the collection target for valid programs, and k is again the sample size in the reported metric. The authors set this target when reporting results for k = 1 or k = 5 under their sampling procedure. The multiplication sign indicates that the collection target is twenty times the evaluated sample size. Collecting more programs than the metric’s sample size gives the estimator more information than evaluating a single set of that size. The task-level estimates are averaged over the tasks in the reported group. The full-table permutation test uses greedy generation and reports pass@1 separately.

Experiments and results

Original tables and expanded tables

The original SOFSET benchmark contains 201 distinct tasks, with a median input size of 10 rows. The classification assigns 126 tasks to IND, 44 to DEP, and 31 to EXT. Tasks include string operations, dates and times, arithmetic, address manipulation, and transformations with conditional logic. The paper compares this collection with Jigsaw, which has 79 distinct tasks and a median of 7 rows, and CERT, which has 100 distinct tasks and a median of 3 rows. These figures describe the sizes of the task collections and their typical input tables.

For the larger-table experiment, the authors expand each of the 44 DEP inputs to 1000 rows. They identify the data domain of the original examples and find comparable data in open Kaggle collections. They then process the added values to fit the original inputs’ format and keep the resulting tables coherent. This preserves the existing task request while giving its program a larger and more varied input on which to run. The added rows are chosen for their domains, such as names or dates, and are not associated with the original programming requests.

The expansion produces variation in the formats found by the clustering procedure. The paper reports that 62% of the DEP tasks have at least two clusters, with some tasks reaching ten clusters. The comparison aimed at stronger format variation focuses on 17 of the 44 DEP tasks, reported as 39% of the DEP collection. The criterion for this group is that the table has input columns with at least three clusters. The paper also evaluates representative selection across the full DEP collection, including the tasks with fewer clusters.

The paper reports the principal GPT-4 sampling results at temperature 0.5. Temperature is a setting that affects how variable the generated completions can be. In the sampled experiments, the system can produce different candidate programs for the same prompt. In every row selection condition, the evaluation uses the complete task input. For an expanded task, success on the rows visible in the prompt is only part of what a program must achieve. Its output has to match the expected result on the 1000-row table.

What changes when the prompt gains a row

On the original benchmark the authors compare a query with no data, a query accompanied by the first row, and a query accompanied by ten rows. The first-row setting uses the table’s existing first example. It serves as a test of the amount of context before introducing an algorithm to choose representative rows. Results are shown for the full benchmark and separately for the IND, DEP, and EXT groups.

The paper reports a 7.1% gap in pass@5 between the first-row and no-data conditions for IND tasks. For DEP tasks the reported pass@5 gap between those conditions is 33.8%, and for EXT tasks it is 83.5%. The authors describe the direction as improved performance with data. They also report that almost no EXT tasks are solved in the no-data setting at pass@1 and that providing the first row improves that outcome. These are comparisons within each task category. The gap figures describe the sensitivity to changing the amount of input evidence for those tasks.

The smaller gap for IND fits the category’s definition. These queries already contain enough information to specify their transformations, so table rows supply a smaller share of what is essential. The observed improvement still gives the row a role. A candidate must refer to the right object, implement the operation, and produce an output the evaluator can recognize. A concrete example can help the generator turn a sufficient verbal specification into such a program.

The gaps for DEP and EXT show what happens when the prompt offers less than the task requires from its inputs. DEP requests can leave column names or value formats implicit. EXT requests may likewise benefit from having those details made explicit before the program brings in external knowledge. The comparison measures the effect of including the row as a package. It includes both the displayed structure of the dataframe and the particular values in the example.

Choosing examples for the larger inputs

On the expanded DEP tables, the central comparison holds the number of displayed rows fixed while changing how they are chosen. Random selection draws examples from the table. Representative selection chooses examples using weighted coverage of the inferred format clusters. The authors repeat random selection five times. The larger-table tests also use a query with no data as a baseline and include a full-data reference under a different generation setup.

Among the 17 tasks selected for higher format variation, ten representative rows give a pass@5 of 0.32, the strongest result highlighted for that subset. The paper reports an 8% advantage for representative selection over random selection at a budget of one row and a 6% advantage at a budget of ten rows in this comparison. These figures describe the reported gains for matching row budgets. The subset was chosen because its inputs offer more opportunity for the two strategies to show different formats.

The repeated random trials show why the choice can matter even under a fixed budget. For the higher-variation subset, pass@1 for the one-random-row condition ranges from 0.20 to 0.31 across the five runs. Drawing a new row can reveal a different cluster. With a small sample, that draw can change the visible evidence substantially. The paper describes random selection as competitive on average and presents the coverage-based rule as a more consistent way of choosing examples.

Across all 44 expanded DEP tasks, the comparison includes budgets of 1, 5, and 10 rows along with the no-data condition. Five representative rows attain the highest reported pass@1 and pass@5 in that comparison. The authors also report that five representative rows outperform ten randomly chosen rows. This broad comparison includes tasks with simpler cluster profiles. Its best setting differs from the best setting highlighted for the more varied subset, so the aggregate result depends on which tasks the metric averages over.

A one-row comparison and a larger-budget comparison test different parts of the same procedure. With one row, representative selection favors a row that contributes substantial weighted coverage across its cells. With a larger budget, the already selected rows influence which additional formats count as new evidence. The experiments compare the end-to-end effect on generated code under those budgets. They do not assign each part of the result to a particular cluster or row pattern.

Permuting the table in a long prompt

For the full-data test, the authors use a 32k-context version of GPT-4 and set temperature to 0 for greedy generation. Greedy generation here produces a completion without sampling among alternatives for each prompt. The authors permute the 1000 rows for ten runs. The table contents and task request stay fixed while the presentation order changes. Because this setting produces one completion per ordered prompt, the paper reports pass@1 for it.

GPT-4 pass@1 across full-table row orders on Kaggle-augmented SOFSET DEP tasks

Reordering the full input table changes the success rate under greedy generation.

GPT-4 pass@1 across full-table row orders on Kaggle-augmented SOFSET DEP tasksLowest reported row-order run: 0.20Lowest reported row-order run0.20Mean across row-order runs: 0.26Mean across row-order runs0.26Highest reported row-order run (this paper): 0.32Highest reported row-order run (thispaper)0.32
The numbers
System or settingpass@1
Lowest reported row-order run0.20
Mean across row-order runs0.26
Highest reported row-order run (this paper)0.32

The paper presents this result alongside the higher-variation analysis in its full-data figure. Its discussion also gives a one-random-row pass@1 range of 0.12 to 0.27, with an average of 0.20, in the comparison with full data. This is the one-row range quoted in that discussion, distinct from the 0.20 to 0.31 range the paper gives when describing the five random-selection runs for the higher-variation subset. The authors’ point in the full-data comparison is that giving the generator every row can yield a lower pass@1 than a single randomly selected row in some cases.

The appendix repeats the main types of comparison with Code Llama. On the original benchmark, the authors describe a substantial drop in overall performance and a continuing tendency for additional data to help. The appendix also presents comparisons on the expanded DEP collection and on the higher-variation subset. These experiments broaden the evaluation beyond GPT-4, while the numerical claims emphasized in the paper’s analysis concern GPT-4.

The authors release SOFSET, their evaluation results, and a prototype for the prompting procedure. The released task and result records correspond to different pieces of the evaluation. The former specify the benchmark problems and expected outputs, while the latter record how generation and execution performed under the tested conditions.

What the ablations show

Table context helps even when the request is sufficient

The paper analyzes the procedure through changes to the prompt rather than through a component-by-component study of the whole implementation. The no-data condition removes the sample while preserving the task request. Adding the first row restores a minimal view of the table, and the ten-row condition gives a fuller preview. Comparing those conditions within each task class makes it possible to see whether the effect of data tracks the kind of information the task requires.

The IND result is informative because the category provides a check on a simple explanation of why samples help. If examples mattered only because they supplied information missing from the query, the clearest gain would be confined to tasks that require such information. The IND improvement suggests another role for examples. Showing a dataframe can anchor code generation in a concrete representation even where the operation was already specified. The experiment changes the whole row presentation together, so it leaves open how much of that benefit comes from the schema, the literal values, or the presence of executable input structure in the prompt.

For DEP tasks, the larger reported gap fits the intended distinction between an instruction and the data particulars needed to implement it. The date example illustrates the mechanism. A text-only request can leave several implementation details to guess, while a row supplies actual field names and a sample of what has to be parsed. For EXT tasks, adding a row can solve the table side of the problem and leave the outside knowledge side intact. The experiment records whether the generated program as a whole succeeds, so the improvement cannot locate the source or reliability of the external knowledge it used.

Coverage changes the evidence at a fixed budget

The matched-budget representative and random comparison is the paper’s direct test of row choice. It is possible for both settings to show the same number of rows and still carry different information. If a random draw contains several examples of a common format, the visible contents may be useful but repetitive. Coverage can spend a later slot on another format. With one row, its preference for higher-weight clusters can also produce a different sample before there is any within-prompt diversity to consider.

The higher-variation subset is where this explanation has its clearest test. Its selection criterion ensures that some input columns contain several clusters to be represented. The reported advantage of representative sampling there is consistent with the idea that the composition of the preview matters. The variance across random draws reinforces that interpretation. Repeating the same procedure with a different draw can change which formats are visible and can change the rate of successful code generation.

Looking at all DEP tasks puts that result in a broader setting. Five representative rows give the best reported scores in the all-task comparison, even though ten representative rows lead the subset result. These are averages over different collections of tasks. The paper therefore supplies evidence about how successful budgets vary with the comparison population. It does not supply a task-level rule that predicts how many rows any particular input needs.

The coverage comparison tests the selection rule as used, with its regular-expression synthesis and cluster weights working together. Both the choice of pattern language and the weighting can influence what appears in the prompt. A separate experiment would be needed to determine whether the gains principally come from the clustering, from favoring larger clusters, or from a particular aspect of the greedy choice across columns. The reported comparison supports the combined procedure against random selection in the tested settings.

Position has an effect even when the rows stay the same

The permutation test isolates a different source of variation. Every run of the full-data setup contains the same input values. Temperature stays at 0 and the ordering changes. The resulting range in pass@1 shows that row order can affect the code produced even when the generator has access to the complete set of values. This is consistent with the positional effects that the authors cite from earlier research on long contexts. Lost in the Middle

The permutation changes the positions of many rows at once. It reveals an effect of order as a whole and leaves the influential positions unidentified. For instance, some reordered tables may put an informative example near the beginning, while others move several useful examples together or apart. The study does not assign the change in performance to any one of these arrangements. Its result is about sensitivity to presentation order under the full-table setup.

The short- and long-prompt results also answer different questions. The matched-budget experiments show how selecting a different set of rows affects outcomes under a common preview size. The full-data permutations show how the order of a fixed set affects outcomes under a common generation setup. Comparisons between these experiments are informative about the tested configurations, with context version, temperature, and sampling protocol all relevant when interpreting the scores.

Limitations

Limits identified by the authors

The authors note that a person composing a forum question usually shows the columns they believe matter. A real spreadsheet can have additional fields unrelated to the requested transformation. Those fields could affect both stages of the method. The coverage rule would have more column patterns to consider, and the generator would have more visible fields to interpret. The authors report encouraging observations on tables with extraneous columns, while the main experiments leave that situation without a rigorous evaluation.

The queries are in English. This confines the evidence about how natural-language requests interact with table context to that language. A table can contain values whose written conventions matter to the synthesis procedure, and the instructions can express the same operation in different ways across languages. The paper leaves empirical generalization to other languages open.

The paper also limits its claims about how format groups are defined. The selected clusters depend on the specificity of the regular expressions produced by the synthesis tool. Two profiling methods could divide the same column differently. A coarse pattern might group together values that call for different code, while more specific patterns might spend the row budget distinguishing cases a program could handle identically. The paper evaluates one profiling method and recognizes that changing it could change the resulting clusters.

GPT-4 supplies the evidence behind the paper’s main conclusions, and the authors acknowledge that later generation systems might respond differently to the same prompts. They also identify the cost and accessibility of the evaluation as practical constraints. The workflow can require repeated generation and execution for each task and condition. Access to GPT-4 matters for reproducing the main results, while running the open alternative still calls for GPU resources.

The paper proposes multi-table and hierarchical inputs as future directions. Its evaluated inputs are flat tables, which give each selected row an immediate interpretation as a tuple of cells from one dataframe. With several tables, a row’s relevance can depend on values in related rows elsewhere. A hierarchical table could require preserving relationships across levels of the input. These settings are outside the demonstrated scope of row selection as evaluated here.

In the ethics discussion, the authors identify possible effects of the data placed in prompts, including the exposure of private information and the transmission of biases into generated outputs. They study the overall effect of providing data and leave an evaluation of how biased examples affect generated code for future work. They also describe reviewing the uses of the datasets and obtaining institutional ethics review. The reported improvements concern benchmark correctness on the tasks studied.

Limits visible in the experimental design

The benchmark grounds its tasks in real questions, but the experimental collection reflects a specific sampling frame. It comes from highly rated posts with a spreadsheet formula tag, then passes through manual screening, query rewriting, and extension of the input data. The result is well suited to controlling how much of a table is displayed. It yields evidence about the tasks constructed from this source, while the frequency of task types in ordinary spreadsheets or other collections remains outside the measurement.

The 1000-row tables also represent a deliberate augmentation. They let the authors keep the original tasks while varying how much of a larger input is visible. The authors match source domains and post-process the added data to preserve coherent formats. Patterns such as how several fields vary together on an independently collected table can still differ from those in an augmented one. The paper suggests that selection could scale to tables with over 100K rows. Its large-table code generation results are measured on the 1000-row inputs, leaving performance and cost at the larger scale unmeasured here.

Selecting the 17 tasks with greater format variation puts the hypothesized advantage of clustering under a focused test. That subset is appropriate for asking whether coverage helps when there are several groups to show. It also limits the scope of its numerical gains. The all-DEP experiment gives a separate average and yields a different strongest reported budget. Together they report performance on a selected high-variation subset and on the complete set of expanded data-dependent tasks. The selection comparison is not established for the original IND and EXT groups under the same augmented-table procedure.

The inference that the benchmark is unlikely to overlap with training rests on the transformations made during dataset construction and on low performance in the no-data condition. This is indirect evidence. A system could have encountered related posts and still struggle when a query omits details needed for the rewritten task. Conversely, earlier exposure to similar Pandas patterns could help even when the exact benchmark records are absent. The experiment assesses generated behavior and does not establish what records appeared in training.

The scoring protocol has its own scope. Pass@k is estimated from valid completions under the paper’s collection procedure. It describes the chance of including a correct solution in a sample, averaged over tasks. Selecting that solution for a user is a different operation. In the benchmark, expected outputs reveal which candidates are correct. In the prototype, structural validation can identify a result of the appropriate kind and dimensions, but an executable program with a well-formed output can still calculate incorrect values. The results therefore quantify availability of correct candidates under the experimental checks, leaving user-facing selection and verification unmeasured.

The output comparison also deliberately accommodates some differences in representation. This is appropriate for measuring whether generated values match the transformation when equivalent encodings or extra working columns are acceptable. It means the reported scores apply to the paper’s comparison rules. In an application where names, column order, or exact representations are contractual, a stricter evaluator could judge some of the same programs differently. The study shows correctness against its task outputs under its stated allowances.

Finally, executing across the full evaluation table gives a stronger check than inspecting the sample rows alone, but it still tests a finite set of inputs. A correctly scored program has handled all the evaluated cases under the matching rules. A novel format arriving after generation can expose an assumption absent from those cases. The result concerns how far programs generalize from the displayed preview to the corresponding evaluation table. Generalization to future tables, long-term maintenance of the programs, and the way people respond to plausible but incorrect outputs are outside the study’s measured outcomes.

What came after

Poelitz and colleagues cite Barke and colleagues in work on producing verified synthetic clarification and correction dialogues for TableQA. Their teacher–student approach concerns dialogue systems for answering questions about tables. Its stated focus is on conversations in which a request is clarified or corrected, whereas Barke and colleagues hold the task request fixed within a comparison and change the table evidence that accompanies it. The citation connects these two studies of how a system gets the information it needs to work with a table. The later work’s title identifies its teacher–student setup and dialogue objective. It does not establish that the authors reuse SOFSET, regular-expression clustering, or the representative-row selection algorithm. A Teacher-Student Approach to Creating Verified Synthetic Clarification and Correction Dialogues for TableQA Tasks

Cite

Cite as Shraddha Barke, Christian Poelitz, Carina Negreanu, Benjamin Zorn, José Cambronero, Andrew Gordon, Vu Le, Elnaz Nouri, Nadia Polikarpova, Advait Sarkar, Brian Slininger, Neil Toronto and Jack Williams. 2024. Solving Data-centric Tasks using Large Language Models. Findings of the Association for Computational Linguistics: NAACL 2024.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2024.findings-naacl.41

@inproceedings{barke2024solving,
  title = {{Solving Data-centric Tasks using Large Language Models}},
  author = {Shraddha Barke, Christian Poelitz, Carina Negreanu, Benjamin Zorn, José Cambronero, Andrew Gordon, Vu Le, Elnaz Nouri, Nadia Polikarpova, Advait Sarkar, Brian Slininger, Neil Toronto and Jack Williams},
  booktitle = {Findings of the Association for Computational Linguistics: NAACL 2024},
  year = {2024},
  doi = {10.18653/v1/2024.findings-naacl.41},
  url = {https://doi.org/10.18653/v1/2024.findings-naacl.41}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/barke-2024-solving-data-centric-tasks-large/