Efficient Personalized Text-to-image Generation by Leveraging Textual Subspace

Shian Du, Xiaotian Cheng, Qi Qian, Henglu Wei, Yi Xu, Xiangyang Ji · DOI

Introduction

Personalizing text-to-image (T2I) models allows users to introduce specific concepts—such as a personal pet or a unique artistic style—into a model's vocabulary using only a few reference images. A leading technique for this is Textual Inversion (TI), which optimizes a new word embedding to represent the target concept. However, standard TI often suffers from slow optimization, poor alignment with complex prompts (where the model "forgets" the background or actions in favor of the subject), and high sensitivity to initial word choices.

To address these challenges, researchers have introduced BaTex (Basis-based Textual Subspace). BaTex significantly improves both efficiency and prompt obedience by restricting the search for new concepts to a low-dimensional subspace of the existing word embedding space.

The BaTex Framework

The core innovation of BaTex is the principle of self-expressiveness: the idea that any novel visual concept can be represented as a weighted combination of existing words in the model's vocabulary. Instead of optimizing in a high-dimensional 768-D space, BaTex identifies a small set of "basis vectors" (semantically related words) and optimizes only the weights of these vectors.

Conceptual comparison of optimization paths. BaTex (red) maintains higher text similarity and better prompt obedience compared to Textual Inversion (black).

As shown in the figure above, standard Textual Inversion often drifts into regions of low text similarity, leading to results that ignore parts of the prompt (e.g., failing to render a man with a machine gun). By staying within a constrained "textual subspace," BaTex ensures the learned embedding remains within the distribution of natural language that the text encoder already understands, resulting in much better composition and prompt following.

Key Components

  • Rank-Based Selection: The method uses a nearest-neighbor search around an initial word to pick basis vectors. It continues adding words until the subspace reaches a target dimension, ensuring it is mathematically rich enough to represent the concept.
  • Efficiency: By reducing the search space, BaTex converges in approximately 10 minutes (500 steps), a 6x speedup over the hour required by standard TI.

Performance and Results

BaTex was evaluated across diverse benchmarks, including the Textual Inversion and Custom Diffusion datasets, covering subjects like cats and dogs, art styles (e.g., Anders Zorn), and human faces.

Qualitative examples demonstrating BaTex's ability to capture diverse styles and subjects while maintaining high fidelity and composition.

Quantitative and Qualitative Gains

  • Text Alignment: BaTex achieved a Mean Text Alignment score of 0.76 (CLIP-space), outperforming TI (0.70) and rivaling heavier model-tuning methods like DreamBooth (0.69).
  • User Preference: In human studies, BaTex was preferred for text-image alignment by a margin of 71.9% to 27.5% over TI.
  • Robustness: The method is significantly less sensitive to the "initial word" used for optimization. Because the subspace selection pulls in a broad range of relevant neighbors, starting with a generic term like "animal" instead of a specific breed still yields high-quality results.

Conclusion and Future Work

BaTex demonstrates that a T2I model's existing vocabulary is already expressive enough to represent new concepts without needing to explore the entire embedding space. By treating constraint as a feature, the method achieves superior prompt obedience and faster convergence. While the human face domain remains a challenge due to the extreme detail required, and the subspace dimension currently requires manual tuning, BaTex represents a significant step forward in making personalized AI generation more accessible and controllable.

Summary updated

BibTeX
@misc{du2024efficient,
  author = {Shian Du and Xiaotian Cheng and Qi Qian and Henglu Wei and Yi Xu and Xiangyang Ji},
  title = {{Efficient Personalized Text-to-image Generation by Leveraging Textual Subspace}},
  year = {2024},
  eprint = {2407.00608},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.00608},
}
Figure