Don't make the LLM the classifier
Amazon had Claude Sonnet 4.6 reading 6,554 tokens and writing 170, on average, to put one ticket into one of twenty buckets. Every ticket, in what they call one of the world's largest internal ticketing systems. On November 9, Carr Onstott and Mehul Jaiswal wrote up how they replaced it with a decision model that answers with a single token. Same quality, under a second per call instead of four, and about $500 per million tickets instead of $22,200.
I read it and thought about a prompt I wrote in January 2025.
It was a pre-classifier for support tickets. A notebook, one prompt, a GPT call. The rule was short. Take the tickets still open, hand the model the tags the team had already used on older tickets, and ask for one. I asked someone from support to check the first batch by hand.
Labels kept coming back wrong. The fix we went for was not a bigger model. Someone on the team sat down to review the tags we were feeding the prompt. A week later I moved the prompt into its own file so the support team could change it without waiting for me.
Amazon ended up in the same place, with better numbers. In both cases the hard part was the list of labels.
A label is a closed choice
In May I wrote that most "AI agents" don't need AI in the loop. Of the three jobs I run every day, inbox labeling was the one where I defended the model. Reply, follow up, ignore. Email is the "hard-to-maintain rules" case, and a regex can't tell you if a message is urgent.
I still think that. What I didn't ask back then was what kind of model the job needs.
A language model generates. You give it a prompt, it writes tokens, and you parse the tokens hoping the label you wanted is somewhere in there. For classification that usually means a long system prompt, a JSON schema and a paragraph of reasoning nobody reads. Amazon's setup produced 170 output tokens per ticket to deliver one choice out of twenty.
A decision model can't write. It gets a state, a question and a set of options. It returns a probability for each option and a confidence score. For ticket labeling the state is the ticket and the options are the label catalog. There is nothing to parse and no schema to validate. The output can't come back malformed because there is no text.
The confidence score is the part I care about most. An LLM asked for JSON will happily add a "confidence": 0.92 field. That number is more generated text, produced the same way as the label, and it means whatever you want it to mean. A probability over a closed set is something you can put a threshold on. Amazon did exactly that. They tuned how sure the model had to be before a label was applied.
There is a second lesson I learned the slow way. I have swapped models more than once thinking a better one would fix quality. The gain was always small. What changed the result was fixing the context that went in and the check that ran after. A classifier is the extreme version of that. The context is the label list. The check is a person reading the cases where two answers disagree.
What the research already said about LLM classifiers
None of this is new. Amazon's post is a production receipt for things papers have been measuring for five years.
Order is the first one. In 2021 Tony Zhao and colleagues showed that GPT-3 few-shot accuracy could swing from near chance to near state of the art. The prompt format, the examples and their order were enough. The model leaned toward answers placed near the end of the prompt or common in its training data. In 2023 Pouya Pezeshkpour and Estevam Hruschka reordered the options of multiple choice questions. The performance gap across benchmarks was roughly 13% to 75%. Chujie Zheng and colleagues tested 20 LLMs and traced most of the problem to token bias. Models put more probability on certain option IDs, like "A", before weighing what the options say.
If your label catalog comes out of a database in whatever order the query returns, that bias is already in your production labels.
Decision models are built from the same transformers, so they inherit it. Amazon found that sending the same ticket with the JSON keys in a different order moved the output probabilities by up to 0.19. They now sort the keys on every request. SubQ measured the same thing on a public set of 600 workflow decisions. Rotating the options changed the top answer on 12 to 21% of questions for the decision models they tested. Their Snap 1.2 ships with an inference change so that order no longer moves the answer. That is their benchmark and their claim. Still, someone is measuring it, which is more than most LLM classifiers in production get.
The second finding is about size. Martin Juan José Bucher and Marco Martini put GPT-3.5, GPT-4 and Claude Opus, prompted zero-shot, against smaller fine-tuned models. The tasks were sentiment, emotions, approval and party positions in news, tweets and speeches. The small fine-tuned models won in every case. Cheng-Yu Hsieh and colleagues trained a 770M parameter T5 that beat a few-shot 540B PaLM on a benchmark, using 80% of the available data. They used the big model's rationales as extra training signal. That pattern keeps showing up. The big model ends up as the teacher, and the small one does the daily work.
The third is cost. Lingjiao Chen, Matei Zaharia and James Zou built FrugalGPT, a cascade that learns which model to call for each query. It matched GPT-4 with up to 98% less cost. Same number Amazon reported, three years earlier, in a paper. RouteLLM trained routers between a strong and a weak model and cut cost by more than half in some cases without losing quality.
How Amazon replaced Sonnet with a decision model
The tickets could be customer escalations, capacity requests, automated alarms or security findings, and each had to land in one of 20 categories. Sonnet ran with a long system prompt on every ticket and answered with JSON and reasoning.
They started with the original 2B Strands Decider and moved to the E4B Gemma 4 build after it did clearly better on a test set. It runs on SageMaker, one A10G per instance, about 19 GiB of memory and around 640 ms per request. Ticket events land in SQS, which triggers a Lambda that reads the ticket and calls the endpoint. Plain plumbing.
The real work was in the labels. The production label descriptions alone were longer than the model's 4,096 token window. So they rewrote each of the 20 labels as a criterion of one or two sentences. Those went in as the options of a single question, plus a "none" option. On long tickets they drop the oldest comments to fit.
That is the same move as reviewing our tags in 2025. Nobody wants to do it, and it decides whether the classifier works. A frontier model with a huge context window lets you skip it. You pay for the skip on every ticket, for as long as the system runs.
Then the part I would copy into any project. They didn't flip a switch and hope. The Lambda reads a three-way setting on every message. BEDROCK means Sonnet labels everything. DUAL calls both models in parallel, applies Sonnet's answer and compares it with the Decider's. DECIDER means only the small model runs. They ran DUAL on real traffic and judged every disagreement. In their words, that "told us more than any offline eval would have." Going back was a 45-second config change.
It is the same idea I wrote about in The question has to exist before the code does. They knew how they would judge the new model before they trusted it.
After the switch the average call went from 4,215 ms to 897 ms. Tokens per ticket went from 6,724 to 2,010. Lambda duration dropped 74% on the day they turned Sonnet off. At published list prices that is about $0.0222 per ticket against about $0.0005. The millions saved per year are a projection, and the price table leaves the Lambda out.
The paragraph I trust most is the one where they say when not to do this. Labels that need explanation text, a catalog that changes every week, context that doesn't fit in a few thousand tokens. In any of those, they write, a decision model probably can't replace the LLM. I rarely see that paragraph in a vendor post. It reads like people who measured.
Where the big model belongs
I already run a classifier with no model in it. On my MCP gateway every tool has to be a read or a write before a role can grant it. The verdict comes from overrides in the config, then the protocol annotations, then a score built from the tool name, the description and the schema. Anything in between is treated as a write. When the gateway isn't sure it says no, and the cost is someone adding an override in five minutes.
That is the order I'd follow for any closed choice. Code first, when the rule can be written down. A small decision model when it can't, with a threshold on the confidence and a fallback below it. The big model stays out of the hot path. It drafts the label catalog, reviews the disagreements and handles whatever lands in "none". It is good at that. Paying it to pick one of twenty strings on every request is a prototype nobody went back to finish.
There is also the question of where the data goes. A model that fits on one GPU can sit inside your own network. Amazon's endpoint had outbound access blocked. I have been talking to people who run small models like this in production, some of them on CPU. A first pass on support mail to catch an angry customer early. A judge before and after the expensive call. A guardrail against prompt injection and leaks. None of them needed one more vendor reading every message.
Count the LLM calls in your system that end with one value from a fixed list. Each one is a classifier. Add up what they cost last month and you have the price of a model writing JSON to pick a string.
Use the LLM to figure out the classifier. Don't make it the classifier.