Skip to main content
QUICK REVIEW

[Paper Review] mRAT-SQL+GAP:A Portuguese Text-to-SQL Transformer

Marcelo Archanjo José, Fábio Gagliardi Cozman|arXiv (Cornell University)|Oct 7, 2021
Topic ModelingComputer Science58 references18 citations
TL;DR

This paper introduces mRAT-SQL+GAP, a multilingual text-to-SQL framework based on the mBART-50 transformer model, fine-tuned on a combined English and Portuguese dataset to enable accurate natural language to SQL translation in Portuguese. The key contribution is demonstrating that jointly fine-tuning on both languages significantly improves performance—achieving 83% of the English-only baseline—highlighting the necessity of a multilingual approach for non-English NL2SQL tasks.

ABSTRACT

The translation of natural language questions to SQL queries has attracted growing attention, in particular in connection with transformers and similar language models. A large number of techniques are geared towards the English language; in this work, we thus investigated translation to SQL when input questions are given in the Portuguese language. To do so, we properly adapted state-of-the-art tools and resources. We changed the RAT-SQL+GAP system by relying on a multilingual BART model (we report tests with other language models), and we produced a translated version of the Spider dataset. Our experiments expose interesting phenomena that arise when non-English languages are targeted; in particular, it is better to train with original and translated training datasets together, even if a single target language is desired. This multilingual BART model fine-tuned with a double-size training dataset (English and Portuguese) achieved 83% of the baseline, making inferences for the Portuguese test dataset. This investigation can help other researchers to produce results in Machine Learning in a language different from English. Our multilingual ready version of RAT-SQL+GAP and the data are available, open-sourced as mRAT-SQL+GAP at: https://github.com/C4AI/gap-text2sql

Motivation & Objective

  • To develop a robust text-to-SQL system capable of translating natural language questions in Portuguese into correct SQL queries.
  • To investigate the effectiveness of multilingual pretraining for non-English NL2SQL tasks, particularly for Portuguese.
  • To evaluate whether training on both English and Portuguese data improves performance compared to monolingual Portuguese fine-tuning.
  • To create a publicly available, multilingual-ready version of RAT-SQL+GAP for future research in low-resource NL2SQL settings.
  • To provide a translated Portuguese version of the Spider dataset for benchmarking in Portuguese NL2SQL.

Proposed method

  • Adapted the RAT-SQL+GAP framework by replacing its base model with mBART-50, a multilingual BART variant, to support Portuguese input.
  • Translated the natural language questions in the Spider dataset into Portuguese using the Google Cloud Translation API, preserving original SQL queries.
  • Fine-tuned the mBART-50 model on a combined training dataset of English and Portuguese questions, with shared SQL targets.
  • Evaluated performance using the Spider Exact Set Match without Values metric on both English and Portuguese test sets.
  • Implemented a hybrid inference strategy where named entities (e.g., show names) were preserved in their original form during prediction.
  • Released the multilingual model, translated dataset, and trained checkpoints as open-source under the mRAT-SQL+GAP project.

Experimental results

Research questions

  • RQ1Can a multilingual transformer model like mBART-50 effectively handle text-to-SQL translation for Portuguese, a low-resource language in NL2SQL?
  • RQ2Does joint fine-tuning on both English and Portuguese data improve performance on Portuguese test sets compared to training solely on Portuguese?
  • RQ3How do language-specific keywords and mixed-language entities (e.g., English show names in Portuguese questions) affect model generalization and accuracy?
  • RQ4To what extent does the performance of a multilingual model trained on multiple languages degrade when inferring on a single target language like Portuguese?
  • RQ5Can a multilingual approach mitigate the challenges of low-resource language translation in NL2SQL, especially when lexical and syntactic differences exist?

Key findings

  • Fine-tuning mBART-50 on a combined English and Portuguese training dataset achieved 83% of the performance of the English-only baseline (0.595 vs. 0.718 on the Portuguese test set).
  • The best-performing model, mBART-50 fine-tuned on both languages, achieved 0.664 on the English test set (92% of the English-only baseline of 0.718).
  • Training exclusively on Portuguese data yielded a lower performance (0.588) compared to joint training, indicating that monolingual fine-tuning is suboptimal.
  • The model successfully preserved English proper nouns (e.g., show names) in translated questions, which contributed to correct query generation despite language mixing.
  • Despite lexical and syntactic differences, the multilingual model generalized well enough to produce semantically correct SQL queries for complex, nested queries in Portuguese.
  • Manual analysis of failed predictions showed that errors were not random, suggesting the model learned meaningful patterns even when incorrect, indicating room for targeted improvement.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.