Skip to content
Back to skills

Relaxation Informed Surrogate Training

ASecurity

Relaxation-Informed Training (RIT) for neural network surrogate models enabling exact MILP embedding with reduced binary variables. Activation triggers: surrogate optimization, MILP embedding, neural network relaxation, ReLU pruning, optimization surrogate

  • 3 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 11, 2026
researchpythongoperformance

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add hiyenwong/ai_collection --skill relaxation-informed-surrogate-training --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Relaxation Informed Surrogate Training?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Relaxation Informed Surrogate Training
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hiyenwong-relaxation-informed-surrogate-training/badge)](https://www.skillsdirectory.com/skills/hiyenwong-relaxation-informed-surrogate-training)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: relaxation-informed-surrogate-training
description: "Relaxation-Informed Training (RIT) for neural network surrogate models enabling exact MILP embedding with reduced binary variables. Activation triggers: surrogate optimization, MILP embedding, neural network relaxation, ReLU pruning, optimization surrogate"
---

# Relaxation-Informed Training of Neural Network Surrogate Models

> Training framework for ReLU neural networks that enables exact embedding in Mixed-Integer Linear Programs (MILPs) while minimizing computational complexity through structural optimization.

## Metadata
- **Source**: arXiv:2604.22746
- **Authors**: Optimization/ML Research Group
- **Published**: 2026-04-27
- **Categories**: cs.LG, math.OC

## Core Methodology

### Problem Statement
ReLU neural networks trained as surrogate models for optimization problems can be embedded exactly in MILPs. However, the tractability of the resulting MILP depends critically on the number of binary variables representing ReLU activations. Standard training produces dense activation patterns, leading to intractable optimization problems.

### Relaxation-Informed Training Approach
**Key Insight**: Training with relaxed activations (linear instead of step) produces networks that are:
- Structurally sparse in activations
- Computationally efficient in MILP embedding
- Maintains approximation quality

### Structural Pruning During Training
- Replace ReLU step function with linear relaxation during training
- Promotes dead neurons and sparse activation patterns
- Results in fewer binary variables in final MILP formulation

## Implementation Guide

### Prerequisites
- PyTorch
- CVXPY or commercial MILP solver (Gurobi, CPLEX)
- Optimization problem formulation

### Step-by-Step

1. **Define Surrogate Architecture**
   ```python
   import torch
   import torch.nn as nn
   
   class RelaxedReLU(nn.Module):
       def __init__(self, epsilon=0.1):
           super().__init__()
           self.epsilon = epsilon
       
       def forward(self, x, training=True):
           if training:
               # Linear relaxation during training
               return torch.where(x > 0, x, self.epsilon * x)
           else:
               return torch.relu(x)
   ```

2. **Training with Relaxation**
   ```python
   def train_with_relaxation(model, data_loader, epochs=100):
       optimizer = torch.optim.Adam(model.parameters())
       
       for epoch in range(epochs):
           # Phase 1: Relaxed training (promotes sparsity)
           if epoch < epochs * 0.7:
               model.use_relaxed_activation = True
           else:
               model.use_relaxed_activation = False  # Fine-tune with ReLU
           
           for batch in data_loader:
               loss = compute_surrogate_loss(model, batch)
               optimizer.zero_grad()
               loss.backward()
               optimizer.step()
   ```

3. **MILP Embedding**
   ```python
   def embed_in_milp(model):
       binary_count = 0
       constraints = []
       
       for layer in model.layers:
           if isinstance(layer, nn.ReLU):
               # Only create binary var for active neurons
               active = (layer.weight.data.abs() > threshold).sum()
               binary_count += active
               constraints.append(create_big_m_constraint(layer))
       
       print(f"Total binary variables: {binary_count}")
       return constraints
   ```

4. **Optimization**
   ```python
   import cvxpy as cp
   
   # Create MILP with reduced binaries
   x = cp.Variable(n_inputs)
   y, binaries = model.to_milp(x)  # Sparse embedding
   objective = cp.Minimize(y)
   problem = cp.Problem(objective, constraints + binaries)
   problem.solve(solver=cp.GUROBI)
   ```

## Applications
- **Simulation Optimization**: Replace expensive simulators with tractable surrogates
- **Control Systems**: Model Predictive Control with learned dynamics
- **Chemical Engineering**: Process optimization via surrogate models
- **Energy Systems**: Power grid optimization with learned constraints

## Pitfalls
- Too aggressive relaxation (large epsilon) may degrade accuracy
- Requires careful scheduling between relaxed and ReLU phases
- MILP solver choice significantly impacts performance
- Not suitable for all problem types—test on problem class first

## Related Skills
- surrogate-optimization
- mixed-integer-programming
- physics-informed-neural-networks
- neural-network-pruning

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…