MoECa: Aligning Feature Reuse with Expert Decomposition in Diffusion Transformers
The paper proposes MoECa, a fine-grained caching framework that accelerates Diffusion Transformers with Mixture-of-Experts by performing feature reuse at the expert-branch level rather than the token level, achieving up to 2.93 speedups while preserving generation quality.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to paint a masterpiece, but instead of using a single brush, you have a magical team of hundreds of tiny artists, each specializing in a different style—some are masters of texture, others of color, and some of lighting. This is how modern AI image generators, known as Diffusion Transformers, work. They start with a screen full of static noise and slowly "denoise" it, step by step, until a clear picture emerges. To make these images look amazing, the AI uses a clever trick called "Mixture-of-Experts" (MoE). Think of this as a smart manager who, for every tiny patch of the image, only wakes up the specific team of artists best suited for that job, rather than asking everyone to work at once. This saves energy and allows the AI to be incredibly smart.
However, there's a catch. Creating an image takes hundreds of these "denoising steps," and the AI has to do a massive amount of math for every single step. It's like having to repaint the entire canvas from scratch every time you add a new layer of detail. To speed this up, scientists have tried a technique called "feature caching." This is like saying, "Hey, this part of the painting hasn't changed much since the last step, so let's just reuse the old paint instead of mixing new colors." The problem is, the old way of doing this was too clumsy. It treated the whole tiny patch of the image as one single unit. If even one tiny detail in that patch needed a fresh coat of paint, the old method would force the AI to repaint the entire patch, wasting time. If it was too conservative, it would reuse the whole patch even when parts of it had changed, leading to a blurry mess.
This is where a new study called MoECa comes in. The researchers realized that because the AI uses specialized "expert" artists, the caching strategy needs to be just as specialized. Instead of treating a patch of the image as a single block, MoECa looks inside the block and sees the individual experts working on it. They found that while one expert might be busy changing the texture of a leaf, another expert working on the same patch might be perfectly happy reusing their old work on the sky. By breaking the image down to the level of these individual expert branches, MoECa can decide exactly which parts to repaint and which parts to reuse.
The paper shows that this "fine-grained" approach is a game-changer. By aligning the caching strategy with how the experts actually work, the AI can skip redundant calculations without losing quality. In their tests, the new method made the image generation process up to 2.93 times faster while keeping the images looking just as sharp and detailed as the slow, original version. It's like upgrading from a construction crew that repaints the whole house every time a window needs fixing, to a team that only paints the specific window that needs it, leaving the rest of the house untouched and ready to go.
The Problem: The "All-or-Nothing" Mistake
To understand why MoECa is needed, we have to look at how these AI models think. In the past, when trying to speed up image generation, researchers used a "token-level" caching method. Imagine a token as a tiny square on your canvas. The old rule was simple: "If this square changed even a tiny bit, repaint the whole square. If it didn't change, leave the whole square alone."
But in models with "Mixture-of-Experts," a single square isn't just one thing; it's a collaboration between several different "expert" branches. The paper's analysis revealed a flaw in the old rule: these experts don't all change at the same time. One expert might be working on the rough texture of a tree bark, which changes rapidly as the image forms. Another expert on the same square might be working on the smooth green leaves, which stay very stable.
If you use the old "all-or-nothing" rule, you face a dilemma. If you decide to repaint the whole square because the bark changed, you waste time repainting the stable leaves. If you decide to reuse the whole square to save time, you end up with blurry, wrong leaves because the bark wasn't updated. The paper argues that this mismatch between the "whole square" caching and the "split expert" reality is the main reason why current speed-up methods aren't working as well as they could.
The Solution: MoECa's "Expert-Level" Strategy
The authors propose MoECa (Mixture-of-Experts Caching), a system that changes the rules of the game. Instead of asking, "Should we repaint this whole square?", MoECa asks, "Should we repaint this specific expert's work on this square?"
Here is how MoECa works in practice:
- Branch-Level Caching: It treats each expert branch as its own little unit. It remembers the output of the "bark expert" and the "leaf expert" separately.
- Smart Matching: When the AI moves to the next step, MoECa checks which experts are active. If the "bark expert" is still the same one as before, it checks if its work has changed enough to matter. If the "leaf expert" is also the same, it checks that one too.
- Adaptive Control: The system is smart enough to know that some experts are more sensitive than others. For example, an expert that focuses on fine details (like the edge of a coffee pot) is very sensitive to changes. MoECa gives these experts a lower "reuse threshold," meaning it's more likely to repaint them to ensure quality. An expert working on a blurry background might get a higher threshold, allowing it to be reused more often.
- Synchronized Updates: A crucial part of MoECa is making sure the "attention" part of the AI (which looks at the whole image to understand context) stays in sync with the "expert" part. If the experts update but the attention part doesn't, the image gets confused. MoECa ensures they update together, preventing the AI from getting "drunk" on old information.
The Results: Faster Without the Blur
The researchers tested MoECa on several popular AI models, including the DSMoE family and DiT-MoE. The results were impressive.
- Speed: In the best cases, MoECa made the image generation 2.93 times faster (specifically on the HiDream-I1 model for text-to-image tasks). On other models, it achieved speedups of around 2.14x to 2.83x.
- Quality: Despite the massive speed increase, the quality of the images remained nearly identical to the original, slow method. The paper measured this using metrics like FID (which measures how realistic the images look) and PSNR (which measures how close the accelerated image is to the original). For instance, on the DSMoE-L-E48 model, MoECa achieved a speedup of 2.83x while keeping the FID score at 9.54, which is almost the same as the original model's 9.20.
- Comparison: When compared to other speed-up methods like ToCa, DuCa, and TeaCache, MoECa consistently produced the fastest results with the lowest computational cost (FLOPs), all while maintaining or slightly improving image quality.
The paper also looked at why this works so well. They found that in models with more experts (like the E48 configuration with 48 experts), there are more opportunities to find "stable" branches to reuse. This is why the E48 models saw slightly higher speedups (up to 2.83x) compared to models with fewer experts. The more specialized the team, the more you can pick and choose who works and who rests.
What This Means for the Future
The paper concludes that the key to speeding up these powerful AI models isn't just to make them work faster in general, but to understand how they work internally. By realizing that the "experts" inside the AI have different rhythms and needs, we can build smarter caching systems that respect those differences.
MoECa doesn't require retraining the AI models; it works with the models as they are, simply changing how they process information during the image creation. While the current study focuses on single-computer image generation, the authors suggest that this "fine-grained" approach could be the key to unlocking even faster generation for video and more complex tasks in the future. For now, it proves that sometimes, the fastest way to paint a masterpiece is to let the right artists rest while the others keep working.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.