Large Language Models vs Rules Engines in Freight: Choosing the Right Tool for Each Decision

By Luis Lopez, AI transportation consultant, CEO of Go Hub.io Holdings Corp and subsidiaries, and host of the Freight Guru Podcast

Freight teams are being told that large language models can handle almost anything. Some of that is true. LLMs are remarkably good at reading messy emails, summarizing long threads and pulling details out of documents that were never designed for a computer. But a lot of freight decisions are not messy at all. They are rules: if this, then that. For those, a rules engine is often the better tool.

The llm vs rules engine question is not about which technology is more advanced. It is about matching the tool to the decision. This article walks through where each one fits, how they work together, and how to test and audit them.

What Each Tool Actually Does

A rules engine applies explicit, written logic. A person defines the conditions and outcomes, and the system follows them exactly. Given the same inputs, it always produces the same output. When it is wrong, you can find the rule that caused the error and fix it.

A large language model generates text based on patterns learned from huge amounts of data. It can interpret language, handle ambiguity and work with inputs no one planned for. Its outputs are probabilistic, which means the same input can produce slightly different results, and it can produce confident answers that are wrong.

For a broader view of how different types of AI fit freight work, see our article on generative AI vs predictive AI in freight.

When Deterministic Rules Are Better

Rules engines win when the logic is known, stable and must be applied the same way every time. Common freight examples include:

Accessorial Billing Rules

If a contract says detention starts after a set free time and bills at a set rate per hour, that is a rule. The system should calculate it from arrival and departure times, not interpret it. An LLM might read the contract correctly most of the time, but “most of the time” is not acceptable on an invoice.

Compliance Checks

Is the carrier’s authority active? Is insurance on file and unexpired? Does the hazmat shipment have the required paperwork fields completed? These are yes-or-no checks against defined requirements. A rules engine can run them instantly and produce a clear reason for every failure.

Rate Tables

Contract rates by lane, weight break or zone belong in a lookup table, not a model’s memory. The rate should come from the agreed table every time, with fuel and accessorials applied by defined formulas.

In all of these cases, the advantages are predictability, speed and auditability. When a customer disputes a charge, you can show exactly which rule produced it.

When LLMs Help

LLMs shine where the input is unstructured or the task involves language. Examples include:

  • Unstructured emails. Quote requests, appointment changes and status questions arrive in every format imaginable. An LLM can read them and identify the request type, origin, destination, dates and special requirements.
  • Documents. Bills of lading, delivery receipts and rate confirmations vary by sender. LLM-based extraction can handle layouts that template-based tools struggle with.
  • Summarization. A long email thread about a delayed shipment can be condensed into a few lines a manager can read in seconds.
  • Drafting. First drafts of customer updates or carrier messages, reviewed by a person before sending.

Our article on AI email triage in freight operations covers one of the most common uses in detail.

The Hybrid Design: LLM Extracts, Rules Decide

The most reliable freight systems often combine both. The pattern is straightforward:

  1. An LLM reads the unstructured input, such as an email or document, and extracts structured fields.
  2. Validation checks confirm the fields are complete and plausible, such as a real ZIP code or a date in the future.
  3. A rules engine applies business logic to those fields: pricing, eligibility, routing or compliance.
  4. Exceptions that fail validation or fall outside rules go to a person.

Consider a quote request email. The LLM pulls out origin, destination, weight, pallet count and pickup date. The rules engine applies the rate table and accessorial rules to produce a price. If the request mentions something unusual, such as hazmat or an oversized piece, the system routes it to a human. The LLM never decides the price, and the rules engine never has to read an email.

This split keeps the flexible part flexible and the critical part predictable.

Testing Both Kinds of Systems

Testing looks different for each tool.

For rules engines, build test cases that cover each rule, including edge cases like zero values, boundary times and missing data. Because outputs are deterministic, a passing test stays passing until someone changes a rule.

For LLM components, build a set of real examples with known correct answers and measure accuracy field by field. Rerun the set whenever you change the prompt or the model, because performance can shift. Pay special attention to cases where the model fills in a value that was not in the source. Our guide on catching AI hallucinations in freight explains how to look for those.

Auditability

Freight runs on documentation. Customers dispute invoices, carriers dispute deductions, and auditors ask how decisions were made. Rules engines are easy to audit because the logic is written down. LLM outputs are harder, so a good design logs the original input, the extracted fields, the model version and the final decision. When something goes wrong, you can see whether the extraction or the rule was at fault.

As an AI transportation consultant, the first thing I look at in any proposed AI workflow is whether someone could explain a specific decision to a customer six months later. If the answer depends on what a model happened to generate that day, the design needs a rules layer.

Cost and Latency

In general terms, rules engines are cheap and fast to run. They execute simple logic and return results almost instantly. LLM calls cost more per request and take longer, especially with large documents or long prompts. That difference matters at volume. Running every routine billing calculation through an LLM adds cost and delay for no benefit. Reserving LLMs for the steps that need language understanding keeps systems responsive and budgets predictable.

A Simple Decision Guide

  • If the logic can be written as clear rules and must be applied identically every time, use a rules engine.
  • If the input is free text, varied documents or conversation, use an LLM to interpret it.
  • If a decision has financial, safety or compliance consequences, let rules make the final call and keep a human on exceptions.
  • If you are unsure, start with the hybrid pattern and measure.

The best freight automation is rarely all one or the other. It uses each tool where it is strongest and keeps people involved where judgment matters.

For more conversations on freight and AI, subscribe to the Freight Guru Podcast.


About the author: Luis Lopez is a Miami-based AI transportation consultant and logistics entrepreneur, the CEO of Go Hub.io Holdings Corp and subsidiaries, and host of the Freight Guru Podcast.

Facebook
Twitter
LinkedIn
Email
More Episodes
Follow me on Social Media

Meet Luis Lopez

Luis Lopez is the chairman of Go Hub Holding Group, a logistics holding corporation and the active CEO of Freight Hub Group.