Torsten Scholak, Nathan Schucher, Dzmitry Bahdanau
Large pre-trained language models for textual data have an unconstrained output space; at each decoding step, they can produce any of 10,000s of sub-word tokens. When fine-tuned to target constrained formal languages like SQL, these models often generate invalid code, rendering it unusable. We propose PICARD (code and trained models available at https://github.com/ElementAI/picard), a method for constraining auto-regressive decoders of language models through incremental parsing. PICARD helps to find valid output sequences by rejecting inadmissible tokens at each decoding step. On the challenging Spider and CoSQL text-to-SQL translation tasks, we show that PICARD transforms fine-tuned T5 models with passable performance into state-of-the-art solutions.
| Task | Dataset | Metric | Value | Model |
|---|---|---|---|---|
| Dialogue | CoSQL | interaction match accuracy | 23.7 | T5-3B + PICARD |
| Dialogue | CoSQL | question match accuracy | 54.6 | T5-3B + PICARD |
| Semantic Parsing | spider | Accuracy | 71.9 | T5-3B + PICARD |
| Semantic Parsing | SPIDER | Exact Match Accuracy (in Dev) | 75.5 | T5-3B+PICARD |
| Semantic Parsing | SPIDER | Execution Accuracy (in Dev) | 79.3 | T5-3B+PICARD |
| Semantic Parsing | SPIDER | Exact Match Accuracy (in Dev) | 71.5 | T5-3B |
| Semantic Parsing | SPIDER | Execution Accuracy (in Dev) | 74.4 | T5-3B |
| Semantic Parsing | spider | Exact Match Accuracy (Dev) | 75.5 | T5-3B + PICARD |
| Semantic Parsing | spider | Exact Match Accuracy (Test) | 71.9 | T5-3B + PICARD |
| Semantic Parsing | spider | Execution Accuracy (Test) | 75.1 | T5-3B + PICARD |
| Text-To-SQL | SPIDER | Exact Match Accuracy (in Dev) | 75.5 | T5-3B+PICARD |
| Text-To-SQL | SPIDER | Execution Accuracy (in Dev) | 79.3 | T5-3B+PICARD |
| Text-To-SQL | SPIDER | Exact Match Accuracy (in Dev) | 71.5 | T5-3B |
| Text-To-SQL | SPIDER | Execution Accuracy (in Dev) | 74.4 | T5-3B |
| Text-To-SQL | spider | Exact Match Accuracy (Dev) | 75.5 | T5-3B + PICARD |
| Text-To-SQL | spider | Exact Match Accuracy (Test) | 71.9 | T5-3B + PICARD |
| Text-To-SQL | spider | Execution Accuracy (Test) | 75.1 | T5-3B + PICARD |