Column
Can LLMs Handle Tariff Code Classification? A Practical Look at Trade Compliance Automation
Misclassifying an HS code can mean tariff surcharges, export control violations, or worse. A new multi-agent LLM framework tackles this problem with grounded reasoning, semantic search, and consensus verification — and the results suggest that human-in-the-loop hybrid beats full automation.
Hello. I’m Inoshita from Affectosphere Group.
If you work in import/export compliance, you have probably had this thought at least once:
“Is this HS code actually correct?”
The Harmonized System (HS) code is the international classification standard for customs. The code assigned to a product determines its tariff rate. A misclassification means you may be paying the wrong duty — or in the worst case, you may be violating export control regulations without realizing it.
And yet, getting the classification right is genuinely hard. New products, composite materials, and dual-use goods regularly fall into gray zones where even experienced customs specialists disagree. Meanwhile, the volume of shipments that need to be classified is massive. Manual review at scale is not feasible.
A study published on arXiv (Truong Thanh Hung Nguyen, Khanh Van Quynh Nguyen, Hoang-Loc Cao, Tri Duong, Phuc Ho, Van Pham, Loc Nguyen, Hung Cao; arXiv:2606.16987) proposes a multi-agent LLM framework for automating Harmonized Tariff Schedule (HTS) code classification. The system integrates multi-agent retrieval, semantic search, grounded reasoning, and consensus verification. It was evaluated on approximately 3,300 items, and the findings suggest that a grounded, uncertainty-aware, human-centered hybrid outperforms full automation.
Today I want to walk through how this framework works — and more importantly, what it means for import/export teams and customs brokers thinking about practical AI adoption.
Three things to take away
- The value: LLM-based HTS classification can achieve both accuracy and explainability — but only when grounded reasoning and consensus verification are built in.
- How the framework works: the four-component architecture and why each piece matters.
- A concrete hybrid workflow: what import/export teams and customs brokers could actually implement today.
① Why HS code classification is a hard problem
Let’s start by being honest about the difficulty.
The Harmonized System is maintained by the World Customs Organization (WCO). It organizes goods into 21 sections, 97 chapters, and roughly 5,000 subheadings — all organized hierarchically. Each country then adds further national subdivisions on top of that (Japan uses 9 digits; the US uses 10).
There are three sources of genuine difficulty.
Ambiguous material and use combinations. Consider a carbon-fiber wristband device. Is it sporting goods, electronics, or medical equipment? The correct classification depends on the product’s “principal use” — a judgment call that is inherently subjective and context-dependent.
Hierarchy depth. Arriving at the correct code requires navigating the full classification tree correctly at every level. Errors at early levels cascade downward.
Regulatory revision. The HS code system is updated periodically. New technology and new product categories trigger revisions that can invalidate previously correct classifications.
Manual review handles these challenges in the short run — but at scale and speed, it breaks down.
② Framework architecture: four components
The framework proposed in this research combines four distinct functions.
Multi-Agent Retrieval
Multiple agents work in parallel to gather relevant information: regulations, classification guidelines, precedents, product descriptions, and customs rulings. The parallel search is designed so that information missed by one agent can be recovered by another.
This addresses one of the core weaknesses of a single-model approach: a single LLM can confidently miss sources that a multi-agent ensemble would surface.
Semantic Search
Rather than keyword matching, the system retrieves candidate HS codes based on semantic similarity.
A product description like “wearable carbon-fiber monitoring device” is matched against classification categories by meaning, not exact wording. This makes the system robust to variations in how products are described and enables it to handle novel product types that don’t appear verbatim in the training data.
Grounded Reasoning
The system generates a classification decision along with an explicit rationale grounded in specific regulations, rulings, or precedents.
“This product is classified under subheading X because it satisfies the conditions specified in WCO explanatory note Y” is the form of output. This grounding is what makes the decision auditable — and what distinguishes this approach from black-box automation.
Consensus Verification
Multiple agents produce independent classifications, and the system checks their agreement.
When agents disagree, the system flags the case as high-uncertainty. That flag is the mechanism for routing the case to human review. When agents agree, the classification proceeds with higher confidence.
③ The key finding: why hybrid beats full automation
The most practically important result from this research is the finding that a human-centered hybrid — where LLMs handle the routine and humans handle the uncertain — outperforms full automation.
This is not surprising if you think about it from a risk management perspective. HS code misclassifications carry real legal and financial consequences. The cases where an LLM will err are disproportionately the complex, ambiguous cases — exactly the ones where the cost of error is highest.
Full automation fails not because LLMs perform poorly on average, but because they fail badly on hard cases without surfacing any signal that they are uncertain.
The hybrid architecture proposed here solves this by making uncertainty visible. When consensus is high, the classification is likely reliable. When consensus is low, a human needs to look.
This design principle — “automate the easy cases, escalate the hard ones” — is straightforward, but it requires the system to actually know the difference. Consensus verification is the mechanism that makes that possible.
A concrete hybrid workflow for trade compliance teams
Here is how I would translate this research into a practical implementation for an import/export team or customs brokerage.
Use case 1: First-time HS code determination for new products
Target team: Import/export control department, customs team
Problem: Every new product launch or supplier change requires an initial HS code determination. Without in-house expertise, this gets outsourced — slowly and at cost.
Hybrid workflow:
- Input product name, material description, and intended use as free text.
- LLM generates 2–3 candidate HS codes with grounded rationale for each.
- If consensus is high across agents → customs specialist performs final sign-off only.
- If consensus is low (complex case) → customs specialist reviews from scratch.
KPIs to track: Lead time for initial classification (e.g., from 3 business days to same-day), reduction in cases requiring full specialist review.
Use case 2: Risk screening of historical declarations
Target team: Trade compliance, legal/regulatory affairs
Problem: A company has thousands of past declarations and needs to identify potential misclassifications — especially ones created by recent HS code revisions — without manually reviewing every record.
Hybrid workflow:
- Input historical declaration data (product description + assigned HS code) in batch.
- LLM re-evaluates each declaration and generates a risk score based on consistency with current classification standards.
- High-risk declarations are prioritized for human review.
KPIs to track: Time to complete a screening pass, discovery rate of high-risk misclassifications.
The compliance automation SaaS opportunity
Stepping back to the business picture for a moment.
The framework described in this research maps onto a commercially viable SaaS design, at least in rough outline.
Target customers: Mid-to-large importers and exporters with hundreds of shipments per month; mid-size customs brokerage firms.
Value proposition: Faster initial classification, grounded rationale for audit documentation, reduced specialist burden on routine cases.
Differentiation: Converting “I’m not sure if this is right” into “consensus 92%, based on WCO note X and ruling Y.”
The unresolved question — which would need to be answered before this becomes a real product — is legal liability. Who is responsible when the AI-assisted classification turns out to be wrong? Designing the liability boundaries and error correction processes will likely be the harder work compared to the technical implementation.
But the direction is plausible. Trade compliance is a domain where the cost of errors is high, the volume is large, and expert capacity is limited. Those are exactly the conditions where AI-assisted workflows tend to generate real value.
Takeaway
HS code classification automation should not mean handing the decision entirely to an LLM. The realistic and better-performing design is: LLM generates candidate classifications with grounded rationale, uncertainty-aware routing escalates the hard cases to human review.
The framework in this research — grounded reasoning combined with multi-agent consensus verification — is a concrete reference point for any team designing that kind of workflow.
References
- Truong Thanh Hung Nguyen, Khanh Van Quynh Nguyen, Hoang-Loc Cao, Tri Duong, Phuc Ho, Van Pham, Loc Nguyen, Hung Cao (2026). Consensus-based Agentic Large Language Model Framework for Harmonized Tariff Schedule Code Classification. arXiv preprint arXiv:2606.16987.
* This article was written in part with AI assistance and may contain inaccuracies.