# Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL

Text-to-SQL에서 스키마 검색을 위한 Adaptive-Elbow 그래프 순회

Fabio Picariello, Salvatore Cipolla, Susanna Bonura, Vito Morreale · arXiv · 2026년 11월 16일

- **연구 문제** 고정 top-k 검색은 질문마다 필요한 테이블 수가 달라 예산이 맞지 않고, 임베딩 유사도는 조인에 필요한 브리지 테이블을 놓칩니다.
- **연구 방법** 질의별 유사도 곡선의 엘보로 시드 테이블 수를 정하고, 외래키를 양방향으로 한 홉 순회해 브리지 테이블을 더합니다.
- **주요 결과** BIRD merged에서 한 홉 기준 재현율 97%와 정밀도 36.9%를 기록해, 고정 k 시드의 정밀도 25.6%보다 높았습니다.

## 테이블 선택의 두 가지 실패

LLM 기반 text-to-SQL은 질의를 만들기 전에 스키마 검색 단계를 거쳐야 하며, 테이블이 수백 개인 데이터베이스에서는 이 단계가 전체 정확도의 상한이 됩니다. 필요한 테이블을 빠뜨리면 올바른 질의를 만들 수 없고, 너무 많이 넣으면 무관한 테이블이 잡음으로 작용해 모델 출력을 떨어뜨립니다. 에이전트형 검색은 정확하지만 큰 카탈로그 전체에 적용하기에는 비용과 지연이 큽니다. 그래서 임베딩 코사인 유사도로 상위 k개를 고르는 가벼운 방식이 대안으로 쓰이는데, 이 방식에는 두 가지 약점이 있습니다. 하나는 모든 질문에 같은 k를 적용해 단순한 질문에는 불필요한 테이블이 붙고 복잡한 질문에서는 정답 테이블이 밀려난다는 점입니다.

다른 하나는 order\_items처럼 조인에 필요한 브리지 테이블을 이름과 설명의 의미 유사도로는 찾기 어렵다는 점입니다. 이 논문은 이 두 약점을 각각 적응형 엘보와 외래키 순회로 다룹니다.

![Figure 1: Per-question variation of the elbow seed at a single aggressiveness 𝛼table=0.6.Top:distribution of the elbow seed 𝑘seed over 500 questions per corpus…](https://refivu.com/papers/1d3e708c-277f-497f-9bbf-8b12de718d99/figures/figure-8e1b0cac509def93b04e7b0ce122534b.png?thumb=512)

**Figure 1** :Per-question variation of the elbow seed at a single aggressiveness 𝛼table=0.6.Top:distribution of the elbow seed 𝑘seed over 500 questions per corpus; the dashed line is the mean (the “fixed 𝑘”). The absolute spread (MAD, in tables) grows with the pool—0.4→1.7→4.7 tables—as does the relative spread (CV,0.48→0.52→0.79 ). Bottom:questions sorted by 𝑘seed; a single fixed 𝑘 (its mean) falls below the per-question seed for some queries (fewer tables, at risk to recall) and above it for the rest (more tables, at cost to precision), splitting them20%/80% (BIRD per-DB),40%/60%(BIRD merged), and39%/61%(Spider merged).

[원문](https://arxiv.org/abs/2611.20979v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Fabio Picariello, Salvatore Cipolla, Susanna Bonura, Vito Morreale · Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.

## 질문별 검색 예산을 정하는 적응형 엘보

먼저 각 테이블 노드의 점수를 청크별 최대 코사인 유사도로 계산하고, 점수를 내림차순으로 정렬해 유사도 곡선을 만듭니다. 이 곡선은 앞쪽의 가파른 머리 부분과 뒤쪽의 거의 비슷한 값이 이어지는 꼬리로 나뉘며, 엘보는 그 전환이 일어나는 순위입니다. 이 방법은 곡선을 이동 평균으로 평활화하는데, 창 크기는 풀 크기의 로그에 맞춘 기본 창과 그보다 넓은 창 두 개를 씁니다. 각 평활 곡선에서 양 끝점을 잇는 직선과 각 순위 점 사이의 chord distance를 계산하고, 이 거리가 최대가 되는 가장 이른 순위를 엘보 후보로 정합니다. 두 창에서 얻은 후보의 중앙값을 최종 인덱스로 쓰고, 여기에 공격성 파라미터 α를 곱해 1부터 n−1 사이로 클램프합니다.

α가 1보다 크면 절단점이 더 깊어져 더 많은 후보가 남고, 1보다 작으면 머리 쪽으로 당겨져 후보가 줄어듭니다. 이 조정은 순위를 유사도 임계값 τ로 바꾸는 식으로 이어지며, α가 1이면 조정이 사라집니다. 가장 높은 순위의 후보는 하한 1 때문에 항상 남습니다.

## 외래키 양방향 순회로 브리지 테이블 추가

엘보로 고른 시드 테이블에서 REFERENCES 간선을 방향과 관계없이 따라가며, 한 홉마다 현재 집합에 인접한 테이블을 더합니다. 질의와의 의미 유사도는 낮아도 조인에 꼭 필요한 연결 테이블을 복구하는 것이 목적입니다. 그래프는 PostgreSQL에서 한 번 적재한 뒤 메모리에서 순회합니다. 홉을 늘려도 추가 이득은 작았기 때문에, 이 논문은 엘보와 한 홉을 함께 쓰는 조합을 권합니다.

## BIRD와 Spider로 만든 세 가지 풀

같은 질의 집합을 쓰므로 이 두 설정의 차이는 풀 크기 효과를 통제해 보여 줍니다. Spider는 학습 데이터베이스를 합쳐 546개 테이블 그래프로 만든 가장 큰 풀입니다. BIRD merged에서 Spider merged로 가는 전환은 데이터셋 구성도 함께 바뀌므로 풀 크기만의 인과 비교로 읽을 수 없습니다. 각 코퍼스는 seed 1234로 뽑은 500개 질의를 평가했고, 정답 테이블은 기준 SQL에서 AST 파서로 추출하며 실패하면 정규표현식으로 대체했습니다. 재현율은 정답 테이블 수로 나눈 값이고, 정밀도는 반환된 테이블 수로 나눈 값입니다.

## 고정 k 대비 엘보의 정밀도 차이

BIRD merged에서 t\_hop=1일 때 ElbowHop은 재현율 97%와 정밀도 36.9%를 기록했습니다. 같은 홉 조건에서 고정 k 시드는 정밀도 25.6%에 머물렀고 재현율은 거의 같은 수준이었습니다. Spider merged에서는 한 홉 기준 정밀도가 7.0%에서 14.3%로 올랐으며, 이 차이는 풀이 커질수록 벌어졌습니다. BIRD per-DB 풀에서는 같은 우위가 나타나지 않았습니다. t\_hop이 1 이하일 때 엘보의 작은 예산이 재현율을 일부 내주고 정밀도를 얻는 쪽에 가까웠고, t\_hop이 2 이상에서는 두 예산의 곡선이 거의 겹쳤습니다. 저자들은 후보가 몇 개 없는 작은 풀에서는 질의별 예산과 고정 예산의 차이가 작아 우위가 드러나기 어렵다고 해석합니다.

질의별 seed의 평균 절대 편차는 0.4, 1.7, 4.7 테이블로 풀이 커질수록 커졌습니다.

![Figure 2: ElbowHop (per-question elbow, solid) versus ElbowHop-fixed 𝑘 (fixed seed, dashed), each at its own budget, with blue = recall (left axis) and red = p…](https://refivu.com/papers/1d3e708c-277f-497f-9bbf-8b12de718d99/figures/figure-acbfd4215939fc59cc48731687b864ec.png?thumb=512)

**Figure 2** :ElbowHop (per-question elbow, solid) versus ElbowHop-fixed 𝑘 (fixed seed, dashed), each at its own budget, with blue = recall (left axis) and red = precision (right axis), one panel per 𝑡hop and±1 SEM bands. At matched recall the elbow holds substantially higher precision, and the gap grows with pool size. Markers along each curve are the swept 𝛼table values, labelled in every panel and increasing with 𝑘 from left to right (𝛼table=0.6, our default, is the third).

[원문](https://arxiv.org/abs/2611.20979v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Fabio Picariello, Salvatore Cipolla, Susanna Bonura, Vito Morreale · Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.

## Dense와 Hybrid RRF 베이스라인과의 비교

Dense는 ElbowHop-fixed k와 같은 총 테이블 수로 맞춘 순수 코사인 상위 k이고, Hybrid RRF는 밀집 순위와 BM25 순위를 k\_rrf=60으로 융합한 방식입니다. 같은 예산에서 ElbowHop은 더 높은 재현율을 얻었고, 이 차이는 풀이 커질수록 벌어졌습니다. 재현율 99%를 기준으로 보면 최고 고정 k의 Dense와 Hybrid RRF는 ElbowHop에 약 1에서 6 포인트 못 미쳤고, BIRD merged의 Hybrid RRF 차이가 6.2 포인트로 가장 컸습니다. 정밀도는 세 방법이 한 곡선 위에 놓여, 같은 예산에서는 어느 쪽이 더 정확하다고 말하기 어렵습니다.

![Figure 5: Recall (top) and precision (bottom) frontiers versus average budget 𝑘 (log scale) for ElbowHop (solid, one per𝑡 hop), Dense (dashed, at the ElbowHop-…](https://refivu.com/papers/1d3e708c-277f-497f-9bbf-8b12de718d99/figures/figure-d594de62925ccaa4de91fda5a81e1d15.png?thumb=512)

**Figure 5** :Recall (top) and precision (bottom) frontiers versus average budget 𝑘 (log scale) for ElbowHop (solid, one per𝑡 hop), Dense (dashed, at the ElbowHop-fixed𝑘total budget), and Hybrid-RRF (dashed),±1SEM bands.

[원문](https://arxiv.org/abs/2611.20979v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Fabio Picariello, Salvatore Cipolla, Susanna Bonura, Vito Morreale · Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL · 원문 그림 인용 · 원본 PDF 11쪽에서 그림 영역을 추출했습니다.

## 브리지 테이블 회수 효과

전체 재현율 차이는 BIRD per-DB에서 +8 포인트, BIRD merged에서 +2, Spider merged에서 +3으로 작았습니다. 이 논문은 내용 컬럼 없이 조인 키로만 등장하는 연결 테이블을 브리지 테이블로 따로 세어 분석했습니다. 이 분석에서 t\_hop=1일 때 α가 작은 구간에서 BIRD는 +15 포인트, Spider는 +6에서 7 포인트의 이득이 나타났고, 예산이 커질수록 이 이득은 0으로 줄었습니다. 예산이 넓어지면 Dense가 순위 확산으로 같은 테이블을 회수하기 때문입니다.

![Figure 4: Bridge-table recall gain of the FK traversal at iso-budget:Δ =recall(seed+FK)−recall(dense same-𝑘) , in points, restricted to content-column-free jun…](https://refivu.com/papers/1d3e708c-277f-497f-9bbf-8b12de718d99/figures/figure-da2bf836153a61e7d3debe8253dabba8.png?thumb=512)

**Figure 4** :Bridge-table recall gain of the FK traversal at iso-budget:Δ =recall(seed+FK)−recall(dense same-𝑘) , in points, restricted to content-column-free junction/linking gold tables, at 𝑡hop=1. Each marker is one swept 𝛼table, placed at its mean budget 𝑘. The gain peaks at tight budget (+15 points on BIRD, +6–7 on Spider) and decays as𝑘grows. Counts:72bridge queries /78bridge tables on BIRD,142/161on Spider.

[원문](https://arxiv.org/abs/2611.20979v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Fabio Picariello, Salvatore Cipolla, Susanna Bonura, Vito Morreale · Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL · 원문 그림 인용 · 원본 PDF 10쪽에서 그림 영역을 추출했습니다.

## 테이블 수준 평가의 경계와 평평한 분포

평가는 테이블 수준 재현율과 정밀도에 머물렀고 열 선택과 SQL 실행 정확도는 검증하지 않았습니다. 따라서 테이블 정밀도 향상이 최종 SQL 정확도 향상으로 이어지는지는 이 실험으로 확인되지 않았습니다. 엘보는 뚜렷한 꺾임이 있어야 작동하므로, 후보가 매우 적거나 유사도가 전체적으로 높거나 낮게 평평하면 대부분의 후보를 돌려주는 쪽으로 저하될 수 있습니다. 이런 평평한 경우를 따로 표시해 빈도를 측정하지 않아서 그 빈도는 제시하지 못합니다. chord distance의 최대점이 유일하다는 보장도 없으며, 동률은 가장 이른 순위로 정하지만 여러 지역 최대점 가운데 고르는 기준은 세우지 않았습니다. 임베딩 모델 비교도 체계적 소거 실험이 아니며, all-MiniLM-L6-v2는 계산 비용 때문에 골랐습니다.

## 논문 정보

- **저자**: Fabio Picariello, Salvatore Cipolla, Susanna Bonura, Vito Morreale
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2026년 11월 16일
- **등록일**: 2026년 11월 17일
- **수정일**: 2026년 11월 16일
- **버전**: v1
- **arXiv**: 2611.20979
- **분류**: cs.DB · cs.IR
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2611.20979v1) · [원문 PDF ↗](https://arxiv.org/pdf/2611.20979v1)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

LLM-based natural-language interfaces to relational databases are gated by a schema-retrieval step: the generator can only be as good as the slice of schema it is shown. On a database with hundreds of tables, that slice must be selected and the selection is two-sided---omit a needed table and the query becomes unrecoverable, include too many and the irrelevant ones act as noise that degrades the model's output. When an agentic retriever that lets the model inspect the schema can be too costly or too slow, the fallback is an embedder that ranks tables by cosine similarity and keeps a top-k. This fallback has two weaknesses: a fixed budget is suboptimal question by question, and embedding similarity overlooks foreign-key-linked tables that are necessary for joins. We present Adaptive-Elbow Graph Traversal (AEGT, ElbowHop for short), a property-graph table retriever that addresses both: an adaptive elbow cutoff replaces the fixed budget with a per-question one under a single aggressiveness parameter, and bidirectional foreign-key traversal deterministically recovers the bridge tables embedding similarity misses. We evaluate the retriever on 3 corpora of increasing candidate-pool size (BIRD Mini-Dev queried per database, 3--13 tables; its eleven schemas merged, 74; and a merged Spider-train graph, 546) and isolate the two mechanisms under a per-question budget-matched protocol. Across these settings the adaptive elbow emerges as the dominant mechanism---at matched recall it roughly doubles precision over a fixed budget on the larger pools, the margin widening as the pool grows---while the foreign-key traversal pays off on the join-critical bridge tables dense retrieval cannot reach, in the single-hop tight-budget case. We characterize the method as a low-cost, recall-robust first stage for schema retrieval on which a downstream selection or generation step can build.

## 원문 인용

Fabio Picariello, Salvatore Cipolla, Susanna Bonura, Vito Morreale (2026). Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL. arXiv:2611.20979v1. https://arxiv.org/abs/2611.20979v1

**BibTeX**

```
@misc{picariello2026adaptive,
  title = {{Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL}},
  author = {Fabio Picariello and Salvatore Cipolla and Susanna Bonura and Vito Morreale},
  year = {2026},
  eprint = {2611.20979},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.20979v1}
}
```

## 이 논문의 용어

- [recall](https://refivu.com/terms/3774987267f3-recall)
- [Precision](https://refivu.com/terms/29bee1303774-precision)
- [SPIDEr](https://refivu.com/terms/c5a094bf6e45-spider)
- [Reciprocal Rank Fusion](https://refivu.com/terms/c03bbd77b332-reciprocal-rank-fusion)
- [moving average](https://refivu.com/terms/77c177885beb-moving-average)
- [Okapi BM25](https://refivu.com/terms/094d4fccf2c0-okapi-bm25)
- [property graph](https://refivu.com/terms/95a5734fa6cb-property-graph)
- [gold tables](https://refivu.com/terms/435db381ada4-gold-tables)

## 다른 논문 해설

- [EchoSpec: Training Search Agents to Weigh Evidence Above Echoes](https://refivu.com/papers/22f39cf0-d41a-4695-8d6b-0d26df622012-echospec-training-search-agents-to-weigh-evidence-above.md)
- [UniGraph: A Unified Graph-based Index for Dynamic Hybrid Dense-Sparse Vector Retrieval](https://refivu.com/papers/a5ee1bb8-7883-49ee-91f4-322d407f8039-unigraph-a-unified-graph-based-index-for-dynamic.md)
- [How did data sharing evolve in the decade since the FAIR Principles?](https://refivu.com/papers/e7c9a1d9-84a6-42db-a802-1fdda6ab0746-how-did-data-sharing-evolve-in-the-decade.md)
- [Straight to the Product: What Online Retailers Miss When Shoppers Ask AI First](https://refivu.com/papers/89908e34-b722-4ae9-a8e6-f5fc8adefc2d-straight-to-the-product-what-online-retailers-miss.md)
- [Attribute or Abstain: Evaluating Evidence-Grounded Retrieval on the Low-Resource African Business Web](https://refivu.com/papers/332c2b16-faf9-4082-9a3a-b1b5fa537c32-attribute-or-abstain-evaluating-evidence-grounded-retrieval.md)
- [StaleBench: Isolating Stale Retrieval in Agent Memory, and Pricing the Fix](https://refivu.com/papers/d58fb65a-fbe1-4d01-a4a5-d6848ca8f8a5-stalebench-isolating-stale-retrieval-in-agent-memory-and.md)
- [FARCH: A Functional ARCH Model for Calibrated Prediction Bands](https://refivu.com/papers/803c6002-d508-4e87-b0e9-4d6db420de66-farch-a-functional-arch-model-for-calibrated-prediction.md)
- [Navital Gym: Rule-Graded Agent Environments for Indian Workflows](https://refivu.com/papers/14524c7c-bc42-4225-92b0-86688747deeb-navital-gym-rule-graded-agent-environments-for-indian.md)
- [A Convergence Analysis of the Random Feature Method for Linear PDEs](https://refivu.com/papers/e23ddbbe-6639-473b-8f15-06395434c589-a-convergence-analysis-of-the-random-feature-method.md)
- [Markov-Equivalent Conditional Independence Graphs on Path Spaces](https://refivu.com/papers/84d16c51-6617-4e77-bae7-fc57345e114e-markov-equivalent-conditional-independence-graphs-on-path.md)
- [It Depends on the Task: Rethinking Rhetorical Segmentation of Dutch Judicial Decisions](https://refivu.com/papers/783edff2-a49b-485b-af5d-d4d1c8c741f2-it-depends-on-the-task-rethinking-rhetorical-segmentation.md)
- [artist: A Python package for differentiable ray tracing and gradient-based optimization of solar tower power plant operation](https://refivu.com/papers/a8477da3-259a-4054-b2b2-437e7f633956-artist-a-python-package-for-differentiable-ray-tracing.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/1d3e708c-277f-497f-9bbf-8b12de718d99-adaptive-elbow-graph-traversal-for-schema-retrieval-in)
