Hollowed Net for On-Device Personalization of Text-to-Image Diffusion Models

Wonguk Cho, Seokeon Choi, Debasmit Das, Matthias Reisser, Taesup Kim, Sungrack Yun, Fatih Porikli · DOI

Introduction

Personalizing text-to-image diffusion models—the process of teaching a model like Stable Diffusion to recognize a specific subject, such as a user's pet or a unique object—is typically a resource-intensive task. While techniques like Low-Rank Adaptation (LoRA) have significantly reduced the number of trainable parameters, they do not inherently solve the memory bottleneck associated with the training process. To calculate gradients, the system must perform a backward pass through the entire model, requiring significant GPU memory (VRAM) to store activations and weights. This requirement often exceeds the capacity of mobile phones and edge devices.

This paper introduces Hollowed Net, a novel training strategy that enables high-quality personalization on resource-constrained hardware. By strategically "hollowing out" the middle layers of a diffusion U-Net during the fine-tuning phase, the method reduces peak memory requirements by 26% compared to standard LoRA, bringing the cost of training down to nearly the same level as simple inference.

The Challenge of On-Device Training

In subject-driven fine-tuning, the goal is to map a specific visual concept to a unique identifier. The primary hurdle for on-device implementation is the memory I/O bottleneck. Even when updating only a small fraction of the model's parameters, the system must still process the entire massive architecture. Previous attempts to mitigate this, such as "side-tuning" (adding a small parallel network), often struggle with the complex, multi-scale architecture of diffusion U-Nets, which rely on intricate skip-connections between down-sampling and up-sampling blocks.

Methodology: The Hollowed Net Approach

The researchers observed that during the personalization process, the deep, middle layers of a diffusion U-Net change the least. Leveraging this insight, Hollowed Net operates in two distinct stages:

  1. Pre-computing (Stage 1): The full, frozen model runs a forward pass on the user's training images. The activations from the early "down-block" layers—the points just before the model enters its deepest layers—are saved to disk.
  2. Fine-tuning (Stage 2): The middle layers of the U-Net are physically removed from the training graph, creating a "hollow." The saved activations from Stage 1 are fed directly into the corresponding later "up-block" layers. Only the remaining outer layers are fine-tuned using LoRA.

Because the middle layers are absent during Stage 2, they do not occupy VRAM, and no gradients are calculated for them. Once training is complete, the learned LoRA weights are plugged back into the original, full-sized U-Net. This ensures that while the middle layers are bypassed during learning, they are restored during inference to maintain high-fidelity image generation.

Experimental Evaluation

The effectiveness of Hollowed Net was evaluated across several benchmarks:

  • DreamBooth Dataset: 30 image sets across 15 classes (e.g., dogs, backpacks, teapots).
  • CustomConcept101: A broader dataset featuring 101 subjects and 15 categories to test generalization.
  • SDXL Experiments: Verification on the Stable Diffusion XL (SDXL) model to demonstrate scalability to larger architectures.

Key Results

  • Memory Efficiency: Hollowed Net required only 3.88GB of peak GPU memory, a 26% reduction from the 5.23GB required by standard LoRA and a massive decrease from the 16GB+ required for full fine-tuning. This peak memory is only 11% higher than the memory required for inference alone.
  • Performance Parity: Despite training on a fraction of the model, Hollowed Net achieved DINO and CLIP scores (measuring subject and text fidelity) comparable to standard LoRA.
  • Human Preference: In a user study with 40 participants, images generated via Hollowed Net were perceived to have subject and text fidelity equal to those generated by full LoRA fine-tuning.

Insights and Limitations

The success of Hollowed Net stems from the "U-Shape" advantage of the diffusion architecture. The symmetrical design allows the method to skip the middle by connecting specific down-blocks to their corresponding up-blocks via existing skip-connections. The research highlights that while middle layers are crucial for generating the final image, they are not vital for the specific task of learning a new subject's identity.

However, the method is sensitive to the "granularity" of the class token used during training. If a user provides images of a specific "poop emoji" but uses a broad label like "toy," the model may struggle to correlate the saved intermediate activations with the specific subject. Precise class tokens remain necessary for optimal results.

Conclusion

Hollowed Net represents a significant step toward making personalized AI accessible on consumer hardware. By shifting the focus from parameter reduction to memory optimization, the authors demonstrate that high-quality model adaptation can occur within the strict limits of mobile devices. Future work may combine this approach with quantization and explore its applicability to large language models (LLMs).

Summary updated

BibTeX
@inproceedings{cho2024hollowed,
  author = {Wonguk Cho and Seokeon Choi and Debasmit Das and Matthias Reisser and Taesup Kim and Sungrack Yun and Fatih Porikli},
  title = {{Hollowed Net for On-Device Personalization of Text-to-Image Diffusion Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=Pa8jsrdOnU},
}
Figure