Abstract
Programmatic document generation using large language models (LLMs) with cloud-based editor application programming interfaces can present challenges. Verbose native document formats may lead to high token consumption, and character-indexed updates can cause coordinate drift, potentially resulting in layout corruption. A disclosed technology can utilize a dual-representation architecture that decouples a document's semantic content from its coordinate metadata. A source document may be compiled into a simplified, token-efficient abstract syntax tree (AST) for content population by an LLM, while an isolated index dictionary can preserve the original coordinates and styling. A two-pass synchronization process may then reconstruct the final document by separating text mutations from structural changes, thereby helping to mitigate coordinate drift. This approach can reduce token usage and improve the reliability of automated document synthesis.
Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 License.
Recommended Citation
Dutta, Sparsh; R, Adithya; Rungta, Nikita; Gupta, Dev; Bhattacharya, Saswata; and Suman, Shishir, "System for Document Generation Using a Decoupled Abstract Syntax Tree and Two-Pass Execution", Technical Disclosure Commons, (August 20, 2026)
https://www.tdcommons.org/dpubs_series/11450