NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ORCA: Evaluating LLMs on Data Science Code Translation

Xiaolong Li, Jinyang Li, Bowen Qin, Ge Qu, Nan Huo, Xiaohan Xu, Shipei Lin, Reynold ChengarXiv 2026

While Large Language Models (LLMs) have become remarkably good at writing code from scratch, they often stumble when asked to "translate" existing code from one library to another—for example, moving a data pipeline from Pandas to SQL or a neural network from PyTorch to TensorFlow.

A new paper from researchers at the University of Hong Kong and other institutions introduces ORCA, a comprehensive benchmark designed to evaluate and improve LLMs on Data Science Code Translation (DSCT). Their findings suggest that while frontier models are capable, they are far from reliable for automated migration in production environments.

TL;DR

ORCA is a new, large-scale benchmark for evaluating how LLMs translate code across data science libraries, featuring 1,600 snippet-level and 200 project-level tasks. The study reveals that even top-tier models like Claude 3.5 Opus struggle with complex migrations, but performance can be significantly improved by first asking the model to explain the "intent" of the source code.

What Problem Does This Paper Address?

Data scientists frequently need to migrate code between ecosystems—perhaps moving a Pandas analysis into a production SQL database for speed, or porting a legacy NumPy script to a modern framework. This process, known as Data Science Code Translation (DSCT), is notoriously difficult because it requires more than just swapping function names. It requires maintaining "functional equivalence": the translated code must produce the exact same numerical results, handle the same edge cases, and maintain data types across complex pipelines.

Existing benchmarks mostly focus on generation (Natural Language to Code) or general-purpose language migration (e.g., Java to Python). ORCA fills the gap by focusing specifically on the data-centric nuances of libraries like PyTorch, TensorFlow, Pandas, and SQL.

Figure 1: ORCA evaluates DSCT by providing a model with source code S, associated data D, and translation requirement R, requiring translated target code T that is verified by execution-based test cases. ORCA supports both grounding-level tasks and project-level tasks.

Methods

The researchers constructed ORCA with two distinct levels of difficulty:

  1. ORCA-MAIN (Grounding Level): 1,600 tasks focused on translating short code snippets across three domains: Data Querying (DQ), Data Manipulation (DM), and Deep Learning (DL).
  2. ORCA-PROJECT (Project Level): 200 tasks involving complete data science projects. These require the model to maintain consistency across multiple files and stages (loading, preprocessing, modeling).

To ensure high quality, the benchmark uses execution-based evaluation. Instead of just checking if the code "looks" right, ORCA runs the translated code against real data and compares the output to a reference implementation. They also introduced a multi-stage verification process where human experts checked for test case robustness and code reliability.

Finally, the authors proposed an Intent-Augmented method. Instead of translating directly, the model first generates a natural language description of what the code is trying to achieve (the intent) and then uses that description as a guide for the translation.

Datasets

ORCA was built by curating and adapting data from several high-quality sources:

  • SQL Queries: Sampled from BIRD-SQL and LiveSQLBench.
  • Python Snippets: Collected from Stack Overflow posts with high community scores.
  • Full Projects: Sourced from GitHub repositories and Kaggle notebooks, then containerized using Docker to ensure reproducible environments.

Compared to previous benchmarks, ORCA tasks are significantly longer (averaging ~744 lines for projects) and cover a wider array of 21 different data science libraries.

Figure 3: Distribution summary of ORCA-MAIN operation categories and ORCA-PROJECT task types.

Key Insights and Ideas

  • Directional Asymmetry: Translation is not a two-way street. For instance, translating PostgreSQL to Pandas is significantly harder than the reverse. This is because SQL is declarative (you describe what you want), while Pandas is imperative (you describe how to get it). It is easier for a model to go from a "step-by-step" implementation to a high-level query than to "unroll" a compact SQL query into a sequence of Pandas operations.
  • The "Intent" Bridge: Natural language acts as a powerful intermediate representation. By forcing the model to articulate the logic in plain English first, it avoids getting "distracted" by library-specific syntax and focuses on the underlying mathematical or logical operation.
  • Cross-Stage Fragility: In project-level tasks, the most common failure mode (38% of cases) is "cross-stage data mismatches." A model might translate the preprocessing script correctly in isolation, but change a column name or a data type in a way that breaks the subsequent training script.
Figure 4: ORCA-MAIN average SR across translation directions.

Key Results

The results highlight a significant "capability gap":

  • Frontier Models: Claude-Opus-4.6 was the strongest performer, yet it only achieved a 56.92% success rate on ORCA-MAIN and a lowly 33.67% on ORCA-PROJECT.
  • Open Source: Models like DeepSeek-V3 and Qwen2.5-Coder-32B showed promise but generally lagged behind proprietary models, especially on complex project-level tasks.
  • Intent-Augmentation Works: Using the intent-augmented approach provided an absolute success-rate gain of 4.80% on snippets and 5.33% on projects, proving that "thinking before translating" is a winning strategy.
Figure 5: ORCA-PROJECT baseline performance.

Limitations and Future Work

The authors note that while their agentic approach (using tools like file I/O and execution) improves results, it is expensive. For example, using "Claude Code" (an agentic version of Claude) cost roughly 30 times more than direct prompting.

Future research should focus on making these agents more efficient and "equivalence-aware"—developing models that can autonomously verify if their translation is numerically identical to the source without needing a human-written test suite. Additionally, expanding the benchmark to include more specialized libraries (like those for Spark or R) remains an open challenge.

Summary updated

BibTeX
@misc{li2026orca,
  author = {Xiaolong Li and Jinyang Li and Bowen Qin and Ge Qu and Nan Huo and Xiaohan Xu and Shipei Lin and Reynold Cheng},
  title = {{ORCA: Evaluating LLMs on Data Science Code Translation}},
  year = {2026},
  eprint = {2609.30749},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.30749},
}
Figure