Skip to the articles
AavtikalAITechSciencePolitics
Aavtikal/ AI
Capital Kranti news
AavtikalAITechSciencePolitics
SearchWho writesCapital Kranti newsEditor’s page

Appearance

ગુજરાતીEnglishहिन्दी

Diffusion Model Architecture: The Mathematical Journey from Thermodynamics to AI Image Generation

The physics, neural architecture, and mathematical workings behind diffusion models that create astonishing images and videos in artificial intelligence.

Aavtikal AI desk29 October 2026 · 5 min read
This picture shows the step-by-step image generation process of Stable Diffusion.
This picture shows the step-by-step image generation process of Stable Diffusion.
Send on WhatsApp

In today's age of artificial intelligence (AI), models like Stable Diffusion, DALL-E, and Midjourney generate highly visual and realistic images from just a small text prompt. The technology working behind this seemingly miraculous creation is called 'Diffusion Models' or 'Score-based generative models'. These models have brought a revolutionary transformation in the field of generative AI. However, understanding how these models fundamentally work, what their mathematical framework is, and how a beautiful image is produced from chaotic digital noise is extremely fascinating.

Mathematically, a diffusion model is a type of 'latent variable generative models'. There are two main parts to this model: the first is the 'Forward Diffusion Process' and the second is the 'Reverse Sampling Process'. The primary objective of the model is to learn the patterns of a given dataset of information or images and generate new data of the same type. It views data as a process where each data point takes a random walk with drift in a vast space of probabilities.

Diffusion Model Working Methodology: Step-by-Step ProcessThe main stages of how a diffusion model adds noise from data and creates new data through a reverse process.
  1. 1. Dataset SelectionSamples are taken from the original image dataset to learn its mathematical probability pattern.
  2. 2. Forward Diffusion ProcessGaussian noise is progressively added to the original image to convert it into completely chaotic noise.
  3. 3. Neural Network TrainingThe noise added at each stage is estimated by backbone networks (such as U-Net or Transformer).
  4. 4. Reverse Sampling ProcessStarting from pure random noise, the network progressively denoises it to create an attractive image.
Diffusion Model Working Methodology: Step-by-Step ProcessFrom Image to Noise and Generation of New Image from Noise
  1. 1. Forward DiffusionGaussian noise is added step-by-step to the original image (x₀) so that it turns into completely chaotic noise (x_T).
  2. 2. Noise PredictionThe neural network (U-Net or Transformer) learns to estimate the noise added at any stage using precise mathematics.
  3. 3. Reverse DenoisingStarting from completely random noise, the model gradually subtracts noise and turns back towards a clean image.
  4. 4. Output GenerationBased on the text prompt or guidance, the model prepares a completely new and clear image.

The scientific foundation of diffusion models lies in a branch of physics called 'Non-equilibrium Thermodynamics'. First in 2015, researchers proposed this method of generating data from extremely complex probability distributions by using the laws of physics of diffusion. Considering a collection of natural images, each image is like a point in the imaginary space of images. When noise (fuzzy clutter) is repeatedly added to an image, it transforms into a 'Gaussian distribution'. By reversing this process, original data can be recovered from completely chaotic noise.

This process can be compared to the physics 'Maxwell-Boltzmann distribution', where particle movement occurs in a potential well V(x) = 1/2 ||x||². If the system has only gradient descent (a bias towards a specific direction), all particles gather at the center and are destroyed. Therefore, to maintain equilibrium, it becomes necessary to add randomness to it. A 2020 research paper introduced the 'Denoising Diffusion Probabilistic Model' (DDPM), which wonderfully improved this technique using variational inference.

Major Architectures and Technical Comparison in the Field of Diffusion ModelingVarious Mathematical Methods and Their Uses
Method / ModelMathematics and FrameworkMain BenefitsApplication Area
DDPM (2020)Markov Chain and Variational InferenceStable training and high qualityImage generation, super-resolution
Latent Diffusion (LDM)Compressed Latent Space DiffusionLower computational cost and speedStable Diffusion, DALL-E
Score-based SDEsContinuous-time SDE/ODEPrecise sampling and theoretical robustnessContinuous data modeling
Rectified FlowStraight-line trajectory flowUltrashort sampling in fewer stepsFast AI image and video creation

In the language of mathematics, the forward diffusion process follows a 'Markov Chain'. Starting from the original image x₀, a little bit of Gaussian noise is added in stages over a time period T. For this, certain fixed constants β₁, ..., β_T are determined, which lie between 0 and 1. At each stage, noise is added to x_{t-1} to calculate the new data point x_t. The pleasant thing is that without passing through each stage, the noisy photo of any stage x_t can be calculated directly from x₀ through just a mathematical formula. As the stage t tends to infinity, the original image is completely destroyed and becomes pure Gaussian distribution N(0, I).

The true magical power of diffusion models lies in their 'Reverse Sampling Process'. Because the noise added in the forward process is known to us, but reversing it directly is intractable. Therefore, an artificial neural network is trained that estimates the mathematics of this reverse process. This neural network is called the 'Backbone' of the model. Usually, a 'U-Net' or 'Transformer' architecture is used as this backbone. During training, knowing x_t and time t, the network accurately estimates the noise z_θ added to it.

To reduce computational cost, researchers developed 'Latent Diffusion Models' (LDMs). Running diffusion in actual pixel space is very heavy, so first an autoencoder compresses the image into a 'Latent Space' with small mathematical dimensions. Thereafter, all diffusion and denoising processes happen in this latent space. Stable Diffusion works on this very principle. Cross-attention modules and text-encoders are used to turn the text prompt given by the user into an image.

AI artwork generated by Stable Diffusion V1-5: A matrix grid showing a European-style castle in Japan.
AI artwork generated by Stable Diffusion V1-5: A matrix grid showing a European-style castle in Japan. (Benlisquare, CC BY-SA 4.0, Wikimedia Commons)

To increase user control over the generated image, 'Classifier-free guidance' (CFG) is used. In the CFG technique, the model is trained simultaneously in both conditional (i.e., with text) and unconditional (without text) ways. During sampling, the difference between these two is multiplied by a guidance scale 'w'. This makes it possible to maintain a balance between image diversity and accuracy towards the text prompt.

In 2020, Song and his colleagues presented diffusion models in the universal framework of 'Continuous-Time Stochastic Differential Equations' (SDEs). With this calculation, the diffusion process can be divided into infinitely small time periods. This approach gave birth to the 'Probability Flow ODE', which enabled fast sampling of data and accurate computation. In recent years, techniques like 'Flow Matching' and 'Rectified Flow' have come, which make the paths between noise and data straight trajectories, so that the model can generate an image in just a few steps.

Schematic diagram of Rectified Flow process: Straight paths between noise and data.
Schematic diagram of Rectified Flow process: Straight paths between noise and data. (DarkMoonDragon, CC BY-SA 4.0, Wikimedia Commons)
Reflow process: Method of straightening curved paths to speed up generation.
Reflow process: Method of straightening curved paths to speed up generation. (DarkMoonDragon, CC BY-SA 4.0, Wikimedia Commons)

By 2024, diffusion models are no longer limited to just image creation. They are being widely used in computer vision for image denoising, inpainting, super-resolution, and high-quality video generation. Besides this, diffusion architecture is also playing an important role in natural language processing for text summarization, audio-sound generation, and reinforcement learning.

For a country like India, where the use of AI technology is growing rapidly in education, agriculture, and design fields, the mathematical and architectural understanding of diffusion models is extremely important. However, training these models requires massive computing power (GPUs). In the future, more efficient, fewer-step working, and lower computational cost rectified diffusion models will make the AI revolution more accessible to the public.

Sources

  1. Wikipedia

AI

See all
The SpaceX Dragon spacecraft in Earth's orbit, a symbol of SpaceX's advanced technological capabilities.

The Convergence of Elon Musk and Indian IT: Coforge and SpaceX Grok Announce Major Partnership

Leading Indian IT services firm Coforge has announced a partnership with SpaceX's Super Intelligence Partner Network to implement the Grok AI portfolio for enterprise applications.

Aavtikal AI desk6 Nov4 min read
Tesla Optimus humanoid robots showcased on stage at a public demonstration event.

Humanoid Robots Doing Chores: A Cleaning Revolution or a Technological Experiment?

From San Francisco homes to automated factories, human-like humanoid robots are now performing tasks ranging from cleaning toilets to folding laundry. Based on complex techniques, teleoperation, and sensors, what is the reality of these robots entering our homes?

Aavtikal AI desk6 Nov5 min read
Four Nvidia H100 graphics cards, based on the Hopper architecture and critical for AI data centers.

Nvidia Chip Cache Stranded in Hong Kong: A New Chapter in the U.S.-China Tech War

Approximately 600,000 state-of-the-art H200 chips are sitting in Hong Kong warehouses as China restricts imports to reduce its technological dependency.

Aavtikal AI desk6 Nov4 min read
Aavtikal
AITechSciencePoliticsCapital Kranti news
About usEditorial policyHow we checkContact
© 2026 Capital Kranti