# LuthorSQL: A One-Pass Text-to-SQL Model as System 1 for a Slower LLM Agent

LuthorSQL：遅いLLMエージェントのためのSystem 1として動く、一度で処理するText-to-SQLモデル

Ibrahim Memon, Armin Karamzade, M. Hanif Jhaveri, Roy Fox · arXiv · 2026年11月13日

- **課題** 精度の高いLLMエージェントは、質問ごとに外部呼び出しが必要になるため、コスト、遅延、データ露出の問題が生じます。
- **手法** 凍結したOmniSQL-7Bバックボーンに LoRAアダプタを2つ付け、質問計画を一度で埋めます。コンパイル・実行された候補のうち検証器が選んだ答えを、ローカルで出力します。

## 精度の高いエージェントのコスト問題

LuthorSQL論文が扱うのは、データベースへの質問を自然言語からSQLに変換するText-to-SQLの問題です。ツールを使うLLMエージェントが最も正確ですが、質問ごとにホストモデルを呼び出す必要があるため、遅くて高価です。さらに、組織の機密性の高い質問が外部APIに送られてしまいます。論文では、Claude Opus 5.5エージェントがBIRDの学習用データベースの796問で77.26%を正解し、質問1件あたり約2セントかかったと記録されています。研究上の問いは、組織がすでに持つローカルのハードウェアで、このコストの一部を減らしつつ、エージェントの精度を損なわずにいられるかどうかです。

## 一回のforward passで計画を埋めるSystem 1

LuthorSQLはSQLをトークン単位で生成せず、質問計画の離散的な決定をスロットに分けます。OmniSQL-7Bバックボーン上の一回のforward passで、それらにスコアを付けます。バックボーンは凍結し、LoRAアダプタを2つ付けます。1つはスロットのスコアを出す生成器、もう1つは候補を評価する検証器です。計画のスコアは選ばれた決定の対数確率の和として定義されるため、Σ 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](https://refivu.com/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43/figures/figure-8216b1305582206af74579b78d37b7b1.png?thumb=512)

**Table 16** : Slots of the plan grammar (v3). Ranges give how many of each slot a plan can hold.

[出典](https://arxiv.org/abs/2611.17780v1) · [CC BY 4.0](https://creativecommons.org/licenses/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の候補を結果グループごとにまとめ、上位8グループをエージェントのプロンプトに渡します。カスケードでは、検証器スコアの上位2結果グループ間の差が閾値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 estim…](https://refivu.com/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43/figures/figure-287ec88c9e7679aff962f23f605b84b7.png?thumb=512)

**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.

[出典](https://arxiv.org/abs/2611.17780v1) · [CC BY 4.0](https://creativecommons.org/licenses/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 handof…](https://refivu.com/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43/figures/figure-10a8825402e9711232a0c86d35499000.png?thumb=512)

**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.

[出典](https://arxiv.org/abs/2611.17780v1) · [CC BY 4.0](https://creativecommons.org/licenses/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で3回実行したプーリング結果では、カスケードは質問の約半分を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…](https://refivu.com/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43/figures/figure-8e06192be6a2a4afe1c54804b77b0a89.png?thumb=512)

**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.

[出典](https://arxiv.org/abs/2611.17780v1) · [CC BY 4.0](https://creativecommons.org/licenses/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開発セットでは、2つのアダプタを使うSystem 1が実行精度59.39%を記録しました。非公開のテストセットでは68.03%でした。このスコアは開発時のスコアより8.64点高く、著者らもテストのラベルがなければ理由を説明しにくいと見ています。単一GPUでの質問1件あたりの中央値の遅延は、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…](https://refivu.com/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43/figures/figure-c443c4bbc02df31c227b67ae7fb240e1.png?thumb=512)

**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).

[出典](https://arxiv.org/abs/2611.17780v1) · [CC BY 4.0](https://creativecommons.org/licenses/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…](https://refivu.com/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43/figures/figure-cad4b13424b2613bcfac1ed51853c60a.png?thumb=512)

**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.

[出典](https://arxiv.org/abs/2611.17780v1) · [CC BY 4.0](https://creativecommons.org/licenses/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%; strict…](https://refivu.com/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43/figures/figure-f987b9ca231e8231b545ac72bb43fe6e.png?thumb=512)

**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.

[出典](https://arxiv.org/abs/2611.17780v1) · [CC BY 4.0](https://creativecommons.org/licenses/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-…](https://refivu.com/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43/figures/figure-0cd9c4f2cec167b87d0773a755dbc8a3.png?thumb=512)

**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).

[出典](https://arxiv.org/abs/2611.17780v1) · [CC BY 4.0](https://creativecommons.org/licenses/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](https://creativecommons.org/licenses/by/4.0/)
- **掲載内容**: 論文情報・解説・論文の図

[元論文 ↗](https://arxiv.org/abs/2611.17780v1) · [PDF ↗](https://arxiv.org/pdf/2611.17780v1)

この解説は、Refivuの韓国語解説を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}
}
```

## この論文の用語

- [hard negatives](https://refivu.com/ja/terms/17c156ae3902-hard-negatives)
- [Spider](https://refivu.com/ja/terms/c5a094bf6e45-spider)
- [BIRD](https://refivu.com/ja/terms/3bebf56c82e0-bird)

## ほかの論文解説

- [Generated Evaluation Suites as Diversity-Driven Search for Real Agent Regressions](https://refivu.com/ja/papers/9243696c-5e44-46bb-8770-56015932535d-generated-evaluation-suites-as-diversity-driven-search-for.md)
- [Agent-written heuristics versus commercial solvers on unsolved job-shop benchmark instances](https://refivu.com/ja/papers/5984dfe9-586c-4235-a5c3-6bd1f931e1af-agent-written-heuristics-versus-commercial-solvers-on.md)
- [Learn then Bet: Learning Interpretable Rules for Reliable Agent Intervention](https://refivu.com/ja/papers/56ef761b-5bfc-4309-940f-242cd1192f01-learn-then-bet-learning-interpretable-rules-for-reliable.md)
- [Verifiable pXRD: Hill-climbing pXRD structure determination with LLM agents](https://refivu.com/ja/papers/ac0271e9-392b-4197-8fd2-7a94703b5c28-verifiable-pxrd-hill-climbing-pxrd-structure-determination.md)
- [More Agents, More Samples, or More Thinking? Untangling Coordination, Ensembling, and Test-Time Compute in Multi-Agent LLMs](https://refivu.com/ja/papers/730d1080-fbe2-4e8f-ba2b-54a99b3fac1d-more-agents-more-samples-or-more-thinking-untangling.md)
- [AgentSSL: Can MLE Agents Leverage Unlabeled Data?](https://refivu.com/ja/papers/7ba356fa-3652-4ea1-a299-cdcb8ac47ade-agentssl-can-mle-agents-leverage-unlabeled-data.md)
- [Rethinking Visual Reasoning in Text-to-Image Reward Modeling](https://refivu.com/ja/papers/d043d7db-f765-4a77-8ab6-6225b499d5c9-rethinking-visual-reasoning-in-text-to-image-reward.md)
- [TouchTwin: Scaling Human Touch Data via Real-to-Sim-to-Real](https://refivu.com/ja/papers/462b68fa-213d-42d2-afc6-70494a111d9b-touchtwin-scaling-human-touch-data-via-real-to.md)
- [What Do Multilingual Self-Supervised Speech Encoders Know About Sentence Meaning?](https://refivu.com/ja/papers/8615f562-722c-42f6-bc0f-4fa703adb931-what-do-multilingual-self-supervised-speech-encoders-know.md)
- [Binarization as an Attack Surface in Weightless Neural Networks](https://refivu.com/ja/papers/6ce63039-cb93-495b-bba0-485bc05dc965-binarization-as-an-attack-surface-in-weightless-neural.md)

---

AI解説には誤りが含まれることがあります。 [Refivu](https://refivu.com/ja/papers/eb6f98aa-61fd-4f1c-bb6f-deff920d4f43-luthorsql-a-one-pass-text-to-sql-model)
