BlogsGoogleDiffusion Models for Text Generation

Diffusion Models for Text Generation

Diffusion Models for Text Generation

26
posts
2022–2026

Google has introduced Gemma 2, a new suite of open language models available in 2B, 9B, and 27B parameter sizes. The 27B model has achieved high rankings on the LMSYS Chatbot Arena, and the 2B model outperforms GPT-3.5 on the same platform. Gemma 2 features architectural innovations such as alternating local and global attention, logit soft-capping, RMSNorm for pre and post-normalization, and Grouped-Query Attention (GQA). The models are available for fine-tuning via Google Cloud, Axolotl, Hugging Face, and other platforms. Additionally, Imagen 4, the most advanced text-to-image model, is now generally available in the Gemini API and Google AI Studio. This release includes substantial improvements in text rendering over previous models. The Imagen 4 family now includes Imagen 4 Fast for rapid image generation, the flagship Imagen 4 for high-quality generation, and Imagen 4 Ultra for the highest level of detail. Both Imagen 4 and Imagen 4 Ultra support the generation of images up to 2K resolution. All images generated by the Imagen 4 family are imperceptibly watermarked with SynthID.

2026

DiffusionGemma: The Developer Guide- Google Developers Blog

6/10/2026

This post introduces DiffusionGemma, an experimental text generation model that leverages diffusion techniques. Key technical contributions include: 1. Compute-bound parallel generation for faster token output (up to 4x). 2. Bidirectional context and self-correction mechanisms for simultaneous text block evaluation and error correction. 3. Developer-friendly model sizes (26B MoE, 3.8B active parameters) for deployment within 18 GB VRAM. The architecture details include Uniform State Diffusion for parallel canvas refinement and Block Autoregressive Diffusion for variable-length generation. A Sudoku solver showcase demonstrates the model's ability to handle constrained problems and its fine-tuning capabilities. Serving DiffusionGemma via vLLM is detailed, along with resources for downloading weights, integration, and adaptation.

2025

Introducing Veo 3.1 and new creative capabilities in the Gemini API- Google Developers Blog

10/15/2025

This post introduces Veo 3.1 and Veo 3.1 Fast, updated video generation models available via the Gemini API. Key new capabilities include richer native audio, improved narrative control with cinematic styles, and enhanced image-to-video generation. Specific features highlighted are 'Ingredients to video' (using reference images for consistency and style), 'Scene extension' (creating longer videos by extending existing ones), and 'First and last frame' (generating transitions between two images). Code examples for Python are provided for each new feature.

Own your AI: Learn how to fine-tune Gemma 3 270M and run it on-device- Google Developers Blog

10/8/2025

This post details the process of fine-tuning Gemma 3 270M using QLoRA for custom tasks like emoji translation, quantizing the model for on-device inference (reducing size to under 300MB), and deploying it in a web app using MediaPipe or Transformers.js. It provides practical steps, code examples, and links to Colab notebooks and GitHub repositories for implementation.

Gemini 2.5 Flash Image now ready for production with new aspect ratios- Google Developers Blog

10/2/2025

The Gemini 2.5 Flash Image model is now generally available for production environments. Key new features include support for 10 different aspect ratios (landscape, square, portrait, and flexible options) and the ability to specify image-only output. The post highlights use cases from Cartwheel and Volley, demonstrating character consistency, in-session editing, and low latency. It also provides links to developer documentation, Google AI Studio, and Vertex AI, along with a Python code sample and pricing information.

How to prompt Gemini 2.5 Flash Image Generation for the best results- Google Developers Blog

8/28/2025

This post introduces Gemini 2.5 Flash Image, a natively multimodal model for image generation, and provides detailed prompting strategies for various image creation tasks. It covers text-to-image generation, image editing with text, multi-image composition, iterative refinement, and text rendering within images. The guide offers templates and examples for creating photorealistic scenes, stylized illustrations, product mockups, minimalist designs, and sequential art, along with techniques for inpainting, style transfer, and combining multiple images.

Introducing Gemini 2.5 Flash Image, our state-of-the-art image model- Google Developers Blog

8/26/2025

Introduced Gemini 2.5 Flash Image, a new state-of-the-art image generation and editing model. Key capabilities include blending multiple images, maintaining character consistency, targeted transformations via natural language, and leveraging world knowledge. The model is available via Gemini API, Google AI Studio, and Vertex AI. Pricing is provided. Updates to Google AI Studio's "build mode" are highlighted. Specific features demonstrated include character consistency, prompt-based image editing, native world knowledge integration, and multi-image fusion. Demo apps and templates are available. SynthID digital watermarking is implemented for AI-generated/edited images. Ongoing development areas include long-form text rendering, character consistency, and factual representation.

Announcing Imagen 4 Fast and the general availability of the Imagen 4 family in the Gemini API- Google Developers Blog

8/15/2025

Announces the general availability of Imagen 4, the latest text-to-image model, in the Gemini API and Google AI Studio. Introduces Imagen 4 Fast, a new model optimized for speed and cost-effectiveness. Highlights improvements in text rendering and the ability to generate images up to 2K resolution with Imagen 4 and Imagen 4 Ultra. Mentions that all generated images are watermarked with SynthID.

T5Gemma: A new collection of encoder-decoder Gemma models- Google Developers Blog

7/9/2025

Introduces T5Gemma, a new collection of encoder-decoder LLMs derived from decoder-only Gemma models via an adaptation technique. Details the model adaptation process, which involves initializing encoder-decoder parameters with weights from pretrained decoder-only models and further pre-training. Highlights T5Gemma's performance advantages in quality-inference efficiency across benchmarks like SuperGLUE and GSM8K, demonstrating comparable or better results than decoder-only Gemma models. Discusses the flexibility of 'unbalanced' encoder-decoder configurations (e.g., 9B encoder with 2B decoder) for task-specific trade-offs. Releases T5Gemma checkpoints in various sizes (Small, Base, Large, XL, 2B, 9B) and variants (pretrained, instruction-tuned), including an unbalanced 9B-2B model, and models trained with PrefixLM or UL2 objectives.

Multilingual innovation in LLMs: How open models help unlock global communication- Google Developers Blog

6/23/2025

This post highlights the Kaggle competition 'Unlock Global Communication with Gemma' where developers adapted Gemma LLMs for diverse cultural and linguistic contexts, addressing performance gaps in lower-resourced languages. It showcases specific projects like 'Gemma 2 Swahili', 'Kyara: Retrieval Augmentation for LLM Fine-Tuning', 'ArGemma: Fine-Tuning Gemma for Arabic', 'Post-Training Gemma for Italian and beyond', 'Ancient Chinese Expert: Gemma 2>ChatGPT', 'Lyric-Gemma 2: One Song, Different Stories', 'Fine-tuning Gemma 2 JPN for Yomigana', 'Mathematical Minds: Fine-tuning Gemma 2 for Hindi', 'Gemma-2-9b-kk-it: Learning to translate Kazakh', and 'THEODEN: The Old English Gemma'. These projects demonstrate parameter-efficient fine-tuning, retrieval augmentation, handling of historical languages, and adaptation for specific tasks like translation, summarization, and mathematical reasoning. It also mentions Gemma 3's pretrained support for over 140 languages.

Gemma explained: What’s new in Gemma 3- Google Developers Blog

4/30/2025

This post introduces Gemma 3, detailing its new vision-language capabilities enabled by a SigLIP encoder and a "Pan&Scan" algorithm for image processing. It explains the use of "soft tokens" to reduce inference resource requirements. Architectural improvements include 5-to-1 interleaved attention for better context handling and QK-norm for improved accuracy and speed. The post highlights Gemma 3's extended context length support (up to 128k tokens) and its use of bidirectional attention for image inputs, contrasting it with PaliGemma's autoregressive approach. A new tokenizer with a 262k vocabulary size is also introduced for enhanced multilingual support.

Experiment with Gemini 2.0 Flash native image generation- Google Developers Blog

3/12/2025

This post announces the availability of native image generation in Gemini 2.0 Flash for developer experimentation. It highlights the model's multimodal capabilities for text and image storytelling, conversational image editing, world understanding for realistic imagery, and improved text rendering. The post provides examples and a Python code snippet demonstrating how to use the experimental version of Gemini 2.0 Flash for image generation.

Safer and Multimodal: Responsible AI with Gemma- Google Developers Blog

3/12/2025

Introduces ShieldGemma 2, a 4B parameter safety classifier model built on Gemma 3, extending safety capabilities to image analysis for multimodal AI. It can be used as an input filter for vision language models or an output filter for image generation systems, handling both synthetic and natural images. The model is trained on curated datasets and instruction-tuned for performance, with a focus on detecting sexually explicit, dangerous, and violent content. It offers flexibility for fine-tuning, versatility across Gemma 3 supporting frameworks, and an open, collaborative approach.

2024

Introducing PaliGemma 2: Powerful Vision-Language Models, Simple Fine-Tuning- Google Developers Blog

12/5/2024

Introduces PaliGemma 2, an evolution of vision-language models built on Gemma 2. Highlights scalable performance with multiple model sizes and resolutions, long captioning capabilities, and leading performance on specific recognition tasks (chemical formulas, music scores, spatial reasoning, chest X-rays). Positions PaliGemma 2 as a drop-in replacement for existing PaliGemma users and emphasizes straightforward fine-tuning.

Announcing Build with Google AI release 3: A Season of Gemma!- Google Developers Blog

10/2/2024

This post announces Season 3 of the 'Build with Google AI' series, focusing on practical applications of Google's Gemma open generative AI models. It highlights three specific projects: a Native Language AI Assistant, a Business Email AI Assistant, and a Personal AI Code Assistant (upgraded to work with Gemma and a VS Code extension). All projects are provided with open-source code and guidance from Google AI experts. It also directs users to Gemma developer documentation and the Gemma cookbook repository for further resources.

Gemma explained: RecurrentGemma architecture- Google Developers Blog

8/29/2024

This post introduces the RecurrentGemma architecture, detailing its hybrid approach combining gated linear recurrences with local sliding window attention. It explains the architectural components like RecurrentGemmaDecoderLayer, RecurrentGemmaRecurrentBlock, RecurrentGemmaSdpaAttention, and RecurrentGemmaMlp. Key parameters such as non-embedding and embedding parameters, model width, RNN width, MLP expansion factor, and local attention window size are discussed. The post also provides a Python code snippet for the RecurrentGemmaForCausalLM model and elaborates on the embed_tokens layer and the structure of the 26 decoder layers, including the specific implementation of residual blocks with recurrent blocks and local MQA blocks.

Gemma explained: What’s new in Gemma 2- Google Developers Blog

8/22/2024

This post introduces Gemma 2, detailing its architectural innovations including alternating local and global attention, logit soft-capping, RMSNorm for pre and post-normalization, and Grouped-Query Attention (GQA). It provides specific implementation details for the Gemma 27B model's self-attention mechanism and MLP layers, including the number of heads and head sizes for GQA across different model sizes (27B, 9B, 2B). Key findings from the technical report are summarized, highlighting the benefits of knowledge distillation, GQA over MHA, and deeper vs. wider model architectures.

Gemma explained: An overview of Gemma model family architectures- Google Developers Blog

8/15/2024

This post introduces the Gemma family of models, detailing their architectures and design choices. It explains the decoder-only transformer architecture, core parameters like d_model, layers, feedforward hidden dimensions, num_heads, num_kv_heads (distinguishing MHA in 7B from MQA in 2B), head_size, and vocab_size. It provides a detailed breakdown of the Gemma 7B model's architecture, including its embedding layer, decoder layers, self-attention mechanism (with specific details on projections, heads, and rotary embeddings), MLP with GeGLU activation, and language modeling head. It also highlights the use of SentencePiece for tokenization and the context length of 8192 tokens.

Smaller, Safer, More Transparent: Advancing Responsible AI with Gemma- Google Developers Blog

7/31/2024

Introduces Gemma 2 2B, a new 2 billion parameter model optimized for on-device deployment and efficiency, outperforming GPT-3.5 on the Chatbot Arena. Details its integration with NVIDIA TensorRT-LLM and availability on various hardware. Introduces ShieldGemma, a suite of safety content classifier models built on Gemma 2 to filter harmful AI inputs/outputs (hate speech, harassment, sexually explicit, dangerous content), offering flexible sizes (2B, 9B, 27B) and SOTA performance. Introduces Gemma Scope, a model interpretability tool using sparse autoencoders (SAEs) to analyze Gemma 2 2B and 9B models, with over 400 SAEs available and interactive demos on Neuronpedia.

3 fun Gemma project ideas- Google Developers Blog

7/10/2024

This post introduces three project ideas that leverage Gemma models: translating old Korean literature, game design brainstorming, and a "magic of Santa's mailbox" project. For the Korean translation project, it details the use of fine-tuning with historical datasets and SentencePiece for tokenization, and provides code examples for saving and uploading fine-tuned models. For game design, it shows how Gemma can generate game concepts, characters, and stories based on prompts. The "magic of Santa's mailbox" project is outlined as using Gemma on a Raspberry Pi. Expansion ideas for style transfer and dialect translation are also presented.

Fine-tuning Gemma 2 with Keras - and an update from Hugging Face- Google Developers Blog

6/27/2024

This post details the fine-tuning of Gemma 2 models using Keras and JAX, focusing on distributed fine-tuning with Model Parallelism and LoRA. It introduces the `keras.distribution.ModelParallel` API for specifying weight sharding configurations and demonstrates how to use `keras.distribution.LayoutMap` for layer-by-layer weight partitioning. It also showcases the use of LoRA for efficient fine-tuning by freezing model weights and replacing them with low-rank adapters. Furthermore, it announces enhanced Hugging Face integration allowing KerasNLP to load fine-tuned weights from Hugging Face for supported models, including Gemma and Llama3, and highlights the availability of PaliGemma for vision-language tasks.

How it's Made: GenType Alphabet Creator- Google Developers Blog

6/10/2024

This post introduces GenType, a tool built using the Imagen 2 API that generates custom alphabets from user-provided prompts. It details the prompt recipe used ('The letter "{letter}" made out of {prompt}') and the automation process of sending 26 individual requests to generate a consistent alphabet. It also provides guidance on crafting effective prompts by specifying foreground, background, and style, and highlights various use cases for the generated alphabets.

Introducing PaliGemma, Gemma 2, and an Upgraded Responsible AI Toolkit- Google Developers Blog

5/14/2024

This post announces the upcoming launch of Gemma 2, detailing its new architecture designed for breakthrough performance and efficiency, with a 27B parameter model comparable to Llama 3 70B at less than half the size. It also introduces PaliGemma, an open vision-language model (VLM) built on SigLIP and Gemma, available with pretrained and fine-tuned checkpoints for various vision-language tasks. The Responsible Generative AI Toolkit is expanded with the open-source LLM Comparator for model evaluation.

Gemma Family Expands with Models Tailored for Developers and Researchers- Google Developers Blog

4/9/2024

Introduces CodeGemma, a 7B pretrained and instruction-tuned variant, and a 2B pretrained variant, specialized for code completion and generation tasks. Also introduces RecurrentGemma, an efficiency-optimized architecture leveraging recurrent neural networks and local attention for improved memory efficiency and higher throughput, showcasing a non-transformer model. Updates Gemma 1.1 with performance improvements and bug fixes. Details compatibility with various frameworks and hardware.

Introducing Gemma models in Keras- Google Developers Blog

2/21/2024

This post announces the integration of Gemma models into the KerasNLP collection, leveraging Keras 3's multi-backend support (JAX, PyTorch, TensorFlow). It introduces a new LoRA API for parameter-efficient fine-tuning, significantly reducing trainable parameters. Additionally, it details model-parallel training capabilities using Keras's distribution API, enabling distributed training across multiple GPUs/TPUs by sharding model weights. Code examples are provided for getting started, LoRA fine-tuning, and distributed training.

2023

Make with MakerSuite Part 2: Tuning LLMs- Google Developers Blog

10/3/2023

This post introduces Parameter Efficient Tuning (PET) within MakerSuite, a technique that allows developers to customize Large Language Models (LLMs) with hundreds of data points in minutes. It contrasts PET with traditional fine-tuning, highlighting PET's reduced complexity, data requirements, and computational cost. The post details the workflow for tuning models in MakerSuite, including creating a tuned model, selecting data (from saved prompts, Google Sheets, or CSV), viewing tuning progress, and running the newly tuned model.

2022

Improving Video Voice Dubbing Through Deep Learning- Google Developers Blog

12/19/2022

This post details the use of deep learning for video voice dubbing, employing techniques like sequence-to-sequence models with attention mechanisms to align audio and video streams, and using diffusion models to generate natural-sounding speech that matches the original speaker's prosody and emotion. The system leverages large language models for text-to-speech synthesis and fine-tuning for specific voice characteristics.