BIRD-Persona: A Persona-Aware Benchmark for SQL and pandas Analytics Code Generation

Davin Hill, Pawan Chorasiya, Bhawani S. Leelar, Oren Avram, Robert E. Tillman, Tamer SolimanarXiv 2026 · DOI

Whether you’re a data scientist wrestling with a messy dataframe or a business analyst just trying to get a straight answer from a database, you’ve likely noticed that how you ask a question changes the quality of the answer you get.

In the world of Large Language Models (LLMs), this is known as the "persona" problem. A new paper from the team at Optum AI introduces BIRD-Persona, a benchmark designed to figure out why LLMs are better at writing SQL than pandas, and how the way we phrase our requests—as a "novice" or an "expert"—shifts the goalposts.

TL;DR

BIRD-Persona is a new benchmark that reveals a persistent "SQL-over-pandas" gap: LLMs are significantly more reliable at generating database queries than data-science code for the exact same tasks. By testing "novice" (business-speak) versus "expert" (technical-speak) phrasings, the researchers show that while being specific helps everyone, it gives SQL a much bigger boost, highlighting that the target language matters just as much as the prompt.

What Problem Does This Paper Address?

We are increasingly using LLMs to translate natural language into code. Usually, this falls into two buckets: Text-to-SQL (for relational databases) and Text-to-Python/pandas (for tabular data manipulation).

The challenge is that these two paradigms are fundamentally different. SQL is declarative (you describe what you want), while pandas is procedural (you describe the steps to get it). Existing benchmarks often look at one or the other, but they don't isolate the variables. If a model fails, was it because the question was vague? Because the schema was complex? Or because pandas is just inherently harder for an LLM to "think" in?

BIRD-Persona introduces "persona-stratified" questions—rewriting the same task for different user types—to see exactly where these systems break down.

Methods

The researchers took 1,534 tasks from the BIRD-Python dataset and extended them in three clever ways:

  1. Persona Rewrites: They used an LLM to generate two new versions of every question:
  2. Novice: Business-style phrasing using application terms (e.g., "Show me the biggest recent order").
  3. Expert: Technical-style phrasing that explicitly names tables and columns (e.g., "Return the order_id with max total_amount").
  4. Persona Score (PS): They developed a metric to quantify "explicitness"—how much of the underlying database schema is actually mentioned in the prompt.
  5. Structural Complexity Score (SCS): They parsed the "gold standard" SQL to count things like joins, subqueries, and aggregations to measure task difficulty objectively.

They then ran over 245,000 evaluations across nine different LLMs (including Gemini, GPT, Qwen, and GLM) to see how they handled these variations.

Table 1: Persona rewrite controls used to separate business-style and schema-explicit phrasings.

Datasets

The study centers on BIRD-Persona, which is an extension of the BIRD-Python dataset.

  • Tasks: 1,534 unique analytics tasks.
  • Ground Truth: Each task has a "gold" SQL query and a "gold" pandas implementation that produce the same result.
  • Schema Variants: They also tested three ways of presenting the database structure to the model: raw DDL (SQL CREATE TABLE statements), a "cognitive catalog" (metadata-rich descriptions), and an LLM-enriched version of that catalog.

Key Insights and Ideas

  • The SQL Supremacy: In 8 out of 9 models, SQL outperformed pandas. This suggests that the declarative nature of SQL is a better "fit" for LLM reasoning than the step-by-step logic required for pandas.
  • The "Expert" Multiplier: Moving from a novice prompt to an expert prompt improves performance for both SQL and pandas, but the gain is much larger for SQL. When you name the columns, the LLM knows exactly which SQL clauses to fill in.
  • The Projection Burden: One of the most interesting "aha" moments was that pandas struggles specifically with the "selected-column burden." In pandas, you often have to explicitly carry columns through intermediate dataframes. If a task requires selecting many columns, the pandas-SQL gap widens significantly.
  • Subqueries aren't the Bogeyman: Surprisingly, while subqueries make a task harder overall, they don't make pandas uniquely worse. Models seem capable of decomposing nested SQL logic into sequential pandas steps.

Key Results

The quantitative gap is striking. As shown in the evaluation summary, the jump in accuracy when moving to "Expert" prompts is massive.

Table 6: Execution accuracy by persona, schema representation, and binned SCS.
  • Expert Prompts: Reached 88.9% accuracy for SQL vs. 76.6% for pandas.
  • Novice Prompts: Dropped to 56.1% for SQL and 49.4% for pandas.
  • The Outlier: Gemma-4-26B was the only model where pandas beat SQL, but the authors noted this was largely due to the model's high rate of SQL syntax errors rather than a superior understanding of Python.

Limitations and Future Work

The authors are transparent about a few hurdles:

  • Information vs. Register: Expert prompts aren't just "technical"; they are also longer and contain more information. It’s hard to tell if the LLM likes the style of the expert or just the extra data provided.
  • LLM-Generated Benchmarks: The personas were generated by GPT-5.2. While audited by humans, there's always a risk of "model-to-model" bias where the evaluated models find the generator's style easier to parse.
  • Future Directions: The team suggests that future work should look at "schema-fixed, length-matched" ablations to truly isolate the effect of linguistic register from information content.

In short: if you want an LLM to get your data right, try to speak its language—and if you have the choice, ask for SQL.

Summary updated

Abstract

Production text-to-code systems use large language models to turn natural-language analytics requests into executable SQL and pandas code. Existing benchmarks cover both tasks but do not isolate when performance diverges between them. We introduce BIRD-Persona, a persona-stratified extension of BIRD-Python that adds novice and expert rewrites to tasks with matched SQL and pandas ground truth, along with schema variants and task-structure annotations. Across 1,534 tasks, nine models, and 245,592 evaluations, SQL outperforms pandas for eight of nine systems. The gap varies by condition: expert, schema-explicit prompts improve both paradigms but help SQL more; schema representations have mixed, model-dependent effects; and selected-column burden widens the gap while subqueries do not. By making user phrasing a controlled benchmark dimension, BIRD-Persona supports persona-aware and paradigm-aware evaluation of natural-language analytics systems. The dataset is available at https://huggingface.co/datasets/optum-cognition-lab/BIRD-Persona.
BibTeX
@misc{hill2026bird,
  author = {Davin Hill and Pawan Chorasiya and Bhawani S. Leelar and Oren Avram and Robert E. Tillman and Tamer Soliman},
  title = {{BIRD-Persona: A Persona-Aware Benchmark for SQL and pandas Analytics Code Generation}},
  year = {2026},
  eprint = {2611.28542},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.28542},
}
Figure