0:00

تعرف الحواسيب كيف تعثر على الصور التي تبحث عنها، وتكتشف الرسائل المزعجة في صندوق الوارد، وتوصي بمقاطع فيديو قد ترغب في مشاهدتها.

0:07

لكن كيف تفهم فعليًا المعنى وراء صورك أو رسائلك أو مقاطع الفيديو؟

0:15

غالبًا ما تكمن الإجابة في التضمينات. التضمين قائمة من الأرقام، أي متجه عالي الأبعاد يلتقط معنى جزء من البيانات.

0:24

كلما تقارب متجهان في الفضاء، زادت الدلالة المتشابهة للبيانات التي يمثلانها.

0:30

يربط نموذج Embedding Gemma 2 الجديد النصوص، والبرمجيات والصور ومقاطع الفيديو والصوت بفضاء تضمين موحد.

0:38

وهذا يعني أن تضمينات صورة لغروب الشمس والعبارة «الساعة الذهبية» تنتهي متجاورة تمامًا.

0:46

ويمكنك حتى دمج وسائط متعددة في مُدخل واحد.

0:48

يفهم النموذج بطبيعته تسلسلات متداخلة من وسائط متعددة مختلفة.

0:52

لإنشاء تمثيل موحّد للمحتوى يمكن استخدام هذه التضمينات لاسترجاع المستندات ذات الصلة لاستعلام معيّن، وتصنيفها إلى أنواع مختلفة، وتجميعها في مجموعات، وغير ذلك الكثير.

1:04

لنشرح بالتفصيل كيف يعمل Embedding Gemma 2.

1:07

مثل الإصدار السابق من Embedding Gemma، تنشئ بنيةٌ عصبيةٌ واحدة تمثيلات التضمين النهائية لبياناتنا.

1:15

مع Embedding Gemma 2، يكمن الاختلاف في كيفية معالجة المدخلات قبل إنشاء التضمين.

1:20

بدلًا من إدخال كل شيء فورًا إلى نموذج واحد، تمر المدخلات الخام أولًا عبر مُرمِّزات خاصة بكل وسيط.

1:27

يقسّم مُرمِّز الرؤية الصور أو إطارات الفيديو إلى رقع صغيرة.

1:31

يحوّل مُرمِّز الصوت الموجات الصوتية الخام إلى تمثيل بصري يُسمّى مخططًا طيفيًا.

1:37

وتقسّم هذه التمثيلات إلى مقاطع قصيرة. ثم يُخرج كل مُرمِّز متجهات، متجهًا لكل رقعة من الصورة، ومتجهًا لكل فترة صوتية مدتها 40 مللي ثانية، ويسقطها في فضاء مشترك يكون بمثابة لغة مشتركة لـ المعالج الأساسي لمعالجة كل الوسائط معًا.

1:52

في القلب، يوجد محوّل ثنائي الاتجاه، يزن مدى أهمية أجزاء مختلفة من المُدخل، ويضعها في سياقها، ويمزج المعلومات بين الوسائط المختلفة.

2:03

ثم تختزل ثلاث خطوات المخرجات الوسيطة من المحوّل إلى تضمين واحد.

2:09

يحسب التجميع بالمتوسط متوسط المتجهات، ويضغط التسلسل في تمثيل واحد.

2:14

وتسقط طبقة كثيفة المتجه المجمّع إلى شكله النهائي.

2:18

وأخيرًا، تُسقط عملية التطبيع المتجه على كرة الوحدة.

2:22

لاستقرار التدريب وإجراء مقارنات فعّالة. من التحسينات الأساسية في Embedding Gemma 2 إدخال المدخلات في كل طبقة.

2:29

بدلًا من تمرير سياق الإدخال إلى المحوّل مرة واحدة فقط، نُدخل نسخة مخصّصة من الإدخال في كل طبقة.

2:37

وبهذا، نضمن عدم فقدان الإشارة الأصلية، حتى في أعمق طبقاته.

2:41

بفضل هذه التحسينات وغيرها، يظل Embedding Gemma 2 أصغر حجمًا وأسرع من سابقه.

2:47

فكيف يُدرَّب Embedding Gemma 2 لإنشاء تضمينات متعددة الوسائط؟

2:51

يتكوّن التدريب من مرحلتين: ما قبل الضبط الدقيق والضبط الدقيق.

2:55

أولًا، لا ندرّبه من الصفر. يُهيَّأ Embedding Gemma 2 انطلاقًا من نموذج مفكّك الترميز Gemma 4 المدرَّب مسبقًا، لذا فهو يرث معرفة شاملة بالعالم قبل أن يبدأ تدريب التضمينات.

3:07

ثم يتعلّم من الأفضل. من خلال التقطير، يدرس Embedding Gemma 2 فضاء التضمين الخاص بمعلّمه الأكبر بكثير، Gemini Embedding 2.

3:15

أثناء الضبط الدقيق، نحسّن تمثيلات Embedding Gemma بتدريبه على أهداف خسارة تقابلية ومتباعدة.

3:22

تُحسّن الخسارة التقابلية فضاء التضمين، فتعلّمه عمليًا مفاهيم التشابه والتباين.

3:28

تتقارب الأزواج الإيجابية، وتتباعد الأزواج السلبية عن بعضها.

3:32

ونستخدم أيضًا عينات سلبية من البرج نفسه.

3:35

ببساطة، نضيف مزيدًا من الأزواج السلبية بين عناصر من الوسيط نفسه، وندفعها إلى الابتعاد بعضها عن بعض.

3:41

وهذا ضروري للاسترجاع الحقيقي متعدد الوسائط، لئلا تنحاز نتائجك إلى وسيط معيّن.

3:46

وأخيرًا، تضمن الخسارة المتباعدة أن تكون التضمينات موزعة للاستفادة الكاملة من تعبيرية فضاء التضمين.

3:52

وهذا يضمن إمكانية استرجاع تضمينات النموذج بكفاءة في قواعد البيانات المتجهية، وأنها مقاومة للتكميم.

3:58

كلما زادت الأنماط التي يمكنك تضمينها، زادت إمكانية الفهرسة، وقد يؤدي تخزين ملايين المتجهات إلى استنفاد مساحة التخزين سريعًا.

4:05

يتيح التعلّم التمثيلي الماتريوشكي تضمين تمثيلات متناقصة الحجم بعضها داخل بعض.

4:10

نطبّق دوال خسارة على بادئات التضمينات لضمان أن تكون حتى النسخ المقتطعة من التضمينات تمثيلات قوية ومتكاملة.

4:18

يمكنك اختيار المفاضلة التي تناسبك بين الجودة والأداء من دون الحاجة إلى إعادة التدريب أو تغيير النماذج.

4:23

باستخدام نموذج موحّد، يمكنك إجراء استرجاع متعدد الوسائط، مثل البحث في مكتبة فيديو باستخدام مقطع صوتي أو استرجاع المؤثرات الصوتية باستخدام مطالبات نصية، في بضعة أسطر فقط من Python.

4:33

ومع التدريب الواعي بالتكميم، لتقليص حجم النموذج إلى INT4، يعمل Embedding Gemma 2 بسرعة أكبر على الأجهزة الطرفية.

4:40

Embedding Gemma 2 أصغر حجمًا وأسرع، والآن يرى ويسمع ويقرأ.

4:47

نزّل النموذج من Hugging Face وKaggle، أو اطّلع على كتب الوصفات لدينا للبدء.

4:52

نتطلع بشوق إلى رؤية ما ستبنيه به. لمزيد من التفاصيل حول النمذجة، اقرأ تقريرنا التقني في الرابط أدناه.

End of transcript · 677 words · machine translated

Original transcript (English)

Computers know how to find the photos you're looking for, detect spam in your inbox, and recommend videos you'd like to watch.

But how do they actually understand the meaning behind your photos, emails, or videos?

Often, the answer lies in embeddings. An embedding is a list of numbers, a high-dimensional vector that captures the meaning of a piece of data.

The closer two vectors are in space, the more semantically similar the data they represent.

The new Embedding Gemma 2 model maps text, code, images, videos, and audio into a unified embedding space.

This means the embeddings for a photo of a sunset and the text "golden hour" end up right next to each other.

You can even combine modalities into one input.

The model natively understands interleaved sequences of different modalities to create a single unified representation of the content.

These embeddings can be used to retrieve relevant documents for a given query, classify them into different types, cluster them into groups, and much more.

Let's break down how Embedding Gemma 2 works.

Like the previous version of Embedding Gemma, a single neural network backbone creates the final embedding representations of our data.

With Embedding Gemma 2, the difference is in how inputs are processed before an embedding is generated.

Instead of feeding everything immediately into a single model, raw inputs first go through modality-specific encoders.

The vision encoder chops images or video frames into small patches.

The audio encoder converts raw sound waveforms into a visual representation called a spectrogram and slices these representations into short segments.

Each encoder then outputs vectors, one for each image patch and one for each 40-millisecond sound interval, and projects them into a shared space that serves as a common language for the backbone to process all the modalities together.

At the core sits a bidirectional transformer, which weighs the relevance of different parts of the input, contextualizes them, and blends together information across different modalities.

Then three steps collapse the intermediate output from the transformer into a single embedding.

Mean pooling averages vectors, compressing the sequence into a single representation.

A dense layer projects the pooled vector into its final output shape.

Finally, normalization maps the vector onto unit sphere for both training stability and efficient comparisons.

One key improvement in Embedding Gemma 2 is per-layer inputs.

Instead of feeding the input context into the transformer just once, we inject a tailored version of the input at every layer.

With this, we ensure the original signal is not lost, even in its deepest layers.

Thanks to these and other upgrades, Embedding Gemma 2 is able to stay leaner and faster than its predecessor.

So how is Embedding Gemma 2 trained to generate multimodal embeddings?

The training regime is two stages: pre-fine-tuning and fine-tuning.

First of all, we don't train from scratch.

Embedding Gemma 2 is initialized from a pre-trained Gemma 4 decoder model, so it inherits comprehensive world knowledge before the embedding training even begins.

Then it learns from the best. Through distillation, Embedding Gemma 2 studies the embedding space of its much larger teacher, Gemini Embedding 2.

During fine-tuning, we refine Embedding Gemma's representations by training on contrastive and spread-out loss objectives.

Contrastive loss sharpens the embedding space, effectively teaching notions of similarity and contrast.

Positive pairs pull closer together, and negative pairs are pushed further apart.

We also use same-tower negatives. Essentially, we add more negative pairs between elements of the same modality, pushing them further away from each other.

This is crucial for true omnimodal retrieval, so your results are not biased towards any given modality.

Finally, spread-out loss ensures the embeddings are dispersed to fully utilize the expressiveness of the embedding space.

This ensures the model's embeddings can be retrieved efficiently in vector databases and are robust to quantization.

The more modalities you can embed, the more you can index, and storing millions of vectors can quickly exhaust storage.

Matryoshka representation learning allows us to nest embeddings of decreasing size.

We apply loss functions to embedding prefixes to ensure that even truncated versions of the embeddings are powerful and complete representations.

You can choose your quality-performance trade-off without having to retrain or change models.

With a unified model, you can run multimodal retrieval, like searching a video library using an audio clip or retrieving audio effects using text prompts, in just a few lines of Python.

And with quantization-aware training to compress the model's footprint down to INT4, Embedding Gemma 2 runs even faster on edge devices.

Embedding Gemma 2 is smaller and faster, and now it sees, hears, and reads.

Download the model on Hugging Face and Kaggle, or check out our cookbooks to get started.

We can't wait to see what you build with it.

For more modeling details, read our technical report in the link below.

Up next

Keep watching Swipe through more videos, one after another
  1. 4:04 خمس هدايا يقول كائنات فضائية إنهم سيقدمونها للبشرية English → Arabic
  2. 3:11 ادعاءات الأرض المسطحة عن قرب الشمس والقمر والمنظور English → Arabic
  3. 1:01 كيف يكشف جهاز الرؤية الليلية ومضات الأشعة تحت الحمراء في iPhone 16 English → Arabic
  4. 1:31 مخاطر الذكاء الاصطناعي الفائق: هل يتحرك الكونغرس في الوقت المناسب؟ English → Arabic
  5. 1:21 تحذيرات أنونيموس من انقطاع عالمي للكهرباء بعد أعطال مايكروسوفت English → Arabic
  6. 3:04 الاندماج النووي والتوكاماك: جهود إيران لتطوير طاقة المستقبل Persian → Arabic
  7. 1:18 لافوازييه والذرات وتحول المادة والطاقة French → Arabic
  8. 4:23 انتقاد سنيكو بسبب تصريحاته عن الحوثيين ومضيق باب المندب English → Arabic 103 views
  9. 4:55 العمل الذكي أم العمل الشاق؟ نقاش مع حارس أمن يعمل 80 ساعة أسبوعياً English → Arabic 81 views
  10. 4:59 مرشح لمجلس الشيوخ يناقش تصنيف الإخوان المسلمين إرهابياً وحرب العراق English → Arabic 80 views
  11. 1:34 مشادة بسبب تجاوز الدور أثناء شراء الماء English → Arabic 74 views
  12. 1:45 نقاش حول الإساءة للنبي محمد وحرية التعبير والرد على التجديف English → Arabic 74 views
iPhone app Translate videos on your iPhone Paste a TikTok, Instagram or X link, add subtitles in your language and save the video to Photos.

Made with TranslateMom

TranslateMom transcribes and translates videos from X, TikTok, YouTube and Instagram. Paste a link and you get a page like this one, in your language.

تم النسخ والترجمة باستخدام TranslateMom. الصق رابط أي فيديو لتحصل على ترجمة ونص مكتوب بلغتك.

© 2026 TranslateMom · AI video translation and subtitles Transcripts Sources Pricing Legal