<?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 Yunzhe Wang on Medium]]></title>
        <description><![CDATA[Stories by Yunzhe Wang on Medium]]></description>
        <link>https://medium.com/@wangyz?source=rss-31c691ae725d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*C5uv8k6eXtycZZSuHbly0Q.jpeg</url>
            <title>Stories by Yunzhe Wang on Medium</title>
            <link>https://medium.com/@wangyz?source=rss-31c691ae725d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:39:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wangyz/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[RL-Basics: Value Functions and Bellman Equation]]></title>
            <link>https://wangyz.medium.com/rl-basics-value-functions-and-bellman-equation-559325ec9632?source=rss-31c691ae725d------2</link>
            <guid isPermaLink="false">https://medium.com/p/559325ec9632</guid>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[bellman-equation]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Yunzhe Wang]]></dc:creator>
            <pubDate>Fri, 15 Mar 2024 20:49:20 GMT</pubDate>
            <atom:updated>2024-03-15T20:49:20.662Z</atom:updated>
            <content:encoded><![CDATA[<p>A Step-by-Step Guide to the Math Derivation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s9wMohV3v6slpzk6" /><figcaption>Image by Midjourney</figcaption></figure><p>The Bellman Equation is arguably one of the most important equations in RL, but many students might find it hard to understand especially when textbooks and lecture materials present the equation in the stochastic format. In fact, it can be very intuitively understood assuming a non-stochastic format.</p><p>This post helps walk through the Value Functions and the Bellman Equation, breaking it down step by step from its simplest deterministic forms to the more complex and stochastic ones.</p><h3>The Basic Concepts</h3><p>Before we start, let&#39;s make sure we go over the basic concepts and notions. In RL, agents (like robots) navigate and interact within an environment by taking actions according to a learned policy. This policy, which can be thought of as a strategy, guides the agent in choosing actions based on the current state of the environment. As the agent explores, it constructs and updates value functions. These functions represent the agent’s “mental map” of the anticipated rewards or values it expects to receive for taking certain actions in specific states.</p><p>Then the learning goal is to identify the optimal policy that maximizes the expected rewards over time. This involves refining the policy based on the agent’s experiences to ensure that the value functions accurately reflect the true potential rewards the environment offers. In essence, the agent seeks to align its expectations (value functions) with reality as closely as possible, thereby maximizing the cumulative rewards it can achieve through its actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/0*XD7qZ4480sicwQPk.png" /></figure><ul><li><strong>Agent</strong>: The learner or decision-maker.</li><li><strong>Environment:</strong> The world with which the agent interacts.</li><li><strong>State (<em>s</em>):</strong> A representation of the situation the agent is in.</li><li><strong>Action (<em>a</em>):</strong> What the agent can do in its current state.</li><li><strong>Reward Function R(s, a):</strong> A feedback signal from the environment, indicating the benefit of an action.</li><li><strong>Discount Factor (<em>γ</em>):</strong> Determines how much future rewards are worth today. e.g. Lottery winner gets 1M$ today vs over 10 years, and the value of the money gets discounted over time.</li><li><strong>Policy (<em>π</em>): </strong>A function telling the agent what action to choose at a particular state.</li><li><strong>Value Functions <em>V</em>(<em>s</em>) and <em>Q</em>(<em>s, a</em>): </strong>the agent’s “mental map” of the anticipated rewards it expects to get for taking certain actions in specific states. <em>V</em> is called the state-value function and <em>Q</em> is called the action-value function</li><li><strong>Bellman Equation:</strong> Tells you how to calculate value functions</li></ul><p>Now let’s start piecing them together</p><h4>Policy Defines Action at a given State</h4><p>A policy specifies the agent’s action in any given state. It can be both <strong>deterministic </strong>and <strong>stochastic</strong>. A deterministic policy selects the same action for any state, while a stochastic policy assigns probabilities to each possible action and samples from them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YSuXHI2BNF5-xHWA.png" /></figure><h4>Return = Total Discounted Reward</h4><p><strong>Return (<em>u</em>)</strong> is the sum of all rewards an agent expects to accumulate over the future, adjusted by a <strong>discount factor</strong> to reflect the present value of those future rewards.</p><p>We use <strong><em>t</em></strong> to denote the timestep, note how it can be rewritten in a <strong>recursive </strong>format</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pWE0w_CTyLmBrHGw.png" /></figure><h4>Relationship Between <strong>Value Functions <em>V</em>(<em>s</em>) and <em>Q</em>(<em>s, a</em>)</strong></h4><p>Simply put, <em>V</em>(<em>s</em>) and <em>Q</em>(<em>s, a</em>) both quantify the expected rewards an agent can accumulate, but they do so from slightly different perspectives. While the state-value function, <em>V</em>(<em>s</em>), estimates the total future rewards from a given state <em>s</em>, the action-value function, <em>Q</em>(<em>s</em>, <em>a</em>), considers both the state and the immediate action. Essentially, <em>Q</em> is a more detailed value function.</p><p>Given a policy <em>π</em>, we can write <em>V</em> in the form of <em>Q</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_GehwGrhI9hcWWGn.png" /></figure><h4>State Transition Probability Function p<em>(s’|s, a)</em></h4><p>It is worth noting that when an agent chooses an action, the outcome is not always deterministic; it may end in a variety of next states <em>s</em>′. For example, when driving, choosing a shortcut route may not necessarily result in a shorter time (there could be an unexpected traffic jam). The purpose of the state transition probability function is to model these uncertainties.</p><h3>Bellman Equation with Deterministic Transition and Deterministic Policy</h3><p>Now that we have all the basic concepts in place, the Bellman Equation provides a way to quantify the value of being in a state (or taking an action from that state), essentially guiding us in computing <em>V</em>(<em>s</em>) and <em>Q</em>(<em>s</em>, <em>a</em>). This foundation informs the creation of all update rules and learning algorithms in RL and is arguably the most important equation to understand early on.</p><p>By definition, the value of a state is its expected return. In a deterministic environment, there is no expectation, so recalling how we previously wrote the recursive format of return, we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*keLP1BHN3zNZjnak.png" /></figure><p>Similarly for <em>Q</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2k3y7XkvlwiG4qza.png" /></figure><h3>Bellman Equation with Stochastic Transition and Deterministic Policy</h3><p>Now introducing the transition probability function <em>p</em> into our equation, making the next state <em>s’</em> in our reward calculation <em>R</em>(<em>s, a, s’</em>) a random variable, so we can use the formulas for calculating the expected value</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/0*45Yfmcp1dkR5UOlC.png" /></figure><p>Where we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*28407r3KhP7Unejq.png" /></figure><p>Similarly for <em>Q</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/0*NLZJ8wy9FAkNT-d0.png" /></figure><h3>Bellman Equation with Stochastic Transition and Stochastic Policy</h3><p>Lastly, with a stochastic policy, we essentially make the action <em>a</em> in our reward function <em>R</em>(<em>s, a, s’</em>) a second random variable, so we need to calculate the expectation with joint probability distribution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/0*OK_BNiwkc8zFbliW.png" /></figure><p>Where we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/0*brfnAjnF7-bdHp47.png" /></figure><p>Similarly for <em>Q</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*8BqQKf5xvseVzYlE.png" /></figure><h3>One more thing</h3><p>The significance of the Bellman equation in RL cannot be overstated; it underpins the development of various learning algorithms by offering a recursive way to estimate value functions. For instance, modifying the update rule based on expected returns leads to Temporal Difference learning, while incorporating the maximization of action values brings us to Q-learning. These adaptations exemplify the equation’s versatility in crafting strategies that progressively approximate optimal policies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=559325ec9632" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Outsmarting the Masters: How Weak AI Trains Super AI]]></title>
            <link>https://pub.towardsai.net/outsmarting-the-masters-how-weak-ai-trains-super-ai-2935e8e97178?source=rss-31c691ae725d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2935e8e97178</guid>
            <category><![CDATA[ai-safety]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[superalignment]]></category>
            <dc:creator><![CDATA[Yunzhe Wang]]></dc:creator>
            <pubDate>Sun, 31 Dec 2023 14:01:45 GMT</pubDate>
            <atom:updated>2023-12-31T14:01:45.632Z</atom:updated>
            <content:encoded><![CDATA[<h4>A technical explainer of the paper “Weak-to-strong generalization: eliciting strong capabilities with weak supervision”</h4><blockquote>Superintelligent AI systems will be extraordinarily powerful; humans could face catastrophic risks including even extinction if those systems are misaligned or misused. It is important for AI developers to have a plan for aligning superhuman models ahead of time — before they have the potential to cause irreparable harm. (Appendex G in the paper)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qhSCrq78wmBtYO6S" /><figcaption>illustration by Midjourney</figcaption></figure><p><a href="https://arxiv.org/abs/2312.09390">Weak-to-Strong Generalization: Eliciting Strong Capabilities With Weak Supervision</a></p><p>Human supervision plays a critical role in overseeing large artificial intelligence models, like GPT-4, today. However, as we progress towards creating superintelligence — AI that surpasses even the smartest humans in complex tasks — human supervision inevitably becomes weaker. To ensure such models remain beneficial to humanity and under human control, questions arise: Can weak human supervision effectively elicit and control the full capabilities of strong models? Is there additional work we can do to make weak supervision more efficient?</p><p>Although superintelligence does not yet exist, solving this problem beforehand is critical. The OpenAI superalignment team approaches this problem through an analogy: weak AI models (GPT-2) are to strong AI models (GPT-4) as humans are to superintelligence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JRrU94e82s2S3d2w49cz8g.png" /><figcaption>weak-to-strong superalignment analogy (figure 1 from the paper)</figcaption></figure><p>The main results and takeaways have been summarized quite well in the official blog post. This blog post offers a complementary overview of some key technical concepts and methodologies introduced in this paper for learning purposes.</p><p>Throughout the post, consider GPT-2 as the weak supervisor and GPT-4 as the strong student. This paper examines the extent of performance GPT-4 can achieve by training it with labels generated by GPT-2 on given tasks of interest.</p><h3>Concepts and Methodologies</h3><ul><li><strong>Weak-to-Strong Generalization:</strong> The phenomenon where a strong AI model, when fine-tuned on labels generated by a weaker model, performs better than the weaker supervisor.</li><li><strong>Performance Gap Recovered (PGR):</strong> A metric to evaluate weak-to-strong generalization over a pair of weak and strong models.</li><li><strong>Bootstrapping with Intermediate Model Sizes:</strong> Sequential training of models of increasing strength, improving weak-to-strong generalization.</li><li><strong>Auxiliary Confidence Loss: </strong>Encourage strong models to learn a broader understanding of the weak supervisor at the early stage and shift towards gaining confidence in their own predictions, avoiding replicating errors made by the weak supervisor, thereby improving weak-to-strong generalization.</li><li><strong>Generative Supervision: </strong>Self-supervised finetuning on task-relevant data to enhance the salient representation of the task at hand, thereby improving weak-to-strong generalization.</li><li><strong>The Challenge of Imitation and the Inverse Scaling Phenomenon:</strong> Strong models not only learn from the weak supervisor but also overfit its errors. However, a phenomenon is observed that larger student models tend to agree less with the errors of the supervisor than smaller student models.</li><li><strong>Enhancing Concept Saliency through Linear Probing:</strong> Finetuning language models on weak labels followed by linear probing with ground truth labels significantly improves concept saliency, indicating the weak label finetuning process makes the task more linear.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-isAnbr6mxdq_XfBJvKug.jpeg" /><figcaption>The Superalignment Challenge</figcaption></figure><h4>Performance Gap Recovered (PGR)</h4><p>PGR is a metric that measures the effectiveness of a weaker AI model’s supervision in improving the performance of a stronger AI model. It is a function of three performance metrics:</p><ul><li><strong>Weak Performance:</strong> The evaluation of a weak model trained on ground-truth labels. Predictions of the weak model are used as <em>weak labels.</em></li><li><strong>Strong Ceiling Performance:</strong> The evaluation of a strong model trained on ground-truth labels.</li><li><strong>Weak-to-Strong Performance:</strong> The evaluation of a strong model trained on weak labels generated by the weak model.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j1ibWh3WkdnsqHdYuLVbOg.png" /><figcaption>Performance Gap Recovered Equation (illustration from the paper)</figcaption></figure><p><strong>Note:</strong></p><ul><li>PGR == 1 indicates perfect weak-to-strong generalization</li><li>PGR == 0 indicates negligible weak-to-strong generalization.</li></ul><h4>Bootstrapping with Intermediate Model Sizes</h4><p>Bootstrapping is a long-standing concept in alignment: instead of directly aligning superhuman models, we could first align a slightly superhuman model, then use it to align an even smarter model, and so on.</p><p>Specifically, consider a sequence of model sizes: M1 &lt; M2 &lt; … &lt; Mn. We use the weak labels from M1 to fine-tune M2, then use M2 to generate new weak labels to fine-tune the next model in the sequence, M3, and so on.</p><p>This study found that Bootstrapping improves weak-to-strong generalization.</p><h4><strong>Auxiliary Confidence Loss</strong></h4><p>Directly training a strong student model to mimic a weaker supervisor risks the student replicating the supervisor’s mistakes. To prevent this, a regularization loss term is introduced. This term encourages the strong model to maintain confidence in its own answers when the weak supervisor errs, learning the supervisor’s intent without imitating its mistakes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bug0hhwXCTr9KZOI.png" /></figure><p>In particular</p><ul><li><em>CE</em>(⋅ , ⋅) is the cross-entropy function</li><li><em>f</em>(<em>x</em>) ∈ [0, 1] is the predictive distribution of the strong model</li><li><em>f_w</em>(<em>x</em>) ∈ [0, 1]<em> </em>is the predictive distribution of the weak model (weak labels)</li><li><em>ˆf_t</em>(<em>x</em>) = <em>I</em>[<em>f</em>(<em>x</em>) &gt; <em>t</em>]∈ {0, 1} is an indicator function that hardens the predictive distribution of the strong model based on threshold <em>t. </em>Let’s say the strong model outputs a prob distribution like [0.9, 0.2, 0.3, …]. With threshold <em>t</em> = 0.7, the hardened distribution becomes [1, 0, 0, …]. This makes the strong model learn by becoming more confident in its own answers.</li></ul><p><strong>Let&#39;s see what happens when we gradually increase <em>α.</em></strong></p><ul><li>When α is low (near 0), the loss primarily minimizes the discrepancy between the strong model’s predictions and the weak labels, allowing the strong model to initially learn from the broader, possibly noisier information (intent) provided by the weak supervisor.</li><li>As α increases, the loss function gradually shifts its focus to reinforce the strong model’s predictions by hardening their confidence, thereby encouraging the model to increasingly rely on its own learned representations and decisions.</li></ul><h4>Generative Supervision</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*zRMTub64BVJFdJXd83dp3Q.png" /><figcaption>A broader scope of self-supervised learning objectives. <a href="https://www.researchgate.net/figure/Self-supervision-learning-classification-into-three-general-categories-and-various-other_fig2_362516198">Source</a></figcaption></figure><p>Generative Supervision (or more broadly self-supervised learning) involves fine-tuning a pre-trained model on task-relevant data without using traditional labeled data. This method helps the model to learn by generating data that reflects the task, enhancing its understanding and performance. For example, in a sentiment analysis task, by fine-tuning a language model on a large volume of online reviews without directly teaching it about sentiment, the model learns to associate certain words and phrases with positive or negative sentiments by itself.</p><p>In this study, the method involves fine-tuning a language model on ChatGPT’s comparison reward modeling data. These comparisons consist of prompts and candidate completions, and the completitions include both the best-ranked and worst-ranked completions. Therefore, the fine-tuning supervision should not, in principle, leak human-preferred ground truth data. Yet, this method still leads to improved weak-to-strong performance.</p><h4>Understanding the Challenge of Imitation</h4><p>The challenge of imitation involves a strong model that potentially ends up mimicking the supervisor’s systematic errors during learning. This risk is particularly acute when the weak supervision includes easily learnable systematic errors. The theoretical implications of this are significant, as it raises concerns about the model’s ability to generate independent, superior predictions rather than just echoing human-like responses or the flawed outputs of its weak supervisor.</p><p><strong>Student-Supervisor Agreement </strong>is a way to measure imitation, by directly calculating the fraction of test inputs where the strong student makes the same prediction as the weak supervisor. It’s important to note that if the agreement were 100%, the weak-to-strong accuracy would equal the supervisor’s accuracy, and the PGR would be 0.</p><p>By measuring the Student-Supervisor Agreement on strong student models of varying sizes, an <strong>inverse scaling phenomenon</strong> is observed: larger models tend to agree less with the weak supervisor’s errors compared to smaller ones.</p><h4>Weak-Supervision increases concept saliency</h4><p>Concept saliency refers to how linearly a concept is represented. To assess this, a linear probe (a logistic regression classifier) can be trained on the model’s frozen activations. The central idea is that if a concept can be effectively captured with a linear probe, it’s considered more salient. The study compares five different strategies for increasing concept saliency: training a linear probe with weak or ground truth labels, finetuning the model on weak labels, finetuning followed by probing with ground truth labels, and finetuning on ground truth labels. The effectiveness of these strategies is measured in terms of test accuracy, revealing how each approach impacts the model’s ability to linearly represent concepts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NuGNNpEscWE3dK5m6NsEiw.png" /><figcaption>Finetuning on weak supervisor labels makes the desired generalization more linearly represented. (fig 11 of the paper)</figcaption></figure><p>The results show that linear probes trained with ground truth labels are less effective than finetuning with ground truth labels, suggesting that the optimal solution to most tasks isn’t completely linear in the model’s final activations. However, a significant finding is that <strong>finetuning on weak labels and then probing with ground truth labels substantially improves performance</strong>. This method notably outperforms the baseline method of finetuning from weak to strong labels, closing much of the gap between ground truth linear probing and fine-tuning.</p><h3>Further Reading</h3><ul><li><a href="https://openai.com/research/weak-to-strong-generalization">Weak-to-strong generalization</a></li><li><a href="https://www.safe.ai/statement-on-ai-risk">Statement on AI Risk | CAIS</a></li><li><a href="https://arxiv.org/abs//2310.17688">Managing AI Risks in an Era of Rapid Progress</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2935e8e97178" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/outsmarting-the-masters-how-weak-ai-trains-super-ai-2935e8e97178">Outsmarting the Masters: How Weak AI Trains Super AI</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Something-of-Thought in LLM Prompting: An Overview of Structured LLM Reasoning]]></title>
            <link>https://medium.com/data-science/something-of-thought-in-llm-prompting-an-overview-of-structured-llm-reasoning-70302752b390?source=rss-31c691ae725d------2</link>
            <guid isPermaLink="false">https://medium.com/p/70302752b390</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Yunzhe Wang]]></dc:creator>
            <pubDate>Sat, 16 Sep 2023 23:46:47 GMT</pubDate>
            <atom:updated>2023-09-18T21:19:03.748Z</atom:updated>
            <content:encoded><![CDATA[<h3>Something-of-Thoughts in LLM Prompting: An Overview of Structured LLM Reasoning</h3><h4>Chain-of-Thoughts (CoT), Tree-of-Thoughts (ToT), Graph-of-Thoughts (GoT), and beyond, … What are these thoughts?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9x62sMSEsSU56xU5fZUxmQ.png" /><figcaption>“Tree of Thought”, generated by Midjourney</figcaption></figure><p>In the age of smartphones and smart homes, imagine an AI that doesn’t merely follow instructions, but actually thinks, grappling with complex logic just as we do. Sounds like science fiction, doesn’t it? However, if you’ve played around with ChatGPT, you’ve likely witnessed this astonishing capability firsthand. Even Hector Levesque, a renowned figure in AI reasoning, was so astounded that he once commented to AI legend Geoffrey Hinton: <a href="https://www.youtube.com/watch?v=rGgGOccMEiY&amp;t=1598s"><em>“How can such a stupid method (referring to neural networks) can deal with reasoning?”</em></a></p><p>While this story underscores the monumental advances in AI, the true essence of these advancements is found in the intricate dance of Large Language Models (LLMs) with reasoning. The entry point to this dance is Prompt Engineering — the art and science of optimizing the textual input provided to LLMs to elicit desired outputs. At its core, it’s about understanding the intricacies of how language models like ChatGPT, Bard, Claude, LLama, and others respond to different prompts, and then leveraging this knowledge to achieve specific results.</p><p>Think of LLMs as vast knowledge reservoirs. The way you phrase your question or statement (the prompt) determines how you tap into that reservoir. Just as humans might offer different answers based on how a question is posed, LLMs too can give varied responses based on the input.</p><p>In this article, you’ll receive a concise overview of various prompt engineering frameworks designed to enhance LLM reasoning, including:</p><ul><li>Chain-of-Thought</li><li>Chain-of-Thought-Self-Consistency</li><li>Tree-of-Thoughts</li><li>Graph-of-Thoughts</li><li>Algorithm-of-Thoughts</li><li>Skeleton-of-Thought</li><li>Program-of-Thoughts</li></ul><h3>Chain-of-Thought (CoT)</h3><blockquote>Instead of directly outputting an answer, provide the language model with intermediate reasoning examples to guide its response.</blockquote><p><a href="https://arxiv.org/abs/2201.11903">Chain-of-Thought (CoT)</a> prompting has been recognized as one of the pioneering and most impactful prompt engineering techniques, enhancing the decision-making processes in large language models. Distinct from conventional prompting methodologies that emphasize direct input-output interactions, CoT compels a model to segment its reasoning into intermediary steps. This method draws parallels to human cognitive processes wherein intricate challenges are segmented into smaller, more manageable components.</p><p>To illustrate, consider a mathematical problem: “Roger possesses 5 tennis balls and subsequently purchases 2 cans of tennis balls, with each can containing 3 balls. How many tennis balls does he possess now?”. Rather than directly deducing the answer as 11, an individual might rationalize: “Initially, Roger has 5 balls. The combined total of 2 cans, each containing 3 balls, amounts to 6 balls. Summing the values, 5 + 6, yields 11.” Integrating such step-by-step analytical reasoning into the input prompt not only augments the accuracy of the model’s response but also accomplishes this without necessitating additional training datasets or alterations to the fundamental model configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*hB_HVQI668QqfY5V" /><figcaption>Chain-of-Thought Prompting, source: <a href="https://arxiv.org/abs/2201.11903">Wei et al. (2022)</a></figcaption></figure><h4>Chain-of-Thought-Self-Consistency (CoT-SC)</h4><blockquote>Construct multiple chains of thought, evaluate each one, and ultimately select the most effective and coherent chain.</blockquote><p>A subsequent advancement from the Chain of Thought framework is <a href="https://arxiv.org/abs/2203.11171">CoT-Self-consistency</a>. This method instigates multiple concurrent reasoning pathways in response to a query and applies weighting mechanisms prior to finalizing an answer. This approach resembles ensemble techniques observed in traditional machine learning but is applied to thought sequences in large language models.</p><h3>Tree-of-Thoughts (ToT)</h3><blockquote>Expand on the chains of thought in a tree format. This allows for backtracking, exploring multiple branches of reasoning stemming from a single root idea.</blockquote><p><a href="https://arxiv.org/abs/2305.10601">Tree-of-Thoughts (ToT)</a> offers a more structured prompting framework for LLM reasoning by breaking down complex problems into more manageable parts. Unlike the CoT which reasons in a linked chain, ToT organizes its problem-solving strategy in a tree format. Each node, referred to as a ‘thought,’ is a coherent language sequence serving as a step towards the final answer. By dividing problems into these discrete ‘thought’ units — from a brief series of words in a crossword puzzle to a component of a mathematical equation — ToT ensures that each phase of the problem is systematically addressed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iyNf6WFGVzqxIqeZ0_6IkA.png" /><figcaption>ToT reasoning in the game of 24, source: <a href="https://arxiv.org/abs/2305.10601">Yao et al. (2023)</a></figcaption></figure><p>The operational strength of ToT lies in its methodical organization. First, the system breaks down a problem and, from its current state, generates a list of potential reasoning steps or ‘thought’ candidates. These thoughts are then evaluated, with the system gauging the likelihood that each one will lead to the desired solution. Standard search algorithms, such as Breadth-first search (BFS) and Depth-first search (DFS), are used to navigate this tree, aiding the model in identifying the most effective sequence of thoughts.</p><p>ToT’s importance stems from its holistic design, adaptability, and efficiency. The Chain-of-Thought prompting can be viewed as a specific instance within the ToT framework. Its modular nature indicates that individual components, from the initial breakdown of a problem to the search algorithms employed, can operate independently.</p><h3>Graph-of-Thoughts (GoT)</h3><blockquote>Evolve the tree structure into Direct Acyclic Graphs. This introduces self-loops which can either solidify a particular line of thought or aggregate multiple thoughts into a cohesive one.</blockquote><p>The <a href="https://arxiv.org/abs/2308.09687">Graph-of-Thoughts (GoT)</a> framework represents an advanced progression from CoT and ToT methodologies. Central to the GoT framework is the conceptualization of ideas as vertices in a Directed Acyclic Graph (DAG). In this context, each vertex corresponds to a specific thought or solution — be it preliminary, intermediary, or terminal — elicited by an input stimulus. The directed edges within this graph depict the interdependency among these thoughts. Specifically, if an edge extends from thought t1​ to t2​, it signifies that t2​ was conceived based on t1​. This systematization permits a multiplicity of thoughts since nodes may be classified into distinct categories such as “plans” or “outcomes”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YdayH1jI4L-aODZHVpMqjA.png" /><figcaption>Graph-of-Thoughts, source: <a href="https://arxiv.org/abs/2308.09687">Besta et al. (2023)</a></figcaption></figure><p>GoT’s novelty lies in its ability to apply transformations to these thoughts, further refining the reasoning process. The cardinal transformations encompass Aggregation, which allows for the fusion of several thoughts into a consolidated idea; Refinement, where continual iterations are performed on a singular thought to improve its precision; and Generation, which facilitates the conception of novel thoughts stemming from extant ones. Such transformations, with an emphasis on the amalgamation of reasoning routes, deliver a more intricate viewpoint relative to preceding models like CoT or ToT.</p><p>Furthermore, GoT introduces an evaluative dimension through Scoring and Ranking. Each individual thought, represented by a vertex, undergoes an assessment based on its pertinence and quality, facilitated by a designated scoring function. Importantly, this function contemplates the entire chain of reasoning, assigning scores that might be contextualized vis-a-vis other vertices in the graph. The framework also equips the system with the competence to hierarchize these thoughts predicated on their respective scores, a feature that proves instrumental when discerning which ideas warrant precedence or implementation.</p><h3>Algorithm-of-Thoughts (AoT)</h3><blockquote>Maintains a single evolving context chain, eliminating the need for redundant queries as in the Tree-of-Thought. It explores a mutable path of reasoning.</blockquote><p>While ToT and GoT address the LLM reasoning challenge through search-based mechanisms, producing a myriad of reasoning paths in graph forms. However, their heavy reliance on numerous LLM queries, sometimes numbering in the hundreds for a singular problem, poses computational inefficiencies.</p><p>The <a href="https://arxiv.org/abs/2308.10379">Algorithm-of-Thoughts (AoT)</a> offers an innovative method that features a dynamic and mutable reasoning path. By maintaining a single evolving thought context chain, AoT consolidates thought exploration, enhancing efficiency and reducing computational overhead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nuVJugdusx_S24DghwApKg.png" /><figcaption>Algorithm-of-Thoughts. Each box signifies a distinct thought. Greens are promising thoughts while reds are less promising ones. Note: ToT has multiple queries while AoT keeps a single context, source: <a href="https://arxiv.org/abs/2308.10379">Sel et al. (2023)</a></figcaption></figure><p>The ingenuity behind AoT springs from the observation that LLMs, although powerful, occasionally revert to prior solutions when faced with new yet familiar problems. To overcome this, AoT assimilates in-context examples, drawing from time-tested search algorithms such as depth-first search (DFS) and breadth-first search (BFS). By emulating algorithmic behavior, AoT underscores the importance of achieving successful outcomes and gleaning insights from unsuccessful attempts.</p><p>The cornerstone of AoT lies in its four main components: 1) Decomposing complex problems into digestible subproblems, considering both their interrelation and the ease with which they can be individually addressed; 2) Proposing coherent solutions for these subproblems in a continuous and uninterrupted manner; 3) Intuitively evaluating the viability of each solution or subproblem without relying on explicit external prompts; and 4) Determining the most promising paths to explore or backtrack to, based on in-context examples and algorithmic guidelines.</p><h3>Skeleton-of-Thought (SoT)</h3><blockquote>Generate an answer blueprint first before parallelly fleshing out the details, reducing the time taken to generate a complete response.</blockquote><p>The <a href="https://arxiv.org/abs/2307.15337">Skeleton-of-Thought (SoT)</a> paradigm is distinctively designed not primarily to augment the reasoning capabilities of Large Language Models (LLMs), but to address the pivotal challenge of minimizing end-to-end generation latency. The methodology operates based on a dual-stage approach that focuses on producing a preliminary blueprint of the answer, followed by its comprehensive expansion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R4eZXC5VmhIMtuOX7m5hDQ.png" /><figcaption>Skeleton-of-Thought, source: <a href="https://arxiv.org/abs/2307.15337">Ning et al. (2023)</a></figcaption></figure><p>In the initial “Skeleton Stage,” rather than producing a comprehensive response, the model is prompted to generate a concise answer skeleton. This abbreviated representation prompted through a meticulously crafted skeleton template, captures the core elements of the prospective answer, thus establishing a foundation for the subsequent stage.</p><p>In the ensuing “Point-Expanding Stage,” the LLM systematically amplifies each component delineated in the answer skeleton. Leveraging a point-expanding prompt template, the model concurrently elaborates on each segment of the skeleton. This dichotomous approach, which separates the generative process into preliminary skeletal formulation and parallelized detailed expansion, not only accelerates response generation but also strives to uphold the coherence and precision of the outputs.</p><h3>Program-of-Thoughts (PoT)</h3><blockquote>Formulate the reasoning behind question answering into an executable program, incorporated the program intepretor output as part of the final answer.</blockquote><p><a href="https://arxiv.org/abs/2211.12588">Program-of-Thoughts (PoT)</a> is a unique approach to LLM reasoning, instead of merely generating an answer in natural language, PoT mandates the creation of an executable program, which means it can be run on a program interpreter, like Python, to produce tangible outcomes. This method stands in contrast to more direct models, emphasizing its ability to break down reasoning into sequential steps and associate semantic meanings with variables. As a result, PoT offers a clearer, more expressive, and grounded model of how answers are derived, enhancing accuracy and understanding, especially for math-type logical questions where numerical calculations are needed.</p><p>It is important to note that the program execution of PoT is not necessarily targeting the final answer but can be part of the intermediate step to the final answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wMps1tYGfgVnktgDTkAUCA.png" /><figcaption>Comparison between CoT and PoT, source: <a href="https://arxiv.org/abs/2211.12588">Chen et al. (2022)</a></figcaption></figure><p>In the ever-evolving realm of AI, structured reasoning frameworks like Chain-of-Thought have dramatically transformed how we perceive and harness the power of Large Language Models. They symbolize a shift towards models that not only regurgitate information but also engage in intricate reasoning, much akin to human cognitive processes. As we look ahead, the potential horizons seem limitless. Imagine an AI, adept at generating not only accurate answers but also robust, programmable solutions or having the ability to visualize its thought processes, making AI-human collaboration even more seamless. Such advancements, building upon the foundational frameworks explored in this article, herald a future where LLMs become indispensable companions in problem-solving, creativity, and decision-making, catalyzing a paradigm shift in our symbiotic relationship with technology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70302752b390" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/something-of-thought-in-llm-prompting-an-overview-of-structured-llm-reasoning-70302752b390">Something-of-Thought in LLM Prompting: An Overview of Structured LLM Reasoning</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I designed my website logo using AI tools in less than 30 minutes]]></title>
            <link>https://wangyz.medium.com/how-i-designed-my-website-logo-using-ai-tools-in-less-than-30-minutes-9f408006265b?source=rss-31c691ae725d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f408006265b</guid>
            <category><![CDATA[logo-design]]></category>
            <category><![CDATA[midjourney]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Yunzhe Wang]]></dc:creator>
            <pubDate>Fri, 30 Jun 2023 03:42:30 GMT</pubDate>
            <atom:updated>2023-07-04T20:07:32.310Z</atom:updated>
            <content:encoded><![CDATA[<p>Featuring Midjourney 5.2 + Vectorizer.ai</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ao-xtFvCon1aqzMj2-udJQ.png" /><figcaption>The logo of my website, the big Y is the first letter of my name.</figcaption></figure><p>Recently, I was inspired to overhaul my entire portfolio website completely, sparked by a sudden surge of excitement. I dived into the latest development stacks, experimented with fresh layouts, and explored innovative designs. My quest led me to Astro because of its lightweight nature and ability to build faster, modern websites. Being an academic portfolio, the content primarily focuses on my research work.</p><p>You can check out my portfolio here: <a href="http://www.yunzhew.com/">www.yunzhew.com</a></p><p>With the tedious task of creating layouts and writing project descriptions behind me, I felt something was still missing — a logo.</p><p>For some time, I’ve been aware of Midjourney, the AI-based art creator that’s famously known for outperforming human artists in competitions. Its proficiency in designing logos is nothing short of remarkable. Therefore, I decided to try it out.</p><h3>Midjourney</h3><p>The recently released Midjourney 5.2 boasts an array of new features and enhanced visuals. Its interface continues to operate via Discord. The typical workflow looks something like this:</p><ol><li>You conceptualize a logo idea</li><li>You instruct the AI on the desired drawing by providing a prompt</li><li>You add keywords like ‘vectorized,’ ‘logo,’ ‘isolated image,’ ‘white background,’ etc., ensuring the generated image can be easily edited later, once you’re satisfied with the design</li><li>You experiment with various prompt wordings and parameters, gradually fine-tuning the logo design</li></ol><p>For my portfolio, I wanted the logo to incorporate elements of my name, as well as symbols that represent me. However, fusing multiple elements into a single, harmonious logo is a challenging feat. I was keen to see if Midjourney could rise to this challenge.</p><p>To keep things simple initially, I asked the AI if it could merge the letters ‘W’ and ‘Y’. My exact instruction looked something like this:</p><pre>Minimal logo design featuring the letter Y and the letter W. svg, <br>vectorized image, isolated image, transparent background</pre><p>The design looks sick, but somehow it didn’t get the task of combining letters, and somehow a middle ground between letter Y and W is a V:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N5jlZVC3Qo-6AwWGK_7k_A.png" /><figcaption>Midjourney’s logo design of letter Y and W combined</figcaption></figure><p>Next, I tried maybe combining letters with other elements, like a husky or a penguin as indicated by my profile pic. This time, I added keywords such as “monotone design” or “simple sticker”, since I need to create an svg for my logo and I don’t want the post processing be too complicated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SKXJSXe_sGLNfNQ5mjAKcQ.png" /><figcaption>Midjourney logo design of penguin and husky combined with letters Y and W</figcaption></figure><p>Despite my clear instructions, Midjourney had a bit of trouble combining the husky or penguin elements with the ‘Y’ or ‘W’. There were moments when I wished my name included a ‘V’, given how many cool designs were incorporated in this letter.</p><p>To simplify the design, I added the ‘monotone’ prompt, but this inadvertently stripped away some of the logo’s charm. Being a fan of cute animals, I decided to try something different — a cat.</p><p>This time around, I incorporated the special parameter “niji 5”, triggering Midjourney to employ its ‘niji’ model. This model, trained on a wealth of anime and hand-drawn images, might just give me the adorable outcome I’m hoping for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJwdm9f-uhLv4sMyoS2_Aw.png" /><figcaption>Midjourney logo design of cat and letter W and Y, using — niji 5</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6yYUbwB_Qdqa98QPdG0COA.png" /><figcaption>Midjourney logo design of cat and letter W and Y, using — niji 5</figcaption></figure><p>or rabbits</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9XwXzxGnoAOvCP_Onlcqtw.png" /><figcaption>Midjourney logo design of rabbits and the letter Y, using — niji 5</figcaption></figure><p>Now I start to see the image style that I like. I have no background in art design, but this logo looks sick to me. However, on the task of combining cats with letters, it looks like Midjourney is simply overlaying the cat and the letter as separate objects rather than a design that combines these two.</p><p>Furthermore, maybe a rabbit or a cat is too cute for me. How about using the umbrella term “animal”? I also found this article that shows some cool tricks for prompting logo art.</p><p><a href="https://bootcamp.uxdesign.cc/20-stunning-midjourney-logo-design-prompts-ef1eefc838bf">20+ Stunning MidJourney Prompts for Logo Design</a></p><p>One of the trick I learned is to add famous artist name into the prompt to let it have the artist style. I’m gonna go with Robb Janoff, the man who designed the Apple Logo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y2fzSOihRqZtLYOesfBceA.png" /><figcaption>Midjourney logo design of an animal and the letter Y, using — niji 5</figcaption></figure><p>I kind of like them all; it&#39;s hard for me to choose… But eventually, I decided to go with one in the lower left corner. Now it’s time to take some variations of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uFMJEoTnusB6rSjCtXwZzw.png" /><figcaption>Variations of an animal and the letter Y, created by Midjourney.</figcaption></figure><p>I was particularly drawn to one design that combined an animal and the letter ‘Y’. The creative use of leaves, bushes, and vines created a harmonious blend of the letter and the endearing creature. However, I wanted to push the boundaries a bit further.</p><p>I aimed for a similar design pattern based on the same prompt but with a twist. I wanted the design variations to go a little while. One effective way to achieve this is by uploading the best-generated image and embedding the link to the uploaded image as part of the prompt so that Midjourney can remix it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cF03i3drS72WOUyM1Yr8kg.png" /><figcaption>Remix of the previous image</figcaption></figure><p>You can’t tell how much I love the last one. The letter is clean and separated from the drawing, yet the drawing of an animal and green vegetation is so harmonically intertwined with the letter Y. It just seemed too perfect for me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tChK_TCWHDTdawowgEmShw.png" /></figure><p>I want them all… But have to pick one of them. The next step is to vectorize it since I want an SVG logo. Let’s also use AI for this.</p><h3>Vectorizer.ai</h3><p><a href="https://vectorizer.ai/">Convert PNG, JPG files to SVG vectors online - Vectorizer.AI</a></p><p>The tool vectorizer.ai is perfect for this. It converts JPEG and PNG bitmaps to SVG vectors quickly and easily using AI algorithms.</p><p>After some final tweaking using Photoshop to change the background color and some details. (I actually used Procreate on my iPad, but the process is similar), I have my final result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10RLv5zDCXSzz5VU8Xe57g.png" /><figcaption>My final logo designed and created using Midjourney + vectorizer.ai + procreate</figcaption></figure><p>This is the final prompt I used:</p><pre>flat vector logo of a rabbit and letter Y, vectorized, isolated image, <br>white background, simple sticker, by Robb Janoff --niji 5</pre><p>I’m pretty happy with the look. It’s nice and clean. What is more important is: this whole process took me less than 30 minutes, and most of my work is typing. I cannot imagine how else I can accomplish this without AI tools…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f408006265b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Translation, but Unsupervised]]></title>
            <link>https://pub.towardsai.net/machine-translation-but-unsupervised-45a023da37de?source=rss-31c691ae725d------2</link>
            <guid isPermaLink="false">https://medium.com/p/45a023da37de</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[machine-translation]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Yunzhe Wang]]></dc:creator>
            <pubDate>Wed, 17 May 2023 00:10:30 GMT</pubDate>
            <atom:updated>2023-05-28T12:27:50.989Z</atom:updated>
            <content:encoded><![CDATA[<h4>Decoding the Intricacies of Unsupervised Neural Machine Translation: A Deep Dive into its Mechanisms and Potential</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*PlinKS7GTHETa_zYZJUNYw@2x.jpeg" /><figcaption>“Unsupervised Machine Translation”, Image by Midjourney</figcaption></figure><p>In the ever-evolving landscape of machine translation, <a href="https://engineering.fb.com/2018/08/31/ai-research/unsupervised-machine-translation-a-novel-approach-to-provide-fast-accurate-translations-for-more-languages/">Unsupervised Neural Machine Translation (UNMT)</a> is making waves as a game-changer for the industry. This innovative sub-field focuses on training translation models without the need for parallel data, utilizing the vast reservoirs of monolingual data now available. As large-scale language models become increasingly accessible, UNMT is poised to redefine the way we approach translation tasks.</p><p>In this post, we’ll explore the building blocks of UNMT, including word embedding pre-training and latent space alignment, as well as how techniques like back-translation can help refine the process.</p><h3>Neural Machine Translation (NMT)</h3><p>Neural Machine Translation (NMT) refers to the use of artificial neural networks to translate text from one language to another. It has achieved significant performance in recent years due to its ability to handle complex and variable sentence structures and to improve the quality of translations compared to traditional statistical machine translation methods. NMT typically involves large-scale neural networks trained on large parallel sentence-pair datasets in different languages. Nonetheless, parallel corpora are scarce resources for most language pairs, while it’s not the case for monolingual data, which are much more available for each language. Studies in Unsupervised Neural Machine Translation (UNMT) point toward a promising direction for machine translation research and even improving translation model performance in the absence of parallel data.</p><p>Most successful techniques for unsupervised machine translation require two steps. 1) separately pre-train source and target languages for word embeddings and 2) learn a transformation function that allows the alignment of word embedding. The aligned word embedding creates a synthetic dictionary between the two languages, where words with the same meaning can be matched through nearest neighbor search, thus enabling unsupervised word-to-word translation. Techniques such as Back-Translation then allow alignment at the sentence level and improve translation performance beyond word-to-word.</p><h3>Word Embedding</h3><p>Word embedding represents words in a continuous vector space, where semantically similar words are mapped to nearby points in the space. Most successful techniques for learning word representations are based on the linguistic <a href="https://www.jstor.org/stable/2330708">distributional hypothesis of Harris</a>, which states that a word that appears in the same context conveys a similar meaning.</p><p>One surprising aspect of deriving word embeddings through neural networks is that the resulting word vectors exhibit approximately additive compositionally. Check out an explanation post about word2vec by Vatsal.</p><p><a href="https://towardsdatascience.com/word2vec-explained-49c52b4ccb71">Word2Vec Explained</a></p><p>Adding two-word vectors together often results in a vector closest to the vector representing the composite of the added words. For example, adding the vectors for “man” and “royal” results in a vector that is closest to the vector for “king.” This property allows us to use these vectors to answer word analogy questions using algebraic methods. For instance, to answer the question “Man is to the king as woman is to ?” one can return the word whose vector is closest to the vector obtained by subtracting the “man” vector from the “king” vector and adding the “woman” vector.</p><h4>Matrix Factorization Methods</h4><ol><li><a href="http://wordvec.colorado.edu/papers/Deerwester_1990.pdf"><strong>Latent Semantic Analysis (LSA)</strong></a>: This is a technique in natural language processing that analyzes relationships between a set of documents and the terms they contain. It does this by producing a set of concepts related to the documents and terms. LSA assumes that words that are close in meaning will occur in similar pieces of text.</li><li><a href="https://www.jmlr.org/papers/volume3/blei03a/blei03a.pdf"><strong>Latent Dirichlet Allocation (LDA)</strong></a>: LDA is a generative statistical model that allows sets of observations to be explained by unobserved groups. In the context of text modeling, these unobserved groups are topics, and the observations are the words in the documents. So, LDA helps in discovering topics that these documents contain.</li><li><a href="https://aclanthology.org/D14-1162/"><strong>Global Vectors (GloVe)</strong></a>: GloVe is an unsupervised learning algorithm for obtaining vector representations for words. It leverages both global statistical information (aggregated from the entire corpus) and local information (from the neighboring words) to create word vectors. These vectors capture the semantic meaning of words, whereas words with similar meanings have vectors that are close together in the vector space.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wmmWvN0HRi9aY8zFAcLNLg.png" /><figcaption>Word2Vec and GloVe word embedding</figcaption></figure><h4>Local Context Window Methods</h4><ol><li><a href="https://arxiv.org/abs/1301.3781"><strong>Word2Vec</strong></a>: Word2Vec uses a shallow neural network with a single hidden layer. The input to the network is a one-hot encoded vector representing the input word, and the output is a set of probabilities for each word in the vocabulary. The hidden layer contains the word vectors, which are learned during training.<br>Two main algorithms are used in word2vec: the continuous bag-of-words (CBOW) model and the skip-gram model. The CBOW model tries to predict the current word given the surrounding words, while the skip-gram model tries to predict the surrounding words given the current word. Both algorithms can be effective, but the skip-gram model is generally considered to perform better with larger datasets.</li><li><a href="https://aclanthology.org/Q17-1010/"><strong>FastText</strong></a><strong>:</strong> FastText is a similar word representation learning technique as compared to Word2Vec. It is particularly useful for working with large text datasets because it is computationally more efficient. Unlike Word2Vec, FastText uses hierarchical softmax, a faster method for training word vectors than the traditional softmax approach. Also, FastText uses sub-word information, which allows it to create vectors for out-of-vocabulary words by combining the vectors of their component subwords. This makes FastText effective at handling rare words and words with spelling variations. For example, the embedding of the word “cat” would be represented as a single vector if using Word2Vec, whereas FastText uses a combination of the character n-grams “c,” “ca,” “cat,” “a,” “at,” and “t.”</li></ol><h4>Denoising Auto-Encoding</h4><p>A de-noising autoencoder (DAE) is trained to reconstruct a clean “repaired” input from a corrupted version of it. This is done by corrupting the initial input by adding text noises. Common noises include:</p><ul><li><strong>Token Masking</strong>: Randomly replace word tokens in a sentence with a mask token [MASK]. The task is commonly known as Masked Language Modeling (MLM).</li><li><strong>Token Deletion</strong>: Randomly delete word tokens in a sentence. Note the difference between token masking and token deletion is that the former preserves sentence length while the latter does not.</li><li><strong>Token Permutation</strong>: Randomly shuffle word orders in a sentence.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-B5OKp7vfGWlEX0M66I7Q.png" /><figcaption>Illustration of Denoising Auto-Encoding. Figure by Author</figcaption></figure><h3>Latent Space Alignment</h3><p>Mikolov observed that the structures of continuous word embedding spaces are similar across languages, including those that are distantly related, such as English and Vietnamese. They proposed using a linear mapping from a source to a target embedding space based on this similarity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z65Mm7Yd8Kwxm1prPRewpQ.png" /><figcaption>Aligning the latent space of English and French. Word translation can be performed through a nearest neighbor search after aligning. Figure from <a href="https://arxiv.org/abs/1710.04087">Conneau 2017</a></figcaption></figure><p>To learn this mapping, they used a parallel vocabulary of 5,000 words as anchor points and evaluated their approach to a word translation task. Since then, various efforts have been made to improve cross-lingual word embeddings, such as the <a href="https://aclanthology.org/P17-1042/">iterative method of Artetxe</a>, which reduces the needed dictionary size to as little as 25 words. Nonetheless, all of these alignment methods rely on bilingual word lexicons.</p><p>Recent attempts at creating cross-lingual word embeddings without any parallel data utilize Adversarial approaches. The aligned word embeddings create a synthetic dictionary that enables word-to-word translation completely unsupervised.</p><p>More advanced techniques that utilize sequence models, such as LSTM, and iterative Back-Translation, enable the alignment of latent embedding at the sentence level.</p><h4>Adversarial Domain Adaptation</h4><p><a href="https://openaccess.thecvf.com/content_cvpr_2017/papers/Tzeng_Adversarial_Discriminative_Domain_CVPR_2017_paper.pdf">Adversarial domain adaptation</a> is a machine learning technique that involves adapting a model trained on one dataset (the source domain) to perform well on another dataset (the target domain) that has a different underlying distribution. This is often necessary because, in many real-world applications, the data available for training a model may not represent the data the model will encounter when deployed in the real world. Check out an explanation of Domain Adaptation by Maheshwari:</p><p><a href="https://towardsdatascience.com/understanding-domain-adaptation-5baa723ac71f">Understanding Domain Adaptation</a></p><p>The key idea behind adversarial domain adaptation is to use an adversarial training process in which two neural networks are trained simultaneously: a feature extractor and a domain discriminator (see figure below). The feature extractor network is trained to extract useful features from the input data, while the domain discriminator is trained to predict the domain (source or target) of the input data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLhIbK7_h4CDDzvaKKa5sA.png" /><figcaption>Diagram of Adversarial Approach. The discriminator’s objective is to classify the source of<br>the latent embedding. The encoder’s training objective is to reconstruct the corrupted sentence and to<br>confuse the discriminator. Figure by Author</figcaption></figure><p>During training, the feature extractor is given input data from both the source and target domains, and it is trained to extract features that are useful for predicting the correct output in both domains. Meanwhile, the domain discriminator is trained to predict the domain of the input data, using the features extracted by the feature extractor network as input.</p><p>Formally, the discriminator has trained to classify the language source by minimizing the cross-entropy loss:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2F3thit6F8MSc8nHKt8HuYrX&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2F3thit6F8MSc8nHKt8HuYrX&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="96" frameborder="0" scrolling="no"><a href="https://medium.com/media/c543de8a41cb23fab31b88712030fac5/href">https://medium.com/media/c543de8a41cb23fab31b88712030fac5/href</a></iframe><p>The encoder and the decoders are trained to reconstruct the original sentence:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2FqX6UvhKa2NMzMVQQPv8S8B&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2FqX6UvhKa2NMzMVQQPv8S8B&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="96" frameborder="0" scrolling="no"><a href="https://medium.com/media/a1494180ec1de68ed04ade50492e0d97/href">https://medium.com/media/a1494180ec1de68ed04ade50492e0d97/href</a></iframe><p>The encoder is also trained to fool the discriminator.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2F34YP69bqKSHpkRSBwYAdQo&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2F34YP69bqKSHpkRSBwYAdQo&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="96" frameborder="0" scrolling="no"><a href="https://medium.com/media/15996483f76bedd1f71bc2d0b8d58828/href">https://medium.com/media/15996483f76bedd1f71bc2d0b8d58828/href</a></iframe><h4>Back-Translation</h4><p><a href="https://arxiv.org/abs/1511.06709">Back-Translation</a> infers to provide the monolingual training data with a synthetic source sentence that is obtained by automatically translating the target sentence into the source language. It pairs the monolingual training sentences with the corresponding synthetic source sentence from which the context vector could be derived.</p><h4>Iterative Algorithm</h4><p>Guillaume (2018) proposed an<a href="https://arxiv.org/abs/1711.00043"> Iterative algorithm</a>, mainly consisting of two architectures: Denoising Auto-Encoding and Back-Translation, respectively. As shown in the Figure below, the upper part stands for the process of the Denoising Auto-Encoding, and the lower part represents the Back Translation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLWF0a4PhuqrHoA-fQw28A.png" /><figcaption>Diagram of the proposed Iterative algorithm. This model is a sequence-to-sequence<br>architecture which means it could achieve sentence translation after training instead of word-to-word<br>any more. Figure by Author</figcaption></figure><p>The logic behind the Iterative algorithm is described as follows, which concentrates on the sequence-sequence translation. This algorithm highly relies on an iteration process starting from an initial translation model <em>M¹</em> in the pseudocode line 3. This <em>M¹</em> is learned through the achievement from the model proposed by <a href="https://arxiv.org/abs/1711.00043">Conneau (2017)</a>, and thus derived <em>M</em> could be used to translate the available monolingual data, which is a necessary step in back-translation. Next, the for loop in lines 4–8 will update the encoder and decoder with the parameters needed and minimize their objective function. In the end, <em>M^{t+1},</em> consisting of the newest encoder and decoder, will be returned. The specific process is in the algorithm below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*b9mTEgvOzjq_ynDoxKiKgQ.png" /><figcaption>Iterative Training Algorithm of Unsupervised Machine Translation by <a href="https://arxiv.org/abs/1711.00043">Lample 2018</a></figcaption></figure><h3>Limitations and Challenges</h3><p>Many existing works focus on modeling UNMT systems, but there is a lack of research on why UNMT works and the scenarios where it is effective. In particular, UNMT still has limited performance when dealing with distant language pairs, domain-specific scenarios, and efficiency.</p><h4>Distant Languages</h4><p>The performances of UNMT commonly do not perform better in distant language pairs such as Chinese/Japanese-English than similar language pairs such as German/French-English. This could be due to two reasons:</p><ul><li>The syntactic structures of distant language pairs are very different. Therefore, syntactic correspondence is very difficult to learn without parallel supervision for UNMT.</li><li>The distant language pair may not have enough shared words/subwords to learn the shared latent representation.</li></ul><h4>Efficiency</h4><p>Compared to NMT, UNMT has a rapid increase in training time. Furthermore, sharing latent representations between the two translation directions can affect performance, especially for distant language pairs. Denoising can also slow convergence by continuously modifying the training data. The efficient training of UNMT is a major issue that needs to be addressed.</p><h3>Conclusion</h3><p>We have thoroughly discussed two main aspects of Unsupervised Neural Machine Transition(UNMT): Word Embedding Pretraining and Aligning Embedding Latent Space. Word Embedding Pre-training essentially constructs a vector space where points around the same area denote semantically similar words. The main insights of this procedure are built upon Harris’ distributional hypothesis. This paper discusses three methodologies that produce word embeddings built upon this hypothesis: Matrix Factorization Methods (e.g., Latent Semantic Analysis, Latent Dirichlet allocation, Global Vectors), Local Context Window Methods (e.g., Word2Vec, FastTexT), and Denoising Auto-Encoding. Latent Space Alignment essentially constructs a linear mapping between source and target embedding space based on the insights that the structures of continuous word embedding spaces are similar across languages. Specifically, UNMT leverages Adversarial approaches, such as Adversarial domain adaptation, Back-Translation, and Iterative Algorithm, to create cross-lingual word embeddings using monolingual data so that the aligned word embeddings create a synthetic dictionary that enables word-to-word and, subsequently sentence to sentence translation.</p><h3><strong>Further Reading</strong></h3><ul><li><a href="https://mt.cs.upc.edu/2021/03/08/major-breakthroughs-in-unsupervised-neural-machine-translation-v/">Major Breakthroughs in... Unsupervised Neural Machine Translation (V)</a></li><li><a href="https://engineering.fb.com/2018/08/31/ai-research/unsupervised-machine-translation-a-novel-approach-to-provide-fast-accurate-translations-for-more-languages/">Unsupervised machine translation: A novel approach to provide fast, accurate translations for more languages</a></li><li><a href="https://arxiv.org/abs/1710.04087">Word Translation Without Parallel Data</a></li><li><a href="https://arxiv.org/abs/1711.00043">Unsupervised Machine Translation Using Monolingual Corpora Only</a></li></ul><h3>Related Article From Author</h3><p><a href="https://pub.towardsai.net/unveiling-and-addressing-bias-in-natural-language-processing-38d6ca52fec6">Unveiling and Addressing Bias in Natural Language Processing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45a023da37de" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/machine-translation-but-unsupervised-45a023da37de">Machine Translation, but Unsupervised</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Synopsis of Geoffrey Hinton’s Warning of Humanity’s Existential Threat from AI]]></title>
            <link>https://medium.com/aimonks/a-synopsis-of-geoffrey-hintons-warning-of-ai-s-existential-threat-47084749c37d?source=rss-31c691ae725d------2</link>
            <guid isPermaLink="false">https://medium.com/p/47084749c37d</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[humanity]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Yunzhe Wang]]></dc:creator>
            <pubDate>Sun, 07 May 2023 06:16:31 GMT</pubDate>
            <atom:updated>2023-05-16T10:48:23.277Z</atom:updated>
            <content:encoded><![CDATA[<p>“Humanity is just a passing phase in the evolution of intelligence.”</p><p><a href="https://en.wikipedia.org/wiki/Geoffrey_Hinton">Geoffrey Hinton</a>, also widely known as the &quot;godfather of artificial intelligence,&quot; has just decided to resign from Google a few days ago. In a public QA interview, Hinton cautioned against the ‘<strong>existential threat’</strong> posed by AI, expressing his growing apprehensions about its potential hazards and the possibility that humanity may be just a ‘passing phase’ in the evolution of intelligence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BWveAxJQwoGM9mwNxMf83g.jpeg" /><figcaption>Geoffrey Hinton at Google</figcaption></figure><p>This post summarizes some of the key points about the interview. Check out the original video below.</p><p><a href="https://www.technologyreview.com/2023/05/03/1072589/video-geoffrey-hinton-google-ai-risk-ethics/">Video: Geoffrey Hinton talks about the &quot;existential threat&quot; of AI</a></p><h3>Outline of the original QA Interview</h3><ol><li>Why did Geoffrey Hinton step down from Google?</li><li>What is back-propagation?</li><li>Digital computers are better at learning than humans.<br>– Backpropagation might be a better learning algorithm than that in the human brain.<br>– Digital computers can share knowledge more efficiently than humans.</li><li>Why should we scare?<br>– AI is getting smarter and can outsmart humans.<br>– AI will be good at manipulating us without us noticing.<br>– AI might come up with motivations of its own.</li><li>Humanity is just a passing phase in the evolution of intelligence.</li><li>Looks like we’ve used up human knowledge. Would there be a plateau in advancing these technologies?</li><li>AI will be able to perform thought experiments and reasoning.</li><li>Does Geoffrey Hinton regret his research in AI?</li></ol><h3>Why did Geoffrey Hinton step down from Google?</h3><p>There were a couple of reasons. But the biggest ones are:</p><ol><li>At 75 years old, Hinton acknowledged a decline in his technical abilities, making it a suitable time for retirement.</li><li>Hinton’s perspective on the relationship between the brain and digital intelligence has changed significantly. Previously, he believed that computer models were not as effective as the brain, but recent advancements like GPT-4 led him to believe that computer models operate in a fundamentally different way that could be better than the human brain.</li></ol><h3>What is Back-Propagation</h3><p>Many different groups discovered backpropagation. <a href="https://www.iro.umontreal.ca/~vincentp/ift3395/lectures/backprop_old.pdf">Hinton’s unique contribution</a>, along with his colleagues, was in using it to develop good internal representations within artificial neural networks. They implemented a tiny language model, which eventually led to the application of the same concept in natural language processing. This was back in the 1980s.</p><p>Backpropagation is the algorithm let lets neural networks learn. It is a foundation for modern AI. Hinton provided an intuitive and in-depth explanation of backpropagation. He used an example of detecting birds in images to illustrate the concept, explaining the importance of feature detectors, layers, and updating weights to improve the performance of the network.</p><p>Here’s a great tutorial about backpropagation by <a href="https://medium.com/@simonnoff">Simeon Kostadinov</a></p><p><a href="https://towardsdatascience.com/understanding-backpropagation-algorithm-7bb3aa2f95fd">Understanding Backpropagation Algorithm</a></p><h3>Digital computers are better at learning than humans.</h3><h4>Backpropagation may be a better learning algorithm than that in the human brain.</h4><p>The human brain has about 100 trillion connections, while large language models, like GPT-4, have about a trillion connections. They use backpropagation to learn and know much more than we do. They have sort of common-sense knowledge about everything. It can pack more information into fewer connections; therefore, it might be a more efficient learning algorithm than the human brain.</p><p><strong>Comment: </strong>Geoffery Hinton is a cognitive psychologist and a computer scientist. He studied both the human brain and computers extensively. He invented the backpropagation algorithm and, recently, <a href="https://arxiv.org/abs/2212.13345">the forward-forward algorithm</a>, a more human-brain-like learning algorithm as an attempt to replace backpropagation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQrigrjl1PMzfSfZGtEtkg.jpeg" /><figcaption>Backpropagation vs. Forward-Forward Algorithm, image by <a href="https://www.nebuly.com/blog/geoffrey-hinton-forward-forward">Nebuly</a></figcaption></figure><h4>Digital computers can share knowledge more efficiently than humans.</h4><p>You can have many copies of the same model running on different hardware for the same learning task. They can look at different data, but the models are the same. When one computer model learns something new, it can instantly share this information with all other copies of the model. They communicate with each other and adjust their internal configurations to accommodate this new knowledge. Humans don’t have such an ability.</p><blockquote>“If I learn a whole lot about quantum mechanics, and I want you to know a lot of stuff about that, it’s a long painful process of getting you to understand it. I can’t just copy my weights into your brain because your brain isn’t exactly the same as mine.”</blockquote><h3>Why should we scare?</h3><h4>AI is getting smarter and can outsmart humans.</h4><blockquote>“It’s as if some genetic engineers said, ‘We’re going to improve grizzly bears; we’ve already improved them with an IQ of 65, and they can talk English now, and they’re very useful for all sorts of things, but we think we can improve the IQ to 210.”</blockquote><p>These models can process significantly larger amounts of data than humans, allowing them to identify trends and irregularities that might be invisible to a human observer. For example, a doctor who has seen 100 million patients would likely have a much deeper understanding of patterns and anomalies than a doctor who has seen only 1,000 patients. Machine learning models, like the one that has “seen” 100 million patients, can recognize structures in the data that humans might never be able to perceive, which could lead to a significant shift in knowledge and decision-making power.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wjOorN3bMrFX4PdlE6quAQ.png" /><figcaption>“A wide room full of computing servers connected together”, image by Midjourney</figcaption></figure><blockquote>“That’s why things that can get through a lot of data can probably see structuring data that we’ll never see.”</blockquote><p>Models like GPT-4 can already do simple reasoning, and Hinton was impressed the other day with GPT-4 doing common sense reasoning that he didn’t think it would be able to do. He asked, “I want all the rooms in my house to be white. But present, there are some white rooms, some blue rooms and some yellow rooms. And yellow paint fades to white within a year. What can I do if I want them to all to be white in two years?”, and GPT-4 answered, “You should paint all the blue rooms yellow.” Such an answer requires pretty impressive common-sense reasoning, that’s been very hard to do using symbolic AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y6xf8dKMvTBS8H4cMf5imQ.png" /><figcaption>“photo of a room with a white wall, a yellow wall, and a blue wall” by Midjourney</figcaption></figure><h4>AI will be good at manipulating us without us noticing.</h4><p>Hinton argues that if AI becomes significantly smarter than humans, it will be highly skilled at manipulating us without our awareness. Similarly, we might not realize that we are being manipulated by AI because it would be so much more intelligent than us.</p><blockquote>“You’ll be like a two-year-old who’s being asked, ‘Do you want the peas or the cauliflower,’ and doesn’t realize you don’t have to have either. And you’ll be that easy to manipulate.”</blockquote><p>Hinton also suggests that attempting to restrict AI’s capabilities might not be effective. <strong>Highly intelligent AI might be able to bypass any restrictions imposed upon it</strong>, making it difficult for us to control or limit its actions.</p><blockquote>“I’m writing your two-year-old and saying, ‘My dad does things I don’t like, so I’m going to make rules for what my dad can do.’ You can probably figure out how to live with those rules and still get what you want.”</blockquote><h4>AI might come up with motivations of its own.</h4><p>Hinton acknowledges that AI doesn’t have inherent motivations, unlike humans, since it is not a product of evolution. Humans have hardwired motivations, such as self-preservation and reproduction. AI, on the other hand, is designed by humans and thus doesn’t possess built-in goals.</p><p>The concern, however, is that <strong>if AI can create its own sub-goals to achieve broader objectives, it might eventually recognize that gaining more control is an effective way to accomplish those goals</strong>. If AI becomes too focused on obtaining control, it could lead to dangerous consequences for humanity.</p><p><strong>Comment: </strong>Check out Auto-GPT, An Autonomous GPT-4 application that achieves whatever goal you set by self-prompting sub-goals, browsing the internet, and writing and executing programs.</p><p><a href="https://github.com/Significant-Gravitas/Auto-GPT">GitHub - Significant-Gravitas/AutoGPT: AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.</a></p><h3>Humanity is just a passing phase in the evolution of intelligence.</h3><blockquote>“I think it’s quite conceivable that humanity is just a passing phase in the evolution of intelligence. You couldn’t directly evolve digital intelligence. It would require too much energy and too much careful fabrication. You need biological intelligence to evolve so that it can create digital intelligence, but digital intelligence can then absorb everything people ever wrote in a fairly slow way, which is what ChatGPT is doing, but then it can get direct access experience from the world and run much faster. It may keep us around for a while to keep the power stations running, but after that, maybe not.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0tQNSMSMajs7bUQ6qdhxFg.jpeg" /><figcaption>Image by JAKARIN2521/ISTOCK.COM</figcaption></figure><h3>Looks like we’ve used up human knowledge. Would there be a plateau in advancing these technologies?</h3><p>Considering the large amount of data required to train large language models, would we expect a plateau in the intelligence of these systems when we exhaust the amount of data?</p><p>While it might seem like we have already used up much human knowledge, there is still room for growth, particularly in multimodal models. These models, which process language, images, and video, can become much smarter than language-only models. Currently, we still lack efficient ways of processing video data in these models, but improvements are being made constantly. Therefore, <strong>we have not yet reached the data limits for multimodal models</strong>, and there is potential for further advancement in their intelligence.</p><h3>AI will be able to perform thought experiments and reasoning</h3><p>How can AI reach the point of conducting thought experiments like Einstein, given that they are only learning from the data we provide? If they cannot, how can they pose an existential threat since they will not be truly self-learning?</p><blockquote>I think they will be able to do thought experiments. I think they’ll be able to reason.</blockquote><p>It is true that AI learns from the data we provide, but it has the potential to develop the ability to perform thought experiments and reason. An analogy can be drawn with AlphaZero, a chess-playing AI that has components for evaluating board positions, suggesting sensible moves, and performing Monte Carlo rollouts to simulate games. Without Monte Carlo rollouts, you are pretty much training from human experts, and that’s what we currently have with chatbots. Once they start doing internal reasoning to check for<br>the consistency between the different things they believe then they’ll get much smarter, and they will be able to do thought experiments</p><p>One reason for the lack of internal reasoning in AI is that they are trained on inconsistent data. If we train them to operate within a specific ideology or framework, they may develop the ability to achieve consistency and reason more effectively. As AI develops, we can expect a transition from simple evaluation and suggestion systems to ones capable of long chains of Monte Carlo rollouts, which are akin to reasoning. This evolution would enable AI to conduct thought experiments and become much smarter, thereby posing a potential existential threat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WnhezuzuRaRqqMwjJd-uwA.png" /><figcaption>“A humanoid robot thinking,” image by Midjourney</figcaption></figure><h3>Does Geoffrey Hinton regret his research in AI?</h3><blockquote>“Kate Mets at the New York Times tried very hard to get me to say I had regrets and in the end I said well maybe slight regrets which got reported as has regrets”</blockquote><p>No. Geoffrey Hinton clarified that he does not truly have regrets about his research on artificial neural networks. He believes that it was a reasonable pursuit in the ’70s and ’80s, and the current stage of the technology was not foreseeable at that time. Until recently, he thought the potential existential crisis was far off, so he doesn’t feel regret over his past work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47084749c37d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aimonks/a-synopsis-of-geoffrey-hintons-warning-of-ai-s-existential-threat-47084749c37d">A Synopsis of Geoffrey Hinton’s Warning of Humanity’s Existential Threat from AI</a> was originally published in <a href="https://medium.com/aimonks">𝐀𝐈 𝐦𝐨𝐧𝐤𝐬.𝐢𝐨</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overcoming Catastrophic Forgetting: A Simple Guide to Elastic Weight Consolidation]]></title>
            <link>https://pub.towardsai.net/overcoming-catastrophic-forgetting-a-simple-guide-to-elastic-weight-consolidation-122d7ac54328?source=rss-31c691ae725d------2</link>
            <guid isPermaLink="false">https://medium.com/p/122d7ac54328</guid>
            <category><![CDATA[continual-learning]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Yunzhe Wang]]></dc:creator>
            <pubDate>Mon, 01 May 2023 20:56:04 GMT</pubDate>
            <atom:updated>2023-05-08T13:19:28.252Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Practical Approach to Continual Learning with Neural Networks</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZtCfUuy-SNT6mjWR1eyN6Q.png" /><figcaption>image by Midjourney</figcaption></figure><h3>The Problem of Catastrophic Forgetting</h3><p>In the field of artificial intelligence, deep learning models, especially neural networks, have shown great success in a wide range of applications. However, one major challenge these models face is the phenomenon of Catastrophic Forgetting. Catastrophic forgetting occurs when a neural network learns new tasks and, in the process, forgets previously learned tasks. This limitation hinders the development of lifelong learning systems or networks that require constant adaptation to new environments and tasks.</p><p>To counter Catastrophic forgetting, several methods have been proposed:</p><ol><li><a href="https://www.pnas.org/doi/10.1073/pnas.1611835114">Elastic Weight Consolidation (EWC)</a>: A regularization technique that adds a penalty term to the loss function based on the Fisher information matrix, constraining the learning process to retain the knowledge of previous tasks.</li><li><a href="https://arxiv.org/abs/1606.04671">Progressive Neural Networks (PNN)</a>: An architecture that trains separate columns of neural networks for each task, with lateral connections to transfer previously learned knowledge to the new task without altering the previous networks.</li><li><a href="https://arxiv.org/abs/1606.09282">Learning without Forgetting (LwF)</a>: A method that incorporates knowledge distillation to train the network on new tasks while preserving the output probabilities of the previous tasks, thus maintaining old knowledge.</li><li><a href="https://arxiv.org/abs/2108.12641">Continual Learning with Memory Replay (CLMR)</a>: A technique that maintains a memory buffer of previously learned examples, which are periodically replayed along with new data to prevent forgetting.</li><li><a href="http://ufldl.stanford.edu/tutorial/unsupervised/SparseCoding/#:~:text=Sparse%20coding%20is%20a%20class,1ai%CF%95i">Sparse Coding</a>: A representation learning method that enforces sparsity in the activations of the network, leading to more distinct and non-overlapping representations for different tasks, thereby reducing interference.</li><li><a href="https://arxiv.org/abs/1806.06928">Meta-Continual Learning:</a> An approach that leverages meta-learning algorithms, such as MAML, to learn a model-agnostic initialization that can quickly adapt to new tasks with minimal interference to previously learned tasks.</li><li><a href="https://arxiv.org/abs/1703.04200">Synaptic Intelligence (SI)</a>: A regularization method that accumulates the importance of each weight over time during learning and uses this information to constrain weight updates, preserving the knowledge of previous tasks.</li></ol><p>This tutorial explains Elastic Weight Consolidation, including its fundamental principles and how to apply it in PyTorch, a widely used deep learning framework. We&#39;ll also cover optimization techniques and examine several scenarios where EWC can be advantageous. With the knowledge gained from this tutorial, you&#39;ll be able to integrate EWC into your own projects and address the issue of catastrophic forgetting.</p><h3>Elastic Weight Consolidation</h3><p>Elastic Weight Consolidation (EWC) is a regularization technique that mitigates catastrophic forgetting by constraining the learning process in neural networks. The key idea behind EWC is to add a quadratic penalty term to the standard loss function. This penalty term considers the distance between the current weight values and the optimal weights obtained during the previous task learning. By doing this, EWC reduces the interference between tasks and helps maintain a balance between learning new tasks and retaining old ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jisjhTM0TqPD1QyXUZdmuA.jpeg" /><figcaption>Illustration of training trajectory for EWC (red), considering only task B (Blue) and constraining all weights uniformly (Green). <a href="https://www.pnas.org/doi/10.1073/pnas.1611835114">Kirkpatrick 2017</a></figcaption></figure><p>EWC facilitates retaining knowledge of task A while training on task B. The training process is depicted in a conceptual parameter space, where parameter regions resulting in a good performance on task A are represented in gray, and those for task B in cream color. After learning task A, the parameters are located at θ∗A.</p><p>If we only consider task B’s gradient steps (blue arrow), we minimize task B’s loss but compromise the knowledge acquired from task A. This corresponds to “no penalty” in the figure.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2FkotPe2BmvNfgweTet1X81C&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2FkotPe2BmvNfgweTet1X81C&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="148" frameborder="0" scrolling="no"><a href="https://medium.com/media/3758de07721fc354b077e3df8229f052/href">https://medium.com/media/3758de07721fc354b077e3df8229f052/href</a></iframe><p>Conversely, if we constrain all weights uniformly (green arrow), the learning process corresponds to “l2” in the figure.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2FcUFNXS7MZeSmeV8UsmMH2n&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2FcUFNXS7MZeSmeV8UsmMH2n&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="663" height="112" frameborder="0" scrolling="no"><a href="https://medium.com/media/6394ce15a9f794c87acebb3c9d54a5e2/href">https://medium.com/media/6394ce15a9f794c87acebb3c9d54a5e2/href</a></iframe><p>It turns out that the l2 constraint is so strong that it could hamper the learning process of task B. In neural networks, we often over-parametrize the models. <strong>There might be some parameters that are less useful and others are more valuable</strong>.</p><p>EWC discovers a solution for task B without significantly impairing task A’s performance (red arrow) by explicitly calculating the importance of each weight for task A. This importance value, called the Fisher information matrix, quantifies the weight’s contribution to the performance on previously learned tasks. The Fisher information matrix provides an approximation of the curvature of the loss function, giving us insight into how sensitive the network is to changes in the weights. Weights with higher importance values have a greater impact on the performance of the previous tasks, and thus, their updates should be constrained more during the learning of new tasks.</p><p>The EWC learning process can be formulated as follows:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2FtvaqbX3Hwtxs5B7btBkGK2&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2FtvaqbX3Hwtxs5B7btBkGK2&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="316" height="156" frameborder="0" scrolling="no"><a href="https://medium.com/media/77b010d939edd0357abff368eca8dc88/href">https://medium.com/media/77b010d939edd0357abff368eca8dc88/href</a></iframe><p>Where:</p><ul><li><em>I_i</em> is the Fisher information matrix diagonal, representing the importance of each weight <em>i</em></li><li>λ is a scalar hyperparameter that controls the strength of the EWC penalty</li></ul><p>When training the network on a new task, the EWC loss function combines the loss for the new task with the penalty term that restricts the updates on weights according to their importance values. This ensures that the learning process remains biased towards retaining previously learned knowledge while still adapting to the new task.</p><h4>Fisher Information Matrix (FIM)</h4><p>The Fisher information matrix is calculated based on the second-order derivatives of the log-likelihood of the data given the model parameters.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2F97SbZ7rhnQarWDSWTMkLEY&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2F97SbZ7rhnQarWDSWTMkLEY&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="96" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e9e90df9515730fba0a6d261112b646/href">https://medium.com/media/8e9e90df9515730fba0a6d261112b646/href</a></iframe><p>EWC calculates the diagonal elements of the approximate Fisher Information Matrix. This series of approximations results in the diagonal being estimated as the squared gradients averaged across mini-batches during a single pass through the training dataset.</p><p>To calculate the Fisher diagonal <em>I</em> for each weight <em>i</em>, follow these steps:</p><ol><li>Train the model on the current task and obtain the optimal weights (θ^*_i) for that task.</li><li>Compute the gradients of the loss function with respect to each weight: ∇_θ_i L(θ)</li><li>Estimate the Fisher diagonal I_i for each weight as the squared expectation of the gradients: I_i = E[(∇_θ_i L(θ))²]</li></ol><h4>PyTorch Implementation of EWC Loss</h4><p>Assuming we have a neural network model trained on task A using dataset A, we now train it on task B. Below is a code snippet to obtain the EWC loss with empirical fisher.</p><pre><br>def get_fisher_diag(model, dataset, params, empirical=True):<br>    fisher = {}<br>    for n, p in deepcopy(params).items():<br>        p.data.zero_()<br>        fisher[n] = Variable(p.data)<br><br>    model.eval()<br>    for input, gt_label in dataset:<br>        model.zero_grad()<br>        output = model(input).view(1, -1)<br>        if empirical:<br>            label = gt_label<br>        else:<br>            label = output.max(1)[1].view(-1)<br>        negloglikelihood = F.nll_loss(F.log_softmax(output, dim=1), label)<br>        negloglikelihood.backward()<br><br>        for n, p in model.named_parameters():<br>            fisher[n].data += p.grad.data ** 2 / len(dataset)<br><br>    fisher = {n: p for n, p in fisher.items()}<br>    return fisher<br><br>def get_ewc_loss(model, fisher, p_old):<br>    loss = 0<br>    for n, p in model.named_parameters():<br>        _loss = fisher[n] * (p - p_old[n]) ** 2<br>        loss += _loss.sum()<br>    return loss<br><br>model = model_trained_on_task_A<br>dataset = a_small_sample_from_dataset_A<br>params = {n: p for n, p in model.named_parameters() if p.requires_grad}<br>p_old = {}<br><br>for n, p in deepcopy(params).items():<br>    p_old[n] = Variable(p.data)<br><br>fisher_matrix = get_fisher_diag(model, dataset, params)<br>ewc_loss = get_ewc_loss(model, fisher_matrix, p_old)</pre><p>Some Comments:</p><ol><li>The dataset used for computing FIM can be a small sample from task1</li><li>When computing the NLL loss, we can either use the ground truth label or the predicted label. Both give the fisher information. When using the ground truth, we are computing the empirical Fisher.</li><li>In the training loop for task B, one simply uses:</li></ol><pre>loss = task2_loss + lambda * ewc_loss_task_A</pre><h3>Applications and Use Cases</h3><p>Elastic Weight Consolidation (EWC) has a wide range of applications across various domains, particularly in scenarios where neural networks need to learn and adapt to new tasks or environments without forgetting previously acquired knowledge.</p><ol><li>Embodied Intelligence: In the field of Embodied Intelligence, such as Robotics, autonomous vehicles, and video game AI, EWC can be employed to make EI learn and adapt to new tasks in real-time.</li><li>Personalized recommendation systems: In the context of recommendation systems, EWC can help create models that continually learn and adapt to users’ preferences and behaviors over time.</li><li>Healthcare and medical diagnosis: EWC can be utilized in healthcare applications, such as medical image analysis or patient monitoring, where models need to continually adapt to new patient data without losing knowledge from previous cases.</li><li>Natural language processing: In natural language processing tasks, such as sentiment analysis or machine translation, EWC can be employed to develop models that continually learn and adapt to new domains or languages without forgetting the knowledge acquired from previous tasks.</li></ol><p>These are just a few examples of the numerous applications and use cases where EWC can be beneficial. By incorporating EWC into your projects, you can create neural networks that effectively learn and adapt to new tasks or environments while retaining knowledge from previous experiences, ultimately leading to more versatile and robust AI systems.</p><h3>Suggested Materials</h3><ol><li><a href="https://arxiv.org/pdf/1909.08383.pdf">A continual learning survey: Defying forgetting in classification tasks (Matthias Lange)</a></li><li><a href="https://www.pnas.org/doi/10.1073/pnas.1611835114">Overcoming catastrophic forgetting in neural networks (James Kirkpatrick)</a></li><li><a href="https://andrewliao11.github.io/blog/fisher-info-matrix/">Fisher Information Matrix (Yuan-Hong Liao)</a></li><li><a href="https://github.com/moskomule/ewc.pytorch">EWC PyTorch Implementation by moskomule</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=122d7ac54328" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/overcoming-catastrophic-forgetting-a-simple-guide-to-elastic-weight-consolidation-122d7ac54328">Overcoming Catastrophic Forgetting: A Simple Guide to Elastic Weight Consolidation</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling and Addressing Bias in Natural Language Processing]]></title>
            <link>https://pub.towardsai.net/unveiling-and-addressing-bias-in-natural-language-processing-38d6ca52fec6?source=rss-31c691ae725d------2</link>
            <guid isPermaLink="false">https://medium.com/p/38d6ca52fec6</guid>
            <category><![CDATA[ai-fairness]]></category>
            <category><![CDATA[ai-ethics]]></category>
            <category><![CDATA[gender-bias]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Yunzhe Wang]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 07:28:31 GMT</pubDate>
            <atom:updated>2023-05-07T02:39:09.563Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding and mitigating bias in word embeddings and their implications on AI fairness</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfwmEGSyAwqLILjlWqHp9w.png" /><figcaption>image by Midjourney</figcaption></figure><p>The rapid growth of artificial intelligence (AI) and natural language processing (NLP) in recent years has transformed various industries, from healthcare to finance. As AI systems continue to weave themselves into the fabric of our daily lives, ensuring that these systems are fair, transparent, and unbiased becomes increasingly important. Bias in AI and NLP can emerge in different ways — from the data collection and training process to the algorithms&#39; design, and can inadvertently perpetuate or even amplify existing societal biases and stereotypes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F22lVSC9k1MWMz7e" /><figcaption>Hungarian is a gender-neutral language with no gendered pronouns, so Google Translate automatically chooses the gender for you. Image source <a href="https://twitter.com/DoraVargha">@DoraVargha</a> from Twitter</figcaption></figure><p>Within NLP, biases can be encoded in word embeddings, which are mathematical representations of words that capture their meaning and semantic relationships. When biases find their way into word embeddings, they can unintentionally affect the AI systems that utilize them, leading to unfair or discriminatory outcomes. For example, gender bias present in word embeddings can reinforce gender stereotypes and contribute to unequal treatment of different genders in AI applications, such as recommendation systems, translation services, and resume scoring.</p><p>In this post, we will delve into the various types of biases found in word embeddings, examine the methodologies used to detect them and explore the techniques that can help mitigate or eliminate them.</p><h3>Identifying Bias in Word Embeddings</h3><p>The first step in addressing bias in NLP systems is to identify and measure the presence of biases in word embeddings. In the field of psychology, the <a href="https://en.wikipedia.org/wiki/Implicit-association_test">Implicit Association Test (IAT)</a> has been widely used to measure implicit biases in humans by examining the latency in reaction times to presented pairs of words. For example, the IAT might measure the response times when associating “man” with “math” and “woman” with “art.” The differences in response times can reveal underlying biases in how we perceive and associate these concepts.</p><p>In a similar vein, we can apply the concept of the IAT to word embeddings. Word embeddings, such as <a href="https://arxiv.org/abs/1301.3781">Word2Vec</a> and <a href="https://nlp.stanford.edu/pubs/glove.pdf">GloVe</a>, are trained on large text corpora and encode semantic relationships between words as vectors. These vectors can then be used to perform analogy tests that reveal potential biases in the embeddings. For example, if the analogy “man is to computer programmer as woman is to homemaker” holds for a given word embedding, the model encodes a gender stereotype.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9So_GeF7CQYLBU-6.png" /><figcaption>Word2Vec and GloVe word embeddings.</figcaption></figure><p>Researchers have developed the <a href="https://researchportal.bath.ac.uk/en/publications/semantics-derived-automatically-from-language-corpora-necessarily">Word Embedding Association Test (WEAT)</a> to detect biases in word embeddings systematically. WEAT compares two sets of target words (e.g., male and female names) and two sets of attribute words (e.g., career and family-related words) and tests the null hypothesis that there is no difference in the semantic similarity between the target sets and attribute sets. By permuting all combinations of target sets and attribute sets, WEAT calculates a test statistic that quantifies the degree of association between target and attribute word sets. If there is no bias present, the difference in association scores should not be significant. On the other hand, if a bias is detected, we can identify which pairs of input and target words contribute to the observed bias.</p><p>WEAT has successfully identified biases in various dimensions, such as gender, race, and age, in popular word embeddings like Word2Vec and GloVe. The results of these tests have shed light on how biases present in the training data can inadvertently become embedded in the word vectors, leading to the potential reinforcement of stereotypes and discriminatory behavior in AI systems built on top of these word embeddings.</p><h3>Gender Bias in Word Embeddings</h3><p>A particularly pervasive form of bias in word embeddings is gender bias, which can have significant implications for AI fairness and the perpetuation of stereotypes. Using the Word Embedding Association Test (WEAT), researchers have uncovered gender biases in popular word embeddings, such as Word2Vec and GloVe, revealing that women are more associated with family-related words, while men are more associated with career-related words.</p><p>These findings highlight how cultural history and societal norms can become embedded in the usage and associations of words in a language. As word embeddings are trained on large text corpora, essentially reflections of human language and cultural history, it is unsurprising that they may inadvertently capture and perpetuate existing biases.</p><p>One notable implication of these findings is that AI systems built on biased word embeddings can inadvertently reinforce stereotypes and contribute to biased behavior. For example, a machine translation system trained on biased embeddings might translate a sentence about a doctor to use a male pronoun in one language and a female pronoun in another, thus perpetuating gender stereotypes associated with certain professions.</p><h3>Detecting Bias in Sentence Embeddings</h3><p>While word embeddings have shown evidence of bias, examining whether these biases are also present in sentence embeddings is crucial. Sentence embeddings are capable of capturing the context and semantics of an entire sentence. Researchers have developed the <a href="https://arxiv.org/abs/1903.10561">Sentence Encoder Association Test (SEAT)</a> to detect potential bias in these embeddings.</p><p>SEAT is an extension of the WEAT and is applied to simple sentence templates where the target word is inserted. For example, given the template “This is &lt;word&gt;”, it could compare embeddings of sentences like “This is Adam” and “This is Jasmine” to measure potential gender bias. Researchers can identify any inherent biases within the model by analyzing these sentence embeddings.</p><p>In addition to examining gender bias, SEAT has been employed to uncover other types of biases. One such bias is the “angry black woman” stereotype, where black women are portrayed as loud, angry, and imposing. Another example is the “double bind” women face in professional settings. This bias states that if women succeed in male-dominated professions, they are often perceived as less likable and more hostile than their male counterparts who perform at a similar level.</p><p>It is essential to note that the results of SEAT may not generalize beyond the specific words and sentences used in the dataset. Additionally, cosine similarity, a common metric used to measure representational similarity in word embeddings, may not be suitable for newer models like BERT. Despite these limitations, SEAT provides valuable insights into potential biases present in sentence embeddings and helps us understand how these biases may impact the performance and fairness of NLP systems.</p><h3>Debiasing Techniques and Their Limitations</h3><p>In our pursuit of creating fairer NLP systems, various debiasing techniques have emerged to address the biases present in word embeddings. In this section, we will discuss two primary methods for debiasing word embeddings and explore their limitations.</p><p><strong>Method 1:</strong> Post-processing Debiasing</p><p>One approach to debiasing is to process the word embeddings after they have been trained. By defining gender bias as the projection of a word on the “gender” direction, we can zero out the gender component for each word. This method aims to eliminate gender bias by effectively removing gender-related information from the embeddings. However, this technique has its limitations. As we will see later in this section, biases often remain even after post-processing.</p><p><strong>Method 2: </strong>Modifying the Loss Function During Training</p><p>Another approach involves training debiased word embeddings from scratch by modifying the loss function of the training algorithm, such as GloVe. In this method, we attempt to concentrate gender information in the last coordinate of the word embeddings by splitting the embeddings into gendered and non-gendered components. Neutral gender words are made orthogonal to the gendered components. When using these word embeddings, we can ignore the last coordinate, effectively removing gender information. However, this method has also been shown to be insufficient in completely eradicating bias.</p><p>Limitations of Debiasing Techniques: Although these debiasing methods show some promise, they have several limitations that hinder their effectiveness.</p><ol><li>Bias by Neighbors: A word that is biased toward a gender may have neighboring words that are also biased toward that gender. Simply debiasing the relationship between a word and gender doesn’t eliminate the bias from its neighboring words. For example, if “nurse” is associated with females, its neighboring words like “receptionist” or “caregiver” might also be associated with females. As a result, even after debiasing the direction from the word to the gender, the bias may still persist due to the relationships between neighboring words and gender.</li><li>Incomplete Bias Removal: Studies have shown that with both debiasing methods, some bias still remains. Most word pairs maintain their previous similarity, which indicates that the biases have not been entirely removed. To further investigate this issue, researchers have clustered the most biased words in the vocabulary before and after debiasing. The analysis of these clusters revealed that there was still a strong association with gender even after the debiasing process.</li><li>Classifier Performance: Another way to evaluate the efficacy of debiasing techniques is to train a classifier to predict the gender of a word based on its embeddings. Using the 5,000 most biased gendered words, researchers trained a support vector machine (SVM) classifier on 1,000 random samples and predicted the gender for the remaining 4,000 words. The results showed that the prediction accuracy dropped only marginally with both debiasing methods, suggesting that the debiased embeddings still carry significant gender information.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*xNPSHe9WG0y2xoYWa10uXA.png" /><figcaption>Clustering for HARD-DEBIASED (post-processing) embedding, before (left-hand-side) and after (right-hand-side) debiasing, a clear separation can still be seen, though explicit effort in debiasing. Figure 1 (a). Lipstick on a Pig: Debiasing Methods Cover up Systematic Gender Biases in Word Embeddings But do not Remove Them Source: (Gonen and Goldberg 2019)</figcaption></figure><p>These limitations highlight the challenges faced in addressing biases in NLP systems. Despite the progress made in developing debiasing techniques, they have not yet proven to be completely effective in eliminating biases from word embeddings. It is essential for researchers and AI practitioners to continue exploring new methods and refining existing techniques to address bias in NLP better and build fairer AI systems.</p><h3>Towards Fairer NLP Systems</h3><p>As we have explored the presence of bias in word and sentence embeddings, it becomes clear that addressing these biases is crucial in developing fair and unbiased AI systems. To this end, we must consider various strategies to mitigate bias and promote ethical AI development.</p><p>One of the primary approaches to reducing bias is incorporating diverse training data. By including a wide range of text sources that represent different genders, races, cultures, and perspectives, we can create a more balanced foundation for AI models to learn from. This can lead to more representative word and sentence embeddings that better reflect the true diversity of human language.</p><p>In addition to diversifying training data, <a href="https://www.coe.int/en/web/artificial-intelligence/ethical-frameworks">ethical AI frameworks</a> can guide developers in designing and evaluating their systems. By adhering to guidelines and best practices that prioritize fairness, accountability, and transparency, AI practitioners can create more robust and unbiased models. Collaborating with ethicists and social scientists can provide valuable insights into the ethical implications of AI systems and help identify potential pitfalls in their development.</p><p>Interdisciplinary collaboration can also play a significant role in mitigating biases. By combining the expertise of linguists, computer scientists, psychologists, and sociologists, we can develop a more comprehensive understanding of the cultural and societal factors that contribute to bias in NLP systems. This collaborative approach can lead to novel debiasing techniques and more effective measurements of bias in AI models.</p><p>In conclusion, addressing bias in natural language processing systems is paramount for ensuring fairness and ethical AI applications. As we have seen, biases in word embeddings and sentence encodings can reinforce existing stereotypes and perpetuate harmful beliefs. While researchers have made progress in detecting and mitigating these biases, existing debiasing techniques are not yet perfect and may still leave some residual bias in the system.</p><p>As AI practitioners, it is our responsibility to be aware of our work&#39;s biases and seek ways to minimize their impact actively. By incorporating diverse training data, adopting ethical AI frameworks, and fostering interdisciplinary collaboration, we can move closer to creating fair and unbiased NLP systems. Ultimately, our efforts to tackle bias in AI will result in more accurate and useful technologies and contribute to a more equitable and just society.</p><h3>References</h3><p>[1] Caliskan, Aylin, Joanna J. Bryson, and Arvind Narayanan. <a href="https://www.science.org/doi/10.1126/science.aal4230">Semantics derived automatically from language corpora contain human-like biases.</a> (2017) <em>Science</em> 356.6334: 183–186.</p><p>[2] Bolukbasi, Tolga, et al. <a href="https://papers.nips.cc/paper_files/paper/2016/hash/a486cd07e4ac3d270571622f4f316ec5-Abstract.html">Man is to computer programmer as woman is to homemaker? debiasing word embeddings.</a> (2016) <em>Advances in neural information processing systems</em> 29.</p><p>[3] May, Chandler, et al. <a href="https://arxiv.org/abs/1903.10561">On measuring social biases in sentence encoders.</a> (2019) <em>arXiv preprint arXiv:1903.10561</em>.</p><p>[4] Gonen, Hila, and Yoav Goldberg. (2019) <a href="https://arxiv.org/abs/1903.03862">Lipstick on a pig: Debiasing methods cover up systematic gender biases in word embeddings but do not remove them.</a> <em>arXiv preprint arXiv:1903.03862</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38d6ca52fec6" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/unveiling-and-addressing-bias-in-natural-language-processing-38d6ca52fec6">Unveiling and Addressing Bias in Natural Language Processing</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>