AWS for Industries
Optimization in the era of generative AI
Operations research (OR) optimization is a critically important discipline that focuses on applying advanced analytical methods to help make better decisions. By using mathematical models, statistics, and algorithms, OR optimization aims to find the most efficient solutions to complex problems in various industries, such as logistics, finance, healthcare, and manufacturing. It involves formulating real-world problems as mathematical expressions and then solving these using optimization techniques for the best possible outcomes, such as minimizing costs, maximizing profits, and improving efficiency. The field uses various methodologies, including linear programming, integer programming, and nonlinear programming, and it is pivotal in enhancing operational effectiveness and strategic planning.
As customers of Amazon Web Services (AWS) find themselves navigating increasingly complex environments, OR optimization provides the tools and frameworks necessary to make informed, data-driven decisions that drive growth and innovation. OR optimization utilizes solvers, which are specialized software tools designed to find optimal solutions to mathematical models representing real-world problems. These solvers use various algorithms and computational techniques, helping users avoid the need to design their own algorithms for solving common types of problems. Widely used solvers include commercial ones like CPLEX, Gurobi, and Xpress, as well as open source options like COIN-OR LP (CLP), HIGHS, and SCIP.
Customers across various industries have diverse optimization needs. Typical applications of optimization include supply chain management, production planning, scheduling, portfolio management, and resource allocation, to name just a few.
- Supply chain optimization: Many companies rely on optimization techniques to streamline their supply chain operations. This involves optimizing inventory levels, transportation routes, production schedules, and distribution networks to minimize costs while meeting customer demand. Optimization algorithms help companies determine the most efficient way to allocate resources, reduce lead times, and improve overall supply chain performance. For example, a logistics company may use optimization to determine the most cost-effective routes for delivering goods to various destinations, considering factors such as distance, fuel cost, vehicle capacity, and delivery deadlines.
- Financial portfolio optimization: In the field of finance, portfolio optimization involves selecting the optimal mix of assets to maximize returns while minimizing risk. Investors use optimization techniques to construct diversified portfolios that offer the highest expected return for a given level of risk, or the lowest risk for a given level of return. Optimization algorithms take into account factors such as asset returns, correlations, volatility, and investment constraints to identify the portfolio allocation that achieves the investor’s objectives. For instance, a wealth management firm may use optimization to allocate funds across different asset classes (such as stocks, bonds, and commodities) to achieve a client’s investment goals while managing risk.
- Production planning and scheduling: Manufacturing companies employ optimization techniques to optimize production planning and scheduling processes. This involves determining the most efficient use of resources, such as labor, machines, and materials, to meet production targets while minimizing costs and maximizing productivity. Optimization algorithms help companies optimize production schedules, allocate resources effectively, minimize idling time, and reduce setup/changeover time. For example, a manufacturing plant may use optimization to schedule production runs, sequence tasks on the production line, and allocate workforce resources to maximize throughput and minimize production costs.
Customers often run optimization solvers on AWS, taking advantage of the scalable compute resources and managed services available in the cloud. AWS provides a robust infrastructure for running solvers – empowering customers to tackle complex optimization problems efficiently and cost-effectively. With AWS, customers can access powerful compute resources on demand, scale their workloads seamlessly, and benefit from the security and reliability of cloud solutions.
How generative AI is impacting optimization
Operations research and machine learning (ML) are distinct yet complementary fields that share the goal of deriving insights and optimizing decisions with the use of data. OR primarily focuses on formulating and solving mathematical models to optimize complex systems and processes, using techniques such as linear programming and integer programming. OR’s roots are in mathematical optimization and statistical analysis, which have traditionally been applied to logistical, financial, and operational challenges. ML, on the other hand, is a subset of artificial intelligence (AI) that empowers systems to learn patterns from data and make predictions or decisions without being explicitly programmed to do so. ML uses technologies like neural networks, decision trees, and clustering to uncover insights and automate tasks.
The connection between OR and ML is increasingly evident as the need to integrate predictive analytics (a strength of ML) with prescriptive analytics (a strength of OR) becomes more prevalent. For instance, ML models can predict future trends or behavior based on historical data, and OR models can then use these predictions to optimize strategic decisions. This synergy enhances the ability to not only predict outcomes but also to prescribe optimal actions based on those predictions. Combining OR’s rigorous optimization frameworks with ML’s adaptive learning capabilities creates powerful tools for tackling complex, data-driven challenges across various industries.
Generative AI, an emerging field of great promise on the present ML landscape, is also pushing the boundaries of what is possible in OR optimization, providing innovative approaches to tackle the increasingly complex problems faced by various industries. As these technologies continue to evolve, they promise to complement traditional methods and expand the toolkit available to operations researchers. We will now explore a few specific use cases connecting generative AI and optimization.
Use case 1: Optimization coding assistant
Recent advances in large language models (LLMs) like ChatGPT have democratized access to AI capabilities by facilitating natural language interaction, significantly simplifying many tasks—including code generation. Code generation is highly correlated to the task of automating the generation of mathematical models. LLMs underpin intelligent copilots that enhance user productivity, such as GitHub Copilot, which accelerates software development through natural language interaction. Similar products include Amazon Q Developer, the leading generative AI–powered assistant for software development, OpenAI Codex, and others. Inspired by the trend of using LLMs for code generation, researchers and industries have begun to explore the possibility of using LLMs to help formulate mathematical optimization problems and obtain solutions, making expert-level optimization more accessible.
Solutions like chain-of-experts (CoE), a novel multi-agent cooperative framework to enhance reasoning capabilities, have recently been proposed to help formulate optimization problems. In the CoE framework, each agent is assigned a specific role, such as programmer, modeling expert, terminology interpreter, and others. These agents are then given domain knowledge related to OR and other fields. The authors of CoE then use another LLM-based agent to orchestrate the other agents through forward thought construction and backward reflection mechanisms. The backward reflection mechanism empowers the system to use external feedback and dynamically adjust the collaboration among experts.
In the video demo below, we show how you can use Amazon Q Developer to interactively edit an optimization project. Here, we start with a standard vehicle routing problem (VRP) using OR tools and ask Amazon Q Developer to use forecasted demand at the nodes rather than static demand to solve it. Amazon Q Developer plans the route and provides updates that can be verified before adding it to a project. As a follow-up, we ask Amazon Q Developer to implement a standard forecasting library to replace the baseline forecast, which is based on historical average. Amazon Q Developer then uses Prophet to update the forecasting section. In this specific example, we leave the optimization model untouched, but the same procedure can be used to edit any part of the example VRP project—from the optimization model to test functions to adding more functionality, such as connecting to other AWS services.
Use case 2: Smart interface for models
Generative AI is revolutionizing OR by offering smart interfaces that simplify and enhance interactions with complex models. By providing an abstraction layer at the level of natural language, it empowers users to understand a model’s purpose and facilitates the use and analysis of models. One example use case is data ingestion: generative AI can advise users on what data is required to run a model and assist in directly ingesting the necessary data into the model. In this video, we present a demo in which generative AI helps users interact with a routing optimization model, demonstrating its practical application and ease of use.
Going beyond simple data ingestion, another compelling use case involves a framework that accepts plain-text queries and outputs insights about optimization outcomes. This tool, designed to enhance user interaction, empowers users to define novel scenarios and evaluate model performance under those conditions. For example, the tool can answer questions like, “How much performance improvement will I see if I open a new store at this particular location?” It typically uses predefined schemes and templates to guide LLMs in modifying existing models based on natural language descriptions. This capability empowers planners with greater autonomy and significantly reduces the engineering on-call burden. Previously, addressing a single what-if question required coordination among multiple operators and an on-call engineer, but this process is now streamlined. One such example is OptiGuide, a recently proposed solution for supply chain optimization. OptiGuide has received positive feedback from planners and engineers, who have appreciated its ability to clarify optimization logic and support critical what-if scenarios. According to its authors, OptiGuide achieved over 90 percent accuracy in preliminary evaluations, demonstrating how generative AI can make advanced analytical techniques more accessible and efficient, thereby promoting better decision-making in operational contexts.
Generative AI also helps with model interpretation and explainability. Generative AI systems can offer detailed and comprehensible descriptions of optimization models themselves, explaining their objectives, constraints, and variables in plain language. This capability is particularly beneficial for users who may not have extensive expertise in optimization modeling, empowering them to more easily grasp a model’s intricacies. Moreover, these systems can identify potential sources of infeasibility—a situation in which no solution satisfies all the constraints of the optimization problem. For example, generative AI can assist investors and portfolio managers in interpreting the results of complex portfolio optimization models. These models aim to maximize returns while minimizing risk and adhering to various constraints related to asset allocation, diversification, and regulatory requirements. The AI system can explain the optimal portfolio composition, identify potential sources of risk or constraint violations, and provide suggestions for adjusting the portfolio to align with the desired risk-return profile. Overall, generative AI is proving to be pivotal in bridging the gap between complex optimization models and human understanding – empowering users to gain valuable insights, troubleshoot issues, and make informed decisions based on optimization results.
Conclusion
In this blog, we introduced the world of OR optimization and presented our views on how generative AI will increase the use of optimization by organizations while empowering a new category of business users. We believe our customers will eventually run hundreds of optimization models aimed at improving all parts of their businesses. Today, we are helping many of our most advanced customers across various industries in laying the foundation for making this vision a reality.
For interested readers, please see the following links for more about how Amazon and AWS customers use optimization: