PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models

Torsten Scholak, Nathan Schucher, Dzmitry Bahdanau
9/10/2021
cs.CLcs.PL

Official code: ServiceNow/picard (377 stars, Apache-2.0, last commit 2023-10-18).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

ServiceNow/picardOfficial100%
Apache-2.0

PICARD - Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models. PICARD is a ServiceNow Research project that was started at Element AI.

377126Python, ThriftAug 31, 20213 years agoApache-2.0

Similar Papers

Cite this paper

@article{scholak2021picard,
  title  = {PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models},
  author = {Torsten Scholak and Nathan Schucher and Dzmitry Bahdanau},
  year   = {2021},
  eprint = {2109.05093},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2109.05093}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2109.05093.svg)](https://codeofpaper.com/paper/2109.05093)

Discussion