<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mujeeb Ur Rehman on Medium]]></title>
        <description><![CDATA[Stories by Mujeeb Ur Rehman on Medium]]></description>
        <link>https://medium.com/@mujeeb.merwat?source=rss-8e46392e2f72------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qiZVWP2AoHlIG8VDRTWK3A@2x.jpeg</url>
            <title>Stories by Mujeeb Ur Rehman on Medium</title>
            <link>https://medium.com/@mujeeb.merwat?source=rss-8e46392e2f72------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 22:08:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mujeeb.merwat/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Tokenization All You Need]]></title>
            <link>https://medium.com/@mujeeb.merwat/tokenization-all-you-need-88e0fe798cfe?source=rss-8e46392e2f72------2</link>
            <guid isPermaLink="false">https://medium.com/p/88e0fe798cfe</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[generative]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Mujeeb Ur Rehman]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 11:32:01 GMT</pubDate>
            <atom:updated>2024-08-16T11:32:01.753Z</atom:updated>
            <content:encoded><![CDATA[<p>What is the meaning of the tokenizer’s vocabulary? How does the tokenizer process the input for the language model? How do tokenizers impact the performance of the LLMs? Why is a single tokenizer insufficient for all language models?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6PsfT0UV3NGFqcVtd1JxfQ.png" /><figcaption>Tokenization</figcaption></figure><p>Suhas Pai defines vocabulary in his book as:</p><blockquote>All the words in a language that are understood by a specific person.</blockquote><p>The GPT-3 model has a vocabulary size of 50,257 tokens. Here are some tokens from the GPT-3 tokenizer:</p><pre>&quot;Ġdeep&quot;: 3676,<br>&quot;Ġdeeply&quot;: 11617,<br>&quot;Ġdeeper&quot;: 12861,<br>&quot;ĠDeep&quot;: 18147,<br>&quot;deep&quot;: 22412,<br>&quot;Deep&quot;: 30763,<br>&quot;Ġdeepest&quot;: 34620,</pre><p>The ‘Ġ’ character represents the space before the word. For example, in the phrase “<em>I’m learning deep learning</em>” the space before ‘d’ is considered part of the token ‘deep’. Most tokenizers are case-sensitive, meaning there will be separate tokens for ‘<em>deep</em>’ and ‘<em>Deep</em>’.</p><p>Different tokenizers split the text into different tokens based on the data they were trained on. Here is a visualization of how different <a href="https://tiktokenizer.vercel.app/">tokenizers</a> split the text:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjlM_BOp56O3O5Umy3qnfg.png" /><figcaption>GPT-2 Tokenizer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ApA7dJjGHRyY2UfRlKsUw.png" /><figcaption>GPT-4 Tokenizer</figcaption></figure><p>If you choose a different tokenizer, it will not only split the text into different tokens but also with different numbers of tokens. For example, the <strong><em>gpt2</em></strong> tokenizer splits each indentation space (in Python code) into a separate token, while <strong><em>cl100k_base</em></strong> tokenizes it as one token (which is why GPT-2 does not perform well on Python coding-related tasks). Looking at Chinese text, <strong><em>gpt2 </em></strong>splits it into 8 tokens, whereas <strong><em>cl100k_base</em></strong> splits it into 7 tokens. A tokenizer that splits text into less number of tokens has the advantage of allowing the self-attention layer to capture a larger context of the input. This enables the model to make more accurate predictions for the next word, as the attention mechanism can only process a fixed number of tokens at a time.</p><h3><strong>Tokenizer</strong></h3><p>Okay! But what is a tokenizer.? A tokenizer is a tool that breaks down the given text into smaller units called tokens, based on the vocabulary it has been trained on. The tokenizer has two main responsibilities:</p><ul><li>First, it generates the vocabulary during the pre-training stage.</li><li>Second, it splits the text into tokens during the training and inference processes.</li></ul><h4>Tokenization Pipeline</h4><p>Tokenizer passes the input text into four different steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z4dTm8pnnM6Dx4mozTdM1A.png" /><figcaption>Tokenization Pipeline</figcaption></figure><h4>1. Normalization:</h4><p>In the normalization step, various techniques are applied to standardize the text, such as converting it to lowercase and removing accents.</p><pre>lowercase: I am Learning. → i am learning.<br>stripping accents: Açúcar → acucar.</pre><h4>2. Pre-Tokenization:</h4><p>Before adding tokens to the base vocabulary, the tokenizer first splits the text into words based on whitespace and punctuation. Some tokenizers collapse multiple consecutive spaces into one, while others retain all extra spaces. Here’s an example of pre-tokenization using the “<em>google/flan-t5-xl</em>” model:</p><pre><br>from transformers import AutoTokenizer<br>tokenizer = AutoTokenizer.from_pretrained(&quot;google/flan-t5-xl&quot;)<br>tokenizer.backend_tokenizer.pre_tokenizer.pre_tokenize_str(&quot;The sum of <br>3452 + 9863 is    13315, I think 🤔.&quot;)<br><br>#Output<br>[<br>  (&#39;▁The&#39;, (0, 3)), (&#39;▁sum&#39;, (3, 7)), (&#39;▁of&#39;, (7, 10)), (&#39;▁3452&#39;, (10, 15)),<br> (&#39;▁+&#39;, (15, 17)), (&#39;▁9863&#39;, (17, 22)), (&#39;▁is&#39;, (22, 25)), (&#39;▁&#39;, (25, 26)),<br> (&#39;▁&#39;, (26, 27)), (&#39;▁&#39;, (27, 28)), (&#39;▁13315,&#39;, (28, 35)), (&#39;▁I&#39;, (35, 37)),<br> (&#39;▁think&#39;, (37, 43)), (&#39;▁🤔.&#39;, (43, 46))<br>]</pre><h4>3. Tokenization:</h4><p>Tokenization is the critical step where text is broken down into sub-tokens, forming the base vocabulary. While it might seem straightforward, it’s more complex than it appears.</p><p>For example, consider the input text:</p><pre>input_text = &quot;Are you learning about tokenizers? They&#39;re very easy! 😎&quot;</pre><p>A naive tokenization might yield:</p><pre>tokenized_text = [&quot;are&quot;, &quot;you&quot;, &quot;learning&quot;, &quot;about&quot;, &quot;tokenizers?&quot;,<br>                  &quot;they&#39;re&quot;, &quot;very&quot;, &quot;easy!&quot;, &quot;😎&quot;]</pre><p>Here, punctuation marks like “?” and “!” remain attached to words, creating tokens like &quot;tokenizers?&quot; and &quot;easy!&quot;. This can lead to an unnecessarily large vocabulary, as the model would need to learn separate tokens for every word followed by different punctuation marks.</p><p>To handle this, the tokenizer separates punctuation from words:</p><pre>input_text = &quot;Are you learning about tokenizers? They&#39;re very easy! 😎&quot;<br>tokenized_text = [&quot;are&quot;, &quot;you&quot;, &quot;learning&quot;, &quot;about&quot;, &quot;tokenizers&quot;, &quot;?&quot;,<br>                  &quot;they&quot;, &quot;&#39;&quot;, &quot;re&quot;, &quot;very&quot;, &quot;easy&quot;, &quot;!&quot;, &quot;😎&quot;]</pre><p>This approach improves tokenization but still, there are challenges. For example, &quot;they&#39;re&quot; would be tokenized into [&quot;they&quot;, &quot;&#39;re&quot;], reflecting the contraction&#39;s meaning &quot;they are&quot;. Ans this is where things get tuff.</p><p>Generally, there are four notable approaches to tokenize:</p><ol><li><strong>Word Tokenizer:</strong> Splits text into individual words based on spaces and punctuation. This method can lead to a large vocabulary, as each unique word becomes a separate token.</li><li><strong>Character Tokenizer:</strong> Splits text into individual characters, treating each character as a token. While this approach reduces vocabulary size, it often loses important context since each character is isolated.</li><li><strong>SubWord Tokenizer:</strong> This breaks words into meaningful subword units or segments, effectively combining the benefits of word and character tokenizers. This method balances vocabulary size and context preservation.</li><li><strong>Byte tokenizer:</strong> Splits text into individual bytes, representing characters at the byte level. This allows for encoding any possible text, regardless of the language or character set, providing maximum flexibility.</li></ol><p>The most commonly used algorithms in LLMs are standard Byte Pair Encoding (BPE), byte-level Byte Pair Encoding (BBPE), WordPiece, Unigram, and SentencePiece. These are all subword tokenizers, each with its own approach to tokenization. In this article, I will focus on BPE and BBPE, which are specifically used by GPT-n models.</p><h4>BPE (Byte Pair Encoding):</h4><p>BPE is an algorithm that iteratively merges the most frequent pairs of consecutive bytes or characters in a text, as a new token until the desired vocabulary size is achieved.</p><p><strong>Training Stage:</strong></p><p>After the text has been normalized and pre-tokenized, BPE begins by analyzing the corpus for unique words. For example, consider the following words in our corpus:</p><pre>[&quot;top&quot;, &quot;pop&quot;, &quot;pot&quot;, &quot;tap&quot;, &quot;tops&quot;]</pre><p>The initial base vocabulary consists of all the symbols or characters needed to write these words:</p><pre>[&quot;t&quot;, &quot;o&quot;, &quot;p&quot;, &quot;a&quot;, &quot;s&quot;]</pre><p>The algorithm then looks for the most frequent pair of tokens to merge. Let’s look at the frequency of different pairs:</p><pre>&#39;t o&#39;:2, &#39;o p&#39;:3, &#39;p o&#39;:2, &#39;o t&#39;:1, &#39;t a&#39;:1, &#39;a p&#39;:1, &#39;p s&#39;:1</pre><p>The pair ‘o p’ has the highest frequency (3). The first merge rule is to combine ‘o’ and ‘p’. The updated vocabulary becomes:</p><pre>[&quot;t&quot;, &quot;o&quot;, &quot;p&quot;, &quot;a&quot;, &quot;s&quot;, &quot;op&quot;]</pre><p>Next, the new frequencies are calculated:</p><pre>&#39;p o&#39;:2, &#39;t op&#39;:2, &#39;p op&#39;:1, &#39;o t&#39;:1, &#39;t a&#39;:1, &#39;a p&#39;:1, &#39;p s&#39;:1</pre><p>The pair ‘p o’ now has the highest frequency (2), so the second merge rule combines ‘p’ and ‘o’. The updated vocabulary is:</p><pre>[&quot;t&quot;, &quot;o&quot;, &quot;p&quot;, &quot;a&quot;, &quot;s&quot;, &quot;op&quot;, &quot;po&quot;]</pre><p>Continuing this process, the new frequencies are:</p><pre>&#39;t op&#39;:2, &#39;p op&#39;:1, &#39;po t&#39;:1 , &#39;op s&#39;:1, &#39;a p&#39;:1, , &#39;o t&#39;:1</pre><p>The pair ‘t op’ now has the highest frequency (2). The third merge rule is to combine ‘t’ and ‘op’, resulting in the vocabulary:</p><pre>[&quot;t&quot;, &quot;o&quot;, &quot;p&quot;, &quot;a&quot;, &quot;s&quot;, &quot;op&quot;, &quot;po&quot;, &quot;top&quot;]</pre><p>This merging process continues until the desired vocabulary size is reached. Once the tokenizer is trained, it learns all the necessary merge rules. These rules are then applied to new input text during inference to break it down into appropriate tokens, which are then fed into the model.</p><p><strong>Inference Stage:</strong> When the user inputs a prompt into the language model, the trained tokenizer applies the learned rules to tokenize the text. For example, the above tokenizer has learned the following merge rules:</p><pre>(&#39;o&#39;, &#39;p&#39;) --&gt; &#39;op&#39;<br>(&#39;p&#39;, &#39;o&#39;) --&gt; &#39;po&#39;<br>(&#39;t&#39;, &#39;op&#39;) --&gt; &#39;top&#39;</pre><p>Now, consider a prompt containing the words “topo” and “topr”. The tokenizer processes these words as follows:</p><ul><li>“topo” is tokenized into [&quot;top&quot;, &quot;o&quot;] because both &quot;top&quot; and “o” are in the vocabulary.</li><li>“topr” is tokenized into [&quot;top&quot;, &quot;[UNK]&quot;] because while &quot;top&quot; is recognized, &quot;r&quot; is not part of the base vocabulary. Therefore, it is replaced with a special [UNK] token, representing an unknown word or character.</li></ul><p>In real models like GPT-3, the tokenizer has a vocabulary size of 50,257 tokens. However, the Unicode standard includes 149,813 characters, which means there’s a significant likelihood that the user’s prompt could contain characters not present in the tokenizer’s vocabulary. When this happens, the unknown character is typically represented by a special token, &lt;UNK&gt;.</p><p>However, language models can’t generate text containing &lt;UNK&gt; tokens. Imagine if ChatGPT responded with something like: 😄</p><pre>Learning tokenizers are &lt;UNK&gt;. Don&#39;t worry about &lt;UNK&gt;. </pre><p>One possible solution to this problem is to include the entire set of Unicode characters in the vocabulary. However, this approach would drastically increase the vocabulary size, leading to computational cost.</p><p>A more efficient approach is used to resolve these issues: <strong>byte-level Byte Pair Encoding (BBPE)</strong>. This method encodes text at the byte level, allowing the tokenizer to handle any character by representing it as a signal byte or a sequence of bytes, rather than relying on a large set of predefined tokens.</p><p>Before diving deep into BBPE, let’s first discuss what Unicode is.</p><blockquote><strong>Unicode</strong>, formally <strong><em>The Unicode Standard</em></strong>,is a text encoding standard maintained by the Unicode Consortium designed to support the use of text in all of the world’s writing systems that can be digitized. Version 15.1 of the standard defines 149813 characters.</blockquote><p>Unicode assigns each character a specific value, a single byte, or a sequence of bytes (ranging from 0–255). Here are some examples of how different characters are encoded in Unicode:</p><pre>the Unicode representation of:<br>&quot;A&quot; is [65],<br>&#39;a&#39; is [97],<br>&#39;+&#39; is [43],<br>&#39;ش&#39; is [216, 180],<br>&#39;𐍈&#39; is [240, 144, 141, 136],<br>&#39;𓂀&#39; is [240 147 130 128]<br>&#39;☭ &#39; is [226 156 173]<br>&#39;😊&#39; is [240, 159, 152, 138].</pre><h4>BBPE (Byte-Level Byte Pair Encoding):</h4><p>BBPE starts with 256 base tokens (corresponding to bytes, ranging from 0–255), representing all characters that can be represented by a single byte (8 bits). Other Unicode characters will be encoded by the concatenation/ sequence of bytes, as shown above. Plus With some additional rules to deal with punctuation.</p><h4>4. PostProcessing:</h4><p>In the final stage of tokenization, special tokens are added to the tokenized sequence to convey specific instructions to the model:</p><ul><li>&lt;PAD&gt;: Indicates padding, ensuring that all sequences in a batch have the same length.</li><li>&lt;EOS&gt;: Marks the end of a sequence.</li><li>&lt;SEP&gt;: Separates different segments or sentences within a sequence.</li></ul><p>Each tokenizer may introduce its own special tokens tailored to the specific domain or purpose of the model.</p><p>For instance, the tokenizer used by <strong>GALACTICA</strong>, a model developed by Meta, includes domain-specific tokens such as:</p><ul><li>[START_REF] and [END_REF] for wrapping citations.</li><li>[START_SMILES], [START_DNA], [START_AMINO], [END_SMILES], [END_DNA], and [END_AMINO] for marking the start and end of protein sequences, DNA sequences, and amino acid sequences, respectively.</li></ul><h4><strong>Tokenizer Affecting LLM Performance</strong></h4><p>In summary, tokenization is the reason behind many strange behaviors in large language models (LLMs). It explains why LLMs struggle with spelling, simple tasks like reversing a string, and why they often perform poorly with non-English languages and basic math. It’s also why older models had trouble coding in Python, why they might suddenly stop when seeing certain strings. Simply put, tokenization is at the core of many challenges when using LLMs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88e0fe798cfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Positional Emneddings are Required in Attention Models.?]]></title>
            <link>https://medium.com/@mujeeb.merwat/why-positional-emneddings-are-required-in-attention-models-4ccaf91d3f76?source=rss-8e46392e2f72------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ccaf91d3f76</guid>
            <category><![CDATA[attention-model]]></category>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[generative-ai]]></category>
            <dc:creator><![CDATA[Mujeeb Ur Rehman]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 12:10:09 GMT</pubDate>
            <atom:updated>2024-07-15T12:10:09.498Z</atom:updated>
            <content:encoded><![CDATA[<p>What are positional embeddings? Why are they necessary in attention models but not in sequence models (RNN) or CNN? How do they work? What are the different types of positional embeddings?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*T7M2BAGwafq5WXeO3-QOvw.jpeg" /><figcaption>src: <a href="https://arxiv.org/abs/1706.03762">Attention Is All You Need</a></figcaption></figure><p><strong>Positional Embeddings </strong>provide information about the order of words in a sentence. In natural language, word order can significantly affect the meaning of a sentence. For example, in the sentence “Alice drove John to the store,” humans can determine who is driving by considering the order or position of the names (words). However, machines may not understand the order of words and can misinterpret the sentence as “John drove Alice to the store” or “drove store John to Alice,” leading to incorrect or nonsensical conclusions. To help machines understand the order of words, we use positional embeddings to convey the idea of word order through vectors.</p><p><strong>Why RNNs don&#39;t need Positonal Embeddings:</strong> Recurrent Neural Networks (RNNs) incorporate information about position due to their sequential nature. RNNs process input one token at a time in a sequential manner. As they move through the sequence, they naturally maintain the order of tokens based on the input sequence. Additionally, RNNs maintain a hidden state that changes over time as each token in the sequence is processed, effectively encoding the positional information.</p><p><strong>Why Attention models need Positonal Embeddings:</strong> Attention models do not use the RNNs (sequence) technique, they proceed with all the tokens in parallel in a scaled Dot-Product attention block (without keeping information about the order of words). Due to this the Attention model needs an extra step of calculating positional encoding vectors.</p><p><strong>Several ways of Positional Embeddings</strong>: There are several ways to capture positional encodings. The original paper uses “Sinusoidal Positional” encoding, while all other advanced models (such as BERT, GPT, and T5) use “Learnable Positional” embeddings.</p><p><strong>Sinusoidal Positional Embeddings: </strong>The author uses sine at the odd index of the token and cosine at the even index. Here <em>pos</em> stands for the token (word) in sequence (sentence), <em>i</em> is the index in the word embedding vector and <em>d_model</em> is the dimension of the embeddings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B57IzMF9kVLRf-1sB3s7iQ.png" /></figure><p>The argument of the sine and cosine functions involves [<em>pos/10000 ^ 2*i/d_model</em>]</p><ul><li>This term ensures that the positional encoding has different frequencies for different dimensions. This helps in creating a diverse and distinguishable set of positional encodings across the embedding space.</li><li>Lower dimensions (smaller <em>i</em>) will have higher frequency variations (faster oscillations).</li><li>Higher dimensions (larger <em>i</em>) will have lower frequency variations (slower oscillations).</li><li>The scaling factor (<em>1000^2*i/d</em>) ensures that each dimension <em>i</em> captures positional information at a different scale, which allows the model to learn to distinguish between nearby positions and distant positions effectively.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*L4RAwsWIPW5TjqUbWbZKfw.png" /><figcaption>Sine Function Oscillation at the same range (1–10) with different frequencies</figcaption></figure><p><strong>Learnable Positional Embeddings</strong>: Instead of using fixed sinusoidal values, learnable positional embeddings treat positions as trainable parameters. Each position in the sequence has a corresponding embedding vector that is learned during training. This approach allows the model to potentially learn more complex positional relationships.</p><p>As we calculate positional embedding vectors, the next step is to add them to word embedding vectors (both have the same dimensions), and then feed the combined vectors to the encoder/decoder layer.</p><p><strong>Further Reading</strong></p><p><a href="https://machinelearningmastery.com/a-gentle-introduction-to-positional-encoding-in-transformer-models-part-1/">A Gentle Introduction to Positional Encoding in Transformers Models</a>.</p><p><a href="https://machinelearningmastery.com/the-transformer-positional-encoding-layer-in-keras-part-2/">The Transformer Positional Encoding Layer in Keras</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ccaf91d3f76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The leading products and emerging technologies are engulfed by RUST.]]></title>
            <link>https://medium.com/@mujeeb.merwat/the-leading-products-and-emerging-technologies-are-engulfed-by-rust-c0e3c1a1b07a?source=rss-8e46392e2f72------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0e3c1a1b07a</guid>
            <dc:creator><![CDATA[Mujeeb Ur Rehman]]></dc:creator>
            <pubDate>Sun, 04 Dec 2022 10:16:56 GMT</pubDate>
            <atom:updated>2022-12-04T10:16:56.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*eat1Ol8uMqUIyhyitTBqsg.jpeg" /></figure><p>Why leading companies like Microsoft, Google, Facebook are planning to bring RUST into the game.? Why Solana, Polkadot, Near Protocol, Hyperledger and Elrond like top blockchains using RUST. How RUST solve the pain points of battle tested languages.?</p><h4>Short Answer: Everyone wants security and performance.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*5h0_6iZaUpdBGKXexVC3WQ.jpeg" /></figure><p>Microsoft security engineer, Matt Miller, at BlueHat security conference mention that over last 12 years, around 70 percent of all Microsoft patches were fixes for memory safety bugs. Microsoft experimenting RUST for solving memory safety bugs and building Verona. Verona is a programming language for modern cloud.</p><p>Google engineers mention that 70% of all serious security bugs in Chrome codebase are memory management and safety bugs. Google bringing RUST to linux kernel to reduce security flaws. In April 2021 Google also announced the addition of RUST to the Android open source project (AOSP) for developing the operating system.</p><p>In blockchain safety, transaction speed and quality are the most important aspects and where RUST excels. Top blockchains like Solana, Polkadot, Hyperledger and Near Protocl are based on RUST. <em>If Satoshi Nakamoto has a secret command for you then learn RUST</em>.</p><h3>What are pain points RUST is solving.?</h3><p>The major goal of RUST language is memory safety and performance, most of all other features/advantages are derived from improving these two. Steve Klabnik and Carol Nichols mention in the book <a href="https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/second-edition/ch16-00-concurrency.html">The Rust Programming Language</a> that:</p><blockquote>“<em>Initially, the Rust team thought that ensuring memory safety and preventing concurrency problems were two separate challenges to be solved with different methods. Over time, the team discovered that the </em><strong><em>ownership</em></strong><em> and type systems are a powerful set of tools to help manage memory safety and concurrency problems!</em>”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/190/1*Lv36dKEvaJ9ElAlCZMqrFQ.jpeg" /></figure><h4>Memory Safety</h4><p>What is memory safety.? Memory safety is the property of the program assuring the reading/writing into the valid and allocated memory. And can’t access another memory regardless of what you do in program. Memory safety issues cause security vulnerabilities and exposures.</p><p>Rust manage memory safety with ownership. “<strong><em>Ownership</em></strong> is a set of rules that governs how a Rust program manages memory…memory is managed through a system of ownership with a set of rules that the compiler checks. If any of the rules are violated, the program won’t compile. None of the features of ownership will slow down your program while it’s running.”</p><blockquote>“Ownership is Rust’s most unique feature, and it enables Rust to make memory safety guarantees without needing a garbage collector.”</blockquote><h4>Fearless Concurrency</h4><p>Another achievement of RUST language is solving concurrency difficulty , data races at compile time and its error proning safely and efficiently by introducing <strong>ownership.</strong></p><h4>Performance</h4><p>Having no garbage collector by design and efficiently handling of concurrent and parallel programming RUST performance is quite noticeable as compared to other low level languages.</p><h4>Conclusion</h4><p>Rust has collected all the powerfull aspects of battle tested languages and add the features developer struggling with in other languages like C, C++ etc. Due to its safety and performance features most of the products and top blockchains are going with Rust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0e3c1a1b07a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>