Salesforce Patents AI That Corrects Its Own Visual Math Mistakes
Counting objects in a photo sounds trivial for a human, but it trips up most AI systems. Salesforce is filing a patent for a method that trains AI to get this right by having one model quiz another, then scoring the answers.
How Salesforce trains AI to count and compare what it sees
You're reviewing a sales dashboard packed with charts and product photos, and the AI assistant you rely on confidently gives you the wrong count. It says there are four items in a cluster image when there are six. That kind of arithmetic slip is a real and common failure in AI systems that read images.
Salesforce's patent describes a system where AI teaches itself to fix that problem. A first AI model generates an image, writes a math-related question about it (like "how many red objects are in this picture?"), and produces both a correct and a deliberately wrong answer. That set of four pieces, the image, the question, the right answer, and the wrong one, is used to train a second AI model. The second model learns by figuring out which answer is right and updating itself based on whether it got it correct.
The result is an AI agent that has practiced thousands of these drills before ever seeing real data. Rather than needing humans to label millions of examples by hand, the system generates its own training material automatically.
generating, programmically, an image containing at least one object having a target arithmetic property; generating a query relating to the target arithmetic property using a query-response template based on the generated image …
Translation: The system creates an image with a specific math feature and makes up a matching question to test the AI.
Inside the four-part training data Salesforce builds from scratch
The patent describes a pipeline for generating training data and using it to improve a language model's ability to reason about numbers it sees in images, things like counting objects, comparing quantities, or identifying numeric properties in a picture.
Here is how the pipeline works step by step:
- Step 1 - Synthetic image generation: A program creates images that contain objects with specific arithmetic properties (for example, seven blue circles or three stacked boxes). This removes the need for human-labeled photo datasets.
- Step 2 - Query and answer generation: A first neural network (a large language model) reads the image and writes a question tied to the numeric property, then generates both a correct "positive" response and an incorrect "negative" response. Together with the image and question, these form what the patent calls a training quadruple.
- Step 3 - Policy-guided candidate generation: A second, separate language model is given the quadruple and produces its own candidate answer. It also outputs two probabilities: how likely is this answer to be the correct one, and how likely is it to be the wrong one.
- Step 4 - Training objective: The system calculates a loss (a math score measuring how far off the model's guess is) based on those two probabilities and uses it to update the second model's internal settings, nudging it toward better answers over many rounds.
Once training is complete, the second model is deployed as the active AI agent. The whole loop is self-contained: no human labelers are needed at any point.
… generating, by a first neural network language model, a positive response and a negative response; and forming a training quadruple including the image, the query, the positive response and the negative response.
Translation: One AI model generates both a correct and an incorrect answer to package into a training set alongside the image and question.
What this means for AI agents handling real business data
For anyone building or buying AI tools that read charts, invoices, product images, or any document where numbers matter, this kind of failure, a confident but wrong count, is not a minor annoyance. It is a trust-destroying bug. A system trained the way Salesforce describes here would have seen a huge volume of arithmetic drills before deployment, which should reduce that class of error meaningfully.
Salesforce's customer base runs on data-heavy workflows: sales reports, inventory counts, financial summaries. An AI agent that can reliably read a chart and tell you the right number has obvious value in that context. The self-generating training approach also matters economically because human data labeling is slow and expensive. AI researchers who follow new Big Tech patents in the visual reasoning space will recognize this filing as part of a wider push to close the gap between what language models can say and what they can actually count.
Salesforce files its ninth patent we've tracked since July in our AI teams watchlist, building on a task-routing system and an AI answer coach to push further into multi-agent design.
The design makes a deliberate trade: by generating synthetic images and answers programmatically instead of using real-world labeled data, Salesforce gains scale and speed but risks a training distribution that does not match the messy, varied images an agent will actually encounter on the job. Synthetic drills can produce a model that aces tidy test images but still stumbles on a poorly scanned invoice or an unlabeled bar chart. That gap between training conditions and deployment conditions is the central cost of this approach, and the patent does not describe how the system handles it. That said, the self-supervised loop is a reasonable engineering bet for a company that needs AI agents to handle numeric reasoning across enterprise software at scale, and the quadruple-based training signal is a clean mechanism for teaching a model to distinguish right from wrong without human annotation.
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
13 drawing sheets from US 2026/0244680 A1 · click any drawing to enlarge
Want this weekly breakdown for a company we don't cover? Patentlyze Pro →