DailyGlimpse

Deconstructing Sentence Transformers: A Deep Dive into BERT's Inner Workings

AI
April 26, 2026 · 11:19 PM

In the latest lecture of the Generative AI course (Lecture 22), Constantine Caramanis provides a hands-on exploration of how Sentence Transformers operate under the hood. The session moves beyond high-level abstractions to directly utilize BERT via Hugging Face's AutoModelForMaskedLM, demonstrating the step-by-step text processing pipeline.

The lecture covers the entire workflow: from tokenization through the transformer's hidden states, culminating in the generation of sentence embeddings via mean pooling. This practical approach bridges the theoretical foundations from previous lectures with a concrete understanding of what the SentenceTransformers library automates.

Viewers gain familiarity with BERT's tokenization and embedding mechanisms, gaining insight into how masked language models process and represent textual input. The session is part of an ongoing course, "Παραγωγική Τεχνητή Νοημοσύνη - Generative AI," and includes a companion Colab notebook for hands-on experimentation.