# US 2024/0004619 A1 · Using indentation to trim output of a language synthesis model

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0004619 A1
- Document ID: US20240004619A1
- Status: Published application
- Kind: A1
- Application number: 17/853,105
- Filed: 2022-06-29
- Published: 2024-01-04
- Earliest claimed: 2022-06-29
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Johan Sebastian Heesemann ROSENKILDE; Albert ZIEGLER; Oegerikus DE MOOR; Maksym TARAN; Edward Emil AFTANDILIAN; Arjuna Ganesh SITTAMPALAM; Krzysztof Stanislaw CIESLAK
- Web page: https://patentgrep.com/patent/US20240004619A1

## CPC

- G06F 8/35: model driven
- G06F 8/33: Intelligent editors
- G06F 8/427: {Parsing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Using indentation to trim output of a language synthesis model. A computer system determines a first indentation level associated with a cursor within an editor buffer. The computer system identifies a block of line(s) from an output from a language synthesis model. Each line in the block meets at least one criterion from a set of criteria, including a first criterion that the line is an initial line in the output from the language synthesis model, a second criterion that the line has a second indentation level that is greater than the first indentation level, and a third criterion that the line contains a continuation token. The computer system identifies a particular line, immediately following the block, that does not meet any criterion from the set of criteria. The computer system trims the output from the language synthesis model from the particular line onward.

## Claims

### Claim 1

A method, implemented at a computer system that includes a processor, for using indentation to trim output of a language synthesis model, the method comprising:
determining a first indentation level associated with a cursor within an editor buffer;
identifying a block of one or more lines from an output from a language synthesis model, each line in the block of one or more lines meeting at least one criterion from a set of criteria, the set of criteria including:
a first criterion that the line is an initial line in the output from the language synthesis model,
a second criterion that the line has a second indentation level that is greater than the first indentation level, and
a third criterion that the line contains a continuation token;
identifying a particular line, immediately following the block of one or more lines, that does not meet any criterion from the set of criteria; and
trimming the output from the language synthesis model from the particular line onward.

### Claim 2 (depends on 1)

The method of claim 1, further comprising, based on having identified the particular line, stopping generation of the output by the language synthesis model.

### Claim 3 (depends on 1)

The method of claim 1, wherein a blank line in the output from the language synthesis model is determined to have an indentation level greater than the first indentation level.

### Claim 4 (depends on 1)

The method of claim 1, wherein a line containing only whitespace characters is determined to be a blank line.

### Claim 5 (depends on 1)

The method of claim 1, wherein determining the first indentation level comprises determining that the first indentation level is equal to an indentation level of a line within the editor buffer at which the cursor is located.

### Claim 6 (depends on 1)

The method of claim 1, wherein determining the first indentation level comprises determining that the first indentation level is equal to an indentation level of a non-blank line before a line within the editor buffer at which the cursor is located.

### Claim 7 (depends on 1)

The method of claim 1, wherein determining the first indentation level comprises determining that the first indentation level is equal to an indentation level of a non-blank line after a line within the editor buffer at which the cursor is located.

### Claim 8 (depends on 1)

The method of claim 1, wherein determining the first indentation level comprises determining that the first indentation level is equal to a maximum of a third indentation level of a first non-blank line before a line within the editor buffer at which the cursor is located, and a fourth indentation level of a second non-blank line after the line within the editor buffer at which the cursor is located.

### Claim 9 (depends on 1)

The method of claim 1, wherein the third criterion applies only if a context of the cursor within the editor buffer is associated with the continuation token.

### Claim 10 (depends on 1)

The method of claim 1, wherein the continuation token is defined by regular expression.

### Claim 11 (depends on 1)

The method of claim 1, wherein the continuation token is same-level control flow keyword, an end keyword, a brace control symbol, or a multi-line comment symbol.

### Claim 12 (depends on 1)

The method of claim 1, further comprising inserting the block of one or more lines at the cursor.

### Claim 13

A computer system for using indentation to trim output of a language synthesis model, comprising:
a processor; and
a computer storage media that stores computer-executable instructions that are executable by the processor to cause the computer system to at least:
determine a first indentation level associated with a cursor within an editor buffer;
identify a block of one or more lines from an output from a language synthesis model, each line in the block of one or more lines meeting at least one criterion from a set of criteria, the set of criteria including:
a first criterion that the line is an initial line in the output from the language synthesis model,
a second criterion that the line has a second indentation level that is greater than the first indentation level, and
a third criterion that the line contains a continuation token;
identify a particular line, immediately following the block of one or more lines, that does not meet any criterion from the set of criteria; and
trim the output from the language synthesis model from the particular line onward.

### Claim 14 (depends on 13)

The computer system of claim 13, the computer-executable instructions also including instructions that are executable by the processor to cause the computer system to, based on having identified the particular line, stop generation of the output by the language synthesis model.

### Claim 15 (depends on 13)

The computer system of claim 13, wherein a blank line in the output from the language synthesis model is determined to have an indentation level greater than the first indentation level.

### Claim 16 (depends on 13)

The computer system of claim 13, wherein a line containing only whitespace characters is determined to be a blank line.

### Claim 17 (depends on 13)

The computer system of claim 13, wherein determining the first indentation level comprises at least one of:
determining that the first indentation level is equal to a third indentation level of a line within the editor buffer at which the cursor is located;
determining that the first indentation level is equal to a fourth indentation level of a first non-blank line before the line within the editor buffer at which the cursor is located;
determining that the first indentation level is equal to a fifth indentation level of a second non-blank line after the line within the editor buffer at which the cursor is located; or
determining that the first indentation level is equal to a maximum of the fourth indentation level and the fifth indentation level.

### Claim 18 (depends on 13)

The computer system of claim 13, wherein the third criterion applies only if a context of the cursor within the editor buffer is associated with the continuation token.

### Claim 19 (depends on 13)

The computer system of claim 13, the computer-executable instructions also including instructions that are executable by the processor to cause the computer system to insert the block of one or more lines at the cursor.

### Claim 20

A computer program product comprising a computer storage media that stores computer-executable instructions that are executable by a processor to cause a computer system to use indentation to trim output of a language synthesis model, the computer-executable instructions including instructions that are executable by the processor to cause the computer system to at least:
determine a first indentation level associated with a cursor within an editor buffer;
identify a block of one or more lines from an output from a language synthesis model, each line in the block of one or more lines meeting at least one criterion from a set of criteria, the set of criteria including:
a first criterion that the line is an initial line in the output from the language synthesis model,
a second criterion that the line has a second indentation level that is greater than the first indentation level, and
a third criterion that the line contains a continuation token, wherein the second criterion applies only if a context of the cursor within the editor buffer is associated with the continuation token;
identify a particular line, immediately following the block of one or more lines, that does not meet any criterion from the set of criteria; and
trim the output from the language synthesis model from the particular line onward.
