Digital twins and generative AI: A powerful pairing

by Alex Cosmas, Guilherme Cruz, Sebastian Cubela, Mark Huntington, Sohrab Rahimi, and Sanchit Tiwari

Many organizations across industries are separately implementing digital twins and generative AI (gen AI)—two technologies with distinct value propositions and tremendous promise—to support a wide range of use cases. Gen AI can structure inputs and synthesize outputs of digital twins, and digital twins can provide a robust test-and-learn environment for gen AI. By combining these technologies, organizations could produce synergies that reduce costs, accelerate deployment, and provide substantially more value than either could deliver on its own.

This blog is the first in a three-part series on digital twins. Future posts will explore when and why to use digital twins and delve into an in-depth case study on how gen AI and digital twins could be used to enhance customer experience.

Digital twins and gen AI have proven their value

Each of these technologies has demonstrated its value across a wide range of industries and use cases.

Digital twins—reusable virtual representations of assets, people, or processes and their environments that simulate strategies and optimize behaviors—are a powerful tool that can help organizations improve data-backed decision making. By constructing scenarios of real-world situations and outcomes, they can provide insights that serve as an early-warning system, predicting events and the likelihood they will occur. They also provide a risk-free digital laboratory for testing designs and options, improving efficiency and time to market, for example, by optimizing scheduling, sequencing, and maintenance.

Gen AI describes algorithms that can be used to create content, including audio, code, images, text, simulations, and videos. As with digital twins, gen AI is revolutionizing business processes and activities in myriad ways, and new applications of gen AI are being conceived daily; the impact on productivity and economic potential multiplies with each one.

Today, 75 percent of large enterprises are actively investing in digital twins to scale AI solutions. Each technology has immense potential, and together they could unlock trillions in total economic value.

Generative AI and digital twins elevate and reinforce each other

Digital twins and gen AI can be used in combination to unlock insights and elevate their respective value. Following are some examples.

A universal model

Building a digital twin, especially for highly specialized applications (such as multimachine production scheduling or vehicle routing), can be time-consuming and resource-intensive. The effort often entails designing and developing new digital-twin models, a process that can take six months or longer and incur substantial labor, computing, and server costs. By leveraging a software development platform such as GitHub, large language models (LLMs) can create code for the digital twin, accelerating the development process and increasing effectiveness. This ability to generate such output leads to an exciting prospect: LLMs could possibly be used to create a generalized digital-twin solution—a foundational, universal model—that facilitates design and serves as a starting point for developers across digital-twin projects and even industries.

The architecture of a digital twin can be represented as nodes and edges in a time-series graph, allowing graph-based LLMs (such as GNN-LM, TextGNN, GIANT, and SimTeG) to create a basic model of a twin, whose design can then be built upon and adapted for various scenarios and industries.1 For example, in a future smart-city context, various urban elements—such as traffic systems, public utilities, and environmental sensors—could feed into LLMs, which could identify and create potential connections between nodes in a graph. This lays the groundwork for simulating and predicting interactions and impacts over time.2

Data collection, transfer, and augmentation

Digital twins thrive on large volumes of (often real-time) data from diverse sources, which can be unwieldly to manage. LLMs offer advanced “embedding” capabilities,3 meaning they can significantly compress data while retaining essential information. As such, they enable efficient data transfer and processing in digital twins.4 In a manufacturing setting, for example, gen AI could organize data from maintenance logs, equipment images, and operational videos. A digital twin could analyze this data, identify patterns or anomalies that might not be evident from unstructured data alone, and inform decision making and predictive-maintenance strategies.5

Additionally, gen AI tools can supplement data training sets used by digital twins by creating synthetic data. For example, a set of maintenance logs may not include a particular defect. Gen AI could create a synthetic data set that includes the defect so that the digital twin is trained to recognize it in the future.

Interface

Digital twins generate a large volume of data on assets, people, or processes and their environments. Multimodal LLMs (such as Gemini and GPT-4V) can efficiently analyze and interpret large data sets and synthesize insights. Additionally, LLMs can generate scenarios for the digital twin to simulate that are more comprehensive. In this way, LLMs (such as OptiGuide or Vertex) can function as an interface for simulators, allowing users to communicate with digital twins via natural language (for example, asking questions and receiving understandable insights in return).6 This method eases interactions with a complex system, making it more accessible to users who lack extensive technical expertise, and facilitates data-backed decision making.

Checks and balances

Gen AI not only enhances digital-twin capabilities but also uses real-time data from digital twins as a source of additional context, making inputs (such as prompt engineering) far more dynamic. With stores of robust, contextualized data, digital twins provide a secure environment in which gen AI can “learn” and broaden the scope of prompts and output. Through “what if” simulations run by digital twins, users can fine-tune gen AI, enabling it to conduct predictive modeling, as opposed to the primarily backward-looking view that most LLMs provide. Last, the digital-twin constraint engine can validate gen AI capabilities and boost gen AI accuracy by limiting answers to only feasible regions, helping answers from gen AI adhere to physical limits or other constraints. For example, after gen AI copilots generate code to support a piece of machinery, the digital twin can validate the code before it is deployed to ensure it functions within preset parameters (such as machinery temperature or output rate). While this capability is still in the early stages of development, there is immense potential and substantial future value for a broad variety of use cases.

Capturing synergies requires mitigating certain risks

Leaders can mitigate risks associated with AI tools by establishing clear principles, a guiding framework and commitment to safe, secure use. Gen AI use comes with a potential for inaccuracies and bias, so it is important to ensure that tools are optimized for privacy and regulated data. Extensive diligence is necessary to assess the values and security measures of third parties prior to starting development. During the development process, it is important to carefully consider models’ assumptions and simplifications to ensure outputs are contextualized. Ongoing monitoring is also critical because inaccurate models are apt to produce misleading outcomes that the model itself is unlikely to flag. This can be avoided by ensuring that digital twins and gen AI are built on a foundation of high-volume and high-quality data. Prior to building a digital twin, it is important to have a clear business use case for the twin and safe, quality data available.

Generative AI can present ethical challenges, particularly with respect to data privacy and security. These risks are most prevalent in sensitive industries that handle personally identifiable information (PII). Addressing these challenges requires careful attention to data protection and ethically sourcing training data. Likewise, maintaining a culture of continuous learning and development of AI systems will be important as AI tools continue to evolve and advance. Regular adaptive training, improving feedback loops, and educating users are critical to success and maintaining compliance with legal and societal standards.


The symbiotic relationship between digital twins and gen AI increases their combined scalability, accessibility, and affordability. This new frontier will allow innovative and dynamic organizations to improve their advantage and allow organizations that are lagging behind to catch up to the competition.

Alex Cosmas and Guilherme Cruz are partners in McKinsey’s New York office; Sebastian Cubela is a partner in the Miami office; Mark Huntington is a partner in the Chicago office, where Sanchit Tiwari is a senior principal data scientist; and Sohrab Rahimi is an associate partner in the New Jersey office.

1 Jiadi Du and Tie Luo, “Digital twin graph: Automated domain-agnostic construction, fusion, and simulation of IoT-enabled world,” arXiv, April 20, 2023.
2 Chi Han et al., “Large language models on graphs: A comprehensive survey,” arXiv, February 1, 2024.
3 “Embeddings,” OpenAI, accessed March 25, 2024.
4 Yongming Wang et al., “Wireless network digital twin for 6G: Generative AI as a key enabler,” arXiv, November 29, 2023.
5 Nasser Jazdi et al., “Towards autonomous system: Flexible modular production system enhanced with large language model agents,” arXiv, July 24, 2023.
6 Beibin Li et al., “Large language models for supply chain optimization,” arXiv, July 13, 2023.