Text-to-Python 대 Text-to-SQL 벤치마킹: 명시적 로직과 모호성의 영향
Benchmarking Text-to-Python against Text-to-SQL: The Impact of Explicit Logic and Ambiguity
Text-to-SQL이 데이터베이스 상호작용의 지배적인 접근 방식으로 남아 있지만, 실제 분석 환경에서는 파일 기반 데이터와 복잡한 분석 워크플로우를 관리하기 위해 Python이나 Pandas와 같은 범용 프로그래밍 언어의 유연성이 점점 더 요구되고 있다. 이러한 증가하는 요구에도 불구하고, 핵심 데이터 검색에 있어 Text-to-Python의 신뢰성은 성숙한 SQL 생태계에 비해 충분히 연구되지 않았다. 이러한 간극을 해결하기 위해, 본 논문에서는 패러다임 간 평가를 위해 설계된 벤치마크인 BIRD-Python을 소개한다. 우리는 주석 노이즈를 줄이고 실행 의미(execution semantics)를 정렬하기 위해 원본 데이터셋을 체계적으로 정제하였으며, 이를 통해 비교를 위한 일관되고 표준화된 기준선을 확립했다. 분석 결과 근본적인 패러다임의 차이가 드러났다. SQL은 선언적 구조를 통해 암시적인 DBMS 동작을 활용하는 반면, Python은 명시적인 절차적 로직을 요구하므로 불충분하게 명시된 사용자 의도에 매우 민감하다. 이러한 문제를 완화하기 위해, 생성 과정에 잠재적인 도메인 지식을 통합하여 모호성을 해결하는 로직 완성 프레임워크(Logic Completion Framework, LCF)를 제안한다. 실험 결과는 (1) 성능 차이가 코드 생성의 내재적 한계보다는 주로 누락된 도메인 맥락에서 기인하며, (2) 이러한 격차가 해소될 때 Text-to-Python이 Text-to-SQL과 동등한 성능을 달성함을 보여준다. 이러한 발견은 시스템이 모호한 자연어 입력을 실행 가능한 논리적 명세에 효과적으로 기반(ground)시킬 수 있다면, Python이 분석 에이전트를 위한 실행 가능한 토대가 됨을 입증한다. 관련 리소스는 https://anonymous.4open.science/r/Bird-Python-43B7/ 에서 이용할 수 있다.
While Text-to-SQL remains the dominant approach for database interaction, real-world analytics increasingly require the flexibility of general-purpose programming languages such as Python or Pandas to manage file-based data and complex analytical workflows. Despite this growing need, the reliability of Text-to-Python in core data retrieval remains underexplored relative to the mature SQL ecosystem. To address this gap, we introduce BIRD-Python, a benchmark designed for cross-paradigm evaluation. We systematically refined the original dataset to reduce annotation noise and align execution semantics, thereby establishing a consistent and standardized baseline for comparison. Our analysis reveals a fundamental paradigmatic divergence: whereas SQL leverages implicit DBMS behaviors through its declarative structure, Python requires explicit procedural logic, making it highly sensitive to underspecified user intent. To mitigate this challenge, we propose the Logic Completion Framework (LCF), which resolves ambiguity by incorporating latent domain knowledge into the generation process. Experimental results show that (1) performance differences primarily stem from missing domain context rather than inherent limitations in code generation, and (2) when these gaps are addressed, Text-to-Python achieves performance parity with Text-to-SQL. These findings establish Python as a viable foundation for analytical agents-provided that systems effectively ground ambiguous natural language inputs in executable logical specifications. Resources are available at https://anonymous.4open.science/r/Bird-Python-43B7/.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.