Constraining output of a generative language model to conform to a grammar
AssigneeShopify Inc.
InventorsDavid Libbey, Neil Leonard Padgett
Life of this patent
Estimating the term…
Loading patent…
AssigneeShopify Inc.
InventorsDavid Libbey, Neil Leonard Padgett
Estimating the term…
One problem of a generative language model (e.g. a large language model) is the generation of syntactically-invalid or misinformed output. This may be mitigated by utilizing a grammar defining valid sequences of output. The grammar may constrain the token generation. A method may include obtaining values generated using the generative language model, where each value is indicative of a probability of a respective token being a next token in the token sequence. The method may further include obtaining a mask based on the token sequence already generated and the grammar. The method may further include applying the mask to the values. The mask may operate on each value that corresponds to a token not compliant with the grammar to reduce or zero the probability of the corresponding token being the next token. The next token is then determined based on the values after the mask is applied.
A computer-implemented method comprising:
A system comprising:
One or more non-transitory computer-readable storage media having stored thereon computer-executable instructions that, when executed by at least one processing unit, cause the at least one processing unit to perform operations comprising:
Dependencies are inferred from the claim text.