Microsoft Patents a Method for Trimming Work Files Down Before AI Reads Them
Ask an AI assistant to fix one block of code in a long notebook, and it can end up editing the wrong block. A new Microsoft patent filing tries to prevent that by cleaning up the file before the AI ever reads it.

- Publication number
- US 2026/0368066 A1(US20260368066A1)
- Applicant
- Microsoft Technology Licensing, LLC
- Filed · Published
- May 14, 2025 · Nov 19, 2026
- Inventors
- Peng LYU, Don Thilaka Sri JAYAMANNE, Kai-Uwe MAETZEL
- Status when we published
- Waiting for an examiner
- Document
- 20 claims
- US classification
- 717/126
What Microsoft's notebook cleanup does for AI
Coding notebooks, the documents data scientists use to mix code, notes and charts, keep every result right next to the code that produced it. That is handy for a person. For an AI assistant it is a pile of extra material, some of it irrelevant and some easy to misread, and the assistant can lose track of which section it is supposed to change.
Microsoft's patent filing describes a cleanup step that runs before the AI sees anything. It strips out the saved results, gives each block of code its own unique code instead of a simple 1, 2, 3 number, and can label which programming language each block uses. The AI then receives that slimmed-down version along with your request.
What comes back is a suggested change, which you see on screen. In some versions, the AI asks your permission before it actually edits the file.
remove the outputs of the respective subroutines from the deserialized notebook file; add hash values, which uniquely identify the cells, in the deserialized notebook file; and add representations of valid programming code snippets, which represent the respective subroutines, in the deserialized notebook file; …
Translation: The system strips out old results, labels each section with a unique ID, and keeps only the actual code before sending it to the AI.
How the file gets stripped before the AI sees it
The filing starts with a computational notebook, a document that mixes code, notes and results in separate blocks called cells. Before the AI sees anything, the system takes the notebook's working copy and serializes it (converts it into text that can be stored or sent) in a slimmed-down format.
The main claim has three steps:
- Remove the outputs. Charts, tables and printed results are dropped. The filing gives 10% to 50% smaller files as examples.
- Add hash values. Each cell gets a unique code (a short scrambled string made with a standard algorithm such as SHA-256) in place of a position number.
- Add valid code snippets. Each cell's code is included in a form that follows the rules of its programming language.
Optional extras include a language label for every cell, removal of side notes (metadata), and rendering embedded images when the AI can handle them.
The slimmed file travels with your request to the AI model, which returns a recommended change. You see it as a text suggestion or a code diff (a view of what was added, deleted or changed). Examples include reordering cells to match the order they actually run, renaming a variable everywhere after you change it in one cell, drafting the next cell, or fixing an error.
An AI model is caused to recommend a change to the notebook file by providing the serialized notebook file to the AI model.
Translation: The trimmed-down file is then handed to an artificial intelligence so it can suggest improvements.
Why unique cell codes matter for AI coding help
If you have ever asked an AI assistant to tidy a long document and watched it change the wrong paragraph, you know the risk. The filing says old-style numbering leads AI to renumber cells or edit the wrong ones when cells are added or deleted, and unique codes are its fix. For people who write data analysis code, that could mean assistant edits that land where you meant them to.
The bigger picture is that Microsoft treats the file format itself as part of the AI problem. Among the example tools the filing lists are Visual Studio and an Azure AI suite, and it says the chosen format does not depend on whether the original is a Jupyter,.NET or GitHub issues notebook. The idea is to prepare the document better for whatever AI model sits behind the assistant.
That makes this Microsoft's 672nd filing in our Microsoft coverage since May, adding to work like the AI fact-checker and the filter-aware search tool.
Source: US 2026/0368066 A1 at the USPTO (PDF). Full patent text and figures are in the official publication.
Get our take in your Top Stories
Liked this breakdown? Add Patentlyze as a preferred source on Google, and our plain-English take shows up more often in your Top Stories the next time Microsoft patent news breaks.
We read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.
The drawings · 6 sheets
6 drawing sheets from US 2026/0368066 A1 · click any drawing to enlarge

No comments yet