ছোট্ট ইতিহাস: স্মৃতির সমস্যা থেকে attention পর্যন্ত
Attention হঠাৎ আকাশ থেকে নামেনি। ত্রিশ বছর ধরে মানুষ চেষ্টা করেছে মেশিনকে শব্দের ক্রম বোঝাতে — প্রতিটা মডেল একটা সমস্যা সমাধান করে পরেরটা দেখিয়েছে। এই টাইমলাইন দেখলে বোঝা যাবে, ২০১৭-র Transformer 'বিপ্লব' কেন ছিল, কাকতালীয় নয়।
গভীরে: recurrence কেন রাস্তার শেষ ছিল (এক প্যারায়)
টোকেনাইজেশন — মেশিন শব্দ পড়ে না, সংখ্যা পড়ে
Gold chips are subword pieces; BERT-style "##" means "continuation of the previous piece". IDs here are toy hashes — real vocabularies (e.g. 50,257 entries in GPT-2) map IDs to pieces fixed at training time.
গভীরে: সাবওয়ার্ড কেন? (সহজ ভাষায় BPE)
BPE মার্জ ল্যাব — টোকেনাইজারের কাটাশেখা চোখের সামনে
The actual Byte Pair Encoding algorithm, live on a 19-word corpus. Each step counts every adjacent pair and merges the most frequent one into a new vocabulary piece — exactly how GPT built 50,257 pieces, just with a bigger corpus.
নিজে করো: যেকোনো শব্দে এই মার্জগুলো প্রয়োগ করো
Type "lowest" → low + est. Type "glow" → g + low — the model reuses 'low' even inside 'glow'. That recycling is the whole point of subwords.
বাইট-অ্যানাটমি — মডেল আসলে প্রথমে কী দেখে
Modern tokenizers (GPT-2, GPT-4o, LLaMA) start from UTF-8 BYTES, not letters. An English letter is 1 byte; a Bangla letter is 3. That is why rare Bangla text costs 2–4× more tokens — more bytes, more pieces, more context window spent. Click any letter.
Byte-level BPE can encode ANY text — emoji, Bangla, code — with zero [UNK]. The merges then learn which byte groups are frequent in YOUR language.
স্পেশাল টোকেন — মডেল-ভাষার যতিচিহ্ন
Besides learned pieces, every tokenizer ships with reserved control tokens. They are not words — they are signals: where a sentence starts, where it ends, what is blank padding, what is hidden for guessing.
একই টেক্সট, তিন টোকেনাইজার — খরচ গুনে দেখো
Word-level: fewest tokens but chokes on new words. Character-level: never fails but wastes context. Subword: the trade-off that won. Watch the numbers change as you edit the text box above — Bangla words with suffixes split much more.
এমবেডিং — জ্যামিতি হয়ে ওঠা অর্থ
ভেক্টরটা, সংখ্যা ধরে ধরে
One-hot × E — আসল lookup-টা
An embedding table E has one row per token. Multiplying a one-hot vector by E selects exactly one row — that IS the embedding.
Cosine similarity — লাইভ হিসাব
গভীরে: দুই ভেক্টর তুলনা করা হয় কীভাবে?
পজিশনাল এনকোডিং — attention ক্রম ভুলে যায়, তাই আমরা ফিসফিস করে বলি
তরঙ্গ-ল্যান্ডস্কেপ, ৩-ডিতে
Left→right = position 0…47, front→back = dimension 0…31, height = value (−1…+1). The glowing slice follows your slider — every position cuts a unique fingerprint out of this landscape.
গভীরে: ১,২,৩… না দিয়ে তরঙ্গ কেন?
কুয়েরি, কী, ভ্যালু — প্রতিটা টোকেনের তিনটা ছদ্মবেশ
কুয়েরি — "আমি কী খুঁজছি?"
Q = X·W_Q। 'it'/'সে' সর্বনামটার কুয়েরি হয়ে ওঠে কিছু এমন: "কাছের একবচন বিশেষ্য, মিলবে প্রাণী বা বস্তু হলে"।
কী — "আমার মধ্যে কী আছে?"
K = X·W_K। 'mouse'/'ইঁদুর' শব্দের কী হয়ে ওঠে এমন: "একবচন প্রাণী-বিশেষ্য, সবেমাত্র উল্লেখ হয়েছে" — সে কীসের উত্তর দিতে পারে তার বিজ্ঞাপন।
ভ্যালু — "ম্যাচ পেলে কী দেব?"
V = X·W_V। 'it'/'সে' যদি 'mouse'/'ইঁদুর'-এর দিকে তাকায়, ইঁদুরের ভ্যালু (তার অর্থের পে-লোড) 'it'-এর ভেক্টরে ঢুকে যায়। তথ্য চলাচল করে V দিয়ে, কখনো স্কোর দিয়ে নয়।
নিজে দেখো — একটা টোকেন, চারটা আসল ভেক্টর
Pick a token from the sentence. You see its input vector x, then the SAME vector in three costumes (q, k, v) after multiplying by three learned 8×8 matrices — the real numbers the score matrix is built from.
গভীরে: W_Q, W_K, W_V আসে কোথা থেকে?
স্কোর → সফটম্যাক্স → ওজন — সেই বিখ্যাত সূত্র, জীবন্ত
$$\text{Attention}(Q,K,V)=\text{softmax}\!\left(\frac{QK^{\top}}{\sqrt{d_k}}\right)V$$গভীরে: √dk দিয়ে ভাগ করা হয় কেন?
আর্ক ডায়াগ্রাম — দেখো 'সে' কীভাবে 'ইঁদুর' খুঁজে পায়
মাল্টি-হেড অ্যাটেনশন — বিশেষজ্ঞদের কমিটি
গভীরে: ৮ হেড → concat → W_O (শেপগুলো)
কজ্যুয়াল মাস্কিং — ভবিষ্যতে চোখ দেওয়া নিষেধ
টগল করলে কী বদলায়
১. প্রতিটা সারি একমুখী দৃষ্টি পায়: টোকেন ৪ দেখে শুধু টোকেন ০–৪।
২. প্রতিটা সারির ওজন শুধু দৃশ্যমান ঘরগুলোর ওপরে আবার normalize হয়।
৩. এখন শেষ টোকেনই পুরো বাক্যের কনটেক্সট বহন করে — যে ভেক্টর দিয়ে পরের শব্দ অনুমান হয়, ঠিক সেটাই।
গভীরে: সমান্তরাল ট্রেনিংয়ের কৌশল
পুরো পাইপলাইন — এক বাক্য, শুরু থেকে শেষ
আউটপুট — লজিটস, সফটম্যাক্স, স্যাম্পলিং: শব্দের জন্ম
গভীরে: top-k, top-p, আর ChatGPT মানুষের মতো কেন শোনায়
গণিত, দুইবার — কঠোরভাবে এবং মানুষের ভাষায়
৩-ডি এক্সপ্লোরার — ঘোরাও, জুম করো, ক্লিক করো
চারটা হেডই, ৩-ডিতে স্তূপাকারে
Four floors, one attention head per floor. Every tower is one weight. Click any tower to sync the 2-D explorers above to that head; hover for the exact token pair.
Attention নিয়ে সেরা ভিডিওগুলো — বাছাই করা ও এমবেড করা
Hand-picked explanations from 3Blue1Brown, StatQuest, Andrej Karpathy and Umar Jamil — the four channels teachers cite most. Watch after playing with the visualizations above; each video answers questions this page raises.
গ্লসারি — ২৫টা টার্ম, দুই ভাষাতেই
| টার্ম | বাংলা | অর্থ |
|---|
ক্রেডিট ও অনুপ্রেরণা
This site was built by combining the best ideas from six landmark visualizations. Open them all — each one goes deeper on a different axis.