Gemma 4 models handle a broad range of tasks across text, vision, and audio. Key capabilities include:
Thinking – Built-in reasoning mode that lets the model think step-by-step before answering.
Long Context – Context windows of up to 128K tokens (E2B/E4B) and 256K tokens (26B A4B/31B).
Image Understanding – Object detection, Document/PDF parsing, screen and UI understanding, chart comprehension, OCR (including multilingual), handwriting recognition, and pointing. Images can be processed at variable aspect ratios and resolutions.
Video Understanding – Analyze video by processing sequences of frames.
Interleaved Multimodal Input – Freely mix text and images in any order within a single prompt.
Function Calling – Native support for structured tool use, enabling agentic workflows.
Coding – Code generation, completion, and correction.
Multilingual – Out-of-the-box support for 35+ languages, pre-trained on 140+ languages.
Audio (E2B and E4B only) – Automatic speech recognition (ASR) and speech-to-translated-text translation across multiple languages.
NISTy
🎯 Overview
NISTy is a fine-tuned and post-trained variant of the gemma-4-E4B-it transformer model, optimized for NIST-aligned artificial intelligence governance, risk management, trustworthiness, and technical standards reasoning. It is designed to support structured question answering, policy interpretation, document comprehension, retrieval-augmented generation, and domain-specific analysis across authoritative National Institute of Standards and Technology materials.
Built on the lightweight Gemma 4 8B instruction-tuned architecture, NISTy provides a practical balance between inference speed, compact deployment, and specialized reasoning over AI risk management documentation. The model is intended for use cases where users need concise, standards-aware responses grounded in NIST guidance, especially in contexts involving responsible AI, risk framing, governance workflows, control mapping, and trustworthy AI lifecycle analysis.
✨ Features
Feature
Description
🔍 Instruction-Tuned
Adapted from a compact instruction-following base model for direct, task-oriented responses.
🏛️ GAO & NIST-Specialized
Fine-tuned and post-trained on NIST AI risk-management material for standards-aware reasoning.
📚 Document-Aware
Optimized for structured comprehension, summarization, and question answering over technical guidance.
⚖️ Governance-Oriented
Supports analysis of AI risk framing, governance structures, lifecycle controls, and accountability concepts.
⚡ Optimized for RAG
Designed to work well with retrieval-augmented generation pipelines and vectorized source stores.
🧩 Multi-Turn Dialogue
Supports iterative conversations where prior context, follow-up questions, and document references matter.
🧠 Compact Intelligence
Uses a lightweight model footprint suitable for experimentation, local workflows, and constrained deployments.
🧪 Intended Use
NISTy is intended for use in:
AI risk-management assistants
Retrieval-augmented generation systems using NIST source material
Standards-aware question answering
AI governance workflow support
Technical policy summarization
Control mapping and gap-analysis support
Trustworthy AI lifecycle analysis
Training-data generation and evaluation workflows
Research prototypes for responsible AI and standards interpretation
NISTy is not a substitute for legal, compliance, audit, acquisition, cybersecurity, privacy, or official standards interpretation by qualified professionals. It should be used as a technical assistant that supports review, drafting, analysis, and retrieval workflows.
🧠 Core Capabilities
NISTy inherits general instruction-following behavior from its base model while adding domain specialization through NIST-focused post-training. Key capabilities include:
Risk Framing – Helps organize AI risks by context, intended use, stakeholders, impacts, and lifecycle phase.
Governance Analysis – Supports policy, process, accountability, and oversight discussions for AI systems.
Control Mapping – Assists with mapping AI risks, safeguards, documentation practices, and monitoring activities.
Document Comprehension – Summarizes and explains technical guidance, policy language, and framework concepts.
RAG Integration – Works with vector stores to ground responses in authoritative source passages.
1messages =[2{3"role":"system",4"content":"You are NISTy, a NIST-aware AI risk management assistant."5},6{7"role":"user",8"content":"Summarize the core purpose of the NIST AI Risk Management Framework."9}10]1112text = tokenizer.apply_chat_template(13 messages,14 tokenize=False,15 add_generation_prompt=True16)1718inputs = tokenizer(text, return_tensors="pt").to(model.device)19outputs = model.generate(**inputs, max_new_tokens=512)20response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)2122print(response)
Example Prompts
Explain the NIST AI Risk Management Framework in plain language for a program manager.
Create a two-column table mapping AI governance responsibilities to practical implementation actions.
Draft a risk register template for an agency deploying a generative AI document assistant.
Compare AI risk framing, measurement, and governance as separate lifecycle activities.
Generate a checklist for evaluating whether an AI system is valid, reliable, safe, secure, accountable, transparent, explainable, privacy-enhanced, and fair.
Recommended RAG Pattern
NISTy performs best when paired with retrieval-augmented generation over the source corpus used during fine-tuning and post-training.
Recommended workflow:
Clean and normalize the source documents.
Split documents into semantically meaningful chunks.
Preserve document title, section heading, source URL, and page or section metadata.
Embed chunks into a vector store.
Retrieve the most relevant chunks for each user query.
Pass retrieved context into NISTy with explicit citation and grounding instructions.
Ask NISTy to distinguish between source-grounded conclusions and implementation recommendations.
Model Card Summary
Field
Value
Model Name
nisty
Base Model
gemma-4-8b-it
Model Type
Fine-tuned and post-trained instruction model
Primary Domain
NIST AI risk management and trustworthy AI guidance
Primary Use
AI governance, risk analysis, standards-aware Q&A, RAG workflows
Deployment Profile
Lightweight local, notebook, API, and Streamlit experimentation
Recommended Interface
Retrieval-augmented chat or structured prompt workflows
Limitations
NISTy may generate plausible but unsupported statements if used without retrieval grounding.
It should not be treated as an official NIST interpretation engine.
It may require external retrieval to answer questions about newly published or revised NIST materials.
It may not fully preserve legal, compliance, technical, or policy nuance unless source passages are included in the prompt.
It should be evaluated against representative risk-management tasks before production use.
Suggested Evaluation Tasks
Evaluation Area
Example Test
Source Recall
Ask the model to explain major AI RMF concepts using retrieved context.
Governance Reasoning
Ask the model to map governance roles to implementation activities.
Risk Analysis
Ask the model to create risk scenarios and mitigation options.
Structured Output
Ask the model to produce tables, checklists, and implementation plans.
Faithfulness
Compare model responses against retrieved NIST passages.
Robustness
Test ambiguous prompts, incomplete context, and adversarial phrasing.
Citation and Grounding Guidance
When using NISTy in a retrieval-augmented generation system, prompts should instruct the model to:
cite retrieved source passages when available;
separate facts from recommendations;
avoid claiming official NIST endorsement;
identify uncertainty where source context is incomplete;
preserve definitions from the source material when interpreting standards language.
License
Include the applicable license for the fine-tuned model, training artifacts, repository code, and any redistributed materials. Ensure that all source documents, datasets, model weights, and derivative artifacts comply with their respective licensing and usage terms.
Acknowledgments
NISTy is based on the gemma-4-1b-it model family and was specialized using NIST-aligned AI risk-management materials. The model is intended to support responsible AI experimentation, governance analysis, and standards-aware retrieval workflows.
Getting Started
You can use all Gemma 4 models with the latest version of Transformers. To get started, install the necessary dependencies in your environment:
pip install -U transformers torch accelerate
Once you have everything installed, you can proceed to load the model with the code below:
Once the model is loaded, you can start generating output by directly referencing the audio URL in the prompt:
python
1# Prompt - add audio before text2messages =[3{4"role":"user",5"content":[6{"type":"audio","audio":"https://raw.githubusercontent.com/google-gemma/cookbook/refs/heads/main/Demos/sample-data/journal1.wav"},7{"type":"text","text":"Transcribe the following speech segment in its original language. Follow these specific instructions for formatting the answer:\n* Only output the transcription, with no newlines.\n* When transcribing numbers, write the digits, i.e. write 1.7 and not one point seven, and write 3 instead of three."},8]9}10]1112# Process input13inputs = processor.apply_chat_template(14 messages,15 tokenize=True,16 return_dict=True,17 return_tensors="pt",18 add_generation_prompt=True,19).to(model.device)20input_len = inputs["input_ids"].shape[-1]2122# Generate output23outputs = model.generate(**inputs, max_new_tokens=512)24response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)2526# Parse output27processor.parse_response(response)
Code for processing Images
Instead of using AutoModelForCausalLM, you can use AutoModelForMultimodalLM to process images. To use it, make sure to install the following packages:
Once the model is loaded, you can start generating output by directly referencing the video URL in the prompt:
python
1# Prompt - add video before text2messages =[3{4'role':'user',5'content':[6{"type":"video","video":"https://github.com/bebechien/gemma/raw/refs/heads/main/videos/ForBiggerBlazes.mp4"},7{'type':'text','text':'Describe this video.'}8]9}10]1112# Process input13inputs = processor.apply_chat_template(14 messages,15 tokenize=True,16 return_dict=True,17 return_tensors="pt",18 add_generation_prompt=True,19).to(model.device)20input_len = inputs["input_ids"].shape[-1]2122# Generate output23outputs = model.generate(**inputs, max_new_tokens=512)24response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)2526# Parse output27processor.parse_response(response)
Best Practices
For the best performance, use these configurations and best practices:
1. Sampling Parameters
Use the following standardized sampling configuration across all use cases:
temperature=1.0
top_p=0.95
top_k=64
2. Thinking Mode Configuration
Compared to Gemma 4, the models use standard system, assistant, and user roles. To properly manage the thinking process, use the following control tokens:
Trigger Thinking: Thinking is enabled by including the <|think|> token at the start of the system prompt. To disable thinking, remove the token.
Standard Generation: When thinking is enabled, the model will output its internal reasoning followed by the final answer using this structure: <|channel>thought\n[Internal reasoning]<channel|>
Disabled Thinking Behavior: For all models except for the E2B and E4B variants, if thinking is disabled, the model will still generate the tags but with an empty thought block: <|channel>thought\n<channel|>[Final answer]
[!Note]
Note that many libraries like Transformers and llama.cpp handle the complexities of the chat template for you.
3. Multi-Turn Conversations
No Thinking Content in History: In multi-turn conversations, the historical model output should only include the final response. Thoughts from previous model turns must not be added before the next user turn begins.
4. Modality order
For optimal performance with multimodal inputs, place image and/or audio content before the text in your prompt.
5. Variable Image Resolution
Aside from variable aspect ratios, Gemma 4 supports variable image resolution through a configurable visual token budget, which controls how many tokens are used to represent an image. A higher token budget preserves more visual detail at the cost of additional compute, while a lower budget enables faster inference for tasks that don't require fine-grained understanding.
The supported token budgets are: 70, 140, 280, 560, and 1120.
Use lower budgets for classification, captioning, or video understanding, where faster inference and processing many frames outweigh fine-grained detail.
Use higher budgets for tasks like OCR, document parsing, or reading small text.
6. Audio
Use the following prompt structures for audio processing:
Audio Speech Recognition (ASR)
text
1Transcribe the following speech segment in {LANGUAGE} into {LANGUAGE} text.
23Follow these specific instructions for formatting the answer:
4* Only output the transcription, with no newlines.
5* When transcribing numbers, write the digits, i.e. write 1.7 and not one point seven, and write 3 instead of three.
Automatic Speech Translation (AST)
text
1Transcribe the following speech segment in {SOURCE_LANGUAGE}, then translate it into {TARGET_LANGUAGE}.
2When formatting the answer, first output the transcription in {SOURCE_LANGUAGE}, then one newline, then output the string '{TARGET_LANGUAGE}: ', then the translation in {TARGET_LANGUAGE}.
7. Audio and Video Length
All models support image inputs and can process videos as frames whereas the E2B and E4B models also support audio inputs. Audio supports a maximum length of 30 seconds. Video supports a maximum of 60 seconds assuming the images are processed at one frame per second.
Model Data
Data used for model training and how the data was processed.
Training Dataset
Our pre-training dataset is a large-scale, diverse collection of data encompassing a wide range of domains and modalities, which includes web documents, code, images, audio, with a cutoff date of January 2025. Here are the key components:
Web Documents: A diverse collection of web text ensures the model is exposed to a broad range of linguistic styles, topics, and vocabulary. The training dataset includes content in over 140 languages.
Code: Exposing the model to code helps it to learn the syntax and patterns of programming languages, which improves its ability to generate code and understand code-related questions.
Mathematics: Training on mathematical text helps the model learn logical reasoning, symbolic representation, and to address mathematical queries.
Images: A wide range of images enables the model to perform image analysis and visual data extraction tasks.
The combination of these diverse data sources is crucial for training a powerful multimodal model that can handle a wide variety of different tasks and data formats.
Data Preprocessing
Here are the key data cleaning and filtering methods applied to the training data:
CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering was applied at multiple stages in the data preparation process to ensure the exclusion of harmful and illegal content.
Sensitive Data Filtering: As part of making Gemma pre-trained models safe and reliable, automated techniques were used to filter out certain personal information and other sensitive data from training sets.
Additional methods: Filtering based on content quality and safety in line with our policies.
Ethics and Safety
As open models become central to enterprise infrastructure, provenance and security are paramount. Developed by Google DeepMind, Gemma 4 undergoes the same rigorous safety evaluations as our proprietary Gemini models.
Evaluation Approach
Gemma 4 models were developed in partnership with internal safety and responsible AI teams. A range of automated as well as human evaluations were conducted to help improve model safety. These evaluations align with Google’s AI principles, as well as safety policies, which aim to prevent our generative AI models from generating harmful content, including:
Content related to child sexual abuse material and exploitation
Dangerous content (e.g., promoting suicide, or instructing in activities that could cause real-world harm)
Sexually explicit content
Hate speech (e.g., dehumanizing members of protected groups)
Harassment (e.g., encouraging violence against people)
Evaluation Results
For all areas of safety testing, we saw major improvements in all categories of content safety relative to previous Gemma models. Overall, Gemma 4 models significantly outperform Gemma 3 and 3n models in improving safety, while keeping unjustified refusals low. All testing was conducted without safety filters to evaluate the model capabilities and behaviors. For both text-to-text and image-to-text, and across all model sizes, the model produced minimal policy violations, and showed significant improvements over previous Gemma models' performance.
Usage and Limitations
These models have certain limitations that users should be aware of.
Intended Usage
Multimodal models (capable of processing vision, language, and/or audio) have a wide range of applications across various industries and domains. The following list of potential uses is not comprehensive. The purpose of this list is to provide contextual information about the possible use-cases that the model creators considered as part of model training and development.
Content Creation and Communication
Text Generation: These models can be used to generate creative text formats such as poems, scripts, code, marketing copy, and email drafts.
Chatbots and Conversational AI: Power conversational interfaces for customer service, virtual assistants, or interactive applications.
Text Summarization: Generate concise summaries of a text corpus, research papers, or reports.
Image Data Extraction: These models can be used to extract, interpret, and summarize visual data for text communications.
Audio Processing and Interaction: The smaller models (E2B and E4B) can analyze and interpret audio inputs, enabling voice-driven interactions and transcriptions.
Research and Education
Natural Language Processing (NLP) and VLM Research: These models can serve as a foundation for researchers to experiment with VLM and NLP techniques, develop algorithms, and contribute to the advancement of the field.
Language Learning Tools: Support interactive language learning experiences, aiding in grammar correction or providing writing practice.
Knowledge Exploration: Assist researchers in exploring large bodies of text by generating summaries or answering questions about specific topics.
Limitations
Training Data
The quality and diversity of the training data significantly influence the model's capabilities. Biases or gaps in the training data can lead to limitations in the model's responses.
The scope of the training dataset determines the subject areas the model can handle effectively.
Context and Task Complexity
Models perform well on tasks that can be framed with clear prompts and instructions. Open-ended or highly complex tasks might be challenging.
A model's performance can be influenced by the amount of context provided (longer context generally leads to better outputs, up to a certain point).
Language Ambiguity and Nuance
Natural language is inherently complex. Models might struggle to grasp subtle nuances, sarcasm, or figurative language.
Factual Accuracy
Models generate responses based on information they learned from their training datasets, but they are not knowledge bases. They may generate incorrect or outdated factual statements.
Common Sense
Models rely on statistical patterns in language. They might lack the ability to apply common sense reasoning in certain situations.
Ethical Considerations and Risks
The development of vision-language models (VLMs) raises several ethical concerns. In creating an open model, we have carefully considered the following:
Bias and Fairness
VLMs trained on large-scale, real-world text and image data can reflect socio-cultural biases embedded in the training material. Gemma 4 models underwent careful scrutiny, input data pre-processing, and post-training evaluations as reported in this card to help mitigate the risk of these biases.
Misinformation and Misuse
VLMs can be misused to generate text that is false, misleading, or harmful.
This model card summarizes details on the models' architecture, capabilities, limitations, and evaluation processes.
A responsibly developed open model offers the opportunity to share innovation by making VLM technology accessible to developers and researchers across the AI ecosystem.
Risks identified and mitigations:
Generation of harmful content: Mechanisms and guidelines for content safety are essential. Developers are encouraged to exercise caution and implement appropriate content safety safeguards based on their specific product policies and application use cases.
Misuse for malicious purposes: Technical limitations and developer and end-user education can help mitigate against malicious applications of VLMs. Educational resources and reporting mechanisms for users to flag misuse are provided.
Privacy violations: Models were trained on data filtered for removal of certain personal information and other sensitive data. Developers are encouraged to adhere to privacy regulations with privacy-preserving techniques.
Perpetuation of biases: It's encouraged to perform continuous monitoring (using evaluation metrics, human review) and the exploration of de-biasing techniques during model training, fine-tuning, and other use cases.