Teachable LLM

Transfer Learning via Transformers.js & k-NN in WebAssembly

Initializing pipeline...

Interactive Architecture Pipeline

Explore how Transformers convert text into high-dimensional vectors and perform transfer learning in-browser.

1

Tokenization

Subword splitting & position IDs

2

Self-Attention

Multi-Head token interaction

3

Mean Pooling

Dense vector fingerprint

4

2D Space & k-NN

PCA Manifold & Class Regions

1. Training Dataset

0 examples

Current Memory Dataset

2. Run Inference

Activity Console

LIVE

Architecture Specs

  • Active Model: Xenova/all-MiniLM-L6-v2
  • Runtime: ONNX Runtime Web via Transformers.js
  • Embedding Dimension: 384
  • Pooling Strategy: Mean pooling with L2 normalization
  • Classifier: k-Nearest Neighbors (Euclidean Distance)

Deep Learning Visual Explorers

Interactive step-by-step breakdown inspired by Transformer Explainer & GAN Lab

Stage 1: Subword Tokenization

WordPiece / BPE

Input text is mapped into discrete subword token IDs and positional indices.

Stage 2: Self-Attention Matrix & QKV Arcs

Softmax(QKT/√d)V

Tokens attend to each other across Multi-Head Self-Attention layers to capture contextual meaning.

Stage 3: Sentence Embedding Fingerprint

Mean Pooling & L2 Norm

Token vectors are collapsed into a dense 1D fingerprint representing the entire sentence's semantics.

Stage 4: 2D Embedding Space & k-NN Decision Boundaries

High-dimensional embeddings projected to 2D via PCA. Background shows memory class zones; click canvas to query!

💡 Click anywhere on canvas to test a 2D vector coordinate query