IBM Files Patent to Make AI Coding Tools Remember What Your Code Is For
A family-tree method from biology sits at the center of IBM's new patent, which tries to teach AI coding tools what each piece of code is actually for.
What IBM's intention-tree idea actually does
Today's AI coding assistants learn by reading enormous piles of code and guessing what comes next. That gets the grammar right, but the tools often miss how a piece of code fits into the bigger project and what it was meant to do. The result can drift away from what you asked for.
IBM's filing adds a middle step. First, the system reads a company's existing code and sorts it into a tree that shows its structure. Then an AI writes a plain-language note for each chunk, such as 'defines a class named BubbleSort,' and those notes get attached to the matching code. The result is what IBM calls an intention tree: a map of what the code does and why.
When you later ask the AI to write, rewrite or translate code, it can use that map as a guide. IBM also says the map can help spot duplicate code, so the AI doesn't keep writing the same thing twice.
… generating an intention tree using the cladogram to represent the syntactical information associated with intention statements that describe an intention associated with portions of the original code base …
Translation: The tool creates an intention tree by linking code syntax with statements about what the code is supposed to do.
How IBM turns code into a tree of purposes
The claims describe a four-step method. The system starts with an existing code base (the full set of files in a software project) and turns it into a syntax tree, a branching diagram of how each statement is built, such as an operator with its two inputs hanging below it.
Next, it converts that syntax tree into a cladogram. That's a family-tree-style diagram borrowed from biology, where scientists group species by shared traits. Here the 'species' are algorithms, and the traits include things like recursion (a function that calls itself), stability, and in-place operation. The filing's example compares bubble sort, merge sort, quick sort and insertion sort.
Then the system builds the intention tree:
- Syntax nodes stand for pieces of the original code.
- Intention nodes hold a plain-language description of each piece, which can be written by a large language model (the AI behind chatbots).
- Edges (links) connect each intention to its code, join different versions of the same component, and join pieces with similar intentions.
The notes can be written per line or per function. Finally, code is generated from the tree. The filing lists copying code, rewriting it while keeping its purpose, translating it into another programming language, writing documentation, and refactoring (cleaning up) by clustering similar intentions to remove redundant code.
Why IBM is aiming at old, duplicated code
If you work on software, the practical promise is an AI assistant that stays closer to what your code is supposed to do. It could help with chores like translating an old program into a new language, writing missing documentation, or finding the near-identical copies of a function that pile up over the years. The filing says translation could work without training on paired examples of the two languages.
For IBM, the angle is older code. The filing mentions working out the intent of undocumented or legacy code and checking code against written requirements. Many large companies have that problem. Still, this is a patent application describing a method, and the text gives no test results, so how well it works is unknown.
This is the 46th AI assistant and agent filing from IBM we've tracked since May, a company that has also applied to trim old chat history and pick the best chatbot answer.
If you write code for a living, you'd notice this one in the dull places: fewer duplicate functions, notes on old code nobody documented, and AI suggestions that match what a program is for. That is a modest but useful benefit.
If you don't code, you'd likely never see it directly. It would show up as apps and company software that are easier to fix and update, if it works.
The biology borrowing is a fun idea. The filing gives no results, so the benefit stays a promise. A tool that explains each chunk of code in plain English, then checks new code against those notes, would save real time on cleanup. Whether it beats simply asking an AI to read the code is the open question.
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 IBM patent news breaks.
There are more where this came from
We read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.
The drawings
7 drawing sheets from US 2026/0339622 A1 · click any drawing to enlarge
Want this weekly breakdown for a company we don't cover? Patentlyze Pro →
Be the first to weigh in