From 8,000 raw PLC logs to 25 relevant tokens: Slashing cloud AI spend by 85%

An engineering guide to context pruning, sub-second diagnostics, and zero-trust IP protection on the factory floor.

What you’ll learn:

  • On a modern production line, diagnostic data pours continuously from a dense web of industrial assets.
  • To troubleshoot a breakdown, an AI model doesn't need 10,000 lines of digital noise. It only needs five core inputs.
  • Manufacturers don’t need to send every line of a PLC log to an LLM. Most of that data has already been generated for other purposes and contains information an AI model doesn’t need.

Rolling out generative AI on the factory floor seems like a quick win. AI can parse error logs, translate maintenance tickets, and automate quality checks, saving hours of manual work. Yet when all that data reaches the model unfiltered, the savings can start disappearing into a quieter cost: compute bloat.

Just as Lean manufacturing eliminates physical waste on the assembly line, software architectures require the same discipline to cut digital waste across data pipelines.

See also: Navigating financial anxiety around paying the bill for industrial AI

The root cause is rarely a single fault message. On a modern production line, diagnostic data pours continuously from a dense web of industrial assets: Siemens SIMATIC S7 and Allen-Bradley ControlLogix PLCs, SCADA panels, OPC UA gateways, historians, MES platforms, and robotic cells.

When something breaks, the system rarely emits a neat, isolated error report. Instead, it dumps a massive stream of telemetry jammed with thousands of repetitive INFO/DEBUG events, heartbeat pings, transient sensor jitter, and retried network connections.

A single operational fault routinely generates 100 to 500 KB of raw diagnostic context—roughly 2,000 to 10,000 lines of unformatted text.

Signal vs. noise: What AI diagnostics actually need

To troubleshoot a breakdown, an AI model doesn't need 10,000 lines of digital noise. It only needs five core inputs:

  • The exact fault code
  • The operational state of the machine when it failed
  • A few critical sensor threshold readings
  • Parameter shifts leading up to the trip
  • 10 to 30 relevant preceding events

Piping full, raw logs directly into a cloud large language model means paying cloud API fees on tens of thousands of redundant tokens that basic deterministic logic could clean up at the edge in milliseconds.

The math behind industrial noise

Research across industrial setups shows just how much noise hides inside raw factory data streams:

  • Cutting out chatter: Studies on process alarms show that "chattering" alarms (sensors firing repeatedly over short bursts) account for 10% to 60% of total alarm volume. In one refinery case, a single sensor tag generated 135 rapid-fire alarm events. Adding a 120-second chatter filter cut that down to just 4 clear events—a 97% reduction in data volume before any pattern analysis even started.
  • Compressing log templates: Open-source log analysis tools (like LogPare) show that over 10,000 raw log lines can be condensed into 23 core templates through pattern extraction, cutting token consumption by 60% to 90%.

The Nordic reality: CSRD, supply chains, and data governance

For Nordic manufacturers, unoptimized compute usage creates a business problem that reaches well beyond IT, affecting three critical areas:

  • Scope 3 carbon tracking: Under EU CSRD mandates, companies must account for indirect digital emissions (GHG Protocol Scope 3). Bloated cloud processing can unnecessarily inflate your corporate carbon numbers.
  • Supply chain expectations: Major industrial buyers like Vestas, Danfoss, and Volvo now demand proven resource efficiency across both physical and digital operations. Higher digital emissions increase the overall carbon footprint of the parts you ship.
  • Data governance and IP protection: Sending raw production logs straight to third-party cloud endpoints opens the door to leaking proprietary machine configurations, recipes, and core trade secrets.

Manufacturers don’t need to send every line of a PLC log to an LLM. Most of that data has already been generated for other purposes and contains information an AI model doesn’t need.

See also: When agents clash: Stopping algorithmic civil war on the plant floor

Filtering and structuring it at the edge means we can send a much smaller, more relevant context to the model while keeping sensitive production data inside the factory network.

Building a Lean industrial AI architecture

Solving compute bloat starts with an “edge-first, cloud-when-needed” approach that keeps AI efficient without limiting its use.

Industrial edge hardware

For lighter workloads like filtering, anomaly detection, vector embeddings, or running small models, hardware such as the NVIDIA Jetson Orin NX or GPU-enabled industrial PCs (IPCs) is standard.

This is far beyond trial setups: Siemens now sells the SIMATIC BX-35A (powered by the Jetson Orin NX) specifically for factory AI jobs like predictive maintenance and visual inspection. For heavier demands, local edge servers keep computation securely inside the OT/IT boundary.

Small language models over LLMs

Rather than sending every single prompt to a massive cloud LLM, edge setups rely on compact models with 2B to 8B parameters (like fine-tuned versions of Phi, Gemma, Llama, or Qwen).

See also: Give operators the authority to stop flawed AI workflows

These focused models easily handle tasks like converting alarm codes, machine status, telemetry, and manual notes into clear diagnostic summaries, offering faster turnaround times, offline functionality, and full data privacy.

The pre-cloud context pruning layer

Sitting right between OT data flows and the AI engine, a deterministic log parser handles 90% of data cleanup in milliseconds. The execution pipeline follows a clear sequence:

  • Normalization
  • Deduplication
  • Noise filtering
  • Template extraction
  • IP redaction
  • Relevance scoring
  • Token pruning
  • Cache lookup
  • AI inference

By introducing an adaptive semantic cache, repeated error patterns hit local memory directly, skipping AI inference entirely for known issues.

Business impact and benchmarks

Trimming down the industrial data pipeline brings immediate gains across cost, speed, and overall security:

  • 70% to 85% cut in billable tokens: Where a raw diagnostic request used to send 20,000 input tokens, structured filtering drops that payload to 3,000 to 6,000 tokens. Open-source optimization tools (like Headroom) show similar wins, bringing log processing requests down from 22,000 to 3,300 tokens (an 85% drop).
  • Sub-second response times: Pure cloud setups often suffer multi-second delays from network round trips and queuing. Edge workflows remove the network bottleneck altogether. Local anomaly checks and cached template matches run in milliseconds, shrinking diagnostic response times from 3-5 seconds down to under a second.
  • Zero-trust data protection: Raw PLC logs, machine identifiers, and operational recipes never leave the plant floor. External APIs receive only scrubbed metadata. Security stays airtight through OT network segmentation, strict firewall egress rules, TLS/mTLS encryption, and local runtimes.
  • Field insight: When tuning diagnostic pipelines for automated production lines, swapping raw stream forwarding for edge template extraction consistently slashes token usage by over 75%, while bringing diagnostic response times down from several seconds to sub-second speeds.

Auditing your current cloud API usage and log-processing pipelines is one of the fastest ways to lower operational costs while keeping your competitive edge across the Nordic manufacturing landscape.

About the Author

Alex Pletnov

Alex Pletnov

Alex Pletnov is CTO and co-founder of Keenethics, an industrial software engineering firm specializing in digital Lean, edge computing, and compute-efficient AI architectures for manufacturing. With a background in complex system architecture, his work focuses on optimizing shop-floor telemetry pipelines, safeguarding operational IP, and aligning industrial software with EU CSRD digital compliance standards.

Sign up for our eNewsletters
Get the latest news and updates