Manuscript Offprint
arXiv:2609.06527ProcArena: A Multi-Scenario Benchmark for LLMs on Direct and Interactive PL/SQL Development from Natural Language
ABSTRACT
Large language models (LLMs) have shown strong potential for translating natural-language (NL) requirements into PL/SQL programs, attracting increasing attention from the database community. However, existing NL-to-PL/SQL efforts primarily focus on directly generating PL/SQL from complete NL requirements. In practice, PL/SQL development involves diverse scenarios, such as from-scratch development, code modification, debugging, and optimization, and may require either direct generation or multi-turn interaction. Yet, no comprehensive benchmark evaluates multi-scenario, direct and interactive, and multi-dialect NL-to-PL/SQL development. In this paper, we present ProcArena, an execution-based benchmark covering both Direct and Interactive modes. ProcArena comprises 3,998 executable tasks over 157 databases, spanning nine development subscenarios in PostgreSQL and Oracle. We construct challenging Direct tasks through Iterative Logic Enhancement and scenario-specific adapters, and derive paired Interactive tasks through Knowledge Integration and Requirement Perturbation while preserving executable targets. We further design a controlled Solver–User Simulator protocol that allows models to clarify user intent and inspect the database environment without exposing hidden execution feedback. Evaluating seven language models, we find that the best average scores are only 62.2% and 57.8% in Direct and Interactive, respectively, demonstrating that realistic NL-to-PL/SQL development remains challenging, particularly in interactive settings. We release the benchmark on the public website https://zeyuhuangzh.github.io/procarena-site/.
PVLDB Reference Format:
Hang Zhang, Chaokun Wang, Yuzhi Pan, Ziyao Zhong, Shuo Cao, Yue Xue, Zeyu Huang, Xingwei Zhou, Fang Niu, Bofan Xie, Guanchen Ge, Leqi Zheng, Ziyang Liu, Xiannian Cao, Pengcheng Ge. ProcArena: A Multi-Scenario Benchmark for LLMs on Direct and Interactive PL/SQL Development from Natural Language [Experiment, Analysis & Benchmark]. PVLDB, 20(1): XXX-XXX, 2027. doi:XX.XX/XXX.XX
1 INTRODUCTION
By integrating procedural constructs with SQL, PL/SQL enables developers to implement data access and business logic directly within database systems, reducing communication overhead between applications and databases [16]. It has therefore become an important component of modern database systems [3, 6, 8, 9]. For example, Microsoft Azure SQL Database alone hosts over two billion PL/SQL codes that serve billions of daily invocations [14, 35]. However, developing PL/SQL codes is difficult in practice, as it requires knowledge of database schemas, business logic, and PL/SQL syntax [16, 38]. Recently, large language models (LLMs) have been increasingly explored for automating the translation from natural language (NL) to PL/SQL (NL-to-PL/SQL) [50].
Despite this progress, systematically assessing LLMs for practical NL-to-PL/SQL development remains challenging, as no benchmark captures the diverse development scenarios and interactions involved in real-world PL/SQL programming. Prior work provides only partial foundations for such an assessment. PLForge [50] introduces NL-to-PL/SQL datasets, models, and execution-based evaluation, but primarily studies direct PL/SQL code generation from complete requirements. NL-to-SQL benchmarks [21, 27, 45, 49] examine how models translate NL requests into SQL by grounding them in database schemas and contents, while interactive Text-to-SQL benchmarks such as BIRD-Interact [18] further incorporate interactions with users and database environments. However, both lines of work target declarative SQL rather than PL/SQL codes. General code-generation benchmarks [5, 19, 31, 40] cover generation and modification tasks in languages such as Python, Java, and C++, but do not capture key characteristics of PL/SQL development, including database environment and procedural logic.
To the best of our knowledge, ProcArena is the first benchmark to evaluate LLMs on NL-to-PL/SQL across multiple development scenarios in both Direct and Interactive modes across PostgreSQL and Oracle. Figure 1 illustrates the Direct and Interactive task under from scratch development scenario. To construct the benchmark, we outline two main challenges. C1: How can we construct realistic
This work is licensed under the Creative Commons BY-NC-ND 4.0 International License. Visit https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of this license. For any use beyond those covered by this license, obtain permission by emailing info@vldb.org. Copyright is held by the owner/author(s). Publication rights licensed to the VLDB Endowment.
Proceedings of the VLDB Endowment, Vol. 20, No. 1 ISSN 2150-8097. doi:XX.XX/XXX.XX
In this paper, we use PL/SQL to refer to procedural extensions of SQL, including Oracle PL/SQL [1], PostgreSQL PL/pgSQL [2], and related dialects.

Figure 1: ProcArena evaluates the same PL/SQL development target under two modes. Left: the nine subscenarios, five under Synthesis and four under Editing, and a Direct episode that maps a complete requirement to PL/SQL code in a single turn. Right: an Interactive episode that clarifies an underspecified request via ask_selector and ask_user turns with the User, execute turns against the Database Environment before the code is submitted.
and difficult NL-to-PL/SQL tasks across multiple PL/SQL development scenarios? Existing publicly available NL-to-PL/SQL datasets rarely cover these diverse development scenarios. They primarily focus on from-scratch generation with complete NL requirements, resulting in relatively limited scenario diversity and task difficulty. C2: How can we construct an executable interactive environment for realistic multi-turn NL-to-PL/SQL development? Interactive NL-to-PL/SQL development requires the Solver to resolve incomplete requirements against both user intent and the database environment. A fixed transcript cannot assess whether the Solver appropriately seeks clarification or inspects database information, while unrestricted interaction may alter database state or leak evaluation signals. The environment must therefore support controlled interactions between the Solver and both the User and the Database Environment under an executable protocol.
For C1, we use iterative logic enhancement to add procedural logic, jointly update the PL/SQL code and NL requirement, and validate their executability and semantic consistency. We then apply scenario-specific adapters to construct executable Direct tasks for nine subscenarios. For each subscenario, we rewrite the user requirement and prepare any required supporting artifact, such as a document, behavioral examples, a template, or existing code, while preserving the gold PL/SQL code. For C2, we apply knowledge injection and requirement perturbation to derive paired Interactive tasks from their Direct counterparts by introducing information omissions and resolvable contradictions while preserving the gold PL/SQL code. We maintain an elicitation ledger of the facts, definitions, and resolutions available to the User Simulator during interaction. We further design the Solver–User Simulator protocol to coordinate user interactions with database environment.
We propose ProcArena, which comprises 3,998 NL-to-PL/SQL tasks across nine PL/SQL development scenarios in PostgreSQL and Oracle. We evaluate 7 models across Direct and Interactive tasks. On
the Direct and Interactive modes, the best average scores achieved by the models are 62.2% and 57.8%, respectively. The evaluation further compares generation across subscenarios and analyzes the construction components and User Simulator.
In summary, we make the following contributions:
(1) We propose ProcArena, the first benchmark to evaluate LLMs on NL-to-PL/SQL across multiple development scenarios in both Direct and Interactive modes across PostgreSQL and Oracle.
(2) We construct PL/SQL-specific interactive environments through knowledge integration and requirement perturbation, and propose the Solver–User Simulator protocol to coordinate Solver–User interactions and Database Environment tools.
(3) We conduct comprehensive experiments to evaluate seven models on 3,998 tasks across nine development scenarios in both Direct and Interactive modes, and further analyze the benchmark construction and interaction behavior.
2 PROBLEM FORMULATION
An NL-to-PL/SQL task asks a Solver to produce PL/SQL code from an NL requirement, a database description, and an optional task attachment. We represent the task input as
where states the NL requirement. The database description contains the database schema and its metadata . denotes the optional task attachment.
Let denote the space of PL/SQL codes. Given a task input , the Solver ultimately produces a candidate PL/SQL code . We model the Solver as
where is the LLM and is its action space.
2.1 Direct NL-to-PL/SQL
The direct NL-to-PL/SQL task provides a task to a Solver , where . The LLM directly generates a candidate PL/SQL code from the task input:
Generation follows under and may use the task attachment . The Solver then submits for evaluation.
2.2 Interactive NL-to-PL/SQL
An interactive NL-to-PL/SQL task is a multi-turn collaboration among a Solver , a User Simulator , and a database environment . The receives the initial task input from :
where may be underspecified. For a paired ProcArena task, and ; interactive construction changes the requirement view while preserving the database description and task attachment. The can clarify information through the and inspect the database through .
The interaction action space of is
where and denote the action spaces for interacting with and , respectively.
The Solver initiates each interaction turn. Starting from an empty interaction history , at an interaction turn , the LLM selects an action based on the initial task input and the interaction history :
For a nonterminal action, the corresponding interaction target returns a response
and the protocol updates the interaction history as
where denotes appending the current action-response pair to the interaction history.
After zero or more nonterminal interaction turns, the LLM generates a candidate PL/SQL code based on the initial task input and the interaction history:
where is the number of interaction turns. The Solver then submits for evaluation, which terminates the task.
3 BENCHMARK CONSTRUCTION
In this section, we describe the construction of ProcArena tasks. Figure 2 illustrates the overall construction pipeline. We first construct the seed PL/SQL codes and enhance their procedural logic through an iterative logic enhancement method. We then rewrite the corresponding NL descriptions to preserve semantic consistency with the enhanced PL/SQL codes. For direct NL-to-PL/SQL task construction, we employ scenario adapters to transform the enhanced NL-to-PL/SQL pairs into direct NL-to-PL/SQL tasks spanning nine development scenarios. For interactive NL-to-PL/SQL

Figure 2: The ProcArena construction pipeline.
task construction, we apply knowledge injection and requirement perturbation to transform the direct NL-to-PL/SQL tasks into interactive NL-to-PL/SQL tasks that necessitate interaction between the Solver and the user to achieve correct task completion.
3.1 Seed Task Construction
We construct the seed NL-to-PL/SQL tasks from two sources. The first consists of the Hard and Webridge datasets from PLForge, whose underlying databases are derived from Spider. These datasets provide difficult NL-to-PL/SQL pairs in PL/pgSQL and Oracle PL/SQL, respectively. The second source is LogicCat [33], which contains databases and NL-to-SQL tasks that require more sophisticated logical reasoning and domain knowledge. Using the LogicCat databases together with their original complex NL-to-SQL examples as prompts, we employ LLMs to generate corresponding seed NL-to-PL/SQL pairs.
3.1.1 Iterative Logic Enhancement. Due to the strong code generation capabilities of state-of-the-art LLMs, we need to ensure that the NL-to-PL/SQL pairs in ProcArena are sufficiently challenging to effectively evaluate the capabilities of LLMs. In practice, users can extend a requirement by adding business rules. We leverage this characteristic and propose an iterative logic enhancement method, which let a held-out LLM to add one reasonable business rule in each round. Through iterative enhancement, we increase the procedural complexity of the PL/SQL code while ensuring that it remains grounded in realistic business scenarios.
Concretely, the iterative procedure starts from an NL-to-PL/SQL pair in the source set and proceeds over multiple rounds. In each round, given the current NL-to-PL/SQL pair, the held-out LLM proposes a business rule, generates a PL/SQL code snippet that implements the rule, integrates the snippet into the current PL/SQL code, and updates the NL requirement to describe the resulting PL/SQL code. After rounds, we execute the final PL/SQL code on the database and use a held-out validation LLM to check whether
Algorithm 1: Iterative Logic Enhancement
Input :Source pair ; database description ; initial state ; held-out construction LLM ; enhancement rounds ; repair budget
Output: Validated seed task , or FAIL
1
/* Add one rule per round */
2 for to do
3
4
5
6 if then
7
8
9
10
11
12 if or then
13
14
15
16 if then
17
18
the NL requirement and code remain semantically aligned. We then generate a call suite and retain only calls that change the database state. The validated pair and its execution assets are collectively referred to as the seed task for subsequent Direct and Interactive task construction. We illustrate the iterative logic enhancement method in Algorithm 1.
3.2 Direct Task Construction
In this section, we first define the scenarios and then explain how to construct Direct tasks based on the seed tasks.
3.2.1 Development Scenarios. We collect 1,535 unique posts from Stack Overflow and Database Administrators Stack Exchange by searching for keywords such as PL/SQL and PL/pgSQL. We then analyze the types of user requests in these posts and find that most could be broadly categorized into two categories. In 48.7% of the posts, users have no existing PL/SQL code and need to generate code from scratch. In another 38.4%, users have PL/SQL code but need to modify, optimize, fix, or complete it. We refer to these two categories as Synthesis and Editing, respectively. Based on the analysis, we further divide Synthesis and Editing into five and four subscenarios, respectively.
For Synthesis, we define five subscenarios according to the information or code artifact provided with the task:
-
A1: From-Scratch Synthesis. The user provides an NL requirement and the database description and requests complete target code from scratch.
-
A2: Document-Grounded Synthesis. The user also provides a design or requirement document that the code must follow.
-
A3: Example-Guided Synthesis. The user provides examples that illustrate the expected behavior of the target code.
-
A4: Template Instantiation. The user provides a generic code template and requests a target implementation that fills its task-specific bindings.
-
A5: Code Composition. The user provides complete, callable PL/SQL components and requests new target code that coordinates their calls, parameters, and procedural logic.
For Editing, we define four subscenarios based on the type of requested code change:
-
B1: Functional Modification. The user requests changes that add, remove, or modify business behavior in existing code.
-
B2: Performance Optimization. The user requests better execution performance while preserving the behavior of existing PL/SQL code.
-
B3: Code Repair. The user reports a defect in PL/SQL code and requests a repair that restores the intended behavior.
-
B4: Code Completion. The user provides incomplete PL/SQL code and requests completion of a coherent missing block.
3.2.2 Scenario-Specific Adapters. We use scenario-specific adapters driven by held-out LLM to transform a validated seed task into a Direct task for each subscenario. The validated seed task defines the target behavior. Each scenario adapter creates the starting point for one development subscenario by rewriting the user requirement and adding a task attachment when needed. The attachment may contain a document, examples, a template, reusable components, or existing PL/SQL code. Let denote the validated seed task. The scenario contract defines the preconditions under which adapter applies and the acceptance criteria that its output must satisfy. For subscenario , the adapter constructs the complete Direct task
Here, denotes the scenario-specific requirement, and denotes the task attachment. The remaining elements correspond to the database description, initial database state, reference PL/SQL code, and call suite, all of which remain unchanged.
Each scenario adapter constructs a task by rewriting the original requirement into a scenario-specific requirement and, when needed, generating a task attachment, while leaving all other task elements unchanged. The resulting NL requirement and attachment must contain all information necessary to complete the task and remain consistent with the database description. If candidate content contains conflicting statements, the adapter resolves the conflict and retains a single consistent statement.
To construct the scenario-specific requirement and attachment, the adapter combines LLM-guided rewriting with scenario-specific artifact preparation. The LLM handles content that requires semantic rewriting. For Synthesis subscenarios that require an attachment, the adapter places the appropriate supporting artifact in the attachment: a document, behavioral examples, the provided generic template, or callable components. For Editing subscenarios, deterministic transformations derive code attachments from the reference PL/SQL code without modifying the reference code itself.
These transformations revert a business rule, introduce a behavior-preserving slowdown, inject a defect, or remove a coherent code block. After each attempt, we validate the candidate against its scenario contract. If validation fails, the LLM receives the failed checks as feedback for the next attempt.
Every candidate must pass three common checks to ensure that the constructed Direct task is valid, non-trivial, and semantically aligned with the reference seed task. ① Artifact validity verifies that the attachment has the type and structure required by the target subscenario. ② Task non-triviality ensures that the candidate neither exposes the reference code nor leaves no meaningful work for the Solver. ③ Reference alignment verifies semantic consistency with the reference code through execution.
In addition to these common checks, each candidate must pass the scenario-specific checks defined in Table 1.
After an adapter passes all checks, we materialize the resulting Direct task. The Solver receives
This input contains only the scenario-specific requirement, database description, and task attachment. We keep the gold PL/SQL code, call suite, and initial database state hidden for offline evaluation. In Direct, the Solver is allowed to submit only once and cannot call ask_user, ask_selector, or any environment tool before submission. We construct Direct tasks for all nine subscenarios.
3.3 Interactive Task Construction
3.3.1 Interactive Requirement Construction. We construct Interactive tasks from the Direct tasks in Section 3.2 through two stages. In real-world development, user requirements are often not fully explicit: users may express their intent using domain-specific knowledge, logical reasoning, or commonsense knowledge, and may also omit necessary information or provide conflicting constraints. We model these realistic forms of underspecification through Knowledge Injection and Requirement Perturbation. Figure 3 illustrates both stages on one airline-operations task, together with the Iterative Logic Enhancement step that produces the underlying Direct requirement.
Both stages modify only the requirement and preserve the task attachment, reference PL/SQL code, call suite, and initial database state. We apply this construction to eight subscenarios; B2 remains Direct-only because it uses runtime-based evaluation.
Knowledge Injection transforms a complete Direct requirement by replacing selected explicit statements with formulations that rely on implicit knowledge. It uses three operators:
- Domain Knowledge replaces an expanded definition or formula with a domain term.
- Logical Reasoning replaces procedural steps with an invariant or constraint.
- Commonsense Knowledge removes information that users infer from common conventions in the given scenario.
All three operators preserve the scenario contract and the reference PL/SQL code.
For all three operators, we extract the knowledge needed to interpret each rewrite and store it in the online knowledge ledger . Each entry contains a domain definition, reasoning logic, or
| Type | Original sentence and controlled change |
|---|---|
| Logic Enhancement | Base: Add a wine and set every vintage to the requested year.Logic: Add the wine (skip duplicates), then assign vintages by priority: premium, target, or Napa Valley → requested year; otherwise → previous year. |
| Knowledge Injection | Original: Otherwise, set the vintage to one year before the requested year.Injected: Otherwise, apply the prior-vintage rule.[Glossary: prior-vintage rule = requested year − 1.] |
| Information Omission | Original: For wines marked "now," increase Cases by exactly 1; treat NULL as 0.Omitted: For wines marked "now," increase Cases.[The increment and NULL rule are hidden.] |
| Contradiction Injection | Intended: The premium-score threshold is 90.Injected: The main rule says score ≥ 90, but a closing note says score ≥ 80. |
Figure 3: Controlled requirement edits on one example task. Each row pairs the original sentence with the rewritten one produced by a single operator, with the changed span highlighted: Iterative Logic Enhancement, Knowledge Injection, Information Omission, and Contradiction Injection.
Algorithm 2: Knowledge Injection
Input : Task ; contract ; knowledge budget ; attempt budget
Output : Interactive requirement candidate and ledger , or FAIL
1 ;
2 if then
3 | return FAIL
4 for to do
5 |
6
7 if then
8 |
9 | return
10 return FAIL
commonsense knowledge and is available to the Solver during interaction.
Algorithm 2 summarizes the Knowledge Injection process. For each rewritten requirement fragment produced by Knowledge Injection, the algorithm records its knowledge type, the corresponding source fact, the rewritten text, and any queryable knowledge entry. It then validates the rewritten fragment by checking whether it preserves the scenario characteristics, remains consistent with the gold PL/SQL code, avoids schema-identifier leakage, provides sufficient ledger coverage, and can be traced back to the source fact. If a rewritten fragment fails any validation check, a new rewrite is generated within the fixed attempt budget.
Requirement Perturbation applies two operators to after Knowledge Injection.
- Information Omission removes necessary but recoverable information from the visible requirement.
Table 1: Scenario-specific adapters. A1–A5 cover Synthesis and B1–B4 cover Editing. All adapters preserve the database description, reference code, call suite, and initial database state. Each constructed user input is written as requirement; attachment. The last column lists the checks applied after the three common checks.
| Subscenario | Applicable seed task | Constructed user input | Additional acceptance criteria |
|---|---|---|---|
| A1: From-Scratch | Any validated seed task. | Complete behavioral requirement; no attachment. | ❖ The task has no attachment. ❖ The requirement fully specifies the target behavior. |
| A2: Document-Grounded | The target behavior depends on facts that can form a separate document. | Task request without the document facts; document stating them. | ❖ Some implementation that ignores a document fact differs from the reference under the call suite. ❖ The document exposes no code. |
| A3: Example-Guided | The call suite contains inputs that illustrate the target behavior. | Task request; calls selected from the call suite with their observed behavior. | ❖ The reference code reproduces every example. ❖ A leakage check rejects PL/SQL implementation text. |
| A4: Template Instantiation | The target admits a reusable skeleton and task-specific bindings. | Task-specific bindings; reusable skeleton with unfilled placeholders. | ❖ A placeholder-coverage check matches every binding to the template. ❖ The check rejects a target-specific body. |
| A5: Code Composition | Existing callable components can implement the target when coordinated. | Composition request; callable PL/SQL components without the coordination code. | ❖ The components compile and are callable. ❖ A structural check confirms the target coordination code is absent. |
| B1: Functional Modification | Reference code has a business rule that functional reversion can invert. | Original rule as the requested change; reference code with that rule reverted. | ❖ At least one call distinguishes the unchanged code from the reference behavior. |
| B2: Performance Optimization | A behavior-preserving slowdown operator applies to the target. | Optimization request; behavior-preserving slowdown of the reference code. | ❖ The slower code matches the reference outputs and state. ❖ Its warm median runtime exceeds the reference by the contract margin. |
| B3: Code Repair | A defect operator applies to the working code. | Repair request; reference code with an injected defect. | ❖ At least one call exposes the defect: an exception, or a mismatched output or persistent state. |
| B4: Code Completion | The reference code contains a coherent removable block. | Completion request; reference code with a coherent block removed and the site marked. | ❖ A structural check validates the removed block. ❖ Compilation or execution confirms the incomplete code fails the target behavior. |
- Contradiction Injection introduces conflicts within the requirement or between the requirement and the database environment.
Information Omission removes an explicit but recoverable requirement detail from the visible requirement. We regard the removed detail as necessary if its omission permits an implementation that satisfies the remaining requirement but behaves differently from the reference PL/SQL code when both are executed on the same call suite and initial database state. For each omitted detail, the requirement ledger records the original statement, where it appears in the source requirement, who can provide the missing information, and how the detail can be restored during interaction.
Contradiction Injection introduces conflicting information that cannot be resolved from the visible requirement alone. We consider two forms of contradiction.
An Intra-requirement contradiction introduces two incompatible statements into the same requirement, such as different thresholds. Because both statements are visible, the Solver can detect the conflict directly from the requirement, but must interact with the user to determine which statement the user actually intends.
A Requirement-environment contradiction introduces a statement that conflicts with the actual database schema or metadata. For example, the requirement may refer to a nonexistent table or column, or specify an incorrect data type or constraint. The Solver can use environment tools to detect such mismatches. Environment tools can detect the mismatch, but cannot determine the user's intended correction. The conflict therefore requires interaction with the user for resolution.
Both perturbation operators modify only the visible requirement while preserving the database schema, metadata, gold PL/SQL code, call suite, and initial database state. Each injected conflict has a unique resolution that is consistent with the gold PL/SQL code. For requirement-environment contradictions, we additionally require that the mismatch can be detected from the database environment.
3.3.2 Task Materialization and Interaction Protocol. Task Materialization. After Knowledge Injection and Requirement Perturbation, we package the resulting requirement and its supporting assets into an Interactive task:
The Solver receives only the requirement, database description, and task attachment. The router assigns each ledger entry to its designated information holder. The pipeline retains only tasks whose ledger entries identify the corresponding construction operators.
Interaction Protocol. The User Simulator represents the user in each interactive episode and responds to the Solver's questions and clarification requests. Since the interaction proceeds over multiple turns in free-form natural language, we implement the simulator with a held-out LLM. The Solver–User Simulator protocol governs how the Solver interacts with the simulator. It defines the actions available to the Solver, the task information that the simulator may access for each action, and the responses that the simulator may provide. By restricting the simulator to user-facing information, the protocol prevents hidden evaluation assets from leaking into the interaction. Within the simulator, the requirement holder and knowledge holder handle requests that match entries in their corresponding ledgers.
During task construction, we create an NL description of the gold PL/SQL behavior for the fallback channel, which answers questions without a matching ledger entry. Separately, environment tools expose the database environment defined in Section 2.2, allowing the Solver to inspect task-relevant database information through the prescribed tool interface.
Table 2: Nine actions available to the Solver in an Interactive episode. Every issued action consumes budget units, even if malformed or failed.
| Action | Env. | Arguments | Returned observation | Cost |
|---|---|---|---|---|
| ask_user | User | question | Natural-language answer | 2 |
| ask_selector | User | options | Index of the intended option | 2 |
| get_schema | DB | - | Schema of the whole database | 1 |
| describe_table | DB | table | Metadata of one table | 0.5 |
| sample_rows | DB | table_limit | Sample rows of one table | 0.5 |
| compile_plsql | DB | code | Compiler diagnostics | 0.5 |
| execute_scratch | DB | sql | Execution result | 1 |
| reset_scratch | DB | - | Scratch context restored | 0.5 |
| submit | Eval | code | - | 0 |
Action Space. The router sends each action to the component selected by the Solver, and the offline evaluator remains outside the interaction. The Solver is the only action initiator in the protocol. It may inspect the environment, request information through ask_user, ask the user to select among candidate interpretations through ask_selector, or end the episode through submit. Table 2 summarizes the nine concrete actions, their target components, inputs, returned observations, and interaction costs. The two user-facing actions return a natural-language answer and the index of the intended option, respectively. The analysis groups malformed or unrecognized names under malformed/other; this category falls outside the action space.
The task attachment remains visible throughout the episode. Every environment action and every ask_user or ask_selector action consumes the interaction budget; submit is cost-free but terminates the episode immediately and returns no execution-accuracy feedback, preventing the Solver from iteratively refining its solution against the hidden oracle.
The protocol provides two user-facing actions. ask_user routes the question to the holder responsible for the matched ledger entry, falling back to a default channel when no entry matches. ask_selector lets the Solver choose a holder and supply candidate interpretations; the holder returns the index consistent with its ledger. When candidates mix requirement facts with injected knowledge, the Solver may query the two holders separately to resolve each source independently.
Resolving contradictions between the requirement and the database requires two complementary information sources. The Solver first calls a schema or metadata action to identify the objective mismatch, such as a referenced column that does not exist, then uses ask_user or ask_selector to obtain the user's intended resolution. Environment actions expose database facts only and never infer user intent, ensuring a clean separation between objective state and subjective preference.
4 PROCARENA STATISTICS
ProcArena spans nine Direct subscenarios and eight paired Interactive subscenarios across PostgreSQL and Oracle. This breadth follows from the task itself: NL-to-PL/SQL development spans synthesis and editing, complete and underspecified requirements, and two dialects. Varying the scenario, the mode, and the dialect therefore keeps evaluation grounded in the full task rather than in one narrow setting. This section reports the resulting corpus: Table 3
Table 3: ProcArena and prior NL-to-PL/SQL datasets. Tasks reports all evaluation instances, and Interactive reports the Interactive subset. Stmt and Cyclo report the mean statement count and cyclomatic complexity per reference procedure.
| Dataset | Scale & coverage | Per-task difficulty | |||||
|---|---|---|---|---|---|---|---|
| Tasks | DBs | Dialects | Scen. | Interactive | Stmt | Cyclo | |
| PLForge Simple | 300 | 130 | 1 | 1 | 0 | 2.8 | 3.0 |
| PLForge Hard | 300 | 113 | 1 | 1 | 0 | 10.7 | 6.8 |
| ProcBench | 300 | 123 | 1 | 1 | 0 | 3.3 | 3.5 |
| WeBridge | 209 | 40 | 1 | 1 | 0 | 29.5 | 9.4 |
| ProcArena | 3,998 | 157 | 2 | 9 | 1,879 | 32.1 | 18.6 |
summarizes its scale, coverage, and difficulty; Table 4 breaks it down by subscenario; and Table 5 quantifies the transformations that construct Interactive requirements.
4.1 Comparison with Prior Datasets
Table 3 compares ProcArena with four prior NL-to-PL/SQL datasets: PLForge Simple, PLForge Hard, ProcBench, and WeBridge [16, 50]. ProcArena expands both scale and coverage. The prior test splits contain 209–300 Direct tasks, one dialect, one scenario, and no Interactive episodes. ProcArena contains 3,998 tasks across two dialects and nine subscenarios, including 1,879 Interactive episodes.
ProcArena procedures also contain more statements and have higher cyclomatic complexity on average. They average 32.1 statements and 18.6 cyclomatic complexity, compared with 10.7 statements and 6.8 cyclomatic complexity for PLForge Hard and 29.5 and 9.4 for WeBridge. ProcArena therefore covers more settings and has higher average procedure complexity.
4.2 Corpus Composition
Table 4 breaks down the corpus by subscenario. Direct task counts range from 111 to 120 per dialect. ProcArena contains 1,060 PostgreSQL and 1,059 Oracle Direct tasks. Each Direct task has a paired Interactive episode except B2, which has no Interactive task because it uses a runtime score after semantic-equivalence checking. This pairing yields 940 PostgreSQL and 939 Oracle Interactive episodes. The corpus spans 157 databases; B3 uses 110, while A1 and B2 each use 76.
The Input rows report the mean size of the requirement and task attachment. NL tokens include the requirement and any textual attachment, such as the A2 design document and A3 behavioral examples. Code tokens count PL/SQL code in the attachment. A1–A3 have no code attachment, so their Code-token cells are shown as dashes.
The Reference procedure rows summarize each target procedure and its call suite: statements, lines, parameters, calls, and tables written. Across the corpus, reference procedures average 39.0 lines, 4.0 parameters, 6.3 calls, and 4.9 tables written.
4.3 Interactive Requirement Transformations
Table 5 reports six transformation types for Interactive requirement construction. Section 3.3.1 groups them into Knowledge, Contradiction, and Omission. Knowledge replaces explicit facts with domain
Table 4: ProcArena corpus by subscenario. All gives the per-subscenario mean for task counts, the corpus-wide distinct count for databases, and the per-applicable-task mean for other metrics. A dash denotes a missing Interactive task or a subscenario without a code attachment.
| Metric | A. Synthesis | B. Editing | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| A1 | A2 | A3 | A4 | A5 | B1 | B2 | B3 | B4 | |||
| Scale & coverage | |||||||||||
| Direct, PG | 114 | 119 | 118 | 119 | 111 | 119 | 120 | 120 | 120 | 117.8 | |
| Direct, Oracle | 115 | 116 | 120 | 116 | 118 | 118 | 120 | 120 | 116 | 117.7 | |
| Interactive, PG | 114 | 119 | 118 | 119 | 111 | 119 | - | 120 | 120 | 117.5 | |
| Interactive, Oracle | 115 | 116 | 120 | 116 | 118 | 118 | - | 120 | 116 | 117.4 | |
| Databases | 76 | 85 | 85 | 87 | 88 | 90 | 76 | 110 | 107 | 157 | |
| Input (per task, avg) | |||||||||||
| NL tokens | 609.5 | 898.5 | 764.3 | 1125.6 | 496.4 | 385.5 | 149.3 | 732.2 | 330.9 | 609.6 | |
| Code tokens | - | - | - | 519.4 | 334.3 | 446.5 | 429.1 | 410.2 | 244.7 | 402.3 | |
| Reference procedure (per task, avg) | |||||||||||
| Statements | 36.9 | 31.2 | 43.6 | 40.7 | 22.7 | 41.9 | 15.0 | 26.7 | 30.5 | 32.1 | |
| Lines | 39.8 | 45.4 | 54.4 | 39.2 | 45.1 | 54.5 | 13.3 | 32.7 | 26.7 | 39.0 | |
| Parameters | 4.0 | 4.0 | 4.1 | 3.6 | 4.9 | 3.9 | 3.9 | 3.9 | 4.1 | 4.0 | |
| Calls k | 6.4 | 6.1 | 6.4 | 6.4 | 6.7 | 6.4 | 5.2 | 6.3 | 6.5 | 6.3 | |
| Tables written | 5.1 | 4.8 | 5.8 | 5.9 | 4.2 | 5.8 | 2.3 | 4.6 | 5.2 | 4.9 | |
Table 5: Interactive requirement transformations per task and subscenario. B2 has no Interactive task. Avg reports the mean across Interactive tasks.
| Fact kind | A. Synthesis | B. Editing | Avg | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| A1 | A2 | A3 | A4 | A5 | B1 | B3 | B4 | |||
| Knowledge | ||||||||||
| Jargon (terminology) | 1.89 | 3.01 | 2.05 | 1.00 | 1.56 | 1.81 | 0.00 | 1.07 | 1.54 | |
| Reasoning | 0.84 | 0.78 | 0.86 | 0.43 | 0.76 | 0.84 | 0.00 | 0.85 | 0.67 | |
| Commonsense | 0.84 | 0.79 | 0.82 | 0.37 | 0.74 | 0.79 | 0.00 | 0.83 | 0.65 | |
| Contradiction | ||||||||||
| Requirement | 0.68 | 0.69 | 0.68 | 0.67 | 0.68 | 0.69 | 0.68 | 0.68 | 0.68 | |
| Environment | 0.32 | 0.31 | 0.32 | 0.33 | 0.32 | 0.31 | 0.33 | 0.32 | 0.32 | |
| Omission | ||||||||||
| Omitted facts | 2.00 | 2.60 | 2.00 | 1.99 | 1.58 | 1.94 | 2.00 | 1.00 | 1.89 | |
| Transformed facts | 6.56 | 8.19 | 6.73 | 4.78 | 5.64 | 6.38 | 3.00 | 4.75 | 5.75 | |
terminology, reasoning constraints, or commonsense conventions. Domain definitions enter the elicitation ledger, while reasoning and commonsense rewrites remain in the offline trace. Contradiction introduces incompatible readings within the requirement or between the requirement and the environment. Information Omission removes a registered fact from the visible requirement and stores it in the elicitation ledger.
ProcArena applies 5.75 transformations per Interactive task on average. A4 has fewer reasoning and commonsense rewrites than the other non-B3 subscenarios, while B3 has zero Knowledge transformations. The construction pipeline changes only the requirement, so a subscenario can retain transformations even when its attachment contains much of the target code.
5 EXPERIMENTS
We evaluate seven language models on ProcArena, across nine Direct subscenarios, eight paired Interactive subscenarios, and two SQL dialects. The strongest model reaches 62.2% execution accuracy in the Direct mode and 57.8% in the Interactive mode. Sections 5.2
through 5.5 report what the models achieve and how they fail. Section 5.6 then checks that the task construction and the interactive environment earn their place.
5.1 Experimental Setup
Evaluation Modes. ProcArena presents all nine subscenarios in the Direct mode and eight of them in the Interactive mode. B2 Performance Optimization is Direct-only, because its score is execution time rather than state equality. In the Direct mode the Solver receives the complete requirement and submits one procedure. In the Interactive mode it receives an underspecified requirement. It may ask the User Simulator for a fact with ask_user, confirm a candidate reading with ask_selector, and inspect the database with six environment tools before it submits. Each paired task shares its database description, task attachment, gold procedure, call suite, and initial state.
Evaluation Metrics. Execution accuracy (EX) is the metric for the eight paired subscenarios in both modes. We adapt PLForge's execution-match principle [50] to the stateful behavior of procedural code. EXEC(P, C, ) installs P from the initial state , runs the ordered call suite C, and returns its outputs together with the final persistent state. For a candidate , the task-level execution indicator is
Execution accuracy averages this indicator over tasks.
B2 is scored differently, because its input is a degraded version of the gold procedure and already satisfies Equation 13. Semantic equivalence is therefore a gate rather than a score. An admitted candidate is measured against the gold procedure by two ratios, acceleration and work , where is a median wall-clock time and a deterministic work counter. Both are oriented so that 1.0 means the candidate matched the gold procedure and larger is better. Section 5.3 gives the measurement protocol.
For the Interactive mode we additionally report the number of interaction turns and the total tokens per episode. Retention is defined in Section 5.4, where it is first used.
Baseline Models. We evaluate seven language models: GPT-5.5, GPT-5.4 Mini, and GPT-5.2 [36], Gemini-3.1 Pro [12], GLM-5.3 and GLM-5.2 [11], and DeepSeek V4 Pro [7].
Implementation Details. Every task runs on a freshly restored database, so no episode observes the writes of another. ProcArena ships tasks in two dialects, PL/pgSQL on PostgreSQL 12.22 and Oracle PL/SQL on Oracle Database 21c Express Edition. A single fixed model, DeepSeek V4 Flash, drives the User Simulator across every Solver, so an EX difference between two Solvers never reflects a difference in the simulator. We set reasoning effort to high for every model that exposes it, and we run each task once. The Solver may take at most 60 recorded steps. Its tool budget is units, where is the task's elicitation ledger. ask_user and ask_selector cost two units each, environment tools cost between 0.5 and one unit, and submit is free. Both the budget and the price list are shown to the Solver, and every tool result reports the units spent so far.
Table 6: Interaction lowers accuracy on Synthesis and raises it on Editing. Execution accuracy (%) per subscenario and dialect, with Direct above the shaded band and Interactive below it. Subscenarios run along each category's ordering axis of Section 3.2. Within each mode block, the best value per column is in bold and the second best is .
| Model | PostgreSQL | Oracle | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A. Synthesis | B. Editing | OverallEX | A. Synthesis | B. Editing | OverallEX | |||||||||||||
| A1 | A2 | A3 | A4 | A5 | B1 | B3 | B4 | A1 | A2 | A3 | A4 | A5 | B1 | B3 | B4 | |||
| Direct | ||||||||||||||||||
| DeepSeek V4 Pro | 39.5 | 36.1 | 27.1 | 44.5 | 33.3 | 40.3 | 19.2 | 41.7 | 35.2 | 46.1 | 34.5 | 41.7 | 44.8 | 30.5 | 44.1 | 15.0 | 50.9 | 38.3 |
| GLM-5.2 | 44.7 | 45.4 | 33.9 | 51.3 | 37.8 | 49.6 | 31.7 | 53.3 | 43.5 | 47.0 | 40.5 | 48.3 | 50.9 | 28.0 | 45.8 | 32.5 | 51.7 | 43.0 |
| GLM-5.3 | 62.3 | 52.1 | 50.0 | 59.7 | 57.7 | 61.3 | 29.2 | 65.8 | 54.7 | 52.2 | 47.4 | 52.5 | 49.1 | 28.0 | 52.5 | 46.7 | 54.3 | 47.8 |
| GPT-5.4 Mini | 57.9 | 52.9 | 50.0 | 46.2 | 51.4 | 43.7 | 41.7 | 60.0 | 50.4 | 63.5 | 55.2 | 65.8 | 56.0 | 33.9 | 44.9 | 45.0 | 59.5 | 52.9 |
| GPT-5.2 | 64.9 | 52.9 | 44.1 | 60.5 | 58.6 | 47.1 | 38.3 | 65.0 | 53.8 | 62.6 | 55.2 | 63.3 | 60.3 | 34.7 | 52.5 | 49.2 | 62.9 | 55.1 |
| GPT-5.5 | 68.4 | 58.0 | 55.1 | 70.6 | 64.0 | 58.8 | 63.3 | 69.2 | 63.4 | 64.3 | 55.2 | 66.7 | 60.3 | 36.4 | 59.3 | 68.3 | 67.2 | 59.7 |
| Gemini-3.1 Pro | 67.5 | 58.8 | 55.1 | 74.8 | 59.5 | 64.7 | 54.2 | 69.2 | 63.0 | 64.3 | 55.2 | 64.2 | 62.1 | 36.4 | 62.7 | 80.8 | 65.5 | 61.4 |
| Interactive | ||||||||||||||||||
| DeepSeek V4 Pro | 5.3 | 10.9 | 5.1 | 10.1 | 12.6 | 28.6 | 29.2 | 33.3 | 17.0 | 29.6 | 52.6 | 28.3 | 35.3 | 19.5 | 29.7 | 7.5 | 42.2 | 30.5 |
| GLM-5.2 | 25.4 | 51.3 | 21.2 | 14.3 | 25.2 | 47.9 | 52.5 | 42.5 | 35.2 | 33.0 | 51.7 | 27.5 | 37.1 | 16.9 | 33.1 | 33.3 | 41.4 | 34.2 |
| GLM-5.3 | 53.5 | 73.9 | 49.2 | 26.1 | 31.5 | 60.5 | 55.0 | 53.3 | 50.5 | 51.3 | 72.4 | 49.2 | 45.7 | 23.7 | 53.4 | 52.5 | 53.4 | 50.2 |
| GPT-5.4 Mini | 30.7 | 50.4 | 46.6 | 21.0 | 18.0 | 42.9 | 54.2 | 52.5 | 39.8 | 42.6 | 54.3 | 46.7 | 40.5 | 22.0 | 37.3 | 45.0 | 52.6 | 42.6 |
| GPT-5.2 | 47.4 | 68.1 | 55.1 | 31.1 | 30.6 | 58.0 | 60.8 | 60.8 | 51.7 | 41.7 | 69.0 | 46.7 | 49.1 | 22.0 | 42.4 | 44.2 | 62.1 | 47.1 |
| GPT-5.5 | 37.7 | 52.1 | 38.1 | 49.6 | 44.1 | 71.4 | 71.7 | 78.3 | 55.6 | 57.4 | 79.3 | 53.3 | 57.8 | 29.7 | 54.2 | 70.8 | 64.7 | 58.4 |
| Gemini-3.1 Pro | 39.5 | 61.3 | 31.4 | 43.7 | 44.1 | 79.8 | 74.2 | 75.0 | 56.4 | 51.3 | 75.0 | 54.2 | 52.6 | 28.0 | 63.6 | 76.7 | 71.6 | 59.1 |
5.2 Overall Results
Table 6 reports EX for every model on every subscenario, in both dialects. The Direct block sits above the shaded band and the Interactive block below it. The two blocks use the same paired tasks and the same row order, so a reader compares them cell by cell. B2 is not in this table; Section 5.3 reports it.
Gemini-3.1 Pro is the strongest model in both modes, at 62.2% and 57.8% pooled over the two dialects. GPT-5.5 follows at 61.6% and 57.0%. DeepSeek V4 Pro is last in both, at 36.8% and 23.7%. Even in the Direct mode, where the requirement is complete and no interaction is needed, the best model is wrong on more than a third of the tasks. The two dialects behave alike, and their differences are small and not consistently signed. In the Direct mode Gemini-3.1 Pro scores 63.0% on PostgreSQL and 61.4% on Oracle, while GPT-5.4 Mini scores 50.4% and 52.9%. A5 Orchestration is the hardest subscenario for every model. No model exceeds 49.8% on it in the Direct mode or 36.7% in the Interactive mode. A5 asks the Solver to compose existing procedures into one transactional workflow while respecting their signatures.
The two categories respond to interaction differently. In the Direct mode Synthesis and Editing are close: 59.8% against 66.2% for Gemini-3.1 Pro, and 59.9% against 64.4% for GPT-5.5. In the Interactive mode they separate, to 48.1% against 73.5% for Gemini-3.1 Pro. Two subscenarios even score higher in the Interactive mode. A2 rises from 57.0% to 68.1% for Gemini-3.1 Pro and from 49.8% to 73.2% for GLM-5.3, and B3 rises from 67.5% to 75.5% for Gemini-3.1 Pro.
Two properties of the tasks account for this. An Editing task hands the Solver the procedure it must change, and that attachment already fixes most of what requirement perturbation removed, so less has to be recovered by asking. A2 and B3 are the two subscenarios whose difficulty is grounding rather than specification: A2 must map a design document onto the real schema, and B3 must
reproduce a reported defect. Both gain from the database tools the Interactive mode provides, and here that gain outweighs the missing requirement facts. A Synthesis task offers no such anchor, so it absorbs the full cost of an underspecified requirement.
5.3 Performance Optimization
Figure 4 reports B2, the one subscenario that execution-state equivalence cannot rank; the figure labels the gold procedure as the reference. B2 hands the Solver a degraded version of the gold procedure and asks for a faster one that behaves the same way. The degradation applies real inefficiency patterns: a set-based UPDATE becomes a cursor loop with one statement per row, a join becomes an N+1 lookup, and an aggregate is recomputed inside a loop. The Solver is told that the procedure is correct but slow, and is not told where the inefficiency is. Seven models answer 120 tasks in each dialect, which gives 1,680 measurements.
Acceleration and work are defined in Section 5.1; what remains is how they are measured. Every table is scaled to the row count recorded with the task, inside a transaction that is rolled back afterwards. Each procedure is then timed five times, with the gold procedure, the degraded input and the candidate taking turns in rotating order, so that cache warmth favors none of them. The median of the five runs is reported. We take the ratio between a procedure's own slowest and fastest run as the measurement noise, whose median is 1.66–2.05 on PostgreSQL and 1.42–1.48 on Oracle. Results are aggregated with the harmonic mean, which penalizes a regression instead of letting one large win hide it.
Panel (a) bins the tasks by speedup. Every model matches or beats the gold procedure on most tasks in both dialects. GPT-5.4 Mini places 36% of its PostgreSQL tasks in the 2–10× band. GLM-5.2 has the largest slower block, 14% on PostgreSQL and 17% on Oracle. Panel (b) reports the two harmonic means. Five models sit just above the gold procedure on both. GPT-5.4 Mini has the highest

(a) Distribution of speedup over the reference
(b) Acceleration and work, harmonic means
(c) Answers rejected by the EX
Figure 4: Most candidates match or beat the gold procedure, but two models buy their speed with far more database work. Each model contributes one bar or marker pair per dialect, PostgreSQL then Oracle. Panel (a) stacks the faster speedup bins above the axis and the slower ones below. Panel (b) uses a log axis on which 1.0 matches the gold procedure, and its connector spans the acceleration and work means. In panel (c), a zero marks a model with no rejected task.
acceleration, 1.51, but a work mean of 0.18. GLM-5.2 reaches 0.02 on work, and is the only model whose acceleration falls below the gold procedure, at 0.72. Panel (c) counts the answers the semantic gate rejects, split by compile failure, wrong final state, and runtime error. GPT-5.5, Gemini-3.1 Pro and GPT-5.2 have none in either dialect. GLM-5.2's rejections are mostly a wrong final state, and DeepSeek V4 Pro's are mostly compile errors, seven of its eight on Oracle. Only three of the 1,680 answers raised a runtime error.
Panel (a) counts tasks and panel (b) weighs them, which is why they disagree. GLM-5.2's two worst PostgreSQL answers perform 4,445× and 1,058× the gold procedure's operations. GPT-5.4 Mini's worst performs 516×, and its measured speedup is 0.97, close enough to the gold procedure to disappear into the matched band of panel (a). An answer can therefore look correct on the clock while doing hundreds of times the database work. On a scaled test table those extra operations cost little wall-clock time; on production volumes they would not. The same two models also account for most of the rejected answers, and GLM-5.2's are changes of behavior rather than compile failures. We read this as code that is locally plausible without a model of what the database will actually do, which is why B2 reports work beside time.
5.4 Interaction Analysis
This subsection asks how much accuracy survives requirement resolution, what that costs, and what the cost is spent on. Figure 5 plots Direct and Interactive EX as bars with their ratio as a line, and mean turns as bars with mean total tokens as a line, where tokens are the input plus output usage reported for an episode. Figure 6 gives each model's share of recorded actions over the nine tools, plus one bucket for any action name outside the protocol. Figure 7 gives action counts by recorded step for four models spanning the Interactive EX range. It plots counts rather than shares, so the outline of each stack is that model's episode attrition. All three pool the paired PostgreSQL and Oracle tasks.

(a) EX and retention
(b) Interaction cost
Figure 5: Interaction cost does not predict retention. Panel (a): Direct and Interactive EX as bars, their ratio as a line. Panel (b): mean turns as bars, mean tokens per episode as a line.
Retention is Interactive EX divided by Direct EX. It measures how much of a model's own generation ability survives requirement resolution. Raw Interactive EX cannot measure this, because a model with weak generation and strong elicitation scores like a model with the opposite profile.
GLM-5.3 retains the most, 98.2%, and DeepSeek V4 Pro the least, 64.5%. The other five fall between 79.4% and 92.6%. Cost does not follow. GPT-5.5 spends the fewest tokens, 38.5k per episode, and the second fewest turns, 7.1, yet retains 92.6%. GLM-5.2 spends the most of both, 123.8k tokens over 19.8 turns, and retains 80.2%. DeepSeek V4 Pro spends the fewest turns, 6.9, and retains the least.
Figure 6 shows what the turns are spent on, and the models split into two strategies. GLM-5.3 spends 54.5% of its actions on execute_scratch, GLM-5.2 40.0%, and Gemini-3.1 Pro 39.1%; these models iterate against a private copy of the database. GPT-5.5 spends 7.2% there, and 18.0% on sample_rows and 18.1% on compile_plsql instead: it reads the data and compiles the code
| Gemini 3.1 Pro | 9.30 | 2.13 | 2.97 | 9.82 | 39.05 | 1.11 | 14.40 | 12.02 | 9.20 | 0.00 |
|---|---|---|---|---|---|---|---|---|---|---|
| GPT-5.5 | 13.54 | 5.32 | 17.97 | 18.14 | 7.22 | 0.08 | 15.08 | 8.36 | 14.30 | 0.00 |
| GLM-5.3 | 6.60 | 1.32 | 9.67 | 5.58 | 54.45 | 3.26 | 7.95 | 4.49 | 6.63 | 0.07 |
| GPT-5.2 | 6.26 | 9.25 | 17.42 | 14.35 | 33.31 | 4.10 | 6.80 | 2.43 | 6.08 | 0.00 |
| GPT-5.4M | 9.68 | 5.44 | 22.14 | 20.56 | 13.76 | 0.56 | 12.40 | 4.83 | 10.63 | 0.00 |
| GLM-5.2 | 4.99 | 11.45 | 14.51 | 6.97 | 40.04 | 3.08 | 6.46 | 7.13 | 5.08 | 0.29 |
| DS-V4-Pro | 9.99 | 12.06 | 3.59 | 15.54 | 18.23 | 2.48 | 19.19 | 2.51 | 16.01 | 0.39 |
| get_schema | describe_table | sample_rows | compile_plsql | execute_scratch | reset_scratch | ask_user | ask_selector | submit | malformed/other |
Figure 6: Models split between iterating against the database and inspecting it. Share of all recorded actions per model. Tool names are verbatim from the traces; names outside the protocol are grouped as malformed/other.
rather than running it. The two channels to the User Simulator split the models the same way. DeepSeek V4 Pro asks the most, 19.2% of its actions on ask_user, and confirms the least, 2.5% on ask_selector. Gemini-3.1 Pro inverts this, at 12.0% on ask_selector, the highest in the figure. Action names outside the protocol never exceed 0.4%, so tool-call formatting affects none of these numbers.
Figure 7 places the same behavior in time. Gemini-3.1 Pro concentrates ask_user in steps two to five and then stops asking. GLM-5.3's execute_scratch band runs to step 25, and its episodes are the longest in the figure. DeepSeek V4 Pro's episodes are nearly over by step ten.
Both strategies work. GLM-5.3 iterates against the database and GPT-5.5 barely does, yet they are the two models that retain the most, at 98.2% and 92.6%, and GPT-5.5 reaches its figure on less than half the tokens. Neither the volume of interaction nor the volume of questions predicts retention. What fails is the absence of a strategy rather than the choice between them: DeepSeek V4 Pro takes the fewest turns, spends the largest share of them asking, confirms the fewest readings, and retains the least. Retention is also unstable when the denominator is small, so GLM-5.3's 98.2% should be read against its Direct EX of 51.3%.
5.5 Error Analysis
Figure 8 reports Interactive failures by type, as a percentage of the tasks each model ran, so a cell reads directly against the Interactive EX columns of Table 6. Schema is a wrong table or column, Control flow a wrong branch or loop, State effect a wrong persistent write, Exception a remaining runtime call failure, and Contract an installation or interface mismatch. We assign these types after evaluation with deterministic rules. Schema and Contract come from installation, interface, argument, signature, component-use, and database diagnostics, and a remaining runtime call failure becomes Exception. For a state mismatch, a lexical comparison of branch,

Figure 7: Models follow visibly different interaction trajectories. Action counts by recorded step, two models per row with shared axes. The bands use the tool names of Figure 6.
loop and return structure between the candidate and the gold procedure separates Control flow from State effect. This comparison is used only in post-hoc analysis and is never shown to the Solver.
Control flow is the largest category for six of the seven models, between 17.6% and 31.2%. State effect is second, between 7.9% and 15.4%. Exception is negligible everywhere, at most 2.9%. GLM-5.2 has the highest rate in both dominant categories, 31.2% and 15.4%. Gemini-3.1 Pro and GPT-5.5 have the lowest rates in almost every category. DeepSeek V4 Pro has a different profile: its Schema rate is 20.1% and its Contract rate is 27.9%, several times any other model's, while its control-flow rate is the lowest at 17.6%.
Models rarely crash. They compile, they run, and they compute the wrong thing. Two of the five categories have no analogue in declarative SQL, because a query has no branch or loop to get wrong and no persistent write to get wrong. Together they account for between 25.5% and 46.6% of the tasks each model ran. DeepSeek V4 Pro is the one model that fails before the logic rather than in it. Its wrong tables and wrong signatures are consistent with its low retention in Section 5.4, and with the fact that it asks many questions but confirms few readings.
5.6 Benchmark Validation
To verify the reliability of the User Simulator, we conduct a human audit of its ask_user replies (Figure 9). We sample 180 turns stratified over solver models and sub-scenarios, one third from the LOC pool; auditors blind to model identity judged each reply against the task's oracle evidence for acceptability, failure reason, and answer leakage. Overall, 85.6% of replies are acceptable and the residual failures scatter over six categories with no dominant mode (a); LOC-pool replies pass at a similar rate, with only 3.3% leaking answer content (b). The simulator thus provides reliable feedback with negligible answer leakage.
6 RELATED WORK
NL-to-PL/SQL. To the best of our knowledge, PLForge [50] represents the first study specifically targeting NL-to-PL/SQL, achieving
| Gemini 3.1 Pro | 5.7 | 18.9 | 10.1 | 1.1 | 6.4 |
|---|---|---|---|---|---|
| GPT-5.5 | 7.1 | 18.3 | 10.1 | 0.7 | 6.9 |
| GLM-5.3 | 0.3 | 22.4 | 13.7 | 1.6 | 11.7 |
| GPT-5.2 | 1.4 | 25.1 | 11.6 | 0.7 | 11.8 |
| GPT-5.4M | 4.4 | 26.7 | 14.6 | 1.2 | 11.9 |
| GLM-5.2 | 3.5 | 31.2 | 15.4 | 2.9 | 12.3 |
| DS-V4-Pro | 20.1 | 17.6 | 7.9 | 2.8 | 27.9 |
| Schema | Control flow | State effect | Exception | Contract |
Figure 8: Control flow and persistent state dominate, and neither exists in declarative SQL. Failures by error type in the Interactive mode, as a percentage of the tasks each model ran.
Table 7: Every construction operation lowers EX on its own, and the full pipeline lowers it most. Base is EX (%); indented rows are paired percentage-point changes against the same tasks.
| Condition | GPT-5.5 | Gemini-3.1 Pro | GPT-5.2 | GLM-5.2 |
|---|---|---|---|---|
| Direct task | 86.67 | 82.92 | 72.92 | 73.33 |
| + Knowledge injection | -16.27 | -9.09 | -13.40 | -25.36 |
| + Contradiction injection | -10.92 | -13.87 | -10.92 | -15.13 |
| + Requirement omission | -10.82 | -3.90 | -7.79 | -25.54 |
| Direct task + all three methods | -23.35 | -17.18 | -22.91 | -39.21 |
SOTA performance through continued pre-training on a PL/SQL-centric corpus. However, PLForge relies on a template-based method for dataset generation, which may restrict syntactic diversity and limit its ability to reflect the complex distribution of real-world workloads. Although real-world procedural workloads also contain UDFs and triggers [14], both PLForge and the current version of ProcArena focus on SPs. ProcArena instead broadens evaluation along a different dimension by covering multiple SP development scenarios in both direct and interactive settings.
Text-to-SQL. Recent progress on Text-to-SQL is increasingly driven by language models, involving two main directions: supervised PLM-based encoder-decoder parsers and LLM-based approaches utilizing prompting and workflows. PLM-based encoder-decoder parsers typically map serialized inputs to SQL. Key enhancements include injecting graph structures for schema-aware learning [4, 26], utilizing intermediate representations to decouple schema linking [10, 13, 24], and applying constrained decoding to ensure syntactic validity [44]. These methods establish reliable baselines for encoding and constraining schema information. LLM-based Text-to-SQL methods have shifted Text-to-SQL toward prompt-centric and agentic paradigms [15, 29, 32], including in-context learning (ICL), fine-tuning (FT), and agentic workflows. ICL exploits prompting via decomposition and execution-guided refinement [15, 29, 39], improving schema grounding through retrieval and dynamic few-shot construction [28, 41, 48]. FT approaches adapt models for

(a) Outcome and failure breakdown (b) LOC audit summary
Figure 9: Human audit (a) Pass rate and failure reasons over all audited ask_user replies. (b) The same audit restricted to the sampled LOC pool.
controllability, leveraging domain-oriented training [23, 25, 37, 46] and structural constraints [42, 51]. Agentic workflows treat synthesis as an iterative process involving planning and feedback, exemplified by MCTS-based Alpha-SQL [22], multi-agent collaboration [47], and user-in-the-loop clarification [34, 52]. Although BIRD-INTERACT [18] introduces dynamic and stateful multi-turn evaluation for Text-to-SQL, it remains focused on SQL statements and does not evaluate dialogue-based alignment and revision of procedural PL/SQL specifications.
Code Language Models. Existing code language models [17, 20, 30, 43] rely on massive polyglot training data to achieve broad coverage. However, this general-purpose objective often leads to suboptimal performance on specialized, low-resource languages such as PL/SQL. The scarcity of high-quality PL/SQL data in public repositories remains a major obstacle to PL/SQL-specific model adaptation. Rather than proposing a new model-specialization method, ProcArena complements existing model-centric research with a model-agnostic, executable benchmark for evaluating procedural database programming across multiple development and interaction settings.
7 CONCLUSION
We proposed ProcArena, to our knowledge the first benchmark to evaluate LLMs on NL-to-PL/SQL across multiple development scenarios in both Direct and Interactive modes: an executable suite of 3,998 tasks spanning nine Direct subscenarios and eight paired Interactive subscenarios in two dialects. Iterative Logic Enhancement, live validation, and scenario-specific adapters constructed verifiable Direct tasks, from which Knowledge Integration and Requirement Perturbation derived paired Interactive tasks whose executable target an isolated Offline Evaluator preserved. Across seven models, the strongest reached 62.2% execution accuracy in the Direct mode and 57.8% in the Interactive mode, interaction cost accuracy on Synthesis and recovered it on Editing, and failures concentrated in control flow and persistent state, the two error types that declarative SQL does not have. We released the benchmark, the interaction traces, and the construction pipeline for reproducible evaluation.
REFERENCES
[1] 2025. Oracle Help Center. https://docs.oracle.com/en/
[2] 2025. PostgreSQL Documentation. https://www.postgreSQL.org/docs/
[3] Itzik Ben-Gan, Dejan Sarka, Roger Wolter, Greg Low, Ed Katibah, and Isaac Kunen. 2009. Inside Microsoft SQL Server 2008 T-SQL Programming. Microsoft Press.
[4] Ruisheng Cao, Lu Chen, Zhi Chen, Yanbin Zhao, Su Zhu, and Kai Yu. 2021. LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relations. ArXiv abs/2106.01093 (2021).
[5] Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde De Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374 (2021).
[6] Vinicius Ferreira de Sousa, Cláudio de Souza Baptista, André Luiz Firmino Alves, and Hugo Feitosa de Figueiredo. 2025. Effectiveness of small and large language models for PL/SQL bad smell detection. In Simpósio Brasileiro de Banco de Dados (SBBD). SBC, 399–412.
[7] DeepSeek-AI. 2026. DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence. ArXiv preprint arXiv:2606.19348 (2026).
[8] Korry Douglas and Susan Douglas. 2003. PostgreSQL: a comprehensive guide to building, programming, and administering PostgreSQL databases. SAMS publishing.
[9] Steven Feuerstein and Bill Pribyl. 2005. Oracle pl/sql Programming. O'Reilly Media, Inc.
[10] Yujian Gan, Xinyun Chen, Jinxia Xie, Matthew Purver, John Robert Woodward, John Drake, and Qiaofu Zhang. 2021. Natural SQL: Making SQL Easier to Infer from Natural Language Specifications. In Conference on Empirical Methods in Natural Language Processing.
[11] GLM-5 Team. 2026. GLM-5: from Vibe Coding to Agentic Engineering. arXiv preprint arXiv:2602.15763 (2026).
[12] Google DeepMind. 2025. Gemini 3. https://deepmind.google/models/gemini/. Accessed: 2026-04-18.
[13] Jiaqi Guo, Zecheng Zhan, Yan Gao, Yan Xiao, Jian-Guang Lou, Ting Liu, and D. Zhang. 2019. Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representation. ArXiv abs/1905.08205 (2019).
[14] Surabhi Gupta and Karthik Ramachandra. 2021. Procedural Extensions of SQL: Understanding their usage in the wild. Proceedings of the VLDB Endowment 14, 8 (2021), 1378–1391.
[15] Zijin Hong, Zheng Yuan, Qinggang Zhang, Hao Chen, Junnan Dong, Feiran Huang, and Xiao Huang. 2024. Next-Generation Database Interfaces: A Survey of LLM-Based Text-to-SQL. IEEE Transactions on Knowledge and Data Engineering 37 (2024), 7328–7345.
[16] Gansen Hu, Zhaoguo Wang, Chuzhe Tang, Jiahuan Shen, Zhiyuan Dong, Sheng Yao, and Haibo Chen. 2024. WeBridge: Synthesizing Stored Procedures for Large-Scale Real-World Web Applications. Proceedings of the ACM on Management of Data 2, 1 (2024), 1–29.
[17] Binyuan Hui, Jian Yang, Zeyu Cui, Jiaxi Yang, Dayiheng Liu, Lei Zhang, Tianyu Liu, Jiajun Zhang, Bowen Yu, Keming Lu, et al. 2024. Qwen2. 5-coder technical report. arXiv preprint arXiv:2409.12186 (2024).
[18] Nan Huo, Xiaohan Xu, Jinyang Li, Per Jacobsson, Shipei Lin, Bowen Qin, Binyuan Hui, Xiaolong Li, Ge Qu, Shuzheng Si, et al. 2026. BIRD-INTERACT: Re-imaging Text-to-SQL Evaluation via Lens of Dynamic Interactions. In International Conference on Learning Representations, Vol. 2026. 44285–44333.
[19] Naman Jain, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang, Armando Solar-Lezama, Koushik Sen, and Ion Stoica. 2025. Livecodebench: Holistic and contamination free evaluation of large language models for code. In International Conference on Learning Representations, Vol. 2025. 58791–58831.
[20] Juyong Jiang, Fan Wang, Jiasi Shen, Sungju Kim, and Sunghun Kim. 2024. A survey on large language models for code generation. arXiv preprint arXiv:2406.00515 (2024).
[21] Fangyu Lei, Jixuan Chen, Yuxiao Ye, Ruisheng Cao, Dongchan Shin, Hongjin SU, ZHAOQING SUO, Hongcheng Gao, Wenjing Hu, Pengcheng Yin, Victor Zhong, Caiming Xiong, Ruoxi Sun, Qian Liu, Sida Wang, and Tao Yu. 2025. Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows. In The Thirteenth International Conference on Learning Representations.
[22] Boyan Li, Jiayi Zhang, Ju Fan, Yanwei Xu, Chong Chen, Nan Tang, and Yuyu Luo. 2025. Alpha-SQL: Zero-Shot Text-to-SQL using Monte Carlo Tree Search. In Forty-second International Conference on Machine Learning.
[23] Haoyang Li, Shang Wu, Xiaokang Zhang, Xinmei Huang, Jing Zhang, Fuxin Jiang, Shuai Wang, Tieying Zhang, Jianjun Chen, Rui Shi, Hong Chen, and Cuiping Li. 2025. OmniSQL: Synthesizing High-Quality Text-to-SQL Data at Scale. Proc. VLDB Endow 18, 11 (July 2025), 4695–4709. https://doi.org/10.14778/3749646.3749723
[24] Haoyang Li, Jing Zhang, Cuiping Li, and Hong Chen. 2023. RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL. In AAAI Conference on Artificial Intelligence.
[25] Haoyang Li, Jing Zhang, Hanbing Liu, Ju Fan, Xiaokang Zhang, Jun Zhu, Renjie Wei, Hongyan Pan, Cuiping Li, and Hong Chen. 2024. CodeS: Towards Building Open-source Language Models for Text-to-SQL. Proceedings of the ACM on Management of Data 2 (2024), 1–28.
[26] Jinyang Li, Binyuan Hui, Reynold Cheng, Bowen Qin, Chenhao Ma, Nan Huo, Fei Huang, Wenyu Du, Luo Si, and Yongbin Li. 2023. Graphix-T5: Mixing Pre-Trained Transformers with Graph-Aware Layers for Text-to-SQL Parsing. ArXiv abs/2301.07507 (2023).
[27] Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Binhua Li, Bowen Li, Bailin Wang, Bowen Qin, Ruiying Geng, Nan Huo, Xuanhe Zhou, Chenhao Ma, Guoliang Li, Kevin C.C. Chang, Fei Huang, Reynold Cheng, and Yongbin Li. 2023. Can LLM already serve as a database interface? a big bench for large-scale database grounded text-to-SQLs. In Proceedings of the 37th International Conference on Neural Information Processing Systems. Red Hook, NY, USA, Article 1835, 28 pages.
[28] Xiuwen Li, Qifeng Cai, Yang Shu, Chenjuan Guo, and Bin Yang. 2025. AID-SQL: Adaptive In-Context Learning of Text-to-SQL with Difficulty-Aware Instruction and Retrieval-Augmented Generation. 2025 IEEE 41st International Conference on Data Engineering (ICDE) (2025), 3945–3957.
[29] Xinyu Liu, Shuyu Shen, Boyan Li, Peixian Ma, Runzhi Jiang, Yu xin Zhang, Ju Fan, Guoliang Li, Nan Tang, and Yuyu Luo. 2024. A Survey of Text-to-SQL in the Era of LLMs: Where Are We, and Where Are We Going? IEEE Transactions on Knowledge and Data Engineering 37 (2024), 5735–5754.
[30] Anton Lozhkov, Raymond Li, Loubna Ben Allal, Federico Cassano, Joel Lamy-Poirier, Nouamane Tazi, Ao Tang, Dmytro Pykhtar, Jiawei Liu, Yuxiang Wei, et al. 2024. Starcoder 2 and the stack v2: The next generation. arXiv preprint arXiv:2402.19173 (2024).
[31] Shuai Lu, Daya Guo, Shuo Ren, Junjie Huang, Alexey Svyatkovskiy, Ambrosio Blanco, Colin Clement, Dawn Drain, Daxin Jiang, Duyu Tang, et al. 2021. Codexglue: A machine learning benchmark dataset for code understanding and generation. arXiv preprint arXiv:2102.04664 (2021).
[32] Yuyu Luo, Guoliang Li, Ju Fan, Chengliang Chai, and Nan Tang. 2025. Natural Language to SQL: State of the Art and Open Problems. Proc. VLDB Endow. 18 (2025), 5466–5471.
[33] Xutao Mao, Dixuan Zhang, Yifan Li, Jiaming Hou, Rui Li, YunLong Li, Aoze Zheng, Zhiqiang Zhang, Luo Zhewei, Hongying Zan, et al. 2026. LogicCat: A Chain-of-Thought Text-to-SQL Benchmark for Complex Reasoning. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 40. 29958–29966.
[34] Aritra Mazumder, Parth Desai, Fuheng Zhao, and Anna Fariba. 2026. Atom-SQL: Interactive Disambiguation of NL-to-SQL via User-Guided Atom-Level Alignment. Proceedings of the VLDB Endowment 19 (2026).
[35] Microsoft n.d.: Azure SQL Database. https://azure.microsoft.com/en-us/services/sql-database/. Accessed: 2026-01-16.
[36] OpenAI. 2025. Introducing GPT-5. https://openai.com/index/introducing-gpt-5/. Accessed: 2026-04-18.
[37] Minjun Park, Yongju Seong, Myoseop Sim, Kyungkoo Min, and Stanley Jungkyu Choi. 2026. ReSQL: Self-Improving Framework for Reasoning-Aware Text-to-SQL Dataset Generation. In Findings of the Association for Computational Linguistics: ACL 2026. 33582–33602.
[38] Andrew Pavlo. 2017. What Are We Doing With Our Lives? Nobody Cares About Our Concurrency Control Research. In Proceedings of the 2017 ACM International Conference on Management of Data. 3. https://doi.org/10.1145/3035918.3056096
[39] Mohammadreza Pourreza and Davood Rafiei. 2024. Din-sql: Decomposed in-context learning of text-to-sql with self-correction. Advances in Neural Information Processing Systems 36 (2024).
[40] Nishat Raihan, Antonios Anastasopoulos, and Marcos Zampieri. 2025. mHumanEval-a multilingual benchmark to evaluate large language models for code generation. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers). 11432–11461.
[41] Tonghui Ren, Yuankai Fan, Zhenying He, Ren Huang, Jiaqi Dai, Can Huang, Yinan Jing, Kai Zhang, Yifan Yang, and Xiaoyang Sean Wang. 2024. PURPLE: Making a Large Language Model a Better SQL Writer. 2024 IEEE 40th ICDE (2024), 15–28.
[42] Tonghui Ren, Chen Ke, Yuankai Fan, Yinan Jing, Zhenying He, Kai Zhang, and Xiaoyang Sean Wang. 2025. The Power of Constraints in Natural Language to SQL Translation. Proc. VLDB Endow 18 (2025), 2097–2111.
[43] Baptiste Roziere, Jonas Gehring, Fabian Gloeckle, Sten Sootla, Itai Gat, Xiaoging Yan, Tossi Adi, Jingyu Liu, Tal Remez, Jéremy Rapin, et al. 2023. Code llama: Open foundation models for code. arXiv preprint arXiv:2308.12950 (2023).
[44] Torsten Scholak, Nathan Schucher, and Dzmitry Bahdanau. 2021. PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. 9895–9901.
[45] Liang Shi, Zhengju Tang, Nan Zhang, Xiaotong Zhang, and Zhi Yang. 2025. A Survey on Employing Large Language Models for Text-to-SQL Tasks. ACM Comput. Surv. 58, 2, Article 54 (Sept. 2025), 37 pages. https://doi.org/10.1145/3737873
[46] Marko Sterbentz, Kevin Cushing, Cameron Barrie, and Kristian J Hammond. 2026. RingSQL: Generating Synthetic Data with Schema-Independent Templates for Text-to-SQL Reasoning Models. arXiv preprint arXiv:2601.05451 (2026).
[47] Bing Wang, Changyu Ren, Jian Yang, Xinnian Liang, Jiaqi Bai, Qian-Wen Zhang, Zhao Yan, and Zhoujun Li. 2023. MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQL. In International Conference on Computational Linguistics.
[48] Xiangjin Xie, Guangwei Xu, Lingyan Zhao, and Rui Guo. 2025. OpenSearch-SQL: Enhancing Text-to-SQL with Dynamic Few-shot and Consistency Alignment. Proceedings of the ACM on Management of Data 3 (2025), 1 – 24.
[49] Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, et al. 2018. Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and
Text-to-SQL Task. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. 3911–3921.
[50] Hang Zhang, Chaokun Wang, Hongwei Li, Cheng Wu, Songyao Wang, Yabin Liu, Gengyuan Shi, and Ziyang Liu. 2025. PLForge: Enhancing Language Models for Natural Language to Procedural Extensions of SQL. Proc. ACM Manag. Data 3, 6, Article 348 (Dec. 2025), 28 pages. https://doi.org/10.1145/3769813
[51] Qinggang Zhang, Hao Chen, Junnan Dong, Shengyuan Chen, Feiran Huang, and Xiao Huang. 2025. Structure-Guided Large Language Models for Text-to-SQL Generation. In Forty-second International Conference on Machine Learning.
[52] Fuheng Zhao, Shaleen Deep, Fotis Psallidas, Avrilia Floratou, Divyakant Agrawal, and A. El Abbadi. 2024. Spinteract: Resolving Ambiguities in NL2SQL Through User Interaction. Proc. VLDB Endow 18 (2024), 1145–1158.