<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://ashaba1in.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://ashaba1in.github.io/" rel="alternate" type="text/html" /><updated>2026-02-02T22:58:13+00:00</updated><id>https://ashaba1in.github.io/feed.xml</id><title type="html">Alexander Shabalin</title><subtitle>I&apos;m Alexander, PhD student from Constructor University Bremen, studying Deep Learning and Natural Language Processing. Here you can find more information about me and short reviews of papers that I read.</subtitle><entry><title type="html">Any-Order Autoregressive Models</title><link href="https://ashaba1in.github.io/definitions/2026/02/02/any_order_model.html" rel="alternate" type="text/html" title="Any-Order Autoregressive Models" /><published>2026-02-02T15:09:34+00:00</published><updated>2026-02-02T15:09:34+00:00</updated><id>https://ashaba1in.github.io/definitions/2026/02/02/any_order_model</id><content type="html" xml:base="https://ashaba1in.github.io/definitions/2026/02/02/any_order_model.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p><strong>Any-Order Autoregressive Models (AO-ARM)</strong> is a concept of autoregressive models that support a generation of tokens in an arbitrary order. The primal advantage of AO-ARMs over MDMs is an absence of probability factorization.</p>

<p>\(p(x_{1:n}) = \prod_{i=1}^n p(x_{\sigma(i)} \mid x_{\sigma(&lt;i)}),\)
where \(\sigma\) is a random permutation of token positions.</p>

<p>This formulation allows models to go beyond left-to-right sampling while keeping the model’s probability function correct. Note that AO-ARMs and basically equivalent to MDMs when sampling one token at a time. During the sampling the permutation \(\sigma\) is usually sampled in advance and do not change during the generation.</p>

<p><strong>Papers:</strong></p>

<ol>
  <li><a href="https://arxiv.org/pdf/1906.08237">XLNet: Generalized Autoregressive Pretraining for Language Understanding, Google, 2020</a></li>
  <li><a href="https://arxiv.org/pdf/2110.02037">Autoregressive Diffusion Models, Google, 2021</a></li>
  <li><a href="https://arxiv.org/pdf/2205.13554">Training and Inference on Any-Order Autoregressive Models the Right Way, Stanford, 2022</a></li>
  <li><a href="https://arxiv.org/pdf/2406.03736">Your absorbing discrete diffusion
secretly models the conditional distributions of clean data, Gaoling, 2025</a></li>
</ol>]]></content><author><name></name></author><category term="definitions" /><category term="" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Discrete Diffusion Models</title><link href="https://ashaba1in.github.io/definitions/2026/02/02/masked_diffusion_models.html" rel="alternate" type="text/html" title="Discrete Diffusion Models" /><published>2026-02-02T15:09:34+00:00</published><updated>2026-02-02T15:09:34+00:00</updated><id>https://ashaba1in.github.io/definitions/2026/02/02/masked_diffusion_models</id><content type="html" xml:base="https://ashaba1in.github.io/definitions/2026/02/02/masked_diffusion_models.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p><strong>Masked Diffusion Models (MDM)</strong> adapt the diffusion models to text by replacing Gaussian noise with categorical. In the basic form, they corrupt a text by masking a fraction of tokens, thus loosing some information. The fraction increases (linearly in most cases) with respect to timestep \(t\). Therefore, a prior distribution is defined as \(q(x) = \delta(x = [M])\). 
The forward (noising) process is defined through a transition matrix \(Q\) of size \((m+1) \times (m+1)\): \(Q_i = (1 - \beta_i) I + \beta_i \mathbf{1}e_m^{\top}\). This matrix defines the state transition between \([s(i), t(i)]\), where \(s(i) = \frac{i - 1}{T}, t(i) = \frac{i}{T}\).</p>

\[q(x_{t(i)} | x_{s(i)}) = \operatorname{Cat}(x_{t(i)}; Q_i^{\top}x_{s(i)}) = x^{\top}_{s(i)} Q_i x_{t(i)}\]

<p>We can also define a one-step sampling of \(x_{t(i)}\).</p>

\[q(x_{t(i)} | x_{s(i)}) = \operatorname{Cat}(x_{t(i)}; \bar{Q}_i^{\top}x_{0}) = x^{\top}_{0} Q_i x_{t(i)},\]

<p>where \(\bar{Q}_i = \prod_{j = 1}^i Q_j = \alpha_i I + (1 - \alpha_i)\mathbf{1}e_m^{\top}\) for \(\alpha_i = \prod_{j = 1}^i (1 - \beta_j)\).</p>

<p>Another important way of looking at MDMs is through Kolmogorov equations.</p>

<h3 id="kolmogorov-equations">Kolmogorov equations</h3>

<p>Let \(p_{ij}(t) = p(x_t = j | x_0 = i)\) be a probability of transitioning from state \(i\) to state \(j\) within a time period \(t\). \(p_{ij}(t)\) satisfy the following properties:</p>
<ol>
  <li>Probability: \(p_{ij}(t) \ge 0, \; \sum_{j} p_{ij} = 1 \;\; \forall i, j\)</li>
  <li>Stationarity: \(p_{ij}(0) = \delta_{ij} = \begin{cases}
1, &amp; i = j,\\
0, &amp; i \neq j\end{cases}\)</li>
  <li>Markov property: \(p_{ij}(t + s) = \sum_{k} p_{ik}(t)p_{kj}(s)\)</li>
  <li>Stochastic continuity: \(p(\)|\(x_{t+h} - x_t\)|\(&gt; \varepsilon) \to 0\) or \(\lim_{t \to 0} p_{ij}(t) = 0\)</li>
</ol>

<p>Let the following limit exist: \(q_{ij} = \lim_{h \to 0} \frac{p_{ij}(h) - \delta_{ij}}{h}\)</p>

<p>It is easy to see that \(\sum_{k} q_{ik} = 0\). Indeed,</p>

\[\sum_{k} q_{ik} = \lim_{h \to 0} \sum_{k} \frac{p_{ik}(h) - \delta_{ik}}{h} = \lim_{h \to 0} \frac{1}{h} \bigg(\sum_{k} p_{ik}(h) - 1\bigg) = 0\]

<p>Also let \(p_{ij}(t)\) be differentiable. Then,</p>

\[p'_{ij}(t) = \sum_{k} p_{ik}(t) q_{kj}\]

<p>This equation is called the <strong>Kolmogorov forward equation</strong> and it can be derived from the Markov property of \(p_{ij}(t)\).</p>

\[p'_{ij}(t) = \lim_{h \to 0} \frac{p_{ij}(t + h) - p_{ij}(t)}{h} = \lim_{h \to 0} \sum_k p_{ik}(t)\frac{p_{kj}(h) - p_{kj}(0)}{h} = \sum_{k} p_{ik}(t) q_{kj}\]

<p>This reads as the rate of the probability change from one state to another for a particular time \(t\) is equal to the sum of transition probabilities to all states at that time multiplies by the instant probability change rate. So, to calculate how fast does probability change, we accumulate the weighted speeds of probability change for all possible paths.</p>

<h3 id="matrix-exponentials">Matrix exponentials</h3>

<p>All these facts can be written with a matrix notation.</p>

<p>Let \(P(t) = \left\{ p_{ij}(t) \right\}_{i,j}\) to be a <em>transition (stochastic) matrix</em> and \(Q = \left\{ q_{ij} \right\}_{i,j}\) to be a <em>transition rate matrix</em>. Then \(P'(t) = P(t) Q\).</p>

<p>Note that we’ve got the simplest separable ordinary differential equation with a known solution in a form of \(P(t) = C \exp(tQ)\). Given that \(P(0) = I\), we derive</p>

\[P(t) = \exp(tQ)\]]]></content><author><name></name></author><category term="definitions" /><category term="" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Sampling Strategies</title><link href="https://ashaba1in.github.io/definitions/2026/02/02/sampling_strategies.html" rel="alternate" type="text/html" title="Sampling Strategies" /><published>2026-02-02T15:09:34+00:00</published><updated>2026-02-02T15:09:34+00:00</updated><id>https://ashaba1in.github.io/definitions/2026/02/02/sampling_strategies</id><content type="html" xml:base="https://ashaba1in.github.io/definitions/2026/02/02/sampling_strategies.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p>One of the main problems of Masked Diffusion Models is that the probability of the original token sequence is factorised: \(p(x^{1:n} \mid x_t^{1:n}) = \prod_{i=1}^n p(x^i \mid x_t^{1:n})\). This assumption leads to incorrect sampling when multiple tokens are sampled at one step, as they are treated independently by the model.</p>

<p>Multiple papers propose different strategies to mitigate this issue:</p>

<ol>
  <li><a href="https://arxiv.org/pdf/2510.03929">Self-Speculative Masked Diffusions, DeepMind, 2025</a></li>
</ol>]]></content><author><name></name></author><category term="definitions" /><category term="" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Text Generation</title><link href="https://ashaba1in.github.io/definitions/2025/04/12/text_generation.html" rel="alternate" type="text/html" title="Text Generation" /><published>2025-04-12T15:09:34+00:00</published><updated>2025-04-12T15:09:34+00:00</updated><id>https://ashaba1in.github.io/definitions/2025/04/12/text_generation</id><content type="html" xml:base="https://ashaba1in.github.io/definitions/2025/04/12/text_generation.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p><strong>Text generation</strong> requires a <em>Language Model</em> to produce a grammatically correct coherent text. Text generation might be <strong>unconditionan</strong> (unrestricted) and <strong>conditional</strong> (the text must meet a certain condition). Both generation types have their limitations and benefits.</p>

<h2 id="unconditional-generation">Unconditional generation</h2>

<p>Unconditional text generation isn’t very useful on its own for most real-world tasks. That’s because generated text usually needs to follow certain rules—like keeping the meaning when translating into another language or giving a question-related answer when asked a question.</p>

<p>Nevertheless, unconditional generation does not require a labeled dataset. Thus, the model can be trained using any text data sourced from the internet. This feature essentially eliminates restrictions on the amount of training data, allowing for the creation of powerful Large Language Models (LLMs).</p>

<p>Even though LLMs trained this way might not be useful right away, they can be fine-tuned for specific tasks using smaller, labeled datasets. They can also do surprisingly well at new tasks without any training—or with just a few examples—in zero-shot or few-shot learning paradigm [1]. That is why unconditional generation is the base for all modern language models.</p>

<h2 id="conditional-generation">Conditional generation</h2>

<p>Conditional generation is more challenging to implement, as the model must process an additional input—the condition—in order to follow it correctly. Modern transformer-based architectures [2] handle this in different ways: Encoder-Decoder models use an additional encoder to process the condition and pass it to the decoder via cross-attention, while Decoder-only models typically concatenate the conditional text with the target sequence. Note that the latter approach isn’t applicable to multimodal text generation—for example, generating image captions.</p>

<h2 id="model-types">Model types</h2>

<p>In the current state of the field, the dominating text generation model is <strong>autoregressive</strong> Transformer Decoder-only <strong>LLM</strong>. However, other approaches also exist.</p>
<ul>
  <li><strong>LSTM</strong> is an outdated approach that is being tried to find a new application [3].</li>
  <li><strong>State Space Models (SSM)</strong> are trying to speed up the transformer by abandoning the quadratic time mechanism of attention [4].</li>
  <li><strong>Diffusion models</strong> are the current SOTA in image generation that is being adapted for text generation [5, 6].</li>
</ul>

<h2 id="datasets-and-benchmarks">Datasets and Benchmarks</h2>

<h3 id="unconditional-generation-1">Unconditional generation:</h3>
<ul>
  <li><strong>WikiText</strong>: a collection of over 100 million tokens (~0.5GB) extracted from the set of verified Good and Featured articles on Wikipedia.</li>
  <li><strong>OpenWebText</strong>: Unofficial open-source recreation of OpenAI’s WebText (~40GB).</li>
  <li><strong>The Pile</strong>: a massive, diverse dataset (~800GB) including books, web pages, GitHub, and academic papers.</li>
  <li><strong>BooksCorpus</strong>: collection of books of various genres scraped from the indie ebook distribution website Smashwords. Used for pretraining BERT and GPT (~5GB).</li>
  <li><strong>Common Crawl</strong>: a massive crawl of the web (~9.5PB); used to train GPT, LLaMA, etc. Needs a lot of cleaning.</li>
  <li><strong>C4</strong>: a <strong>c</strong>olossal, <strong>c</strong>leaned version of <strong>C</strong>ommon <strong>C</strong>rawl dataset developed by Google and Meta (~750GB). C4 was created by taking a single month’s scrape of Common Crawl and removing duplicate, placeholder, nonsensical and non-English language content. It was used for training T5, LaMDA, LLaMA and other models.</li>
  <li><strong>Project Gutenberg</strong>: a set of public domain books (~15GB). Good for literary language modeling.</li>
</ul>

<h3 id="conditional-generation-1">Conditional generation:</h3>

<p>Condition generation has various practical apptications: machine translation, summarization, detoxification, paraphrasing, text simplification, question answering and so on. Each of such tasks has several dedicated datasets.</p>
<ul>
  <li><strong>Machine translation</strong>: <a href="https://huggingface.co/wmt">WMT</a> (Various Years), <a href="https://huggingface.co/datasets/IWSLT/iwslt2017">IWSLT</a></li>
  <li><strong>Summarization</strong>: <a href="https://huggingface.co/datasets/abisee/cnn_dailymail">CNN/Daily Mail</a>, <a href="https://huggingface.co/datasets/EdinburghNLP/xsum">XSum</a></li>
  <li><strong>Detoxification</strong>: <a href="https://github.com/s-nlp/paradetox/blob/main/paradetox/paradetox.tsv">Paradetox</a></li>
  <li><strong>Paraphrasing</strong>: <a href="https://www.kaggle.com/datasets/quora/question-pairs-dataset">Quora Question Pairs</a>, <a href="https://github.com/google-research-datasets/paws?tab=readme-ov-file">PAWS</a></li>
  <li><strong>Text simplification</strong>: <a href="https://huggingface.co/datasets/facebook/asset">ASSET</a>, <a href="https://github.com/chaojiang06/wiki-auto">Wiki-Auto</a>, <a href="https://www.kaggle.com/datasets/thedevastator/unveiling-complex-text-relations-through-splitti">WikiSplit</a></li>
  <li><strong>Question answering</strong>: <a href="https://huggingface.co/datasets/rajpurkar/squad">SQuAD</a>, <a href="https://huggingface.co/datasets/microsoft/ms_marco">MS MARCO</a></li>
</ul>

<p>As modern models become more powerful, these datasets are no longer complex enough to compare models with each other. Moreover, for a more to add more context to model performance, it became necessary to measure the quality of models on a wide range of tasks at once. That is how specialized <strong>benchmarks</strong> were developed.</p>

<h4 id="general-language-understanding">General Language Understanding</h4>
<ul>
  <li><strong><a href="https://huggingface.co/datasets/nyu-mll/glue">GLUE</a> (General Language Understanding Evaluation)</strong> – text classification benchmark.</li>
  <li><strong><a href="https://huggingface.co/datasets/aps/super_glue">SuperGLUE</a></strong> – harder version of GLUE for advanced models, evaluates coreference and reasoning.</li>
  <li><strong><a href="https://huggingface.co/datasets/cais/mmlu">MMLU</a> (Massive Multitask Language Understanding)</strong> – evaluates ability to answer questions about math, law, medicine and so on.</li>
  <li><strong><a href="https://huggingface.co/datasets/Rowan/hellaswag">HellaSwag</a></strong> – evaluates the commonsense knowledge by testing the ability to predict most plausible sentence ending.</li>
  <li><strong><a href="https://huggingface.co/datasets/Idavidrein/gpqa">GPQA</a></strong> – a multiple-choice, Q&amp;A dataset of very hard questions written and validated by experts in biology, physics, and chemistry.</li>
</ul>

<h4 id="factuality-and-truthfulness">Factuality and Truthfulness</h4>
<ul>
  <li><strong><a href="https://huggingface.co/datasets/domenicrosati/TruthfulQA">TruthfulQA</a></strong> – questions that test truthfulness and common misconceptions.</li>
  <li><strong><a href="https://huggingface.co/datasets/fever/fever">FEVER</a></strong> – fact-checking based on Wikipedia evidence.</li>
</ul>

<h4 id="multilingual-qa">Multilingual Q&amp;A</h4>
<ul>
  <li><strong><a href="https://huggingface.co/datasets/openai/MMMLU">MMMLU</a></strong> (Multilingual Massive Multitask Language Understanding) – evaluates ability to answer questions in multiple languages.</li>
</ul>

<h4 id="retrieval-augmented-generation">Retrieval-Augmented Generation</h4>
<ul>
  <li><strong><a href="https://nlp.cs.washington.edu/triviaqa/">TriviaQA</a></strong> – general knowledge questions.</li>
  <li><strong><a href="https://github.com/google-research-datasets/natural-questions">Natural Questions</a></strong> – open-ended questions from Google search.</li>
</ul>

<h4 id="coding">Coding</h4>
<ul>
  <li><strong><a href="https://openai.com/index/introducing-swe-bench-verified/">SWE-bench Verified
</a></strong> – evaluates ability to solve GitHub software issues.</li>
  <li><strong><a href="https://github.com/laude-institute/terminal-bench">Terminal-Bench</a></strong> – tests AI agents in real terminal environments.</li>
  <li><strong><a href="https://huggingface.co/datasets/openai/openai_humaneval">HumanEval</a></strong> – measures functional correctness for synthesizing programs from docstrings.</li>
</ul>

<h2 id="references">References</h2>

<p>[1] Jason Wei et al. Finetuned Language Models are Zero-Shot Learners. ICLR 2022. https://openreview.net/forum?id=gEZrGCozdqR. <br />
[2] Ashish Vaswani et al. Attention is all you need. NeurIPS 2017. https://papers.nips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html. <br />
[3] Maximilian Beck et al. xLSTM: Extended Long Short-Term Memory. NeurIPS 2024, https://openreview.net/forum?id=ARAxPPIAhq. <br />
[4] Albert Gu et al. Efficiently Modeling Long Sequences with Structured State Spaces. ICLR 2022. https://openreview.net/forum?id=uYLFoz1vlAC. <br />
[5] Jacob Austin et al. Structured Denoising Diffusion Models in Discrete
State-Spaces, NeurIPS 2021. https://papers.neurips.cc/paper/2021/hash/958c530554f78bcd8e97125b70e6973d-Abstract.html. <br />
[6] Xiang Lisa Li et al. Diffusion-LM Improves Controllable Text Generation. NeurIPS 2022. https://openreview.net/forum?id=3s9IrEsjLyk.</p>]]></content><author><name></name></author><category term="definitions" /><category term="" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Text Retrieval</title><link href="https://ashaba1in.github.io/definitions/2025/04/12/text_retrieval.html" rel="alternate" type="text/html" title="Text Retrieval" /><published>2025-04-12T15:09:34+00:00</published><updated>2025-04-12T15:09:34+00:00</updated><id>https://ashaba1in.github.io/definitions/2025/04/12/text_retrieval</id><content type="html" xml:base="https://ashaba1in.github.io/definitions/2025/04/12/text_retrieval.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p>Text retrieval is a language modelling task, which goal is to find relevant information stored as text, such as documents or articles, in response to a user’s query. It involves matching a query (a question, keywords, or text) against a set of text documents and returning the most relevant ones. This process is crucial for various applications like search engines, question answering systems, and document retrieval in legal, medical or any other field.</p>

<p>Dense Retrieval:
Pretrained language models (PLMs) are used to generate dense vectors (embeddings) that capture the semantic meaning of text, enabling more accurate semantic matching. 
Learning-based Ranking:
Models are trained to learn relevance scores and rank documents accordingly.</p>

<h2 id="model-types">Model types</h2>

<p>The whole concept of text retrieval in built on idea of representing a text with a real-numbered vector (embedding) of fixed length. Then, text similarity can be measured as a proximity of the corresponding vectors [1].</p>

<p>The first attempts represented texts using bag-of-words or tf-idf sparce vectors [2]. Based on this scheme, the relevance can be estimated according to the lexical similarity between sparse query and text vectors. Such relevance computation resulted in a poor retrieval quality as it doesn’t account for text semantics directly.</p>

<p>Since the invention of the Transformer model, BERT-based approaches have largely raised text retrieval quality bar. There are two different types of retrieval models: <strong>dual-encoder</strong> and <strong>cross-encoder</strong>. Dual-encoder retrieval methods compute embeddings for query and all documents separately and then measure the distance between embeddings, while cross-encoder methods compute a single similarity score for each $\langle$query, document$\rangle$ pair (BERT receives two texts separated with [SEP] token). The former approach it preferable when the list of candidate documents is large, because embeddings for all documents can be pre-computed, which increases the indexing speed. The latter method works better when the amount of documents is small, because it measures relevance better due to the lack of need for information compression.</p>

<p>Also, in the recent years, LLMs started being applied for text retrieval. As LLMs are created only for text generation, the retrieval is done by prompting. For example,</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Rate the semantic similarity between the following two sentences on a scale from 0 to 5, where 0 means completely different and 5 means identical in meaning.

Sentence 1: A man is riding a bicycle.
Sentence 2: A person is biking on the road.

Answer (0-5):
</code></pre></div></div>

<h2 id="benchmarks">Benchmarks</h2>

<p>There are not that much benchmarks for evaluating retrieval capabilities of language models as there are for testing language understanding. However, each benchmark covers many aspects of retrieval problem.</p>

<ul>
  <li><strong><a href="https://github.com/beir-cellar/beir?tab=readme-ov-file">BEIR</a></strong> – 20+ information retrieval datasets (e.g., TREC, SciFact, FEVER)</li>
  <li><strong><a href="https://microsoft.github.io/msmarco/">MS-MARCO</a></strong> – Microsoft benchmark focused on passage ranking for search relevance.</li>
  <li><strong><a href="https://hotpotqa.github.io/">HotpotQA</a></strong> – multi-hop question answering with reasoning across documents.</li>
  <li><strong><a href="https://ai.google.com/research/NaturalQuestions">Natural Questions (NQ)</a></strong> – open-domain QA from Google search	with a query, a long answer and a target short answer.</li>
  <li><strong><a href="https://github.com/embeddings-benchmark/mteb?tab=readme-ov-file">MTEB</a> (Massive Text Embedding Benchmark)</strong> – benchmark with over 50 datasets across 8 NLP task types. Designed primarily for evaluating sentence and document embeddings, like those produced by SBERT, OpenAI embeddings, GTE, or Cohere models.</li>
</ul>

<h2 id="references">References</h2>

<p>[1] Wayne Xin Zhao et al. Dense Text Retrieval Based on Pretrained Language Models: A Survey. 2024. https://arxiv.org/abs/2211.14876. <br />
[2] G. Salton et al. A vector space model for automatic indexing. 1975. https://dl.acm.org/doi/pdf/10.1145/361219.361220.</p>]]></content><author><name></name></author><category term="definitions" /><category term="" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">TSDAE</title><link href="https://ashaba1in.github.io/text_autoencoder/2025/04/12/tsdae.html" rel="alternate" type="text/html" title="TSDAE" /><published>2025-04-12T15:09:34+00:00</published><updated>2025-04-12T15:09:34+00:00</updated><id>https://ashaba1in.github.io/text_autoencoder/2025/04/12/tsdae</id><content type="html" xml:base="https://ashaba1in.github.io/text_autoencoder/2025/04/12/tsdae.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p><strong><a href="https://arxiv.org/abs/2104.06979">Link to the paper</a></strong></p>

<p><strong>TL;DR:</strong> Text AutoEncoder pre-trained on unsupervised denoising task to generalize on downstream text classification. Paper provides a lot of context by comparing many text embedding methods on heterogeneous domains.</p>

<h3 id="idea">Idea</h3>

<p>Authors aim to train a model in <strong>unsupervised</strong> or <strong>semi-supervised</strong> manner to extract meaningful text embeddings. In order to do it, they build an encoder-decoder architecture similar to Transformer to reconstruct an input text. However, unlike Transformer, the decoder has as access only to a single text embedding extracted by the encoder in the form of the output of the [CLS] token. Additionally, authors corrupt an input text by deleting 60% of tokens.</p>

<p><img src="/assets/tsdae/framework.png" alt="image" style="width:35%; display:block; margin-left:auto; margin-right:auto" /></p>

<h3 id="experimental-setup">Experimental setup</h3>

<p>Arguing that the previously reported performance on STS () dataset poorly correlate with the performance real-world tasks, authors compare TSDAE to other methods on AskUbuntu (Re-Ranking), CQADupStack (Information Retrieval), TwitterPara (Paraphrase Identification), and SciDocs (Re-Ranking) datasets. In all tasks, the model is required to measure the similarity between an input query and a set of candidates. The paper utilize cosine similarity between text embeddings.</p>

<h4 id="training-setup">Training setup</h4>

<p>The TSDAE approach is tested in three settings: unsupervised learning, domain Adaptation and pre-training.</p>
<ul>
  <li><strong>Unsupervised Learning</strong>: model have access only to unlabeled sentences from the target task.</li>
  <li><strong>Domain adaptation</strong>: model have access to <em>unlabeled</em> sentences from the target task and <em>labeled</em> sentences from NLI and STS benchmark. Two setups were tested: 1) training on
NLI+STS data, then unsupervised training to the
target domain, 2) unsupervised training on the target domain, then supervised training on NLI + STS.</li>
  <li><strong>Pre-Training</strong>: model have access to a larger collection of <em>unlabeled</em> sentences from the target task
and a smaller set of <em>labeled</em> sentences from the
target task.</li>
</ul>

<h3 id="baselines">Baselines</h3>

<p>TSDAE is compared to various approaches.</p>

<h4 id="pre-trained-transformer-based-unsupervised-methods">Pre-trained Transformer-based unsupervised methods:</h4>
<ul>
  <li><strong>MLM (Masked-Language-Model)</strong>: mean pooling over the BERT
output token embeddings.</li>
  <li><strong>CT (Contrastive Tension)</strong> finetunes pre-trained
Transformers in a contrastive-learning fashion. Views the identical sentences as the positive examples. Uses two models with the same initial parameters to encode first and second texts respectively.</li>
  <li><strong>SimCSE</strong>: same as CT, but applies different dropout masks for the same sentence and uses single model.</li>
  <li><strong>BERT-flow</strong> freezes BERT weights and pushes token embeddings close to a standard Gaussian distribution. The text embeddings is obtained by pooling over processed token embeddings.</li>
</ul>

<h4 id="other-unsupervised-approaches">Other unsupervised approaches:</h4>
<ul>
  <li><strong>BM25</strong>: term-matching method without trainable parameters.</li>
  <li><strong>GloVe</strong>: mean pooling over the GloVe embeddings trained on a large corpus from the general domain.</li>
  <li><strong>Sent2Vec</strong>: similar to GloVe model trained on the in-domain unlabeled corpus.</li>
  <li><strong>BERT-base-uncased</strong> with mean pooling.</li>
</ul>

<h3 id="results">Results</h3>

<p>The comparison results are presenter in the table below. Interestingly, a simple MLM approach scores higher than other specialized methods in most setups. Also, in domain adaptation setting, first training on the target
domain, and then training with labeled NLI+STS
achieves better results than the opposite direction. Overall, TSDAE shows the best results over all datasets.</p>

<p><img src="/assets/tsdae/results.png" alt="image" style="width:100%; display:block; margin-left:auto; margin-right:auto" /></p>]]></content><author><name></name></author><category term="text_autoencoder" /><category term="EMNLP 2021" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Diffusion-LM</title><link href="https://ashaba1in.github.io/text_diffusion/2025/04/02/diffusion_lm.html" rel="alternate" type="text/html" title="Diffusion-LM" /><published>2025-04-02T15:09:34+00:00</published><updated>2025-04-02T15:09:34+00:00</updated><id>https://ashaba1in.github.io/text_diffusion/2025/04/02/diffusion_lm</id><content type="html" xml:base="https://ashaba1in.github.io/text_diffusion/2025/04/02/diffusion_lm.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p><strong><a href="https://arxiv.org/abs/2205.14217">Link to the paper</a></strong></p>

<p><strong>TL;DR:</strong> Gaussian Diffusion Model trained end-to-end on word embeddings.</p>

<h3 id="diffusion-process">Diffusion process</h3>

<p>The first step in building a diffusion is to convert text into continuous data sample. Authors do it by learning embeddings for each token in a vocabulary.</p>

\[\operatorname{Emb}(\mathbf{w})=\left[\operatorname{Emb}(w_1), \ldots, \operatorname{Emb}(w_n)\right] \in \mathbb{R}^{n d},\]

<p>where \(\mathbf{w}\) is a sequence of input tokens.</p>

<p>After that \(x_0\) is sampled from the distribution \(q_\phi(\mathbf{x}_0 \mid \mathbf{w})=\mathcal{N}\left(\operatorname{Emb}(\mathbf{w}), \sigma_0 I\right)\), where \(\sigma_0 = 0.0001\).<br />
<em><strong>Alexander’s remark</strong>: authors do not explain the necessity of \(\sigma_0\) to be greater than 0 and the chosen value makes \(x_0\) indistinguishable from \(\operatorname{Emb}(\mathbf{w})\).</em></p>

<p>After defining \(x_0\) the forward process can be written as a common gaussian diffusion process.</p>

\[q\left(\mathbf{x}_t \mid \mathbf{x}_{t-1}\right)=\mathcal{N}\left(\mathbf{x}_t ; \sqrt{1-\beta_t} \mathbf{x}_{t-1}, \beta_t \mathbf{I}\right)\]

<p>The goal is to learn a model to approximate a reverse (denoising) process</p>

\[p_\theta\left(\mathbf{x}_{t-1} \mid \mathbf{x}_t\right)=\mathcal{N}\left(\mathbf{x}_{t-1} ; \mu_\theta\left(\mathbf{x}_t, t\right), \Sigma_\theta\left(\mathbf{x}_t, t\right)\right)\]

<p>One more crucial step in the conversion of generated \(x_0\) into tokens \(\mathbf{w}\). Authors call this step <em>rounding</em> and parametrize it by the trainable model \(p_\theta\left(\mathbf{w} \mid \mathbf{x}_0\right)=\prod_{i=1}^n p_\theta(w_i \mid x_i)\).
In practice, it is implemented as a single linear layer \(p_\theta(. \mid x_i) = \operatorname{softmax}(Wx_i)\).</p>

<p>The resulting pipeline can be depicted like this.</p>

<p><img src="/assets/diffusion_lm/diffusion_process.png" alt="image" style="width:90%; display:block; margin-left:auto; margin-right:auto" /></p>

<h3 id="training-objective">Training objective</h3>

<p>The diffusion model and embeddings are trained simultaneously by minimizing the following loss function</p>

\[\mathcal{L}^{\mathrm{e}2\mathrm{e}}(\mathbf{w})=\underset{q_\phi\left(\mathbf{x}_{0: T} \mid \mathbf{w}\right)}{\mathbb{E}}\left[\sum_{t=2}^T \left\|f_\theta(\mathbf{x}_t, t) - \mathbf{x}_0\right\|^2 + \left\|\mu_\theta\left(\mathbf{x}_1, 1\right) - \operatorname{Emb}(\mathbf{w})\right\|^2-\log p_\theta\left(\mathbf{w} \mid \mathbf{x}_0\right)\right]\]

<p><em><strong>Alexander’s remark</strong>:
In the <a href="https://github.com/XiangLi1999/Diffusion-LM/blob/main/improved-diffusion/improved_diffusion/gaussian_diffusion.py#L1264">official implementation</a> the term \(\left\|f_\theta(\mathbf{x}_t, t) - \mathbf{x}_0\right\|^2\) is replaced with \(\left\|\mu_\theta\left(\mathbf{x}_t, t\right) - \hat{\mu}\left(\mathbf{x}_t, \mathbf{x}_0\right)\right\|^2\), where \(\mu_\theta\left(\mathbf{x}_t, t\right)\) is a mean of the posterior distribution \(q(x_{t-1} | x_t)\) calculated using the predicted \(x_0\). While these objectives are almost identical in terms of an optimal solution, they have different scaling constants, which might be important.
In addition, authors also add a <a href="https://github.com/XiangLi1999/Diffusion-LM/blob/main/improved-diffusion/improved_diffusion/gaussian_diffusion.py#L1291">regularization</a> loss term \(\left\|\sqrt{\bar{\alpha}_T}x_0\right\|^2\). Without this term embeddings most probably will explode, because it makes the denoising task trivial (SNR becomes huge for all timesteps).</em></p>

<p>The term \(-\log p_\theta(\mathbf{w} \mid \mathbf{x}_0)\) is required to prevent another unwanted local minimum – embedding collapse.</p>

<p><strong>Important.</strong> Trained embeddings turns out to be better, than fixed pre-trained. Also, learning to predict \(x_0\) results in much better quality, than predicting \(\varepsilon\) as commonly done in image diffusion models.
<img src="/assets/diffusion_lm/ablation.png" alt="image" style="width:50%; display:block; margin-left:auto; margin-right:auto" /></p>

<h3 id="clamping-trick">Clamping trick</h3>

<p>During the generation process, authors replace the predicted \(x_0\) with the closest embedding.</p>

\[\mathbf{x}_{t-1}=\sqrt{\bar{\alpha}_{t-1}} \cdot \operatorname{Clamp}\left(f_\theta\left(\mathbf{x}_t, t\right)\right)+\sqrt{1-\bar{\alpha}_{t-1}} \epsilon\]

<p>They call this method clamping trick and claim that it increase the generation quality by forcing a model to commit to a particular token for intermediate diffusion steps.</p>

<h3 id="controllable-text-generation">Controllable Text Generation</h3>

<p>Controllable text generation is equivalent ot sampling from the distribution</p>

\[p\left(\mathbf{x}_{0: T} \mid \mathbf{c}\right)=\prod_{t=1}^T p\left(\mathbf{x}_{t-1} \mid \mathbf{x}_t, \mathbf{c}\right),\]

<p>where \(p\left(\mathbf{x}_{t-1} \mid \mathbf{x}_t, \mathbf{c}\right) \propto p\left(\mathbf{x}_{t-1} \mid \mathbf{x}_t\right) \cdot p\left(\mathbf{c} \mid \mathbf{x}_{t-1}, \mathbf{x}_t\right) = p\left(\mathbf{x}_{t-1} \mid \mathbf{x}_t\right) \cdot p\left(\mathbf{c} \mid \mathbf{x}_{t-1}\right)\)</p>

<p>After each diffusion step authors run 3 updates on \(\mathbf{x}_{t-1}\) moving it in the direction of the following gradient with Agagrad</p>

\[\nabla_{\mathbf{x}_{t-1}} \lambda \log p(\mathbf{x}_{t-1} \mid \mathbf{x}_t) + \nabla_{\mathbf{x}_{t-1}}\log p(\mathbf{c} \mid \mathbf{x}_{t-1}),\]

<p>where \(\lambda\) is a hyperparameter that allows to control fluency. \(\log p(\mathbf{c} \mid \mathbf{x}_{t-1})\) is evaluated using a pre-trained classifier.</p>

<p>To compensate for the generation speed authors use \(T = 200\) for controllable text generation instead of default \(T = 2000\).</p>

<h3 id="minimum-bayes-risk-decoding">Minimum Bayes Risk Decoding</h3>

<p>In order to decrease the variance in generated texts and increase overall quality, authors apply Minimum Bayes Risk (MBR) decoding for controlled generation tasks.</p>

<p>They generate a set of texts \(\mathcal{S}\) and chose one with minimal expected risk.</p>

\[\hat{\mathbf{w}} = \operatorname{argmin}_{\mathbf{w} \in \mathcal{S}} \sum_{\mathbf{w}' \in \mathcal{S}} \frac{1}{\mathcal{S}} \mathcal{L}(\mathbf{w}, \mathbf{w}'),\]

<p>where \(\mathcal{L}\) is a negative BLEU score.</p>

<p><em><strong>Alexander’s remark</strong>: This is a kind of cheat, because the technique produces samples of better quality in exchange for a loss of computing speed. This loss of speed should be taken into account, as it limits the practical applicability. Additionally, the use of MBR makes it harder to compare Diffusion LM with other approaches, and it suggests that without MBR the quality of the proposed method drops significantly.</em></p>

<h3 id="datasets">Datasets</h3>

<p>The evaluation is conducted using two datasets: E2E (50k restaurant reviews) and ROCStories (98k simple five-sentence stories).</p>

<h3 id="control-tasks">Control tasks</h3>

<p>Authors consider 6 control tasks shown in this table. The first 4 tasks rely on a classifier, and the last 2 tasks are classifier free.</p>

<p><img src="/assets/diffusion_lm/dataset_examples.png" alt="image" style="width:90%; display:block; margin-left:auto; margin-right:auto" /></p>

<h3 id="results">Results</h3>

<p><img src="/assets/diffusion_lm/results.png" alt="image" style="width:90%; display:block; margin-left:auto; margin-right:auto" /></p>]]></content><author><name></name></author><category term="text_diffusion" /><category term="NeurIPS 2022" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Continuous diﬀusion for categorical data</title><link href="https://ashaba1in.github.io/text_diffusion/2025/03/16/cdcd.html" rel="alternate" type="text/html" title="Continuous diﬀusion for categorical data" /><published>2025-03-16T12:02:55+00:00</published><updated>2025-03-16T12:02:55+00:00</updated><id>https://ashaba1in.github.io/text_diffusion/2025/03/16/cdcd</id><content type="html" xml:base="https://ashaba1in.github.io/text_diffusion/2025/03/16/cdcd.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p><strong><a href="https://arxiv.org/abs/2211.15089">Link to the paper</a></strong></p>

<p><strong>TL;DR:</strong> Continuous diffusion with cross-entropy loss, trainable embeddings and time warping.</p>

<h3 id="idea">Idea</h3>
<p>The diffusion operates in the space of token embeddings. For training the cross-entropy loss is used as it is allows to train embeddings with diffusion model. Time warping is used to automatically control the distribution of model capacity across the noise levels.</p>

<p><img src="/assets/cdcd/framework.png" alt="image" style="width:50%; display:block; margin-left:auto; margin-right:auto" /></p>

<h3 id="score-interpolation">Score interpolation</h3>

<p>Diﬀusion models are typically trained by minimising
the score matching objective (MSE).</p>

\[L(\theta) = \mathbb{E}_{t, x} \big[\|s_{\theta}(x, t) - \nabla_x \log p_t(x)\|^2\big],\]

<p>where \(x\) is the noised sample and \(t\) is the timestep.
Authors replace it with cross-entropy loss using probabilistic prediction of the clean sample \(x_0\).</p>

\[L(\theta) = -\mathbb{E}_{w, t, x} \big[\log p_{\theta}(x_0 = e_{w} \mid x, t)\big],\]

<p>where \(w\) is an input token and \(e_w\) is the embedding of the \(w\)th token in the vocabulary.</p>

<p>Score function estimate is obtained by linearly interpolating all possible values with predicted probabilities.</p>

\[\hat{s}(x, t) = \sum_{i=1}^{V} p(x_0 = e_i \mid x, t) s(x, t \mid x_0 = e_i) = \mathbb{E}_{p(x_0 \mid x, t)} s(x, t \mid x_0),\]

<p>where \(V\) is the size of the vocabulary.</p>

<p>Authors choose the following probability flow ODE for the diffusion model:
\(dx = −t \nabla_x \log p_t(x) dt\).
In this formulation, \(t\) corresponds directly to the standard deviation of the Gaussian noise that is added to \(x_0\) to simulate samples from \(p_t(x)\).</p>

<p>Due to the fact that \(p_t(x)\) is a Gaussian distribution,</p>

\[s(x, t \mid x_0) = \nabla_x \log p_t(x \mid x_0) = \frac{x_0 - x}{t^2}\]

<p>Therefore,</p>

\[\hat{s}(x, t \mid x_0) = \frac{\mathbb{E}_{p(x_0 \mid x, t)} [x_0] - x}{t^2}\]

<p>This allows to approximate the score function using the trained model \(p_{\theta}\) and estimating the ground truth embedding vector as \(\mathbb{E}_{p(x_0 \mid x, t)}[x_0] \approx \hat{x}_0 = \sum_{i=1}^V p_{\theta}(x_0 = e_i \mid x, t) \cdot e_i\).</p>

<h3 id="diﬀusion-on-embeddings">Diﬀusion on embeddings</h3>

<p>The choice of CE loss allows authors to train embeddings simultaneously with the diffusion model, because with score matching (MSE) loss embeddings would result in collapse of the embedding space. To prevent the embeddings explosion, authors L2-normalize embeddings before the use. They also normalize the predictions of \(x_0\) on every denoising step to match the unit norm.</p>

<p><em><strong>Alexander’s remark</strong>: L2-normalization might be tricky. While it keeps the embeddings norm fixed, this method may force embeddings to accumulating all information in a small subset of vector coordinates and zeroing the rest of coordinates, which is not a desired behaviour.</em></p>

<h3 id="time-warping-important-idea">Time warping (important idea)</h3>

<p>The diffusion model share its parameters between all noise levels. This means that during the training the model somehow distributes its capacity between different noise levels. To control this distribution, we can adjust the weights of loss terms for different noise levels or tune the noise scheduler. Authors state that <strong>the entropy of the model predictions should increase linearly with the growth of \(t\)</strong>. Therefore, during the generation the uncertainty of the model predictions (or the amount of information that is recovered by model) should change at a constant rate.</p>

<p>In order to embed this idea to the model, authors introduce the cumulative distribution function (CDF) \(F\) and sample \(t\) by first sampling \(u \sim U[0, 1]\) and then computing \(t\) as \(t = F^{-1}(u)\).</p>

<p>In practice, authors fit an unnormalised monotonic function \(\tilde{F}(t)\) to the observed cross-entropy loss values \(L(t)\). Cross-entropy loss values here estimate the prediction entropy.</p>

\[\min(\tilde{F}(t) - L(t))^2\]

<p>\(\tilde{F}(t)\) is parametrised as a monotonic piecewise
linear function, which is very straightforward to normalise and invert.</p>

<p>Ablation shows that time warping significantly increase the generation quality in terms of perplexity.</p>

<p><img src="/assets/cdcd/time_warping.png" alt="image" style="width:100%; display:block; margin-left:auto; margin-right:auto" /></p>

<h3 id="conditional-generation">Conditional generation</h3>

<p>For conditional generation authors keep the conditioning tokens clean during the training and add noise only to tokens which should be generated. Also, model receives a binary mask indicating which tokens are clean and which are noisy. Authors experiment with tree masking setups: prefix masking (the sequence prefix of random length is kept clean), random masking (completely random tokens are kept clean) and combination of both. Surprisingly, they found out, that the combination of masking schemes lead to the best prefix completion performance.</p>

<p>During the generation self-conditioning and classifier-free guidance are also applied. Both significantly boost the performance.</p>

<h3 id="results">Results</h3>

<p>The paper provides a very detailed ablation study of all described methods. However, there is no comparison with other diffusion methods. The comparison with autoregressive transformer on the machine translation task shows that the CDCD performs worse even with 100 samples used for Minimum Bayes-Risk decoding.</p>

<p><img src="/assets/cdcd/results.png" alt="image" style="width:100%; display:block; margin-left:auto; margin-right:auto" /></p>]]></content><author><name></name></author><category term="text_diffusion" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Continuous Diffusion Models</title><link href="https://ashaba1in.github.io/definitions/2025/03/12/continuous_diffusion_models.html" rel="alternate" type="text/html" title="Continuous Diffusion Models" /><published>2025-03-12T15:09:34+00:00</published><updated>2025-03-12T15:09:34+00:00</updated><id>https://ashaba1in.github.io/definitions/2025/03/12/continuous_diffusion_models</id><content type="html" xml:base="https://ashaba1in.github.io/definitions/2025/03/12/continuous_diffusion_models.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p><strong>Continuous Diffusion Models</strong> for text generation is an attempt to adapt diffusion models (SOTA for image generation) to text data. Unlike <strong>Discrete Diffusion Models</strong>, continuous diffusion models do not change the noising process (although there are exceptions). Instead they map discrete text into a continuous latent space and run a default diffusion process there.</p>

<p>Formally speaking, let \(w = (w_1, \dots, w_n)\) be an input sequence of tokens of size \(n\). Then its latent \(x_0 \in \mathbb{R}^{m \times d}\) can be obtained using encoder model \(E\), \(x_0 = E(w)\). Note that after the mapping the length of the sequence might change (\(m \neq n\)). Each noised latent \(x_t\) for \(t \in [1, T]\) is sampled from the Gaussian distribution, \(x_t \sim \mathcal{N}(\gamma_t x_0, \sigma_t^2I)\), where \(\gamma_t\) and \(\sigma_t\) are hyperparameters that control the noise injection speed, such that \(\forall s &lt; t, \gamma_s &gt; \gamma_t\) and \(\sigma_s &lt; \sigma_t\) and \(\gamma_T = \sigma_1 = 0, \gamma_0 = \sigma_T = 1\).</p>

<p>During the training a diffusion model \(f_\theta\) learns to reconstruct an original latent \(x_0\) based on its noised version \(x_t\). The generation is performed by starting from the pure noise \(x_T\) and then iteratively refining it using the trained diffusion model \(f_\theta\) until \(\hat{x}_0\) is recovered. At the end of the generation process, decoder \(D\) converts generated latent \(\hat{x}_0\) back to tokens, \(\hat{w} = D(\hat{x}_0)\).</p>

<p>Most commonly encoder \(E\) simply maps each token into its embedding vector, so \(m = n\). Decoder \(D\) then converts generated embedding to a token corresponding to a closes embedding.</p>

<p>At the training phase the main loss term which is optimized is the MSE between the original latent \(x_0\) and the predicted latent.</p>

\[L(\theta) = \mathbb{E}_{x_0, t, \varepsilon} \|x_0 - f_{\theta}(\gamma_t x_0 + \sigma_t \varepsilon, t) \|^2,\]

<p>where \(f_\theta\) is a diffusion model that is being trained.</p>

<p>Often embeddings are optimized simultaneously with the diffusion model. Then some additional loss terms must be added in order to prevent the collapse of the embeddings space.</p>

<p>Note that if a diffusion model is trained with cross-entropy loss instead of MSE, embeddings will explode and this problem must also be fixed. For example, by normalizing embeddings before each use as in <a href="/text_diffusion/2025/03/16/cdcd.html">CDCD</a> method.</p>]]></content><author><name></name></author><category term="definitions" /><category term="" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Language Modelling</title><link href="https://ashaba1in.github.io/definitions/2025/03/08/language_modeling.html" rel="alternate" type="text/html" title="Language Modelling" /><published>2025-03-08T15:09:34+00:00</published><updated>2025-03-08T15:09:34+00:00</updated><id>https://ashaba1in.github.io/definitions/2025/03/08/language_modeling</id><content type="html" xml:base="https://ashaba1in.github.io/definitions/2025/03/08/language_modeling.html"><![CDATA[<script type="text/javascript" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

<p><strong>Language Modelling</strong> is the process of developing a statistical or machine learning model that can understand, generate, or predict language—usually natural language like English.</p>

<h4 id="examples-of-language-models">Examples of Language Models:</h4>
<ul>
  <li><strong>Encoder-Decoder (Sequence-to-sequence)</strong>: Transformer, T5, BART, …</li>
  <li><strong>Decoder (Text generation)</strong>: RNN, LSTM, GPT, LLaMA, Claude, Mistral, …</li>
  <li><strong>Encoder (Text classification, Text embedding)</strong>: BERT, RoBERTa, E5, …</li>
  <li><strong>Diffusion models (Text generation)</strong>: based on <strong>Encoder</strong>; Diffusion-LM, SEDD, LD4LG, …</li>
</ul>]]></content><author><name></name></author><category term="definitions" /><category term="" /><summary type="html"><![CDATA[]]></summary></entry></feed>