Abstract

Large Language Models (LLMs) can have difficulty identifying or referencing specific line numbers in a file, which may affect their performance in tasks involving precise text or code manipulation. This disclosure describes a method to provide LLMs with positional awareness by embedding line number metadata into the file content. The technique can involve preprocessing a file to wrap each line in a structural marker, such as an XML-style tag, that contains the corresponding line number. When presented with this augmented file, the LLM may process the content and its associated line number metadata simultaneously. This can enable the model to more reliably locate, reference, and perform operations on specific lines, which may facilitate improved accuracy in line-based file editing, code modification, and generation of patch files.

Creative Commons License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.

Share

COinS