Skip to main content

Command Palette

Search for a command to run...

Notes on Large Language Models for Supply Chain Optimization

This is a summary of an important research paper that provides a 20:1 time savings. It was made interactively by a human and several AI's. The goal is to save time and curate good ideas.

Published
4 min read
Notes on Large Language Models for Supply Chain Optimization

Link to paper: https://arxiv.org/abs/2307.03875

Paper published on: 2023-07-13

Paper's authors: Beibin Li, Konstantina Mellou, Bo Zhang, Jeevan Pathuri, Ishai Menache

GPT3 API Cost: $0.04

GPT4 API Cost: $0.12

Total Cost To Write This: $0.16

Time Savings: 20:1

Understanding OptiGuide: Harnessing Large Language Models for Supply Chain Optimization

Let's dive into a fascinating piece of research that demonstrates how Large Language Models (LLMs), specifically GPT-4, can be used to optimize supply chains, specifically within the context of Microsoft's Azure cloud system. This research introduces us to OptiGuide, a novel framework that leverages LLMs to interpret optimization outcomes, providing valuable insights.

OptiGuide: A Framework for Supply Chain Optimization

OptiGuide is designed to work in tandem with optimization solvers, not as a replacement. It can answer what-if scenarios and doesn't require sending proprietary data to LLMs. This is particularly important when dealing with sensitive supply chain data.

The framework consists of agents (coder, safeguard, interpreter), application-specific components (database, solver, helper), and user interaction. Each component plays a crucial role: the coder translates user queries into optimization statements, the safeguard ensures the optimization doesn't breach any constraints, and the interpreter uses the LLM to explain the optimization outcome in a user-friendly manner.

Adapting LLMs for Specific Applications

LLMs can be adapted for specific applications using two methods: fine-tuning and in-context learning. Fine-tuning involves adjusting the weights of a pre-trained LLM, while in-context learning involves incorporating domain-specific examples into the prompt.

However, there are challenges. The limited number of tokens that LLMs can process can be a constraint. Privacy is also a concern when using domain-specific information in the prompt, as proprietary data may be involved. LLMs can provide sub-optimal outcomes, and domain-specific tools may be needed to improve accuracy.

OptiGuide in Action: A Real-world Scenario

The authors tested OptiGuide on a real server placement scenario within Microsoft's cloud supply chain. This involved decisions on hardware supplier selection, timeline of deployment, and cluster deployment location. The preliminary feedback from users has been positive, with users expressing excitement about the potential of OptiGuide to help them understand the underlying optimization logic.

Evaluating OptiGuide: Benchmark and Results

The authors developed an evaluation benchmark to measure the accuracy of LLM output. This benchmark includes various optimization problems and uses Python code and the Gurobi optimization solver. The evaluation methodology is based on the accuracy of the language models in answering user questions.

In this evaluation, GPT-4 outperformed text-davinci-003 in both in-distribution and out-of-distribution evaluation. GPT-4 demonstrated stronger reasoning and generalization capabilities, particularly in out-of-distribution evaluation.

OptiGuide Beyond Azure: Coffee Distribution Optimization

The research also involves a case study of optimizing coffee distribution from suppliers to roasteries to cafes. The objective is to minimize the total cost, which includes docking costs, unsatisfied demand costs, and shipping costs. The model includes variables for shipping quantities and roasting quantities.

The model is solved using the Gurobi optimization library. The research includes useful tricks such as saving optimization data in an SQL database and providing intermediate outputs. The code uses the OptiGuide tool with Azure IFS for optimization.

Coding with OptiGuide: Understanding the Syntax

The research provides several code snippets to illustrate how OptiGuide can be used to set constraints and modify variables in a supply chain model. For instance, the line "m.addConstr(ydark[{{VALUE-ROASTERY}}, c] == 0, "")" sets a constraint that the dark coffee from a specific roastery cannot be used at a specific cafe.

Another example is "capacity_in_supplier[{{VALUE-SUPPLIER}}] = capacity_in_supplier[{{VALUE-SUPPLIER}}]/2", which reduces the capacity of a supplier by half. These code snippets provide a hands-on understanding of how OptiGuide can be used for practical supply chain optimization.

Future Directions and Limitations

While OptiGuide shows promise, it has its limitations. It needs specific user questions and depends on application-specific components. Future research directions could include incorporating human feedback, using smaller models for specific tasks, and designing a hybrid framework that combines different AI models.

In conclusion, this research presents a compelling case for the integration of LLMs in supply chain optimization. OptiGuide represents a significant step forward, demonstrating how AI can be harnessed to drive efficiency and provide valuable insights in complex supply chain scenarios.