논문 해설
LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent
LuthorSQL: 느린 LLM 에이전트를 위한 System 1 역할의 한 번에 처리하는 Text-to-SQL 모델
- 연구 문제 정확도 높은 LLM 에이전트는 질문마다 외부 호출이 필요해 비용과 지연, 데이터 노출 문제가 생깁니다.
- 연구 방법 동결된 OmniSQL-7B 백본에 LoRA 어댑터 두 개를 붙여 질의 계획을 한 번에 채우고, 컴파일·실행된 후보 중 검증기가 고른 답을 로컬에서 냅니다.
정확도 높은 에이전트의 비용 문제
LuthorSQL 논문이 다루는 문제는 데이터베이스 질의를 자연어에서 SQL로 바꾸는 text-to-SQL에서, 도구를 쓰는 LLM 에이전트가 가장 정확하지만 질문마다 호스트 모델을 호출해야 하므로 느리고 비싸며 조직의 민감한 질의가 외부 API로 나간다는 점입니다. 논문은 Claude Opus 5.5 에이전트가 BIRD 학습 데이터베이스의 796개 질문에서 77.26%를 맞혔고 질문당 약 2센트가 든다고 기록했습니다. 연구 질문은 조직이 이미 가진 로컬 하드웨어가 이 부담의 일부를 덜어 주면서 에이전트 정확도를 해치지 않을 수 있는지입니다.
한 번의 forward pass로 계획을 채우는 System 1
LuthorSQL은 SQL을 토큰 단위로 생성하지 않고, 질의 계획의 이산 결정들을 슬롯으로 나눠 OmniSQL-7B 백본 위에서 한 번의 forward pass로 점수를 매깁니다. 백본은 동결하고 LoRA 어댑터 두 개를 붙이며, 하나는 슬롯 점수를 내는 생성기이고 다른 하나는 후보를 평가하는 검증기입니다. 계획의 점수는 선택된 결정들의 로그확률 합으로 정의되므로 Σ log P(d|q,e,D) 형태로 분해됩니다. 학습에서 여러 정답 후보가 있는 집합형 슬롯은 각 양성이 모든 음성과 경쟁하되 다른 양성을 억제하지 않는 multi-positive cross-entropy로 최적화합니다. 이 구조 덕분에 점수가 가장 높은 계획을 시작점으로 best-first 방식으로 상위 k개 계획을 자기회귀 빔 탐색 없이 열거할 수 있습니다.

Table 16 : Slots of the plan grammar (v3). Ranges give how many of each slot a plan can hold.
원문 · CC BY 4.0 · Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent · 원문 그림 인용 · 원본 PDF 22쪽에서 그림 영역을 추출했습니다.컴파일과 검증기로 최종 SQL 고르기
예측된 계획은 결정론적 컴파일러가 SQL로 바꿉니다. 조인은 계획이 참조한 테이블들을 외래키 그래프 위의 최소 비용 Steiner tree로 연결해 만들며, 선언된 키는 비용 1, 추론된 키는 더 높은 비용, 모델이 힌트로 준 키는 더 낮은 비용을 가집니다. 컴파일된 후보는 최대 32개까지 중복을 제거한 뒤 읽기 전용으로 실행해 live 후보를 정하고, 실행 결과가 같은 후보끼리 결과 그룹으로 묶습니다. 최종 선택은 VALHARD 검증기가 스키마, 질문, 증거와 컴파일된 SQL 문자열을 전체로 읽어 매긴 점수가 가장 높은 live 후보로 이뤄지며, live 후보가 없으면 전체에서 가장 높은 후보를 씁니다.
검증기는 생성 순위나 계획 점수, 실행 결과를 입력으로 받지 않습니다. 학습에서는 근접 오답 결과 그룹과 COUNT를 COUNT DISTINCT로 바꾸는 식의 합성 변형을 hard negative로 씁니다.
로컬 게이트와 에이전트 캐스케이드
LuthorSQL은 System 2인 Claude Opus 5.5 에이전트 앞단에서 빠른 게이트로 쓰입니다. 핸드오프 방식은 System 1의 후보를 결과 그룹별로 묶어 상위 여덟 그룹을 에이전트 프롬프트에 주는 방식입니다. 캐스케이드는 검증기 점수의 상위 두 결과 그룹 사이 여백이 임계값 t 이상이면 System 1 답을 쓰고, 아니면 에이전트에게 넘깁니다. 임계값 3.0은 사전에 정한 규칙으로 0.25 간격 탐색에서 정확도에서 비용을 뺀 값을 최대화하는 방식으로 고른 것이며, 정답 1달러와 에이전트 호출의 목록가를 기준으로 했습니다.

Table 10 : Candidate handoff on a 400-question DE- CISION sample. Times and tokens include the same agent-harness overhead in both arms. Output text is an estimate (output characters / 4); logged output-token counts were not lower.
원문 · CC BY 4.0 · Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.
Table 11 : Confidence cascade on all 796 DECISION questions. System 1 answers alone when its validator margin is at least t; otherwise the agent gets the handoff prompt. System 1 alone scores 58.92 here: the cascade picks among result groups, which breaks one tie differ- ently from the official pick (59.05). Opus alone scores 77.26. Bold: the threshold picked by the rule fixed be- fore the run, which charged every agent call the same average list-price cost, estimated at the time; measured held-out results are in Table 2 and Figure 2.
원문 · CC BY 4.0 · Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.사전 등록 캐스케이드의 비용 절감과 정확도
RESERVED에서 세 번 실행한 풀링 결과 캐스케이드는 질문의 약 절반을 System 1로 처리했고, 후보를 함께 준 Opus에 대해 목록가 비용을 34.3% 줄이면서 정확도는 0.29점 낮았습니다. 외부 KaggleDBQA와 Spider-Realistic 693개 질문에서는 에이전트에 넘긴 비율이 51.9%였고, 후보를 준 Opus 대비 31.7% 비용을 줄이면서 정확도는 1.30점 높았습니다. 고정된 신규 post-cutoff 세트에서는 Opus 단독 대비 API 비용을 33.3% 줄이면서 정확도 차이를 통계적으로 구분하기 어려웠습니다. 다만 첫 번째 RESERVED 실행은 비용과 시간 기준을 충족하지 못했다고 논문은 밝힙니다.

Table 2 : The four pre-registered tests of the t= 3.0 cas- cade (EX in %; differences in points with database sign- flip intervals). RES: RESERVED; pool: three complete runs of every arm, EX averaged; External: KaggleD- BQA test and Spider-Realistic; Fresh: new questions on post-cutoff databases (no B1 arm). Cost savings are in Figure 2.
원문 · CC BY 4.0 · Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.System 1 단독 성능과 다른 엔진 전이
BIRD 개발셋에서 두 어댑터 System 1은 59.39% 실행 정확도를 기록했습니다. 숨겨진 테스트셋에서는 68.03%를 기록했으며, 이 점수는 개발 점수보다 8.64점 높아 저자들도 테스트 라벨 없이는 이유를 설명하기 어렵다고 봅니다. 단일 GPU에서 중앙값 지연은 k=32 후보와 VALHARD 기준 질문당 0.84초였습니다. 같은 SQLite 후보를 Snowflake, MySQL, DuckDB, PostgreSQL, BigQuery에서 직접 실행했을 때 개발셋 정확도는 57.1–59.3%였고, SQLite의 60.17%와 3.1점 안에 있었습니다.

Table 6 : Speed tiers of the two-adapter System 1 pipeline (bold: the frozen LuthorSQL configuration). EX (%) on DECISION (796 held-out training questions) and BIRD dev (original gold, all 1,534); times are p50 per question at batch size 1, end to end, measured on 200 DECISION questions with model load excluded (H100 PCIe and A100 80GB PCIe); cost at $2.50/h (H100) and $2.00/h (A100).
원문 · CC BY 4.0 · Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent · 원문 그림 인용 · 원본 PDF 17쪽에서 그림 영역을 추출했습니다.
Table 7 : BIRD dev EX (%, original gold). The first block is copied from Ma et al. (2026), an unreviewed preprint that does not say whether BIRD’s evidence was given (v1, Tables 1 and 7, unchanged in v2’s Tables 2 and 10; latency on A100s as they report it), prompted with retrieval-augmented schema context in a setting they call zero-shot. ∗Our runs, given BIRD’s evidence; the writer and LuthorSQL are fine-tuned on public train- ing data, and OmniSQL-7B is the released checkpoint decoded greedily. V ote/pick: majority vote over 8 sam- ples (Maj@8) unless marked. §V ote over 17 candidates. ∥Validator pick from up to 32 distinct candidates, not a vote; latency is the p50 on one H100 PCIe over 200 DECISION questions, not timed on BIRD dev.
원문 · CC BY 4.0 · Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent · 원문 그림 인용 · 원본 PDF 17쪽에서 그림 영역을 추출했습니다.
Table 9 : System 1 on other engines without retraining. Share of candidates that run: MySQL 96%, Snowflake 83%, PostgreSQL 83%, DuckDB 80%, BigQuery 76%; stricter GROUP BY rules and typing account for most failures.
원문 · CC BY 4.0 · Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.공개 벤치마크 기억 검사와 이름 변경 스키마
Opus 에이전트가 공개 벤치마크를 외웠을 가능성을 확인하려고 스키마 없이 질문과 데이터베이스 이름만 준 프로브를 돌렸습니다. 이때 Opus는 정답 질의를 48–92%에서 그대로 재현했습니다. 모든 테이블과 열 이름을 바꾼 RESERVED 데이터베이스에서는 라우팅된 에이전트의 정확도가 72.88%로, 원래 스키마의 72.32%와 비슷하게 유지되었습니다. 저자들은 이 결과를 도구를 쓰는 에이전트의 높은 정확도가 암기보다 데이터베이스 탐색에서 주로 온다는 근거로 읽습니다.

Table 8 : Memorization probes on Opus 5.5 (no database, no tool). EX, no schema: given only the question and the database name; verbatim: the gold query repro- duced after whitespace and quote normalization. Exact completions: of 100 half-questions, second halves re- produced word for word when told / not told the dataset name. BIRD tr.: RESERVED; Mini-Dev: the SQLite version of BIRD Mini-Dev, drawn from BIRD dev, scored on BIRD dev’s databases rather than Mini-Dev’s own copy (2 of its 500 gold queries failed to run there and count as wrong).
원문 · CC BY 4.0 · Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.문법 커버리지와 남은 제약
계획 문법은 BIRD 개발셋 정답 질의의 84.6%(1,297/1,534)만 표현합니다. CTE, 상관 부질의, 윈도우 함수, 학습되지 않은 템플릿이 필요한 질문은 대체로 실패하는 것으로 보고되며, 이 때문에 에이전트로 라우팅합니다. 또 캐스케이드는 BIRD 숨겨진 테스트셋에서 아직 실행되지 않았고, 보류 평가의 데이터베이스 수가 8, 27, 8개로 작아 구간이 넓습니다. 영어와 외래키 조인 중심이며, System 1은 SQLite 출력을 번역해 다른 엔진에서 돌렸습니다.
논문 정보
- 저자
- Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2026년 11월 13일
- 등록일
- 2026년 11월 16일
- 수정일
- 2026년 11월 13일
- 버전
- v1
- arXiv
- 2611.17780
- 분류
- cs.CL · cs.AI · cs.DB · cs.LG
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
Frontier LLM agents that query databases with tools are among the most accurate text-to-SQL systems, but per-query calls to a hosted model are slow, costly, and expose sensitive organizational queries to external APIs. For example, a Claude Opus 5.5 agent serving 10,000 queries a day costs over $70,000 a year at list price. To what extent can local hardware already owned by an organization offload this burden without compromising the agent's accuracy? We present LuthorSQL, a non-autoregressive 7B text-to-SQL model that serves as a rapid System 1 gate for a slower LLM agent (System 2), escalating queries only when uncertain. LuthorSQL makes a single forward pass to predict slot scores over a bounded grammar for query plans, compiles and runs up to 32 candidate plans, and chooses an answer using a trained validator. On its own, LuthorSQL reaches 68.03% execution accuracy on BIRD's hidden test set at 0.84 s per question on a single GPU, maintains its accuracy in 9 GB with 8-bit quantized weights, and transfers zero-shot to Snowflake, BigQuery, MySQL, PostgreSQL, and DuckDB within 3.1 points of its native SQLite accuracy. Combined with Claude Opus 5.5 in a pre-registered confidence cascade over 227 questions on databases published after Opus's training cutoff, LuthorSQL answers nearly half of all questions locally and cuts API cost by 33.3% at the same accuracy. Finally, contamination probing shows that Opus reproduces 48-92% of public benchmark gold queries verbatim without seeing the schema; however, its tool-assisted accuracy holds on renamed schemas and reaches 95.6-97.4% on post-cutoff databases. Code and data: https://github.com/IAMIbrahimmemon/luthorsql
원문 인용
Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox (2026). LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent. arXiv:2611.17780v1. https://arxiv.org/abs/2611.17780v1
BibTeX
@misc{memon2026luthorsql,
title = {{LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent}},
author = {Ibrahim Memon and Armin Karamzade and M. Hanif Jhaveri and Roy Fox},
year = {2026},
eprint = {2611.17780},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.17780v1}
}