IP Library › Granted Patent US 12,626,050
Granted Patent B2
US 12,626,050 · App. 17/751,330 · Granted May 12, 2026

Semi-autoregressive text editing

Inventors: Jonathan Stephen Mallinson (Zurich, CH); Aliaksei Severyn (Lachen, CH); Eric Emil Malmi (Zurich, CH); Jakub Dominik Adamek (Zurich, CH)
Assignee: GOOGLE LLC
G06F40/166G06F40/117G06F40/284G06F40/40
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,626,050
App. No.
17/751,330
Granted
May 12, 2026
Kind
B2
Abstract

Provided are improved machine learning-based text editing models. Specifically, example implementations include a flexible semi-auto-regressive text-editing approach for generation, designed to derive the maximum benefit from non-auto-regressive text-editing and autoregressive decoding. In contrast to conventional sequence-to-sequence (seq2seq) models, the proposed approach is fast at inference time, while being capable of modeling flexible input-output transformations.

Claims (49)

1 . A computer system that performs text editing, the computer system comprising:

one or more processors;

a machine-learned text editing model configured to receive and process a source text string to generate an output text string, the output text string comprising an edited version of the source text string, the machine-learned text editing model comprising:

an encoder model configured to process the source text string in a non-autoregressive manner to generate an intermediate text representation, wherein the source text string comprises a plurality of source tokens, and wherein the intermediate text representation indicates: (1) a subset of the plurality of source tokens to be maintained for the output text string and (2) an ordering of the subset of the plurality of source tokens to be maintained for the output text string; and

a decoder model configured to process the intermediate text representation in an autoregressive manner to select one or more additional tokens to insert into the subset of the plurality of source tokens to generate the output text string, wherein the decoder model is configured to first predict a position token indicating a position at which one or more of the additional tokens should be inserted into the intermediate text representation and then to second predict the one or more of the additional tokens to be inserted into the intermediate text representation at the position;

wherein the encoder model is configured to process the source text string in the non-autoregressive manner to generate the intermediate text representation without indicating the position at which one or more of the additional tokens should be inserted into the intermediate text representation; and

one or more non-transitory computer readable media that store instructions that, when executed by the one or more processors, cause the computer system to perform operations, the operations comprising:

obtaining the source text string;

processing the source text string with the machine-learned text editing model to generate the output text string; and

providing the output text string as an output.

2 . The computer system of claim 1 , wherein the encoder model comprises:

a text embedding model configured to process the source text string to generate a hidden representation;

a tagging model configured to assign a respective tag to each of the source tokens in the source text string, the respective tag for each source token indicating whether or not such source token is included in the subset of the plurality of source tokens to be maintained for the output text string; and

a pointer model configured to generate the ordering of the subset of the plurality of source tokens to be maintained for the output text string based at least in part on the hidden representation and the respective tag assigned to each of the source tokens.

3 . The computer system of claim 1 , wherein each of the encoder model and the decoder model comprises a transformer neural network.

4 . The computer system of claim 3 , wherein at least the transformer neural network in the decoder model comprises a T5 pre-trained transformer neural network that has been pre-trained to insert missing spans.

5 . The computer system of claim 1 , wherein the decoder model has been pre-trained with a denoising objective.

6 . The computer system of claim 1 , wherein the encoder model comprises one or more Sinkhorn layers that normalize over both rows and columns of an intra-pointer attention.

7 . The computer system of claim 1 , wherein the decoder model being configured to first predict the position token comprises repurposing one or more special span_i tokens to indicate the position token indicating the position at which one or more of the additional tokens should be inserted into the intermediate text representation.

8 . A computer-implemented method to train a text editing model, the method comprising:

obtaining, by a computing system comprising one or more computing devices, a training example comprising a source text string and target text string;

processing, by the computing system, the source text string with the text editing model to generate an output text string, wherein processing the source text string with the text editing model to generate the output text string comprises:

processing, by the computing system, the source text string in a non-autoregressive manner with an encoder model of the text editing model to generate an intermediate text representation, wherein the source text string comprises a plurality of source tokens, and wherein the intermediate text representation indicates: (1) a subset of the plurality of source tokens to be maintained for the output text string and (2) an ordering of the subset of the plurality of source tokens to be maintained for the output text string; and

processing, by the computing system, the intermediate text representation in an autoregressive manner with a decoder model of the text editing model to select one or more additional tokens to insert into the subset of the plurality of source tokens to generate the output text string;

wherein the encoder model is configured to process the source text string in the non-autoregressive manner to generate the intermediate text representation without indicating a position at which one or more of the additional tokens should be inserted into the intermediate text representation;

evaluating, by the computing system, a combined loss function that respectively compares (i) each of: a set of ground truth labels for the source tokens to be maintained, a ground truth ordering, and the target text string respectively to (ii) each of: the subset of the plurality of source tokens, the ordering of the subset of the plurality of source tokens, and the output text string; and

modifying, by the computing system, one or more parameters of the text editing model based on the combined loss function.

9 . The computer-implemented method of claim 8 , wherein the encoder model comprises:

a text embedding model configured to process the source text string to generate a hidden representation;

a tagging model configured to assign a respective tag to each of the source tokens in the source text string, the respective tag for each source token indicating whether or not such source token is included in the subset of the plurality of source tokens to be maintained for the output text string; and

a pointer model configured to generate the ordering of the subset of the plurality of source tokens to be maintained for the output text string based at least in part on the hidden representation and the respective tag assigned to each of the source tokens.

10 . The computer-implemented method of claim 8 , wherein the combined loss function comprises a tagging loss term that evaluates a probability of the encoder model outputting the set of ground truth labels for the source tokens to be maintained for the output text string.

11 . The computer-implemented method of claim 8 , wherein the combined loss function comprises a pointing loss term that compares the ordering with the ground truth ordering.

12 . The computer-implemented method of claim 8 , wherein the combined loss function comprises an insertion loss term that evaluates a probability of the decoder model outputting a set of ground truth tokens to be included in the output text string.

13 . The computer-implemented method of claim 8 , wherein each of the encoder model and the decoder model comprises a transformer neural network.

14 . The computer-implemented method of claim 8 , wherein the encoder model comprises one or more Sinkhorn layers that normalize over both rows and columns of an intra-pointer attention.

15 . One or more non-transitory computer readable media that store:

a machine-learned text editing model configured to receive and process a source text string to generate an output text string, the output text string comprising an edited version of the source text string, the machine-learned text editing model comprising:

an encoder model configured to process the source text string in a non-autoregressive manner to generate an intermediate text representation, wherein the source text string comprises a plurality of source tokens, and wherein the intermediate text representation indicates: (1) a subset of the plurality of source tokens to be maintained for the output text string and (2) an ordering of the subset of the plurality of source tokens to be maintained for the output text string; and

a decoder model configured to process the intermediate text representation in an autoregressive manner to first predict a position token indicating a position at which one or more additional tokens should be inserted into the intermediate text representation and then to second select the one or more additional tokens to insert into the subset of the plurality of source tokens at the position to generate the output text string;

wherein the encoder model is configured to process the source text string in the non-autoregressive manner to generate the intermediate text representation without indicating the position at which one or more of the additional tokens should be inserted into the intermediate text representation.

16 . The one or more non-transitory computer readable media of claim 15 , wherein the encoder model comprises:

a text embedding model configured to process the source text string to generate a hidden representation;

a tagging model configured to assign a respective tag to each of the source tokens in the source text string, the respective tag for each source token indicating whether or not such source token is included in the subset of the plurality of source tokens to be maintained for the output text string; and

a pointer model configured to generate the ordering of the subset of the plurality of source tokens to be maintained for the output text string based at least in part on the hidden representation and the respective tag assigned to each of the source tokens.

17 . The one or more non-transitory computer readable media of claim 15 , wherein each of the encoder model and the decoder model comprises a transformer neural network.

18 . The one or more non-transitory computer readable media of claim 17 , wherein at least the transformer neural network in the decoder model comprises a T5 pre-trained transformer neural network that has been pre-trained to insert missing spans.

19 . The one or more non-transitory computer readable media of claim 18 , wherein the decoder model comprises a single T5 decoder transformer layer.

20 . The one or more non-transitory computer-readable media of claim 15 , wherein the encoder model comprises one or more Sinkhorn layers that normalize over both rows and columns of an intra-pointer attention.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 9, 2022
From: ADAMEK, JAKUB DOMINIK
To: GOOGLE LLC
Reel/Frame 060755/0664 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 4, 2022
From: MALLINSON, JONATHAN STEPHEN; SEVERYN, ALIAKSEI; MALMI, ERIC EMIL
To: GOOGLE LLC
Reel/Frame 060719/0359 →
Continuity (1)
Related Publication 20230376676A1 · Nov 23, 2023
References Cited (43)
US 11644961B1 · Brdiczka · 2023 [cited by examiner]
US 12045568B1 · Shrivastava · 2024 [cited by examiner]
US 12079106B1 · Hu · 2024 [cited by examiner]
US 20190303435A1 · Herr · 2019 [cited by examiner]
US 20200364299A1 · Niu · 2020 [cited by examiner]
US 20210019374A1 · Donaldson · 2021 [cited by examiner]
US 20220198130A1 · Tan · 2022 [cited by examiner]
US 20220261555A1 · Lebanoff · 2022 [cited by examiner]
US 20230090625A1 · Zhang · 2023 [cited by examiner]
US 20230123574A1 · Guberman · 2023 [cited by examiner]
US 20230137209A1 · Nangi · 2023 [cited by examiner]
US 20230237277A1 · Reza · 2023 [cited by examiner]
US 20230267285A1 · Wu · 2023 [cited by examiner]
US 20230335126A1 · Huang · 2023 [cited by examiner]
US 20240161730A1 · Elias · 2024 [cited by examiner]
Huang et al. (Huang, SARG: A novel Semi-Autoregressive Generator for Multi-Turn Incomplete Utterance Restoration), 2021 booktitle={Proceedings of the AAAI Conference on Artificial Intelligence}, vol. {35}, No. {14}, pp.… [cited by examiner]
Lin, CommonGen: A Constrained Text Generation Challenge for Generative Commonsense Reasoning).journal={arXiv preprint arXiv:1911.03705}, 2019, pp. 1-18 (Year: 2019). [cited by examiner]
Zaidi et al., From Autoregressive to Non-Autoregressive: Studies on Text Generation in Neural Sequence Models, school={Monash University}, Apr. 2022, pp. 1-130 (Year: 2022). [cited by examiner]
Kasner et al., title={Data-to-text generation with iterative text editing}, journal={arXiv preprint arXiv:2011.01694}, year={2020}, pp. 1-11 (Year: 2020). [cited by examiner]
Gu et al., title={Levenshtein transformer}, journal={Advances in neural information processing systems}, vol. {32}, year={2019}, pp. 1-11 (Year: 2019). [cited by examiner]
Gu et al., title={Insertion-based decoding with automatically inferred generation order}, journal={Transactions of the Association for Computational Linguistics}, vol. {7}, pp. {661--676}, year={2019}, publisher={MIT Pr… [cited by examiner]
Sander et al., Sinkformers: Transformers with Doubly Stochastic Attention, Jan. 2022, pp. 1-16, arXiv:2110.11773 [cs.LG] (Year: 2022). [cited by examiner]
Alva-Manchego et al., “Learning How to Simplify from Explicit Labeling of Complex-Simplified Text Pairs.” In Proceedings of the Eighth International Joint Conference on Natural Language Processing. (vol. 1: Long Papers)… [cited by applicant]
Awasthi et al., “Parallel Iterative Edit Models for Local Sequence Transduction.” In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on N… [cited by applicant]
Bryant et al., “The BEA-2019 Shared Task on Grammatical Error Correction.” In Proceedings of the Fourteenth Workshop on Innovative Use of NLP for Building Educational Applications, 2019, Florence, Italy, pp. 52-75. [cited by applicant]
Eunsol et al., “Decontextualization: Making Sentences Stand-Alone.” Transactions of the Association for Computational Linguistics, vol. 9, 2019, pp. 447-461. [cited by applicant]
Dong et al., “EditNTS: An Neural Programmer-Interpreter Model for Sentence Simplification Through Explicit Editing.” In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019, Flor… [cited by applicant]
Geva et al., “Discofuse: A Large-Scale Dataset for Discourse-Based Sentence Fusion.”, In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language … [cited by applicant]
Kiyono et al., “An Empirical Study of Incorporating Pseudo Data into Grammatical Error Correction.”, arXiv preprint arXiv:1909.00502v1, Sep. 2, 2019, 13 pages. [cited by applicant]
Liu et al., “Incomplete Utterance Rewriting as Semantic Segmentation.”, In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP),2020, pp. 2846-2857. [cited by applicant]
Mallinson et al., “FELIX: Flexible Text Editing Through Tagging and Insertion.” In Findings of the Association for Computational Linguistics: EMNLP, 2020, pp. 1244-1255. [cited by applicant]
Malmi et al., “Encode, Tag, Realize: High-Precision Text Editing.” In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language… [cited by applicant]
Malmi et al., 2020. “Unsupervised Text Style Transfer with Padded Masked Language Models.” In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, 2020, pp. 8671-8680. [cited by applicant]
Mena et al., 2018. “Learning Latent Permutations with Gumbel-Sinkhorn Networks.” arXiv:1802.08665v1, Feb. 23, 2018, 22 pages. [cited by applicant]
Mizumoto et al., “Mining Revision Log of Language Learning SNS for Automated Japanese Error Correction of Second Language Learners.”, In Proceedings of 5th International Joint Conference on Natural Language Processing, … [cited by applicant]
Omelianchuk et al., “GECTOR—Grammatical Error Correction: Tag, Not Rewrite.” In Proceedings of the Fifteenth Workshop on Innovative Use of NLP for Building Educational Applications, 2020, Seattle, WA, pp. 163-170. [cited by applicant]
Raffel et al., “Exploring the Limits of Transfer Learning with a Unified Text-To-Text Transformer.”, arXiv preprint arXiv:1910.10683v3, Jul. 28, 2020, 67 pages. [cited by applicant]
Rothe et al., “A Simple Recipe for Multilingual Grammatical Error Correction.”, Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natu… [cited by applicant]
Rothe et al., “Leveraging Pre-Trained Checkpoints for Sequence Generation Tasks.” Transactions of the Association for Computational Linguistics, 2019, pp. 264-280. [cited by applicant]
Stahlberg et al., “Seq2edits: Sequence Transduction Using Span-Level Edit Operations.”, arXiv:2009.11136v1, Sep. 23, 2020, 17 pages. [cited by applicant]
Vaswani et al., “Attention is All You Need. In Advances in Neural Information Processing Systems.”, 30: Annual Conference on Neural Information Processing Systems, Dec. 4-9, 2017, Long Beach, CA, pp. 5998-6008. [cited by applicant]
Vinyals et al., “Pointer Networks. In Advances in Neural Information Processing Systems” 28: Annual Conference on Neural Information Processing Systems, Dec. 7-12, 2015, Montreal, Quebec, pp. 2692-2700. [cited by applicant]
Yannakoudakis et al., “A New Dataset and Method for Automatically Grading ESOL Texts.” In Proceedings of the 49th Annual Meeting of The Association for Computational Linguistics: Human Language Technologies, 2011, pp. 1… [cited by applicant]
Cited By (1)
US 12,731,007