Refineries make money one barrel at a time inside the process units and then hand a large fraction of that margin back at the blend header. Every gasoline batch that ships at 87.3 octane against an 87.0 spec, every ultra-low-sulfur diesel batch that ships at 9 ppm against a 10 ppm spec, every fuel oil cargo that runs 0.3% sulfur below cap — all of that is quality the refinery paid to produce and the market never paid it for. The industry has a plain name for that gap: giveaway. On a 150,000 barrel-per-day refinery it routinely runs above $30 million a year across gasoline, distillate, and heavy-oil products combined, and most of it hides in operating buffers that look conservative and prudent when a shift supervisor writes them into the blend recipe. AI blending optimization closes those buffers on purpose, safely, by predicting blend properties in real time rather than waiting for a lab result and then leaving a cushion. That is exactly what the product blending optimization platform from iFactory is built to do.
Refinery Unit AI · Blending Optimization · Giveaway Reduction
AI for Product Blending Optimization: Gasoline, Diesel and Fuel Oil
Every refinery blend header carries a quality buffer above spec — half an octane on gasoline, a couple of ppm on diesel sulfur, a few tenths of a percent on fuel oil sulfur — that exists to protect against lab delay, analyzer drift, and LP model error. iFactory replaces those buffers with a real-time nonlinear property predictor that trims each blend to spec without crossing it, and reallocates high-value components from wasted quality into higher-grade production. Live on the blend header, coordinated with your planning LP, on-prem.
$30M+
Typical annual giveaway at a 150 kbpd refinery
10–15 Specs
Simultaneously satisfied on a modern gasoline blend
Nonlinear
Real octane and cloud-point interactions, not LP indices
The Money Hook
Where Giveaway Actually Comes From — And What It's Worth
Gasoline Octane Giveaway
0.5 ON average US refinery
≈ $15M/yr at 100 kbpd
Gasoline RVP Giveaway
≈ $7M/yr at 100 kbpd
Diesel Sulfur Giveaway
1–2 ppm below 10 ppm ULSD cap
Hydrotreating cost + slate flexibility
Fuel Oil Sulfur Giveaway
0.1–0.3% below MARPOL/IMO cap
Low-sulfur cutter stock wasted
Giveaway compounds because operators can't unwind it — a barrel of gasoline that leaves the header at 87.3 octane is gone at 87.3 octane forever. The margin the refinery already paid to make that extra 0.3 ON stays in the blend, uncompensated. On a 150 kbpd refinery, cumulative giveaway across gasoline, distillate and heavy oil regularly runs above $30M/year.
The Blend Problem Isn't Small
What Actually Has to Be Satisfied on Every Blend, Simultaneously
Gasoline
10–15 Specs at Once
RON & MON at multiple boiling-range portions
Reid Vapor Pressure (RVP) — seasonal caps
Initial, T50, T90, and end boiling points
Sulfur — Tier 3 annual average and cap
Aromatics, olefins, benzene content
Oxygenate content (ethanol, MTBE if permitted)
Colour, stability, driveability index
Diesel
8+ Specs at Once
Cetane number and cetane index
Sulfur — 10 ppm ULSD cap
Cloud point (seasonal, regional)
Pour point and CFPP
Flash point (safety spec)
Density and viscosity
T90, T95 distillation points
Aromatic content and lubricity
Fuel Oil
Cargo-Grade Compliance
Sulfur — MARPOL/IMO cap by grade
Viscosity at 50°C — ISO 8217 grade
Pour point — winter/summer
Flash point and water content
Density and compatibility (stability)
Vanadium, sodium, aluminum + silicon
5 to 12+ blendstocks per grade
Every finished grade is assembled from a set of components — virgin naphtha, reformate, alkylate, FCC gasoline, hydrocracked naphtha, butane, MTBE, kerosene, LCO, straight-run distillate, cutter stock. Each has its own specification vector and its own manufacturing cost.
Why Linear Programming Alone Isn't Enough
The Nonlinearity LP Models Approximate — and AI Doesn't
Linear Programming Approach
Uses linear blending indices for octane, cloud point, viscosity
Empirical correction factors bolted on top of the linear form
Composition-effect interactions (olefin content, aromatic content) not fully captured
Solved on a planning cadence — daily or shift-by-shift, not per-second
Lab results confirm actual blend properties hours after the fact
Operators respond by widening quality buffers
Nonlinear AI Predictor
Learned nonlinear blending model from historical lab results
Captures interaction effects between olefinic, aromatic, and paraffinic components
Handles ethanol synergy and antagonism explicitly, not as a correction
Runs every few seconds against the live header property analyzers
Predicts finished property before the barrel leaves the header
Quality buffer collapses from a shift-scale cushion to an analyzer-scale margin
See the Giveaway on Your Own Blends
Get a 30-Minute Giveaway Audit on Your Last 90 Days of Blend Data
Send us blend header history — actual finished properties, tank certificates, and spec limits by grade — and we'll quantify your octane, RVP, and sulfur giveaway in barrels and dollars, plus what an AI-tightened blend would have looked like against the same production plan.
How a Blend Actually Runs, Second by Second
From Component Tank to Certified Product — The AI Loop
1
Component Property Update
Fresh property data on every component tank — RON, sulfur, RVP, density — either from on-line NIR/NMR analyzers or the last lab certificate, weighted by tank movement since.
2
Recipe Solve
Optimizer computes the minimum-cost recipe that hits every finished spec exactly at target, given current component properties, component availability, and blend rate.
3
Setpoints to Ratio Controllers
Component flow ratios written to the blend header ratio controllers through the DCS. Blend rate held steady, ratios update as component properties or availability shift.
4
In-Line Analyzer Feedback
In-line NIR, sulfur, and density analyzers on the finished header feed back. Optimizer closes the loop on any bias between predicted and measured, per property.
5
Certificate at Batch End
Batch closes at target quality, not above it. Lab certificate confirms — with the giveaway distribution collapsed toward zero on the properties the AI controlled to.
Real Situations That Move Blend Margin
Where the Optimizer Earns Back a Basis Point per Barrel
A
Reformer Trip Mid-Blend
Reformate flow drops unexpectedly. LP-recipe blends stall or over-buffer octane with alkylate to be safe — the console blender has no better option than reaching for the highest-octane inventory available and hoping to catch the shortfall. The AI optimizer re-solves in seconds against the reduced high-octane inventory, shifts butane and light naphtha ratios, and finishes the blend on spec without pulling in premium components the refinery didn't need to spend. The alkylate stays in the tank for a batch that actually needs it.
B
RVP Season Changeover Weekend
Summer RVP cap comes into effect. Manual approach over-corrects on butane pull, sacrificing a full psi of octane-boosting volume. The AI holds RVP exactly at the seasonal cap, preserves as much butane as legally allowed, and captures roughly $7M/year at a 100 kbpd site on RVP alone.
C
Cold-Snap Diesel Cloud-Point Emergency
Regional cloud-point spec tightens overnight for winter. Manual response drops kerosene into every diesel blend defensively, sacrificing jet-fuel margin on batches that didn't actually need the kerosene. The AI reallocates kerosene only where the specific diesel batch's cloud point needs it — respecting the individual component-mix of that batch — and keeps jet inventory available for its higher-value market. Multiply that decision across every diesel batch through a winter and it becomes a real number on the monthly slate report.
D
Fuel Oil Cargo Nomination With Tight Sulfur
A 0.5% sulfur cargo is nominated against a slate heavy on 1% straight-run resid. Manual blending burns low-sulfur cutter aggressively to stay well below cap because the console blender is protecting against a lab-latency surprise. The AI trims cutter usage to the cap minus analyzer margin, preserving cutter stock for the next cargo and lifting effective refinery-wide low-sulfur availability. On a slate running multiple low-sulfur cargoes a week, the cutter savings become a meaningful working-capital lever.
E
Ethanol Blend Value Shift
Ethanol economics flip midweek versus alkylate on the RIN and RBOB markets. The optimizer reprices the octane contribution of each blendstock against the new relative cost and rebalances the recipe automatically, capturing the arbitrage instead of waiting for the day-shift blender to notice the pricing shift, re-run the LP, and hand a revised recipe to the console. Two or three of these captured shifts per month adds up to real economics against a marketing team that used to have to explain the miss.
Two Ways to Run the Blend Header
LP-Only Blending vs LP + Real-Time AI Optimization
| Aspect | LP + Manual Adjustment | iFactory AI Blend Optimization |
| Recipe update cadence | Daily or per-batch | Every few seconds during the blend |
| Nonlinear property handling | Linear indices with empirical corrections | Learned nonlinear model with interaction terms |
| Quality buffer per property | Wide — hours of lab latency covered | Narrow — analyzer noise and drift only |
| Component switch response | Manual, minutes to hours | Automatic within the current blend |
| Off-spec risk | Managed through conservative buffering | Managed through predictor confidence bounds |
| Ethanol / oxygenate synergy | Approximated as a correction | Modeled explicitly per component |
| Planning LP alignment | Blender re-solves standalone | Optimizer feeds actual giveaway back to planning |
| Typical annual value | Baseline giveaway holds | Multi-million-dollar recovery on gasoline alone |
How It Deploys
Sitting Between Planning LP and DCS — Advisory First, Closed-Loop When Trusted
Phase 1
Historian & Lab Baseline
Ingest 12+ months of blend header data, component analyzer history, and lab certificates. Train the nonlinear property predictor per grade. Quantify current giveaway per property and per grade.
Phase 2
Advisory Mode on Live Header
Optimizer runs on live blends but only recommends ratio changes to the console blender, with the predicted quality and giveaway delta shown per recommendation. Trust builds against actual lab certificates.
Phase 3
Bounded Closed Loop
Once acceptance on advisory recommendations is consistently high, ratio setpoints are written directly to the DCS ratio controllers within pre-agreed bounds. Blender retains full override and stop authority at all times.
On-prem · No cloud dependency · Planning-LP-agnostic (Aspen PIMS, Haverly GRTMPS, Honeywell RPMS)
The optimizer runs on-prem hardware inside the plant network. Setpoint writes happen through the same DCS ratio controllers the console blender already uses. Nothing bypasses the console. The optimizer complements the planning LP rather than replacing it — planning solves the slate and inventory allocation, the AI closes the giveaway inside each batch.
Non-Negotiable Guardrails
What the Optimizer Never Trades Against a Basis Point
Regulatory Cap Compliance
Sulfur, RVP, benzene, aromatics — every regulated property has an analyzer-margin buffer that is never traded off, even when planning inventory would benefit.
Predictor Confidence Bounds
Every property prediction ships with a confidence interval. The optimizer targets spec-minus-CI, not the spec itself, so the actual finished product is never at the razor's edge.
Analyzer Health Interlocks
If an in-line analyzer degrades or drifts beyond calibration bounds, the optimizer widens its buffer automatically on that property and alerts the blender — never runs blind.
Grade Downgrade Protection
Off-spec risk on a premium grade is worth vastly more than any per-batch giveaway win. The optimizer respects an explicit downgrade-cost weight in its objective function.
Tank Book & Inventory Consistency
Component draws stay consistent with tank inventory and planning-LP allocation. The optimizer doesn't spend components the plan needs elsewhere without console blender approval.
Blender Stop Authority
Console blender retains one-touch authority to revert to planning-LP recipe or drop the optimizer to advisory-only mode at any moment, no reason required.
Common Questions
AI Blend Optimization — FAQ
Does the AI optimizer replace our planning LP (PIMS, GRTMPS, RPMS)?
No, and it shouldn't. The planning LP solves the daily or weekly slate — which crudes to run, which units to push, which grades to make, how to allocate components across product pools. The AI optimizer solves the batch-level nonlinear property problem inside the recipe the LP produced. The two layers coordinate: the AI feeds actual per-batch giveaway back into the planning cycle so the LP recalibrates on real blend behavior rather than static blending indices, and the LP hands the AI a starting recipe and an inventory allocation to respect. Most sites see the largest value from the coordination between the two rather than from replacing either.
How does the optimizer handle in-line analyzer drift or failure?
Every in-line analyzer is monitored against a calibration model. If a property analyzer drifts beyond bounds, the optimizer widens its predictor buffer on that specific property, alerts the console blender, and — if drift is severe or the analyzer fails — falls back to the property predictor plus lab-latency safety margin until the analyzer is repaired. The system is designed so an analyzer problem produces a controlled loss of giveaway benefit on one property, not an off-spec risk.
Our team can walk through the specific analyzer-fallback logic for your installed base.
What's a realistic first-year payback for a mid-sized refinery?
Industry benchmarks put octane and RVP giveaway savings alone at roughly $23M/year at a 100 kbpd refinery when the blending system is upgraded and buffers are tightened. Real results depend on how much giveaway your current setup carries — a well-tuned NIR-driven blender with a disciplined LP process already captures some of that opportunity, while a shop still running on shift-scale lab feedback typically has more to recover. The most honest answer specific to your site comes from running the giveaway audit against your actual blend history, which is what the offline analysis in Phase 1 produces.
Do we need to install new in-line analyzers before this works?
Not necessarily. The optimizer works with whatever analyzer coverage you already have — sites with a strong NIR and sulfur analyzer suite on the finished header capture the most benefit fastest, but sites with a lighter analyzer footprint still recover meaningful giveaway using property predictors calibrated against lab history. Where an added analyzer would clearly pay back, we flag it during the Phase 1 baseline — but nothing is capital-gated. The system is designed to add value with your current instrumentation and improve as analyzer coverage grows.
How does closed-loop mode differ from advisory, and who decides when to move?
In advisory mode, every ratio recommendation surfaces on the blender HMI with the predicted quality outcome and the giveaway delta shown alongside — the blender accepts or overrides each one. In closed-loop mode, ratio moves within pre-agreed bounds write directly to the DCS ratio controllers, with the blender retaining full override and stop authority at any moment. The transition is a decision the site makes, not the vendor — typically after several weeks of advisory operation where the acceptance rate on recommendations is consistently high and lab certificates confirm the predicted quality outcomes.
Book a demo to walk through the specific advisory-to-closed-loop protocol.
Stop Giving Away What You Already Paid to Make
Close the Giveaway Gap on Every Blend, Every Shift, Every Grade
iFactory delivers product blending optimization as a co-pilot for the console blender — nonlinear property predictor, in-line analyzer integration, planning-LP coordination, on-prem deployment, advisory-first rollout, and full blender override authority preserved at all times.