Gemma 3n یک مدل هوش مصنوعی مولد است که برای استفاده در دستگاه های روزمره مانند تلفن، لپ تاپ و تبلت بهینه شده است. این مدل شامل نوآوریهایی در پردازش پارامترهای کارآمد، از جمله ذخیرهسازی پارامتر در هر لایه (PLE) و معماری مدل MatFormer است که انعطافپذیری را برای کاهش نیازهای محاسباتی و حافظه فراهم میکند. این مدلها دارای مدیریت ورودی صوتی و همچنین دادههای متنی و تصویری هستند.
Gemma 3n دارای ویژگی های کلیدی زیر است:
ورودی صوتی : پردازش داده های صدا برای تشخیص گفتار، ترجمه و تجزیه و تحلیل داده های صوتی. بیشتر بدانید
ورودی بصری و متن : قابلیتهای چندوجهی به شما امکان میدهند بینایی، صدا و متن را مدیریت کنید تا به شما در درک و تجزیه و تحلیل دنیای اطرافتان کمک کند. بیشتر بدانید
رمزگذار بینایی: انکودر MobileNet-V5 با کارایی بالا سرعت و دقت پردازش داده های بصری را به میزان قابل توجهی بهبود می بخشد. بیشتر بدانید
ذخیره سازی PLE : پارامترهای تعبیه شده در هر لایه (PLE) موجود در این مدل ها را می توان در حافظه داخلی سریع و برای کاهش هزینه های اجرای حافظه مدل کش کرد. بیشتر بدانید
معماری MatFormer: معماری ترانسفورماتور Matryoshka امکان فعال سازی انتخابی پارامترهای مدل را در هر درخواست برای کاهش هزینه محاسبه و زمان پاسخ می دهد. بیشتر بدانید
بارگذاری پارامتر مشروط: برای کاهش تعداد کل پارامترهای بارگذاری شده و صرفه جویی در منابع حافظه، از بارگذاری پارامترهای بینایی و صدا در مدل دور بزنید. بیشتر بدانید
پشتیبانی از زبان گسترده : قابلیت های زبانی گسترده، آموزش دیده در بیش از 140 زبان.
زمینه توکن 32K : زمینه ورودی قابل توجهی برای تجزیه و تحلیل داده ها و رسیدگی به وظایف پردازشی.
مانند سایر مدلهای Gemma، Gemma 3n با وزنههای باز و دارای مجوز برای استفاده تجاری مسئولانه ارائه میشود و به شما امکان میدهد آن را در پروژهها و برنامههای خود تنظیم و اجرا کنید.
پارامترهای مدل و پارامترهای موثر
مدلهای Gemma 3n با تعداد پارامترهایی مانند E2B و E4B فهرست شدهاند که از تعداد کل پارامترهای موجود در مدلها کمتر است. پیشوند E نشان می دهد که این مدل ها می توانند با مجموعه ای از پارامترهای موثر کار کنند. این عملکرد پارامتر کاهش یافته را می توان با استفاده از فناوری پارامتر انعطاف پذیر تعبیه شده در مدل های Gemma 3n برای کمک به اجرای کارآمد در دستگاه های با منابع پایین تر به دست آورد.
پارامترها در مدل های Gemma 3n به 4 گروه اصلی تقسیم می شوند: پارامترهای متن، بصری، صوتی و تعبیه در هر لایه (PLE). با اجرای استاندارد مدل E2B، بیش از 5 میلیارد پارامتر هنگام اجرای مدل بارگذاری می شود. با این حال، با استفاده از تکنیکهای پرش پارامتر و ذخیرهسازی PLE، این مدل میتواند با بار حافظه موثر کمتر از 2 میلیارد (1.91B) پارامتر، همانطور که در شکل 1 نشان داده شده است، کار کند.
شکل 1. پارامترهای مدل Gemma 3n E2B که در اجرای استاندارد در مقابل بار پارامتر کمتر با استفاده از روشهای ذخیرهسازی PLE و پرش پارامتر اجرا میشوند.
با استفاده از این تکنیکهای تخلیه پارامتر و فعالسازی انتخابی، میتوانید مدل را با مجموعهای از پارامترهای بسیار ناچیز اجرا کنید یا پارامترهای اضافی را برای مدیریت انواع دادههای دیگر مانند دیداری و صوتی فعال کنید. این ویژگیها شما را قادر میسازد تا بر اساس قابلیتهای دستگاه یا الزامات کار، عملکرد مدل را افزایش دهید یا قابلیتهای پایینتر را افزایش دهید. بخشهای زیر بیشتر در مورد تکنیکهای کارآمد پارامتر موجود در مدلهای Gemma 3n توضیح میدهند.
ذخیره سازی PLE
مدلهای Gemma 3n شامل پارامترهای Per-Layer Embedding (PLE) هستند که در طول اجرای مدل برای ایجاد دادههایی استفاده میشوند که عملکرد هر لایه مدل را افزایش میدهد. دادههای PLE را میتوان بهطور جداگانه، خارج از حافظه عملیاتی مدل تولید کرد، در حافظه پنهان ذخیرهسازی سریع ذخیره کرد و سپس با اجرای هر لایه به فرآیند استنتاج مدل اضافه کرد. این رویکرد به پارامترهای PLE اجازه می دهد تا از فضای حافظه مدل خارج شوند و مصرف منابع را کاهش دهد و در عین حال کیفیت پاسخ مدل را بهبود بخشد.
معماری MatFormer
مدلهای Gemma 3n از معماری مدل Matryoshka Transformer یا MatFormer استفاده میکنند که شامل مدلهای تودرتو و کوچکتر در یک مدل بزرگتر است. مدلهای فرعی تو در تو را میتوان برای استنتاج بدون فعال کردن پارامترهای مدلهای محصور در هنگام پاسخ به درخواستها استفاده کرد. این توانایی برای اجرای مدلهای کوچکتر و هستهای در یک مدل MatFormer میتواند هزینه محاسباتی، و زمان پاسخگویی و ردپای انرژی را برای مدل کاهش دهد. در مورد Gemma 3n، مدل E4B شامل پارامترهای مدل E2B است. این معماری همچنین به شما امکان می دهد پارامترها را انتخاب کرده و مدل ها را در اندازه های متوسط بین 2B و 4B مونتاژ کنید. برای جزئیات بیشتر در مورد این رویکرد، مقاله تحقیقاتی MatFormer را ببینید. سعی کنید از تکنیک های MatFormer برای کاهش اندازه یک مدل Gemma 3n با راهنمای MatFormer Lab استفاده کنید.
بارگذاری پارامتر مشروط
مشابه پارامترهای PLE، میتوانید از بارگذاری برخی پارامترها در حافظه مانند پارامترهای صوتی یا بصری در مدل Gemma 3n صرفنظر کنید تا بار حافظه کاهش یابد. اگر دستگاه منابع مورد نیاز را داشته باشد، می توان این پارامترها را به صورت پویا در زمان اجرا بارگذاری کرد. به طور کلی، پرش پارامتر میتواند حافظه عملیاتی مورد نیاز را برای مدل Gemma 3n کاهش دهد، و امکان اجرا در طیف وسیعتری از دستگاهها را فراهم میکند و به توسعهدهندگان اجازه میدهد تا کارایی منابع را برای کارهای کمتر افزایش دهند.
برای شروع ساختن آماده اید؟ با مدل های Gemma شروع کنید !
تاریخ آخرین بهروزرسانی 2025-06-30 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-06-30 بهوقت ساعت هماهنگ جهانی."],[],[],null,["Gemma 3n is a generative AI model optimized for use in everyday devices, such as\nphones, laptops, and tablets. This model includes innovations in\nparameter-efficient processing, including Per-Layer Embedding (PLE) parameter\ncaching and a MatFormer model architecture that provides the flexibility to\nreduce compute and memory requirements. These models feature audio input\nhandling, as well as text and visual data.\n\nGemma 3n includes the following key features:\n\n- **Audio input** : Process sound data for speech recognition, translation, and audio data analysis. [Learn more](/gemma/docs/core/huggingface_inference#audio)\n- **Visual and text input** : Multimodal capabilities let you handle vision, sound, and text to help you understand and analyze the world around you. [Learn more](/gemma/docs/core/huggingface_inference#vision)\n- **Vision encoder:** High-performance MobileNet-V5 encoder substantially improves speed and accuracy of processing visual data. [Learn more](https://developers.googleblog.com/en/introducing-gemma-3n-developer-guide/#mobilenet-v5:-new-state-of-the-art-vision-encoder)\n- **PLE caching** : Per-Layer Embedding (PLE) parameters contained in these models can be cached to fast, local storage to reduce model memory run costs. [Learn more](#ple-caching)\n- **MatFormer architecture:** Matryoshka Transformer architecture allows for selective activation of the models parameters per request to reduce compute cost and response times. [Learn more](#matformer)\n- **Conditional parameter loading:** Bypass loading of vision and audio parameters in the model to reduce the total number of loaded parameters and save memory resources. [Learn more](#conditional-parameter)\n- **Wide language support**: Wide linguistic capabilities, trained in over 140 languages.\n- **32K token context**: Substantial input context for analyzing data and handling processing tasks.\n\n[Try Gemma 3n](https://aistudio.google.com/prompts/new_chat?model=gemma-3n-e4b-it)\n[Get it on Kaggle](https://www.kaggle.com/models/google/gemma-3n)\n[Get it on Hugging Face](https://huggingface.co/collections/google/gemma-3n-685065323f5984ef315c93f4)\n\nAs with other Gemma models, Gemma 3n is provided with open weights and\nlicensed for responsible [commercial use](/gemma/terms), allowing you to tune\nand deploy it in your own projects and applications.\n| **Tip:** If you are interested in building generative AI solutions for Android mobile applications, check out Gemini Nano. For more information, see the Android [Gemini Nano](https://developer.android.com/ai/gemini-nano) developer docs.\n\nModel parameters and effective parameters\n\nGemma 3n models are listed with parameter counts, such as **`E2B`** and\n**`E4B`** , that are *lower* than the total number of parameters contained in the\nmodels. The **`E`** prefix indicates these models can operate with a reduced set\nof Effective parameters. This reduced parameter operation can be achieved using\nthe flexible parameter technology built into Gemma 3n models to help them run\nefficiently on lower resource devices.\n\nThe parameters in Gemma 3n models are divided into 4 main groups: text, visual,\naudio, and per-layer embedding (PLE) parameters. With standard execution of the\nE2B model, over 5 billion parameters are loaded when executing the model.\nHowever, using parameter skipping and PLE caching techniques, this model can be\noperated with an effective memory load of just under 2 billion (1.91B)\nparameters, as illustrated in Figure 1.\n\n**Figure 1.** Gemma 3n E2B model parameters running in standard execution\nversus an effectively lower parameter load using PLE caching and parameter\nskipping techniques.\n\nUsing these parameter offloading and selective activation techniques, you can\nrun the model with a very lean set of parameters or activate additional\nparameters to handle other data types such as visual and audio. These features\nenable you to ramp up model functionality or ramp down capabilities based on\ndevice capabilities or task requirements. The following sections explain more\nabout the parameter efficient techniques available in Gemma 3n models.\n\nPLE caching\n\nGemma 3n models include Per-Layer Embedding (PLE) parameters that are used\nduring model execution to create data that enhances the performance of each\nmodel layer. The PLE data can be generated separately, outside the operating\nmemory of the model, cached to fast storage, and then added to the model\ninference process as each layer runs. This approach allows PLE parameters to be\nkept out of the model memory space, reducing resource consumption while still\nimproving model response quality.\n\nMatFormer architecture\n\nGemma 3n models use a Matryoshka Transformer or *MatFormer* model architecture\nthat contains nested, smaller models within a single, larger model. The nested\nsub-models can be used for inferences without activating the parameters of the\nenclosing models when responding to requests. This ability to run just the\nsmaller, core models within a MatFormer model can reduce compute cost, and\nresponse time, and energy footprint for the model. In the case of Gemma 3n, the\nE4B model contains the parameters of the E2B model. This architecture also\nlets you select parameters and assemble models in intermediate sizes\nbetween 2B and 4B. For more details on this approach, see the\n[MatFormer research paper](https://arxiv.org/pdf/2310.07707).\nTry using MatFormer techniques to reduce the size of a Gemma 3n model with the\n[MatFormer Lab](https://goo.gle/gemma3n-matformer-lab)\nguide.\n\nConditional parameter loading\n\nSimilar to PLE parameters, you can skip loading of some parameters into memory,\nsuch as audio or visual parameters, in the Gemma 3n model to reduce memory load.\nThese parameters can be dynamically loaded at runtime if the device has the\nrequired resources. Overall, parameter skipping can further reduce the required\noperating memory for a Gemma 3n model, enabling execution on a wider range of\ndevices and allowing developers to increase resource efficiency for less\ndemanding tasks.\n\n\u003cbr /\u003e\n\n\nReady to start building?\n[Get started](/gemma/docs/get_started)\nwith Gemma models!"]]