<?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 Saharguebsi on Medium]]></title>
        <description><![CDATA[Stories by Saharguebsi on Medium]]></description>
        <link>https://medium.com/@saharguebsi0?source=rss-47a38879cdd4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0wPHEJB5P9HbW7lznLTCVg.jpeg</url>
            <title>Stories by Saharguebsi on Medium</title>
            <link>https://medium.com/@saharguebsi0?source=rss-47a38879cdd4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:08:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saharguebsi0/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[How were ANNs inspired from human brains?]]></title>
            <link>https://medium.com/@saharguebsi0/how-were-anns-inspired-from-human-brains-091308d7d99c?source=rss-47a38879cdd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/091308d7d99c</guid>
            <category><![CDATA[artificial-neural-network]]></category>
            <category><![CDATA[brain]]></category>
            <category><![CDATA[ai-vs-human-intelligence]]></category>
            <category><![CDATA[human-brain]]></category>
            <dc:creator><![CDATA[Saharguebsi]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 21:16:25 GMT</pubDate>
            <atom:updated>2026-01-09T21:16:25.787Z</atom:updated>
            <content:encoded><![CDATA[<h3>Prerequisites:</h3><ul><li>Deep learning fundamentals</li><li>Structure of artificial neural networks</li><li>Some management basics to understand the memes</li></ul><p>Have you ever wondered why AI can detect your face in photos? (It might recognize you if we humanize them some day and thank you for talking to it politely when you send requests), beat chess grandmasters; and create the most artistic graphic design ever? The secret resides in your own brain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*H6HonSpJkhsGtsxQgRXYqA.jpeg" /></figure><p>In the 1940s, scientists asked a simple question: ‘What if we could build machines that learn like humans do?’ This question led to artificial neural networks (ANNs) , computer systems inspired by the billions of neurons in your head. But how close is this inspiration to reality? Let’s dive into the fascinating connections (and surprising differences) between your brain and the AI systems changing our world.</p><h3>Human brain structure vs ANN inspiration:</h3><p>Just like “The Wright Brothers” looked to the flying birds and thought of inventing the airplane, some very smart guys looked into their own brains and thought about creating ANNs making our courses more complex (but more fun and fascinating when you see the next details)</p><p>To truly understand Artificial Neural Networks, we first need to snoop around the human brain to see how it actually handles business. Instead of a messy lump of tissue, imagine it as a high-stakes corporate headquarters, a sleek building where every floor has a specific job, every department has a unique personality, and the “IT department” manages the whole operation on a tiny 20-watt budget. <em>“While your brain runs on a 20-watt sandwich, training a large model like GPT-4 requires enough electricity to power a small town.”</em></p><h3>1. Cortex lobes:</h3><p>Let’s start with the brain’s outermost layer: the <strong>Cortex</strong>. Think of it as your brain’s high-level management team, seated in the top-floor glass offices. This is where the “big picture” thinking happens: planning, reasoning, and complex decision-making.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xb0WjGb6tlQb1sS9tu-29A.png" /></figure><ul><li>Frontal lobe (The CEO): located in the front of the brain, in the upper flat of the building, he sets the strategy and yells “focus” when you get distracted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*cbb3GYLqlk1wqlDcmHZW3g.png" /></figure><ul><li>Parietal lobe (The interior decorator): located just behind the frontal lobe, constantly updates the office floor plan and alerts the CEO if a piece of furniture (or your arm) is out of place.</li><li>Occipital lobe (The security guard) : located in the back of the brain in the “rear wing”, stares at the security monitors 24/7 and sounds an alarm the moment he spots a suspicious shape or movement.</li><li>Temporal lobe (The archivist): Located beneath the frontal and parietal lobes, in the “lower wings”, wears headphones to record every conversation and frantically files away tapes so you can recognize a familiar voice later.</li></ul><p>As you might have noticed, Deep Learning networks aren’t a 1:1 replica of the human brain’s physical structure. However, each of the brain’s lobes handles specific tasks that “ring a bell” when compared to different ANN applications.</p><p>To make it simple, we can map the “Departments” of the brain to their modern AI counterparts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*bGY-31IhKAYU69-tS-cttA.png" /></figure><p>A key difference is that in the human brain, these lobes are highly interconnected with <strong>recurrent feedback</strong> (loops), whereas most standard ANNs are <strong>feed-forward</strong> (data moves in one direction). We are currently moving toward “biologically plausible” ANNs that use more loops and “spiking” neurons to better match the brain’s efficiency.</p><h3>2. Subcortical structures:</h3><p>Think of it as the building’s essential infrastructure and logistics department working behind the scenes to keep everything functioning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Q3lOYk8txczqOzas37lPyA.png" /></figure><p>We can represent this by the parts shown in the image including these important ones:</p><ul><li>Cerebellum (The Quality Controller): Responsible for motor control, in other words it’s tucked under the back of the building; stands behind the workers to smooth out their clumsy mistakes, making sure no one trips over their own feet while walking.</li><li><strong>Thalamus (The Desk Receptionist):</strong> Positioned right in the center of the lobby, filters all incoming phone calls and decides which ones are important enough to be patched through to the CEO’s office.</li><li><strong>Hippocampus (The Scout):</strong> Located deep within the library; it is the one who draws the “emergency exit” maps and ensures you can navigate your way back to your desk after a long lunch break.</li><li><strong>Corpus Callosum (The High-Speed Bridge):</strong> A massive hallway connecting the left and right wings; it ensures that the “logic” team and the “creative” team are constantly talking so they don’t work in total isolation.</li></ul><p>If we want to compare this part to what AI has achieved we can find this mapping:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*82PyfmXaL9NCrqKaLRKv8w.png" /></figure><h3>Brain matter:</h3><p>Moving on to the substance itself, the brain consists of two matters: think of these as the <strong>building’s raw materials and its hidden communication network.</strong></p><ul><li><strong>Gray matter (The Cubicle Workers):</strong> It acts as the actual desks and offices where the employees (neuron cell bodies) sit and perform the heavy-duty math and decision-making that keeps the company running.</li><li><strong>White matter (The IT Wiring):</strong> It functions as the high-speed fiber-optic cables (I hope I’m not being too pedantic here) hidden under the floorboards; it carries data between the different floors at lightning speed so all departments stay synced.</li></ul><p>Here’s a more detailed comparison of how these structures map to AI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*EZ_TgrP342enEw3eYb8-cg.png" /></figure><p>You might have noticed that this third type of representation seems to make us think more that ANNs are really inspired by the human brains, since they’re literally based on creating “neurons” (digital ones), just not real ones and connecting them through weights and connections. So the representation of gray/white matter was directly transformed as it is into a virtual representation. The previous structures, on the other hand, were not mimicked in a way that a neural network is subdivided based on the function or field itself, but those are rather represented by independant ANNs each.</p><h3>Hierarchical representations of the nervous system:</h3><p>Shepherd’s model can also be used as a framework for analyzing deep neural networks (DNNs), including large language models (LLMs) and computer vision architectures.</p><ol><li>Behavior: (Functional capacity) model’s outputs, such as text generation (LLMs) or image classification (computer vision). Evaluates accuracy, fluency, or task success.</li><li>Systems and pathways: (Architeture): Structure of the network, layer arrangements and token pathways.. How the information is processed across layer</li><li>Local circuits: (Subnetwork specialization) How subnetworks specialize in tasks like attention heads focusing on syntax vs. semantics in LLMs.</li><li>Neurons: (Activation patterns) Role of individual neural activations within networks</li><li>Synapses: (Weight connections) strength of connections between neurons.</li></ol><h3>Biological vs Artificial processes:</h3><p>Even more impressive, other than the structure itself, if we dive into the biological processes that neurons go through, we find that even these characteristics were somehow implemented in the AI field. This is summarized in the following table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_UH8u7K-nO2yruuJx4y6Q.png" /></figure><h3>Dissimilarities between brain and artificial networks:</h3><p>So, How Inspired Are ANNs by Brains? The answer is: more than you might think, but less than the name suggests.</p><p>Even though AI seems to inspire a lot from studying the brain activity. We also have to look into these critical differences, maybe not yet explored deeply:</p><h3>Temporal coding:</h3><ul><li>Biological Logic: To communicate “intensity,” the brain fires more often (Rate Coding) or at specific intervals (Temporal Coding).</li><li>ANN Logic: Artificial neurons use Activation Functions (like Sigmoid or ReLU) that output a specific decimal value. A value of 0.9 is “stronger” than 0.2. This makes ANNs mathematically easier to train using calculus, but much less energy-efficient than the brain.</li></ul><h3>Global vs local learning:</h3><ul><li>ANN (Global): Artificial neural networks use Backpropagation to update a weight in the first layer, the error must be calculated at the very last layer and sent back throughout the whole structure.</li><li>Brain (Local): The brain uses Local Plasticity and synapse would change for the neurons it connects (Hebbian) not because of a mathematical signal from the other side of the brain.</li></ul><h3>Energy efficiency and sparsity:</h3><ul><li>ANN (Dense): ANNs are computationally expensive since every neuron (unless we performed dropout) “fires” for every single input</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*hgse9RvDaLMifGEFj11nrg.jpeg" /></figure><ul><li>Brain (Sparse): The brain is event-driven, only a tiny fraction of the neurons are spiking at a given point.</li></ul><h3>Continuous vs iterative learning:</h3><ul><li>ANN (Catastrophic forgetting): if you take a model in English and try to train it in Chinese, if often forgets its first training.</li><li>Brain (Continual learning): The human brain learns incrementally through a lifetime without overwriting basic skills (unlike an ANN, which sometimes deletes the ‘How to Walk’ file just to make room for a new ‘How to Speak Arabic’ update)</li></ul><h3>So, in conclusion?</h3><p>The evolution of Artificial neural networks was a journey of translating biological perfectness into mathematical logic. We have then created machines capable of making human-like reasoning, answering deep questions, searching and even generating nowadays!</p><p>However, as we have seen through the lens of <strong>Shepherd’s Model</strong> and the study of <strong>Brain Plasticity</strong>, the ANN is not yet a perfect mirror of the human mind, and it still has critical limitations compared to humans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*DbwE8eNSYX2dzqS-MCIeJQ.jpeg" /></figure><p>This study of the human brain’s functionality and the areas of difference between both might help us improve ANNs by making them more biology-like.</p><p>Such studies are being actively conducted to bridge the energy gap through neuromorphic hardware and replace global backpropagation with local, Hebbian-inspired learning rules that allow for true lifelong adaptation.</p><p><strong>Sources:</strong></p><p><a href="https://www.nature.com/articles/s41593-025-02031-z">A neural manifold view of the brain | Nature Neuroscience</a></p><p><a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC10359983/#:~:text=Historically%2C%20the%20development%20of%20CNNs,Riesenhuber%20and%20Poggio%2C%202000">Convolutional neural networks for vision neuroscience: significance, developments, and outstanding issues — PMC</a>.)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=091308d7d99c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KOSMOS-2: The Multimodal Large Language Model That Finally Stops Hallucinating and Points at Things]]></title>
            <link>https://medium.com/@saharguebsi0/kosmos-2-the-multimodal-model-that-finally-stops-hallucinating-and-points-at-things-d43ad4b91909?source=rss-47a38879cdd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d43ad4b91909</guid>
            <category><![CDATA[multimodal-ai]]></category>
            <category><![CDATA[grounding]]></category>
            <category><![CDATA[multimodal]]></category>
            <category><![CDATA[kosmos-2]]></category>
            <category><![CDATA[multimodality]]></category>
            <dc:creator><![CDATA[Saharguebsi]]></dc:creator>
            <pubDate>Thu, 27 Nov 2025 18:24:17 GMT</pubDate>
            <atom:updated>2025-11-27T18:32:47.352Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Large Language Models (LLMs) were engineered to master textual communication and generation. Beyond the text domain, multimodal LLMs extend these capabilities by learning to “see,” “hear,” and interact across the digital world.</strong></p><p>Your language model can act like your gym bro and explain how to use machines on your first day. You can ask it to generate a photo of your favorite dish just by giving it the ingredients (though sadly, the photo is not edible). You can also tell it to describe a diagram you didn’t understand in class. However, it can still mistake a rhinoceros for an elephant in a photo or give incorrect answers when identifying a specific object.</p><p>As good as they are with vision-language and language understanding tasks, <strong>MLLMs can struggle with grounding tasks</strong>. The object might be right in front of them, but they identify it incorrectly. This is the critical flaw that Kosmos-2 aims to fix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*ONJLBg1uucvaSDPDr2v9ng.jpeg" /></figure><p>Now after enough bullying to traditional MLLMs and Grounding models, let’s explore the novelty that this architecture brings.</p><h3>Under the Hood: The Causal Transformer Backbone</h3><p>Just like Kosmos-1, Kosmos-2 uses a similar architecture. Here’s a breakdown of how it works:</p><p><strong>The architecture:</strong> KOSMOS-2 is a <strong>transformer-based causal language model</strong>. It uses a <strong>decoder-only</strong> structure optimized for autoregressive, sequential generation. This training approach is ideal for grounding because it works on next-token prediction, which suits a decoder-only network perfectly.</p><p><strong>Tokenizing space:</strong> Training KOSMOS-2 requires tokenization of spatial areas. This process involves several steps:</p><ul><li>Suppose we have an image of height H and width W. We divide both dimensions into P segments.</li><li>This division results in P x P bins representing the input image.</li><li>To represent a grounding box, the coordinates of the top left and bottom right corners are represented as tokens &lt;loc1&gt; and &lt;loc2&gt;.</li><li>A bounding box is represented using the &lt;box&gt; special token as follows: &lt;box&gt; &lt;loc1&gt; &lt;loc2&gt; &lt;/box&gt;.</li><li>When there is more than one grounding box in a sequence, the model adds the &lt;delim&gt; special token, for example: &lt;box&gt; &lt;loc1&gt; &lt;loc2&gt; &lt;delim&gt; &lt;loc3&gt; &lt;loc4&gt; &lt;/box&gt;.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yf1tDMEeJAbeAbLLRgRhSg.png" /><figcaption>Grouding box tokenization in GrIT</figcaption></figure><p><strong>Training objective:</strong> by tokenizing text and space, and training the model through next-token prediction, we encourage the model to predict the correct spatial coordinates when the preceding text refers to an object. Location tokens are treated the same way as textual tokens. This unifies the spatial task with text generation into a single training objective.</p><h3>The data: What made it possible</h3><p>A key difference between KOSMOS-2 and KOSMOS-1 is the dataset used for training. The Grounded Image-Text pairs (<strong>GrIT</strong>) dataset is a large-scale web dataset combining and augmenting corpora like LAION-2B and COYO-700M. It links bounding boxes to text expressions with a concept similar to “hyperlinking.”</p><ul><li>The dataset contains approximately <strong>91 million images</strong>.</li><li>It has over 115 million text spans explicitly linked to <strong>137 million bounding boxes</strong>.</li><li>To ensure quality and reduce noise, the dataset pipeline removes ambiguous or abstract phrases (like “time” or “love”). It also keeps only bounding boxes with a high confidence score (e.g., greater than 0.65) from an upstream grounding model.</li></ul><h3>Main tasks:</h3><p>KOSMOS-2 was developed and evaluated on four main tasks:</p><ol><li><strong>Multimodal grounding:</strong> KOSMOS-2 can locate grounding boxes based on a text query. In this task, it significantly outperforms existing grounding models, especially in zero-shot settings.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*DkkwjfEUeq-uuoxN_csEpA.png" /><figcaption>Example of KOSMOS-2 performing a grounding task</figcaption></figure><p>2. <strong>Multimodal referring:</strong> In this case, the user can indicate a specific area in the image and ask questions about it. The MLLM answers with high accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*zClmYc_ZBrzer8OizliLfA.png" /><figcaption>Example of KOSMOS-2 performing a referring task</figcaption></figure><p>3. <strong>Perception-language tasks:</strong> After zero-shot evaluations on vision-language tasks, the architecture outperforms existing ones in image captioning tasks, but it has a slight degradation in question-answering tasks (which makes sense based on the way it was trained).</p><p>4. <strong>Language understanding:</strong> The model was tested on eight different language tasks, with results comparable to existing models.</p><h3>How to try it out?</h3><p>The model’s code and pretrained weights are publicly available on HuggingFace:</p><p><a href="https://huggingface.co/docs/transformers/en/model_doc/kosmos-2">KOSMOS-2</a>.</p><p>You can also find configuration files, processor details, model documentation, and example code for testing. Enjoy coding!</p><h3>Key definitions:</h3><ul><li><strong>Multimodal Large Language Models (MLLMs):</strong> AI models that process and understand multiple types of data inputs, such as text and images, to generate richer contextual outputs.</li><li><strong>Grounding:</strong> The ability to link textual descriptions directly to specific locations or objects in an image.</li><li><strong>Causal Transformer (Decoder-Only):</strong> A transformer architecture optimized for predicting the next token in sequence, used for autoregressive text generation.</li><li><strong>Tokenization of Spatial Areas:</strong> Dividing images into segments and representing locations with special tokens to combine spatial understanding with text.</li><li><strong>Bounding Box: </strong>Rectangular coordinates defining the location of objects within images.</li><li><strong>GrIT Dataset:</strong> A large-scale dataset linking texts to bounding boxes in images, used to train KOSMOS-2.</li><li><strong>Next-Token Prediction:</strong> A training task where the model learns to predict the next element in a sequence, integrating text and spatial tokens in our case.</li></ul><h3>Conclusion:</h3><p>KOSMOS-2 is a breakthrough in grounding tasks. Its results are significantly better than previous grounding models. At the same time, it maintains comparable performance on traditional MLLM tasks, with grounding capabilities as the highlight.</p><p>Its only weakness is a slight drop in question-answering accuracy. However, this is minor compared to its overall performance.</p><h3>References:</h3><p><a href="https://arxiv.org/abs/2306.14824">KOSMOS-2 official paper</a></p><p><a href="https://huggingface.co/docs/transformers/main/model_doc/kosmos-2">Code on huggingface</a></p><p><a href="http://unilm/kosmos-2%20at%20master%20%C2%B7%20microsoft/unilm">Github code</a></p><p><a href="https://opendatascience.com/new-multimodal-large-language-model-kosmos-2-introduced-by-microsoft-researchers/">Open Data Science article</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d43ad4b91909" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>