Table of Contents
Fetching ...

XRICL: Cross-lingual Retrieval-Augmented In-Context Learning for Cross-lingual Text-to-SQL Semantic Parsing

Peng Shi, Rui Zhang, He Bai, Jimmy Lin

TL;DR

The paper tackles cross-lingual Text-to-SQL by leveraging in-context learning with large language models. It introduces XRICL, a retrieve-rerank-plus-prompting framework that uses a distillation-based cross-lingual exemplar retriever and a reranker, combined with Translation as a chain-of-thought prompt, to generate SQL from non-English questions with an English schema. Empirical results on XSpider and XKaggle-dbqa show state-of-the-art performance in few-shot settings across multiple languages, with notable gains from the DE-R^2 retriever/reranker and Translation-P prompting. The work demonstrates the practical potential of Codex for multilingual semantic parsing and provides benchmarks and code to facilitate future research, while acknowledging limitations related to model availability and language coverage.

Abstract

In-context learning using large language models has recently shown surprising results for semantic parsing tasks such as Text-to-SQL translation. Prompting GPT-3 or Codex using several examples of question-SQL pairs can produce excellent results, comparable to state-of-the-art finetuning-based models. However, existing work primarily focuses on English datasets, and it is unknown whether large language models can serve as competitive semantic parsers for other languages. To bridge this gap, our work focuses on cross-lingual Text-to-SQL semantic parsing for translating non-English utterances into SQL queries based on an English schema. We consider a zero-shot transfer learning setting with the assumption that we do not have any labeled examples in the target language (but have annotated examples in English). This work introduces the XRICL framework, which learns to retrieve relevant English exemplars for a given query to construct prompts. We also include global translation exemplars for a target language to facilitate the translation process for large language models. To systematically evaluate our model, we construct two new benchmark datasets, XSpider and XKaggle-dbqa, which include questions in Chinese, Vietnamese, Farsi, and Hindi. Our experiments show that XRICL effectively leverages large pre-trained language models to outperform existing baselines. Data and code are publicly available at https://github.com/Impavidity/XRICL.

XRICL: Cross-lingual Retrieval-Augmented In-Context Learning for Cross-lingual Text-to-SQL Semantic Parsing

TL;DR

The paper tackles cross-lingual Text-to-SQL by leveraging in-context learning with large language models. It introduces XRICL, a retrieve-rerank-plus-prompting framework that uses a distillation-based cross-lingual exemplar retriever and a reranker, combined with Translation as a chain-of-thought prompt, to generate SQL from non-English questions with an English schema. Empirical results on XSpider and XKaggle-dbqa show state-of-the-art performance in few-shot settings across multiple languages, with notable gains from the DE-R^2 retriever/reranker and Translation-P prompting. The work demonstrates the practical potential of Codex for multilingual semantic parsing and provides benchmarks and code to facilitate future research, while acknowledging limitations related to model availability and language coverage.

Abstract

In-context learning using large language models has recently shown surprising results for semantic parsing tasks such as Text-to-SQL translation. Prompting GPT-3 or Codex using several examples of question-SQL pairs can produce excellent results, comparable to state-of-the-art finetuning-based models. However, existing work primarily focuses on English datasets, and it is unknown whether large language models can serve as competitive semantic parsers for other languages. To bridge this gap, our work focuses on cross-lingual Text-to-SQL semantic parsing for translating non-English utterances into SQL queries based on an English schema. We consider a zero-shot transfer learning setting with the assumption that we do not have any labeled examples in the target language (but have annotated examples in English). This work introduces the XRICL framework, which learns to retrieve relevant English exemplars for a given query to construct prompts. We also include global translation exemplars for a target language to facilitate the translation process for large language models. To systematically evaluate our model, we construct two new benchmark datasets, XSpider and XKaggle-dbqa, which include questions in Chinese, Vietnamese, Farsi, and Hindi. Our experiments show that XRICL effectively leverages large pre-trained language models to outperform existing baselines. Data and code are publicly available at https://github.com/Impavidity/XRICL.
Paper Structure (22 sections, 4 equations, 2 figures, 4 tables)

This paper contains 22 sections, 4 equations, 2 figures, 4 tables.

Figures (2)

  • Figure 1: Overview of our proposed XRICL framework. Given a labeled English question-SQL candidate pool and the non-English question as input, our framework uses in-context learning with a large pre-trained language model (e.g., Codex) to generate SQL queries in four steps: (1) Cross-lingual Exemplar Retrieval, (2) Exemplar Reranking, (3) Prompt Construction with Translation as Chain-of-Thought, and (4) Inference.
  • Figure 2: Illustration of distillation-based training. The contribution distribution is the likelihood distribution of the top-$N$ exemplars produced by the LLM. The relevance distribution is the ranking score distribution produced by the retriever.