US 12,086,268 B2
Constrained decoding for source code generation
Colin Bruce Clement, Seattle, WA (US); Shao Kun Deng, New York City, NY (US); Xiaoyu Liu, Sammamish, WA (US); Neelakantan Sundaresan, Bellevue, WA (US); and Alexey Svyatkovskiy, Bellevue, WA (US)
Assigned to MICROSOFT TECHNOLOGY LICENSING, LLC., Redmond, WA (US)
Filed by MICROSOFT TECHNOLOGY LICENSING, LLC., Redmond, WA (US)
Filed on Mar. 7, 2022, as Appl. No. 17/688,833.
Prior Publication US 2023/0281318 A1, Sep. 7, 2023
Int. Cl. G06F 21/00 (2013.01); G06F 8/41 (2018.01); G06F 8/73 (2018.01); G06F 21/57 (2013.01); G06N 3/047 (2023.01)
CPC G06F 21/577 (2013.01) [G06F 8/42 (2013.01); G06F 8/73 (2013.01); G06N 3/047 (2023.01)] 20 Claims
OG exemplary drawing
 
1. A system, comprising:
one or more processors; and
a memory that stores one or more programs that are configured to be executed by the one or more processors, the one or more programs including instructions to perform acts that:
access sequence data representing a partially-formed source code fragment requiring decoding into a completed source code fragment;
generate a plurality of partial solutions as candidates to complete the partially-formed source code fragment, wherein a partial solution comprises an ordered sequence of tokens, wherein a token is conditioned on a previously-generated token;
obtain one or more token constraints for a select one of the plurality of partial solutions, wherein a token constraint identifies whether a next token should appear in the select partial solution based on a source code static analysis of the select partial solution;
execute a deep learning decoder model to predict token probabilities for the select partial solution;
generate the next token to append to the select partial solution from the token probabilities and from the one or more token constraints;
expand the select partial solution with the next token; and
select one or more partial solutions having met most of the token constraints as candidate sequences to complete the partially-formed source code fragment.