ICS 582Lecture 06المحاضرة 06Glossaryالمصطلحات
Glossaryالمصطلحات
Every term in Neural Language Models, defined once and used the same way in every part. Each entry links to the slides where the idea appears.كل مصطلح في محاضرة «نماذج اللغة العصبية»، معرّف مرة واحدة ومستخدم بالمعنى نفسه في كل الأجزاء. كل مدخل يربطك بالشرائح التي تظهر فيها الفكرة.
- Termsالمصطلحات
- 52
- Lettersالحروف
- 21
A
- Attention head
One self-attention layer with its own W_i^Q, W_i^K, W_i^V inside multi-head attention; each head can learn a different aspect of the relationships among inputs.طبقة انتباه ذاتي واحدة لها W_i^Q و W_i^K و W_i^V خاصة بها داخل الانتباه متعدد الرؤوس (multi-head attention)؛ ويمكن لكل رأس أن يتعلم جانبا مختلفا من العلاقات بين المدخلات.
- Attention weights
α_ij = exp(score_ij) / Σ_k exp(score_ik) with score_ij = q_i · k_j: how much position i draws on position j; each row sums to 1 and y_i = Σ_j α_ij v_j.α_ij = exp(score_ij) / Σ_k exp(score_ik) حيث score_ij = q_i · k_j: مقدار اعتماد الموضع i على الموضع j؛ مجموع كل صف يساوي 1، و y_i = Σ_j α_ij v_j.
- Autoregressive generation
Generating text by sampling one token from the model's distribution, feeding it back as the next input, and repeating until </s> or a maximum length.توليد النص بسحب رمز (token) واحد من توزيع النموذج، ثم إعادته إليه مدخلا تاليا، وتكرار ذلك حتى الوصول إلى </s> أو إلى طول أقصى.
B
- Bidirectional RNN
Two RNNs reading the sequence left-to-right and right-to-left, with their states concatenated at each position.شبكتا RNN تقرأ إحداهما التسلسل من اليسار إلى اليمين والأخرى من اليمين إلى اليسار، وتُدمج حالتاهما (concatenate) عند كل موضع.
C
- Candidate cell state
C̃_t = tanh(W_C[h_{t-1}, x_t] + b_C): the new information an LSTM may store, scaled by the input gate before it is added to the cell state.C̃_t = tanh(W_C[h_{t-1}, x_t] + b_C): المعلومة الجديدة التي قد تخزنها الـ LSTM، وتُحجَّم ببوابة الإدخال (input gate) قبل إضافتها إلى حالة الخلية.
- Causal (masked) self-attention
Self-attention where scores for future positions (j > i) are set to -∞ so each token attends only to itself and earlier tokens.انتباه ذاتي تُضبط فيه درجات المواضع المستقبلية (j > i) على -∞، فلا ينتبه كل رمز إلا إلى نفسه وإلى الرموز التي قبله.
- Cell state
The LSTM memory C_t, updated additively as C_t = f_t · C_{t-1} + i_t · C̃_t.ذاكرة الـ LSTM المسماة C_t، وتُحدَّث بالجمع على النحو C_t = f_t · C_{t-1} + i_t · C̃_t.
- Context
The representation the encoder passes to the decoder; in a plain RNN encoder-decoder it is the final hidden state, which becomes a bottleneck for long inputs.التمثيل الذي يمرره الـ encoder إلى الـ decoder؛ وفي encoder-decoder المبني على RNN عادية يكون هو الحالة المخفية الأخيرة، فيصبح عنق زجاجة (bottleneck) مع المدخلات الطويلة.
- Count-based (n-gram) language model
A statistical LM that makes an n-th order Markov assumption and estimates probabilities by counting and smoothing.نموذج لغة إحصائي يتبنى افتراض ماركوف (Markov assumption) من الرتبة n، ويقدّر الاحتمالات بالعدّ والتنعيم (smoothing).
- Cross-attention
Attention in the decoder where queries come from the decoder and keys and values come from the final encoder output.انتباه داخل الـ decoder تأتي فيه الاستعلامات (queries) من الـ decoder، بينما تأتي المفاتيح (keys) والقيم (values) من المخرج النهائي للـ encoder.
- Cross-entropy loss
L_CE = -Σ_w y_t[w] log ŷ_t[w], which for a one-hot target reduces to -log ŷ_t[w_true], the negative log probability of the correct next word.L_CE = -Σ_w y_t[w] log ŷ_t[w]، وعندما يكون الهدف بترميز one-hot تختصر إلى -log ŷ_t[w_true]، أي سالب لوغاريتم احتمال الكلمة التالية الصحيحة.
D
- Data sparsity
Most possible n-grams never occur in a training corpus, so counted estimates are zero or unreliable; neural LMs address it by representing words as vectors whose parameters are learned in training.معظم الـ n-grams الممكنة لا تظهر أبدا في مدونة التدريب (corpus)، فتكون التقديرات المعدودة صفرا أو غير موثوقة؛ وتعالج نماذج اللغة العصبية ذلك بتمثيل الكلمات متجهات تُتعلَّم معاملاتها أثناء التدريب.
- Decoder-only model
A causal, autoregressive, left-to-right transformer LM trained to predict the next word; the basis of GPT-style LLMs.نموذج لغة Transformer سببي (causal) وذاتي الانحدار (autoregressive) يعمل من اليسار إلى اليمين ويُدرَّب على التنبؤ بالكلمة التالية؛ وهو أساس نماذج اللغة الكبيرة (LLMs) على طراز GPT.
E
- Embedding matrix E
The learned matrix that maps a one-hot word x_t to its dense vector e_t = E x_t.المصفوفة المتعلَّمة التي تحوّل الكلمة الممثلة بترميز one-hot أي x_t إلى متجهها الكثيف e_t = E x_t.
- Encoder-decoder (seq2seq)
An architecture where an encoder turns the input sequence into a contextual representation and a decoder generates a task-specific output sequence from it.معمارية يحوّل فيها المُرمِّز (encoder) تسلسل المدخلات إلى تمثيل سياقي، ثم يولّد منه فاكّ الترميز (decoder) تسلسل مخرجات خاصا بالمهمة.
- Encoder-only model / masked language model
A bidirectional transformer such as BERT, trained to predict masked words from both sides and usually fine-tuned for classification.Transformer ثنائي الاتجاه مثل BERT، يُدرَّب على التنبؤ بالكلمات المحجوبة (masked) من الجانبين، وعادة يُضبط بدقة (fine-tuned) لمهام التصنيف.
- Exposure bias
The mismatch created by teacher forcing: training conditions only on gold histories, while generation conditions on the model's own, possibly wrong, outputs. Beyond the slides.عدم التطابق الذي ينشأ عن teacher forcing: يعتمد التدريب على تواريخ صحيحة (gold) فقط، بينما يعتمد التوليد على مخرجات النموذج نفسه التي قد تكون خاطئة. خارج نطاق الشرائح.
F
- Feedforward network (FFN)
The position-wise fully connected layer in each transformer block, applied to every position separately after attention: y = LayerNorm(z + FFN(z)).الطبقة المتصلة كليا (fully connected) التي تعمل على كل موضع على حدة (position-wise) في كل كتلة Transformer، وتُطبَّق على كل موضع منفصلا بعد الانتباه: y = LayerNorm(z + FFN(z)).
- Fine-tuning
Further training a pretrained model on a labeled downstream task such as classification.مواصلة تدريب نموذج مُدرَّب مسبقا (pretrained) على مهمة لاحقة (downstream) ذات بيانات موسومة، مثل التصنيف.
- Forget gate
f_t = σ(W_f[h_{t-1}, x_t] + b_f); values near 0 erase the old cell state, near 1 keep it.f_t = σ(W_f[h_{t-1}, x_t] + b_f)؛ القيم القريبة من 0 تمحو حالة الخلية القديمة، والقيم القريبة من 1 تحتفظ بها.
G
- Gated recurrent unit (GRU)
A simpler gated RNN with update and reset gates and no separate cell state.شبكة RNN أبسط ذات بوابات، فيها بوابة تحديث (update) وبوابة إعادة ضبط (reset)، وليست فيها حالة خلية منفصلة.
- Greedy decoding
Always emitting the most probable next word instead of sampling from the distribution; deterministic and prone to generic, repetitive text. Beyond the slides.إخراج الكلمة التالية الأعلى احتمالا دائما بدلا من السحب من التوزيع؛ وهو حتمي (deterministic) ويميل إلى نص عام ومتكرر. خارج نطاق الشرائح.
H
I
- Input gate
i_t = σ(W_i[h_{t-1}, x_t] + b_i); decides how much of the candidate C̃_t is written into the cell.i_t = σ(W_i[h_{t-1}, x_t] + b_i)؛ تحدد مقدار ما يُكتب في الخلية من القيمة المرشحة C̃_t.
L
- Language modeling head
The layers on top of the final transformer block that map h_N^L to a distribution over the vocabulary: unembedding then softmax.الطبقات الموضوعة فوق كتلة الـ Transformer الأخيرة، وتحوّل h_N^L إلى توزيع على المفردات (vocabulary): طبقة unembedding ثم softmax.
- Layer normalization
Normalizing a vector to zero mean and unit variance across its dimensions, followed by a learned scale and shift.تطبيع المتجه ليصبح متوسطه صفرا وتباينه واحدا عبر أبعاده، يتبعه تحجيم (scale) وإزاحة (shift) متعلَّمان.
- Logits
The unnormalized scores u = h_N^L E^T, one per vocabulary item, of shape 1 × |V|.الدرجات غير المطبَّعة u = h_N^L E^T، واحدة لكل عنصر في المفردات، وشكلها 1 × |V|.
- Long short-term memory (LSTM)
An RNN variant with a separate cell state and sigmoid gates (forget, input, output) that control what is erased, written and exposed, letting information survive many steps.نوع من الـ RNN له حالة خلية (cell state) منفصلة وبوابات sigmoid (بوابة النسيان forget، وبوابة الإدخال input، وبوابة الإخراج output) تتحكم فيما يُمحى وما يُكتب وما يُكشف، فتسمح للمعلومة بأن تبقى عبر خطوات كثيرة.
M
- Masked language model (MLM)
A model trained to predict words from the surrounding words on both sides, the popular encoder-only variety used by the BERT family.نموذج يُدرَّب على التنبؤ بالكلمات من الكلمات المحيطة بها على الجانبين، وهو النوع الشائع من نماذج encoder-only الذي تستخدمه عائلة BERT.
- Multi-head attention
Several attention heads with their own W^Q, W^K, W^V run in parallel; outputs are concatenated and projected by W^O.عدة رؤوس انتباه (attention heads) تعمل بالتوازي، لكل منها W^Q و W^K و W^V خاصة بها؛ تُدمج مخرجاتها (concatenate) ثم تُسقط بالمصفوفة W^O.
N
- Neural language model
A language model that represents words as learned vectors and predicts the next word with a neural network, avoiding the sparsity of counted n-grams.نموذج لغة يمثّل الكلمات بمتجهات متعلَّمة ويتنبأ بالكلمة التالية بشبكة عصبية، فيتجنب مشكلة التناثر (sparsity) في الـ n-grams المعدودة.
O
- One-to-many, many-to-one, many-to-many
Input/output configurations of sequence models: one input to a sequence (captioning), a sequence to one label (sentiment), or a sequence to a sequence either delayed (translation) or synchronized (tagging).أشكال المدخلات والمخرجات في نماذج التسلسل: مدخل واحد إلى تسلسل (وصف الصور captioning)، أو تسلسل إلى تصنيف واحد (تحليل المشاعر sentiment)، أو تسلسل إلى تسلسل إما مؤجَّل (الترجمة translation) أو متزامن (الوسم tagging).
- Output gate
o_t = σ(W_o[h_{t-1}, x_t] + b_o); decides how much of tanh(C_t) is exposed as the hidden state h_t.o_t = σ(W_o[h_{t-1}, x_t] + b_o)؛ تحدد مقدار ما يُكشف من tanh(C_t) ليصبح الحالة المخفية h_t.
P
- Parallel training
Computing all positions' next-word losses in one pass using teacher forcing and the causal mask, which transformers can do and RNNs cannot.حساب خسائر الكلمة التالية لجميع المواضع في تمريرة واحدة باستخدام teacher forcing والقناع السببي (causal mask)، وهذا ما تستطيعه الـ Transformers ولا تستطيعه الـ RNNs.
- Perplexity
The exponential of the average per-token cross-entropy loss (natural log), exp((1/T) Σ_t L_CE,t); lower is better. Beyond the slides.الأُسّ (exponential) لمتوسط خسارة cross-entropy لكل رمز (باللوغاريتم الطبيعي)، أي exp((1/T) Σ_t L_CE,t)؛ وكلما كانت أقل كان أفضل. خارج نطاق الشرائح.
- Positional encoding
A vector added to each input embedding that encodes its position, since attention alone ignores word order.متجه يُضاف إلى تضمين (embedding) كل مدخل ليرمّز موضعه، لأن الانتباه وحده يتجاهل ترتيب الكلمات.
Q
- Query, key, value
Three projections of each input, q_i = W^Q x_i, k_i = W^K x_i, v_i = W^V x_i: the query asks, keys are matched against it, values are what gets mixed.ثلاثة إسقاطات (projections) لكل مدخل، q_i = W^Q x_i و k_i = W^K x_i و v_i = W^V x_i: الاستعلام (query) يسأل، والمفاتيح (keys) تُطابَق معه، والقيم (values) هي ما يُمزج.
R
- Recurrent neural network (RNN)
A network that processes a sequence one step at a time, updating a hidden state from the previous hidden state and the current input with the same weights at every step.شبكة تعالج التسلسل خطوة بخطوة، فتحدّث حالة مخفية (hidden state) انطلاقا من الحالة المخفية السابقة والمدخل الحالي، مستخدمة الأوزان نفسها في كل خطوة.
- Residual connection
Adding a layer's input to its output (x + f(x)) so information and gradients pass through unchanged.إضافة مدخل الطبقة إلى مخرجها (x + f(x)) لكي تمر المعلومات والتدرجات (gradients) دون تغيير.
S
- Sampling the next token
Drawing the next word at random according to the probabilities of the model's softmax distribution, as autoregressive generation does at each step.اختيار الكلمة التالية عشوائيا وفق احتمالات توزيع softmax الذي يخرجه النموذج، كما يفعل التوليد الذاتي الانحدار (autoregressive generation) عند كل خطوة.
- Scaled dot-product attention
softmax(QK^T / √d_k) V; dividing by √d_k keeps scores from growing with dimension.softmax(QK^T / √d_k) V؛ القسمة على √d_k تمنع الدرجات من الكبر مع زيادة البُعد.
- Self-attention
Each position builds its output as a weighted sum of value vectors of the sequence, with weights from softmax-normalized query-key dot products.يبني كل موضع مخرجه مجموعا موزونا لمتجهات القيم (value) في التسلسل، والأوزان ناتجة عن تطبيع softmax لحواصل الضرب النقطي بين الاستعلام (query) والمفتاح (key).
- Self-supervised training
Training where the targets come from the data itself: the model is trained to predict the next word of raw text.تدريب تأتي فيه الأهداف من البيانات نفسها: يُدرَّب النموذج على التنبؤ بالكلمة التالية في نص خام.
- Softmax
Function exp(u_i) / Σ_j exp(u_j) that turns a vector of scores into a probability distribution.الدالة exp(u_i) / Σ_j exp(u_j) التي تحوّل متجها من الدرجات (scores) إلى توزيع احتمالي.
- Stacked (multi-layer) RNN
RNN layers placed on top of each other so the output sequence of one layer is the input sequence of the next.طبقات RNN موضوعة بعضها فوق بعض، بحيث يكون تسلسل مخرجات كل طبقة هو تسلسل مدخلات الطبقة التي تليها.
T
- Teacher forcing
Training scheme where at each step the model is given the correct previous tokens rather than its own predictions.أسلوب تدريب يُعطى فيه النموذج عند كل خطوة الرموز السابقة الصحيحة بدلا من تنبؤاته هو.
- Temperature sampling
Dividing the logits by τ before the softmax: τ < 1 sharpens the distribution toward greedy, τ = 1 leaves it unchanged, τ > 1 flattens it. Beyond the slides.قسمة الـ logits على τ قبل الـ softmax: τ < 1 يجعل التوزيع أحدّ ويقرّبه من greedy، و τ = 1 يتركه كما هو، و τ > 1 يسطّحه. خارج نطاق الشرائح.
- Transformer
A sequence architecture without recurrence, built from stacked blocks of self-attention and feedforward layers that map N input vectors to N output vectors.معمارية للتسلسلات بلا تكرار (recurrence)، مبنية من كتل متراصة من الانتباه الذاتي (self-attention) وطبقات feedforward، تحوّل N متجها مدخلا إلى N متجها مخرجا.
- Transformer block
z = LayerNorm(x + SelfAttn(x)); y = LayerNorm(z + FFN(z)).تحسب كتلة الـ Transformer: z = LayerNorm(x + SelfAttn(x))؛ y = LayerNorm(z + FFN(z)).
U
- Unembedding layer
A d × |V| linear map from the final hidden vector to one logit per vocabulary item.تحويل خطي بأبعاد d × |V| من المتجه المخفي الأخير إلى logit واحدة لكل عنصر في المفردات.
V
- Vanishing gradient
Gradients shrinking as they are multiplied back through many time steps, which makes it hard for a simple RNN to learn long-range dependencies.تلاشي التدرجات (gradients) وهي تُضرب راجعة عبر خطوات زمنية كثيرة، مما يصعّب على الـ RNN البسيطة تعلّم الاعتماديات بعيدة المدى (long-range dependencies).
W
- Weight tying
Reusing the transpose of the input embedding matrix, U = E^T, as the unembedding layer.إعادة استخدام منقول (transpose) مصفوفة تضمين المدخلات، U = E^T، لتكون هي طبقة الـ unembedding.