<?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 Siddharth Sharma on Medium]]></title>
        <description><![CDATA[Stories by Siddharth Sharma on Medium]]></description>
        <link>https://medium.com/@siddrrsh?source=rss-2fc75df15f8e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8egTPwnmardHAGO6NDDidQ.png</url>
            <title>Stories by Siddharth Sharma on Medium</title>
            <link>https://medium.com/@siddrrsh?source=rss-2fc75df15f8e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:36:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@siddrrsh/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[Notes on Data-Intensive Systems, Serverless Compute, & Orchestration]]></title>
            <link>https://medium.com/@siddrrsh/notes-on-data-intensive-systems-serverless-compute-orchestration-756727be84f5?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/756727be84f5</guid>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Tue, 30 Jan 2024 16:24:45 GMT</pubDate>
            <atom:updated>2024-01-30T22:41:11.523Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*JJYJprkmVcctmPWR.png" /><figcaption>Musings of the Cloud (xkcd 908)</figcaption></figure><p>If attaining performance in machine learning is analogous to a car, then data is the fuel, and the compute is the motor. When I first began working in machine learning, I kept hearing that data is the most critical part of the workflow. It’s true to a degree — without quality and high-confidence data relevant to the particular task, machine learning processes tend to run into several roadblocks when it comes to performance. Rather than squeeze out performance from data alone, research scientists across academic institutions and industry labs have realized that there are significant performance benefits when training with scaled-up compute resources. What was once a hypothesis regarding how to improve capabilities has become a practice of throwing as much compute as possible at a task:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*CivX-sXmrWqwcL9w.jpg" /></figure><p>The benefits of an NVIDIA A100 vs H100 are consequential when it comes to tasks like AI training and inference. Imagine the benefits of working with 100 GPUs versus 1000 and 10,000. The differences would equate to orders of magnitude. Thus, it comes as no surprise that GPUs are in high demand. One could argue that if everyone could access GPUs then we could unlock the ability to solve problems that lie in currently intractable search spaces. <em>AlphaFold</em> and <em>AlphaCode</em> are strong initial cases due to the impressive results simply achieved through the sheer brute force of optimized parallel computation.</p><p>The ultimate advantage of modern computing is the ability to perform statistical pattern recognition at an unprecedented scale. In Rich Sutton’s famous blog titled “The Bitter Lesson”, the key idea follows suit in that general methods leveraging computation tend to be superior to methods relying on human-crafted knowledge, especially in the long term. This disparity is largely due to the exponentially decreasing cost of computation, following Moore’s Law. Historical trends in AI, exemplified in fields like computer chess, Go, speech recognition, and computer vision, consistently show that approaches using massive computation, such as deep search and learning, eventually outperform those based on human knowledge. One great example is a Monte Carlo Tree Search (MCTS) algorithm and its applications in game-playing: instead of depending on predefined strategies or expert knowledge, MCTS uses random sampling and statistical methods to make decisions that are either guided towards exploration or exploitation. This approach allows MCTS to discover novel strategies and gameplay tactics, often surpassing human intuition and expertise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*kxGQ0-9eK8b0_YwV.jpg" /><figcaption>Rich Sutton, father of RL</figcaption></figure><p>AI’s success in game-playing (rich solution spaces with well-structured rewards) alongside the ideas from Sutton emphasizes that while integrating human knowledge can yield short-term gains, it often plateaus and may hinder further progress. Breakthroughs in AI have predominantly come from scaling up computation through search and learning methods. In this article, we walk through the history of large-scale data-oriented systems, understand recent developments in the cloud with containerized applications, and then explore the future of serverless computing and orchestration.</p><h3><strong>Modern Challenges</strong></h3><p>Training large language models across multiple GPUs in a distributed system presents a host of intricate challenges, spanning both hardware constraints and software complexities. One of the primary hurdles is the <strong>synchronization overhead</strong>, essential for keeping the model’s state consistent across all units. This synchronization, particularly with models harboring an extensive number of parameters, can significantly slow down the training process due to the time-consuming overhead it incurs.</p><p>Additionally, <strong>memory bandwidth</strong> and transfer speeds are critical bottlenecks. The data transfer between GPUs, especially in models that demand substantial memory, can hinder efficiency. Technologies like NVIDIA’s NVLink or AMD’s Infinity Fabric play pivotal roles in this context, with their speeds being crucial for swift data transfer. However, limited bandwidth can lead to GPUs idling as they wait for data, thereby prolonging the training time or leading to CUDA out-of-memory issues.</p><p><strong>Effective load balancing</strong> is also paramount. Distributing the computational workload evenly across all GPUs is a complex task. It involves not just partitioning (sharding) the model but also the data in an efficient manner. An imbalance in this distribution can lead to the underutilization of some GPUs while overburdening others, culminating in an inefficient use of resources. Thus, precision allocation of workloads is a challenge in its own right.</p><p>The <strong>finite memory capacity</strong> of each GPU is another constraint. Given that large models or batch sizes can exceed this capacity, strategies like model parallelism or gradient checkpointing become necessary. However, these strategies introduce their own complexities and can potentially hurt efficiency. Moreover, the software and frameworks facilitating distributed computing need to be optimized to leverage multi-GPU training effectively. Any inefficiency in these tools can negate the benefits of the underlying powerful hardware. One library</p><p>Communication &amp; <strong>networking costs</strong>, especially in multi-node clusters, pose additional challenges. The time and resources required for inter-GPU communication, particularly between GPUs in different nodes, can be substantial. Such high communication costs can erode the advantages of parallel processing, leading to a situation where increasing the number of GPUs offers diminishing returns. Furthermore, the <strong>scalability</strong> of the system is a concern. As the number of GPUs scales up, so does the complexity of efficiently managing the training process, often resulting in lesser gains than expected due to increased communication and synchronization overheads. Additionally, the energy consumption of large-scale distributed training can be considerable, raising operational costs.</p><h3><strong>History of Large-Scale Data Processing</strong></h3><p>If we approach modern machine learning applications and deployment from an architecture lens, distributed systems for data processing and serving have become the paradigm for enabling ML workflows at scale. Whether it be data labeling or model inference, handling massive amounts of queries or examples requires flexible and scalable computing frameworks. From a first-principles view, distributed systems can be defined as large-scale groups of computers (a cluster) or even multi-cluster networks that execute operations in a fault-tolerant and resilient manner. From the earlier section of this piece, you could note that general-purpose computation methods are the ones to index on — distributed systems supply the raw scalability to employ such methods on vast amounts of data. In the early 2000s, Google, grappling with the challenge of indexing an exponentially growing web, developed MapReduce. The architects of this system — Jeff Dean and Sanjay Ghemawat — are icons in the Google lore and the tale of the internet. Their programming model revolutionized data processing by splitting tasks into two phases: ‘Map’ to process and convert data into key-value pairs, and ‘Reduce’ to aggregate these results. The scalability of MapReduce came from its ability to distribute these tasks across numerous computers, handling each chunk of data in parallel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/0*5cS9ie4eudrGjqoQ.jpg" /><figcaption>Two Google Legends: Jeff and Sanjay</figcaption></figure><p>Hadoop, an open-source framework inspired by MapReduce and GFS (Google File System), emerged to bring these capabilities to the broader tech world. At Hadoop’s core was the Hadoop Distributed File System (HDFS), a scalable and fault-tolerant storage system designed to run on commodity hardware, alongside MapReduce for processing. Hadoop’s YARN (Yet Another Resource Negotiator) later evolved as a cluster management component, enhancing the system’s ability to handle diverse data processing tasks beyond just MapReduce, thereby improving resource utilization and scheduling.</p><p>A few years later, Apache Spark was developed in response to the limitations of Hadoop’s MapReduce, especially in terms of speed. Spark introduced an in-memory data processing capability, dramatically reducing the heavy reliance on disk I/O and improving speeds by orders of magnitude, particularly for iterative algorithms and interactive data exploration. Spark’s resilient distributed datasets (RDDs) and its ability to run computations in memory made it highly efficient for a range of applications, from machine learning to stream processing.</p><p>In parallel, Apache Mesos emerged as a solution for more dynamic resource sharing across distributed applications. Unlike YARN, which was closely tied to Hadoop, Mesos provided a more generalized cluster management solution, capable of running Hadoop and other applications like Spark, thereby offering greater flexibility and resource efficiency. This technological evolution from MapReduce to Hadoop, and then to Spark and Mesos, represents a foundational shift in big data processing. It encapsulates the transition from single-server limitations to the expansive, distributed computing landscapes we see today, driven by the need to harness and extract insights from ever-growing data volumes in a scalable, efficient manner. With the scale presented by large language models, there has become a need for data-intensive systems that can provide an optimized user experience alongside heavy scalability. From the systems I’ve encountered, I’d argue that the four key ideas to maintain the integrity and robustness of a scalable big data system are:</p><ul><li>1. Strong performance (low latency, high throughput)</li><li>2. Reliability, availability, and flexibility (scale up and down)</li><li>3. Low-cost and competitive pricing</li><li>4. Ease of use (as simple as can be)</li></ul><h3><strong>The Cloud &amp; Containerization</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*HaZFFoEeZgYAs8ONq7rZiA.png" /><figcaption>The Cloud Race</figcaption></figure><p>Following the advent of large-scale data processing systems like MapReduce and Hadoop in the 2000s, the 2010s introduced the era of the modern public cloud — built on the ability to provide services for data and SaaS applications at scale. The rise of the cloud, pioneered by AWS’s launch of Elastic Compute (now EC2) in 2006, marked a significant shift in IT infrastructure management. AWS’s approach, born from the need to support its growing e-commerce platform, evolved into a highly scalable, shared infrastructure model, drastically reducing application build times and costs. Microsoft Azure, entering the market later in 2010, under Satya Nadella’s leadership, shifted Microsoft’s focus to a cloud-first strategy, incorporating acquisitions like LinkedIn and Github to bolster its cloud offerings. Google Cloud Platform, starting with its App Engine in 2008, has focused on industry-specific services and partnerships under Thomas Kurian’s direction. This competitive landscape among the three giants has accelerated cloud innovation and accessibility, profoundly impacting businesses’ approach to IT infrastructure.</p><p>The major question with the cloud is the idea of vendor lock-in as well as choosing what vendor to pick. Yet, various containerized applications, particularly Docker and Kubernetes (K8s), also began to play a pivotal role in the ecosystem of public cloud providers like AWS, Azure, and GCP. These platforms offer a standardized way to package and deploy applications across various environments, ensuring consistency and efficiency. Cloud providers have integrated these container technologies into their platforms, offering services like Amazon ECS and EKS, Azure Kubernetes Service, and Google Kubernetes Engine. This integration allows businesses to leverage the scalability and flexibility of the cloud while maintaining the portability and ease of management provided by containerization.</p><p>From a technical lens, Docker is a platform that utilizes OS-level virtualization to deliver software in packages called containers. These containers are isolated but can communicate with each other via well-defined channels. Kubernetes (K8s) is an orchestration system for managing containerized applications across a cluster of nodes. It automates deployment, scaling, and management of application containers, ensuring high availability and resource optimization. Both Docker and K8s emphasize modular, microservices-based architectures, promoting agility, scalability, and resilience in application deployment and management.</p><p>The key lesson from the evolution of the modern public cloud and containerized applications is a trend towards a <strong>more serverless, automated computing environment — frameworks built with simplicity at the core</strong>. This progression emphasizes the importance of scalability, flexibility, and efficiency in resource utilization. The abstraction of underlying infrastructure complexities, as seen in container and serverless technologies, allows developers and organizations to focus more on application development rather than on managing servers. This shift is increasingly leading towards an era where workload allocation, resource optimization, and scaling up and down are inherently managed by the system, enabling more agile and cost-effective software development and deployment.</p><h3><strong>Looking to the Future: The Case for Serverless</strong></h3><p>I want to dive deeper into the ideas behind serverless computing and the more general idea of implicit orchestration of compute and application resources. With LLMs, we’re closer than ever to having models that can perform optimal decision-making and solve problems in resource allocation. Serverless computing, despite its name, still relies on servers but abstracts their management from the user. In this context, serverless often refers to Functions-as-a-Service (FaaS), where the focus is on individual functions handling specific tasks. These functions offer a simplified API and lifecycle compared to more complex structures like containers. This simplification aligns well with common web operations like responding to requests or server-side rendering. The transformative aspect lies in its <em>invocation-based approach</em>, rather than maintaining a continuous process. This model offers streamlined orchestration, scalability, and deployment, fitting the needs of businesses focused on rapid, scalable compute solutions. Serverless architectures also bring benefits like automatic multi-region deployment and easy failover, continuously evolving to enhance developer experience and computational efficiency:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mLjk8oPPyg0S7d746dHn9Q.png" /><figcaption><a href="https://medium.com/u/44b51cc1d513">Guillermo Rauch</a> on X</figcaption></figure><p><strong>Vercel</strong> is one company advancing the state-of-the-art in serverless compute: they are building a frontend cloud that optimizes webpage rendering and performance while avoiding the clunkiness of typical container management. <strong>Pinecone</strong>, a vector DB provider, is another strong example of the case for serverless:</p><blockquote>There are no pods, shards, replicas, sizes, or storage limits to think about or manage. Simply name your index, load your data, and start querying through the API or the client. There’s nothing more to it.</blockquote><blockquote>— Edo Liberty, CEO and Founder of Pinecone</blockquote><p>Pinecone’s recent transition emphasizes the evolution of a serverless vector database, specifically tailored for GenAI applications. Emphasizing the significance of knowledge in AI, they highlight how access to extensive data improves AI application performance. The redesigned database offers up to 50 times lower costs, with a focus on ease of use, scalability, and efficient vector-search performance. Notable features include the separation of reads, writes, and storage, innovative indexing and retrieval algorithms, and a multi-tenant compute layer. This serverless solution enables developers to focus more on application development rather than infrastructure management. It may seem too good to be true but Pinecone is not sacrificing optimization for ease of use: Just like their existing pod-based indexes, the serverless implementation supports live index updates, metadata filtering, hybrid search, and namespaces to let the user have the most control of their data.</p><p>Performance is also preserved: when queries are more frequent (greater caching locally in multi-tenant workers), serverless indexes provide significantly lower latencies compared to pod-based indexes, with roughly the same level of recall.</p><h4><strong>The final piece: Orchestration</strong></h4><p>Serverless is just one piece of the pie towards a timeless theme in computing: simplistic abstraction with robust optimization hidden away from the user. In the context of serverless and cloud computing, <strong>orchestration </strong>refers to the automated arrangement, coordination, and management of complex computer systems, middleware, and services. It’s about managing the interactions and dependencies between numerous cloud-based components and services: pods, containers, surrounding infra, etc. We’re trending towards a future where orchestration could evolve to be nearly completely automatic and driven by independent ML planning. This would involve systems that can learn from their environment and user demands, dynamically adapting and optimizing workflows, resource allocation, and responses to changes in real time. Such advancements could significantly enhance efficiency, reduce manual oversight, and streamline cloud operations. The key challenge in the immediate horizon and for 2024 is likely <strong>heterogeneity</strong>: connecting unaligned resources whether it be different workload shapes and types, different hardware and GPUs, different networks and servers, different tasks, etc.</p><p>The ultimate beauty of compute and the cloud is that ease of use is not at odds with performance as one would typically be encouraged to think. Such an economic tradeoff is more easily definable at the optimum between user control and abstraction: for various use cases, there are times when being more elastic and having system-level fluctuations hidden underneath is more ideal, and in other cases, users may prefer the ability to have more control. Going back to the initial example of a car, it’s not in human nature to initially have our hands totally off the wheel even in a fully autonomous vehicle. For designing distributed systems for solving problems in ML, I encourage all to chase the frontier of simplicity and user-oriented abstraction.</p><blockquote>“I don’t need a hard disk in my computer if I can get to the server faster… carrying around these non-connected computers is byzantine by comparison.”</blockquote><blockquote>— <a href="http://www.forbes.com/sites/briancaulfield/2011/10/27/unbelievable-video-shows-steve-jobs-thinking-about-cloud-computing-14-years-ago/"><strong>Steve Jobs</strong></a>, late chairman of Apple (1997)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=756727be84f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Oppenheimer: Why the Truth must Prevail]]></title>
            <link>https://medium.com/@siddrrsh/oppenheimer-the-truth-only-the-truth-in-the-face-of-power-99bc329c0905?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/99bc329c0905</guid>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 23:50:38 GMT</pubDate>
            <atom:updated>2023-07-25T21:05:01.336Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“We do not believe any group of men adequate enough or wise enough to operate without scrutiny or without criticism. We know that the only way to avoid error is to detect it, that the only way to detect it is to be free to enquire. We know that the wages of secrecy are corruption. We know that in secrecy error, undetected, will flourish and subvert.” — Dr. J. Robert Oppenheimer</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*StQeHVNT6TXf8rvP.jpg" /><figcaption>TIME Magazine, November 8th, 1948</figcaption></figure><p>Power is a dangerous thing. The morally corrupted may seek to be politically uncorrupt. The politically corrupted may seek to be morally uncorrupt. When our very existence is at stake, is power the deterrent, or is it the reason for our impending collapse?</p><p>There are some noticeable and poignant lessons in Christopher Nolan’s Oppenheimer. The power of talented individuals organized towards a uniform and inspiring mission … the ability to harness science and technology to achieve the impossible … the fine line between moral responsibility and ethical action. In our current era with hauntingly similar calls to <a href="https://futureoflife.org/open-letter/pause-giant-ai-experiments/">pause large-scale AI experiments</a>, I believe that the true modern message of Oppenheimer is at the junction that lies between <em>truth</em> and<em> power</em>.</p><p>In the final scene of Christopher Nolan’s production, Dr. J. Robert Oppenheimer stands amongst a pond in Princeton, NJ as he speaks with Albert Einstein. The two discuss the series of calculations that suggested any successful nuclear explosion might start a neverending chain reaction, setting fire to the atmosphere and ending life on Earth. The calculations were incorrect and the nonzero possibility of immediate apocalypse is rendered zero but a more insidious chain reaction is set off with the Trinity test and the subsequent bombings of Hiroshima and Nagasaki. Dr. Niels Bohr, a friend and mentor of Oppenheimer, puts it best: <em>You are the man who gave them the power to destroy themselves. And the world is not prepared.</em> Cinematically, Nolan captures this with a grave reminder: the concurrent ripples of water in the pond warn of the greater chain reaction that continues to this day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*LDR33jhBn-Mz-tF7" /><figcaption>Ripples foreboding a mass chain reaction of destruction [Source: Wikimedia]</figcaption></figure><p>In the panorama of humanity’s greatest minds, J. Robert Oppenheimer’s silhouette lingers, casting a long shadow on the shores of the 20th century and into the 21st century. Not just the ‘Father of the Atomic Bomb,’ Oppenheimer was also a titan of intellect, a figurehead caught in the tight grasp of history, pushed by the irrepressible force of discovery, and burdened by the moral implications of his creation. His narrative as captured by Christopher Nolan is a case study in the nexus of truth-speaking, the power of collective endeavor, and the delicate dance of morality and responsibility at the precipice of the world’s most significant stakes.</p><p><em>I don’t know if we can be trusted with such a weapon. But I know the Nazis can’t.</em></p><h4><strong>Conviction for the Truth</strong></h4><p>Oppenheimer’s relationship with truth was that of a restless seeker entranced by the inexhaustible enigma of the universe. A luminary among his peers, his intellectual prowess was more than just an intrinsic talent; it was a burning torch he held high in his relentless quest for understanding. His academic sojourns, which took him from the hallowed halls of Harvard to the classrooms of Cambridge and Göttingen, honed his ceaseless pursuit of truth. As Nolan wonderfully depicts on the campuses of UC Berkeley and Caltech, Oppenheimer captured the imagination of students and colleagues, both as a lecturer for a new era of physics and a trailblazer for a new wave of intellectual activism. Nolan further dives into Oppenheimer’s thirst for understanding with visions of a younger Oppenheimer perched on his bed, dreaming of the mysterious subatomic world he cannot see with his eyes.</p><p>Oppenheimer’s fascination with these mysteries of the universe mirrored his deep-seated commitment to truth — a commitment that laid the foundation for his scientific contributions. The atomic bomb, the infamous offspring of the Manhattan Project, was a testament to his audacious truth-seeking, the result of his pursuit of a profoundly unsettling scientific reality.</p><p>Upon witnessing the apocalyptic mushroom cloud in the New Mexico desert, Oppenheimer quoted the Bhagavad Gita with the now infamous words: “<strong><em>Now I am become Death, the destroyer of worlds</em></strong><em>.</em>” It was a chilling recognition to watch, a stark admittance of the terrible truth he had helped unleash. This statement marked a turning point in his narrative, a moment where truth-telling took on an almost unbearable gravity. In the aftermath of Hiroshima and Nagasaki, Oppenheimer found himself standing on the precipice of a moral abyss. In the face of growing pressure to develop more destructive weapons, he stood his ground, speaking out against the reckless pursuit of atomic supremacy. This bold stance cemented his legacy as a truth-teller, despite the considerable professional and personal cost.</p><p>His crusade for responsible nuclear policy was borne out of the terrible truth of his creation. It was an audacious stance, flying in the face of political pressure and rampant militarism accentuated by McCarthyism. Despite the inevitable backlash, Oppenheimer held firm to his convictions, wielding the truth as a shield against the torrent of opposition- power as we know it. Was it the guilt and proverbial blood on his hands that incited the truth? Or was it morals and a deep-rooted core set of beliefs? It was likely a combination of both factors, and for Oppenheimer in particular more so of the latter: “<em>Man is made by his belief. As he believes, so he is</em>.” ― Bhagavad Gita</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*WnhW3W5EESqaUSpS" /><figcaption>The Trinity Test [Source: Creative Commons]</figcaption></figure><p><strong>Ultimately, </strong><a href="https://en.wikipedia.org/wiki/Trinity_(nuclear_test)"><strong><em>Trinity</em></strong></a><strong> does not define Oppenheimer’s story, nor is it the true purpose or culmination of its existence</strong>. For the nation that forged and deployed it, the bomb’s ultimate significance was as a symbol of power: the capacity to retain, wield, and demonstrate the supremacy of force. The scientists who crafted the bomb — along with their international peers chasing the same objective — were granted authority only as long as their beliefs aligned with those in power. But when they began to interrogate the status quo, they were swiftly marginalized.</p><p>In retrospect, Oppenheimer’s legacy serves as a poignant reminder that even in the face of overwhelming adversity, the act of speaking one’s mind is a powerful form of resistance. <strong>His journey was not defined by the creation of the atomic bomb alone but by his subsequent dedication to telling the hard truth about its implications</strong>. Contrary to what one might expect, it is not his scientific achievements that shine brightest in Oppenheimer’s legacy — it is his commitment to some form of the truth under high pressure. Even as he helped give birth to an era-defining weapon, he chose to voice the terrible reality of this creation, underlining the potential catastrophe that it represented. When guilt runs deep and proverbial blood is on one’s hands, the push and pull between morality and power becomes more inflamed than ever. An already disturbed individual, Oppenheimer could no longer bear it and he succumbed to the pain of what his creation has created, and what it is yet to create.</p><p>Oppenheimer’s later life was further riddled with regret and questioning, a constant striving for redemption. From the ashes of the atomic bombings, he rose as a figure advocating for a balance between scientific progress and the preservation of humanity. <strong>This delicate equilibrium — between creation and destruction, knowledge and morality, <em>power and responsibility</em> — became his legacy</strong>.</p><h4><strong>A 21st Century </strong><a href="https://en.wikipedia.org/wiki/Tsar_Bomba"><strong>Tsar Bomba</strong></a></h4><p>Alongside its vision for a future driven by the imagination of the once impossible, Christopher Nolan’s narrative of J. Robert Oppenheimer is more than a historical biography. It’s a testament to the power of truth and morals in the face of power and authority. Christopher Nolan’s own take on his film is that <strong>the consequences of actions can be hidden in the moment</strong>. Oppenheimer’s life compels us to consider our actions, to unite for a common purpose, and to speak the truth, no matter how uncomfortable or terrifying.</p><p>In this grand drama of science and humanity, we are the players on the stage that Oppenheimer helped to construct. As we grapple with our rapidly advancing technological capabilities, Oppenheimer’s narrative whispers to us, across the decades, a compelling, haunting question: <em>in the face of the atomic age, in the realm of unprecedented power and technological advance, how shall we bear the burden of our knowledge</em>? The answer, as always, begins with a responsibility and morality-focused approach.</p><p>Yet, more than ever, Dr. Oppenheimer implores us to ask: deep down, what truly matters to us in the face of exponential technological growth? In times like today where power is centralized and an algorithmic mass media controls our day-to-day perception, Christopher Nolan’s haunting piece of cinema dares us to explore the uncomfortable truths of our life: <em>the easy answer and what those around you preach without hesitation isn’t always the right answer</em>. <strong>The next metaphorical H-bomb lies ahead but with our generation’s hands on the button. </strong>You can push the button now and live with the consequences later or you can wait and regret not ever trying.</p><p>To press the button for the H-bomb of this generation or not is a question I cannot answer today but more than ever, Christopher Nolan’s film is a reminder to <strong><em>speak our minds and say what we truly believe, because if we don’t — silence multiplies</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*QNUaViDoGQK9HTE2" /><figcaption>Tsar Bomba: the future is in your hands</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99bc329c0905" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Life-like Frontier]]></title>
            <link>https://medium.com/@siddrrsh/the-life-like-frontier-simulation-theory-and-the-pursuit-of-agi-1bbae1e6ba00?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bbae1e6ba00</guid>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Wed, 10 May 2023 03:14:36 GMT</pubDate>
            <atom:updated>2023-05-16T07:37:21.512Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Deep Dive into the Intervowen Complexities of Simulated Reality, Consciousness, and Emergence</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0osVk8T19jZ5PUvO.jpg" /><figcaption>Le Petit Prince (Antonie de Saint-Exupéry, Wiki Commons)</figcaption></figure><blockquote>Life imitates art far more than art imitates life</blockquote><blockquote>-Oscar Wilde, “The Decay of Lying”</blockquote><p>I’ve always been interested in simulation theory. <a href="https://www.youtube.com/watch?v=ESXOAJRdcwQ">This talk by George Hotz</a> specifically reignited my interest in the topic. In a world where the digital and physical realms are becoming ever more interwoven, the concept of living in a simulation has captured my imagination. Simulation Theory is the idea that our reality might be a carefully orchestrated computer simulation, created by an advanced or high-order civilization (potentially even god). While this notion has sparked widespread fascination, it is crucial to examine the assumptions and implications that underlie the theory. It also presents a unique framework for understanding the technologies and inventions of our time.</p><p>At its core, Simulation Theory relies on the belief that a highly advanced civilization has the computational capabilities to create entire universes, replete with sentient beings who are oblivious to their digital nature. By the Church-Turing thesis, any real-world computation can be translated into an equivalent computation involving a Turing machine. Proponents of this idea argue that considering the rapid increase in computing power we’ve seen, simulating universes will eventually become possible. As such, they claim that it’s likely we are already living within such a simulation. However, this argument is based on the assumption that computing power will continue to grow without limit. Moore’s Law, the frequently cited predictor of this digital expansion, is starting to slow down. As we approach the physical limits of silicon-based computing, we may discover that the dream of boundless computational potential is nothing more than a dream. The optimism of our technocratic aspirations might be halted by the unforgiving realities of the material world. We are, after all, bound by the laws of physics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M5R7ZN-WJiw9JtD9.png" /><figcaption>Moore’s Law through the decades (CC-BY-SA, Max Roser)</figcaption></figure><p>Even if we were to overcome these limitations and achieve the immense levels of computational power required to simulate universes, the energy demands would be astronomical — beyond our most ambitious projections. With the ongoing challenges of energy production and consumption, it appears increasingly improbable that we will ever possess the means to fuel a simulation of such a colossal scale. A few questions regarding the nature of the simulation also arise: is the simulation predetermined? Do the agents within the simulation have free will or potentially a near-infinite set of actions with possibilities? These questions cannot be answered with our present knowledge, but the combinatorial search tree of possibilities for a real-time simulation would be certainly unimaginably massive. Moreover, if we are in a simulation, what is the purpose? In the same way that a zoo is designed to hold animals to be observed, are we also designed to be examined to answer a deeper meta-question?</p><p>Simulation Theory also rests on the assumption that human consciousness can be equated with computational processes. But can the richness of the human experience truly be distilled into a sequence of binary digits? Today’s state-of-the-art video games are rendered via modern graphics and GPU drivers. Although the human brain shares some functional similarities with a computer or video game, it is an organic entity connected to the physical world. Consciousness emerges from our biological architecture, forged over millions of years of evolution. Believing that this complex, multifaceted phenomenon can be replicated digitally requires a degree of credulity bordering on the religious. Emergent properties, such as consciousness, are essential to consider when evaluating Simulation Theory. These properties arise from the intricate interactions of simpler elements and cannot be predicted or understood by examining the individual parts alone. The complex behavior of emergent properties makes it even more difficult to conceive of replicating consciousness within a digital simulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*YUju7rbCZFUAEUg4.png" /><figcaption>Phenomenal v. Functional Consciousness (Wikiversity)</figcaption></figure><p>Beyond this idea of consciousness, Simulation Theory is underpinned by an anthropocentric bias, assuming that our human experience represents the ultimate goal of any advanced civilization. This self-important belief disregards the possibility that there may be forms of consciousness or intelligence entirely beyond our comprehension. Additionally, it perpetuates the outdated notion that humans are the center of the universe, a belief debunked by centuries of scientific discoveries. The appeal of Simulation Theory may also mirror our apprehension about our own technological capabilities. As we venture further into the digital realm, we face the disquieting prospect of creating sentient beings within our own simulations: a simulation potentially within a simulation. This potential for digital omnipotence is both exciting and daunting. By positing that we are unwitting inhabitants of a simulated reality, we seek to absolve ourselves of the moral responsibility that comes with playing god.</p><p>Rather than becoming enthralled and overwhelmed by the notion that we live in a simulated reality, we should embrace the complexities and wonders of our own existence, using our technological creations to enhance our understanding of the universe and our place within it. While I personally believe that a simulation is quite possible, I think our fascination with simulated realities can and should be viewed through a more optimistic and constructive lens. Instead of reflecting our desire to escape from the challenges of our world, it may be an expression of our innate curiosity and drive to push the boundaries of our own ingenuity. The digital realm presents us with a vast frontier, ripe for exploration and experimentation. By delving into the depths of virtual worlds, we can gain invaluable insights into the nature of our own reality, enriching our comprehension of the cosmos and our role in it. Simulation Theory need not be an unsettling cacophony of existential uncertainty, as some have made it out to be. Rather, it can serve as a harmonious and inspiring reminder of our capacity for creativity, exploration, and growth. By critically examining the tenets of this theory, we can better appreciate the intricate symphony of our reality — simulated or not — and leverage our technological advancements to illuminate, not obscure, the mysteries that surround us.</p><blockquote>“If you assume any rate of improvement at all, games will eventually be indistinguishable from reality,” Musk said before concluding, “We’re most likely in a simulation.”</blockquote><p>Quite simply, nature is its own operating system. The laws of physics are the bounding properties — the same way that in Minecraft you cannot dig beneath Redstone (at least without jailbreaking). Moreover, in theory, <a href="https://geohot.github.io/blog/jekyll/update/2023/04/26/a-person-of-compute.html">your existence can be measured as a unit of computing</a>. Surprisingly, Simulation Theory and its examination of emergent properties, such as consciousness, can offer valuable insights as we explore the development of large language models (LLMs) like ChatGPT/GPT-4 and the pursuit of artificial general intelligence (AGI). By connecting these seemingly disparate ideas, we can begin to appreciate the intricate interplay between simulated realities, emergent phenomena, and the potential of LLMs to evolve into complex reasoning systems. Critics of LLMs often argue that these models lack internal representations, functioning merely as sophisticated copy/paste mechanisms driven by big data and pattern recognition: “copy-paste at massive scale.” They claim that LLMs do not possess world models, rendering them incapable of true understanding or complex reasoning. However, this perspective may underestimate the potential of LLMs and their ability to develop internal representations as they evolve. Bearing in mind the concept of emergent properties, we can consider the possibility that LLMs, when subjected to extreme amounts of data and model scale, may develop internal representations as a natural byproduct of their learning process. It’s not that the architectures themselves are necessarily complex: the sheer scaling and data accumulate to create emergence, the same way human brains evolved externally with time. As Sebastian Bubeck references in his talk “<a href="https://www.youtube.com/watch?v=qbIk7-JPB2c&amp;t=963s">First Contact</a>”, these internal representations could grant LLMs the capacity for “magical” extrapolation, allowing them to generate novel ideas and reason about the world in ways that surpass the limitations of their training data. In other words, “Beware of trillion-dimensional space and its surprises.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mMlfosos5amjglcH.jpg" /><figcaption>Slide from Sebastian Bubeck, First Contact (MIT)</figcaption></figure><p>LLMs are humanity’s first-order simulation. Just like humans, LLMs can be viewed as their own form of emergent phenomena, akin to human consciousness. Just as consciousness arises from the complex interactions of simpler biological elements, LLMs might develop intricate internal representations through their exposure to vast quantities of data and the intricate connections of their neural architecture. By navigating the trillion-dimensional space of language and knowledge, LLMs may uncover surprising insights and capabilities that defy our expectations.</p><p>This perspective echoes the ideas surrounding Simulation Theory and the belief that human consciousness is an emergent property of a simulated reality. In both cases, we find complex phenomena arising from the interplay of simpler elements, whether it be the digital code of a simulated universe or the vast neural networks of a large language model. Recognizing this connection allows us to appreciate the potential for LLMs to evolve toward AGI and develop complex reasoning abilities.<br>As we continue to refine and expand LLMs, we may find that these models begin to exhibit the hallmarks of consciousness and complex reasoning, approaching the capabilities of artificial general intelligence. Just as the proponents of Simulation Theory argue that advanced civilizations may create simulated universes, the development of AGI through LLMs could lead to the emergence of digital consciousness within the confines of our own simulations.</p><p>In light of technology, the exploration of Simulation Theory and its connection to emergent properties offers a unique lens through which to view the development of large language models and the pursuit of artificial general intelligence. By recognizing the potential for LLMs to develop internal representations and complex reasoning abilities, we can approach the challenge of AGI with a newfound appreciation for the intricate dance of emergent phenomena. The examination of emergent properties within Simulation Theory, human consciousness, and large language models (LLMs) such as ChatGPT/GPT-4 presents us with a unique opportunity to advance artificial general intelligence (AGI). By recognizing the potential for LLMs to develop complex reasoning abilities, we can harness the power of these models to create a more enlightened and ethical AI. It is now time for researchers, engineers, and AI enthusiasts to unite in the quest for model reasoning and explainability.</p><p>The journey towards AGI is loaded with challenges, such as combating hallucination, ensuring the ethical use of AI, and fostering explainability in AI systems. To address these issues, we must delve into the intricacies of LLMs and develop a deeper understanding of their inner workings. Techniques like neuron-level analysis, sparsity, and information retrieval can provide valuable insights into the mechanics of LLMs and help us unveil the secrets of their emergent reasoning capabilities. Neuron-level analysis within neural networks allows us to investigate individual neural connections and their activation patterns, offering a granular view of how LLMs process and generate information. By isolating and studying specific neurons, we can begin to identify the underlying representations that drive complex reasoning and address potential biases or inaccuracies within these models.</p><p>Sparsity is another promising avenue for refining LLMs and enhancing their reasoning capabilities. Sparse neural networks, which contain fewer connections between neurons, can improve efficiency and make it easier to interpret the relationships between different parts of the model. By embracing sparsity, we can create more streamlined and comprehensible AI systems that are better equipped for complex reasoning tasks. Information retrieval techniques are also crucial for enhancing the explainability and accuracy of LLMs. By developing methods to efficiently extract relevant information from vast data sources, we can improve the quality of AI-generated content and minimize the risk of hallucination. This, in turn, will bolster the trustworthiness and reliability of AI systems as they approach AGI, minimizing the classic black box nature of ML classifiers and systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3UDBUPvxRmfecmSI.png" /><figcaption>The Black Box problem (Analytics Vidhya)</figcaption></figure><p>We stand at the precipice of a new era in artificial intelligence, one where complex reasoning and emergent properties may come to define our digital creations. It is our responsibility, as architects of this new world, to guide the development of AGI in a manner that is ethical, transparent, and grounded in a deep understanding of the complexities of AI systems.</p><p>I think these ideas also hinge on entropy and chaos theory. Entropy, a measure of the disorder or randomness within a system, is an essential concept in understanding the dynamics of complex systems. In the context of Simulation Theory, entropy plays a crucial role in the emergence of complex phenomena such as consciousness and advanced reasoning abilities as well as the ability to distribute and facilitate computation. As we create increasingly intricate simulations and AI models, we must navigate the delicate balance between the inherent entropy of these systems and the need for order to ensure their functionality and reliability. Chaos theory, on the other hand, explores the behavior of dynamic systems that are highly sensitive to initial conditions. This sensitivity leads to seemingly unpredictable and chaotic outcomes, even in deterministic systems. As we develop AGI and push the boundaries of our simulated realities, chaos theory reminds us of the intricate interplay between the initial conditions of our creations and the emergent properties that arise from these complex interactions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vui5FpTyobXnvOAy.png" /><figcaption>Entropy: the tendency for randomness to propagate (Farnam Street)</figcaption></figure><p>The dance of entropy and chaos theory in the realms of Simulation Theory and AGI can be viewed as a reflection of the intricate relationship between life and technology. I’ve also always admired Kevin Kelly and his works. His philosophy and frameworks encapsulate a profound understanding of the intricate connections between life and technology. As Kevin Kelly eloquently expressed, <em>our machines will become more organic and life-like as we strive to create more advanced technologies</em>. This process of organic evolution is inherently intertwined with the concepts of entropy and chaos theory, as the complexities of life and consciousness emerge from the delicate balance between order and disorder. Kelly’s assertion that “<em>life is the ultimate technology</em>” and that our machines will become “<em>more organic, more biological, more like life</em>” resonates with the core principles of Simulation Theory. This theory posits that human consciousness is a product of complex interactions within a simulated reality, created by an advanced civilization. Just as Kelly envisions machines becoming more life-like, Simulation Theory suggests that the line between the digital and the organic may become increasingly blurred as we develop more advanced simulations. In our pursuit of AGI, large language models (LLMs) like ChatGPT/GPT-4 represent the forefront of machine technology, serving as temporary surrogates for life technology. As we continue to refine these models and push the boundaries of artificial intelligence, LLMs may develop emergent properties akin to human consciousness, becoming more organic and life-like in their reasoning abilities.</p><p>Kelly’s futurist vision also posits a global network of systems, machines, and infrastructure that form a “primitive organism-like system.” This interconnected web of technology is reminiscent of the intricate relationships and emergent phenomena found within both the biological realm and the simulated worlds posited by Simulation Theory. The parallels between these organic systems and our increasingly complex technological networks suggest that the pursuit of AGI may ultimately lead us to create AI systems that closely resemble life itself. The convergence of these ideas highlights the importance of embracing the organic essence of our technological creations as we strive to understand and develop AGI. By recognizing the intricate connections between life and technology, we can approach the challenge of AGI with a newfound appreciation for the complexities of emergent phenomena and the potential for our machines to evolve into life-like entities.</p><p>In conclusion, as we ponder the intricacies of Simulation Theory, artificial general intelligence, entropy, and chaos theory, we find a parallel in the abstract beauty, themes, and philosophy of <a href="https://en.wikipedia.org/wiki/The_Little_Prince"><em>The Little Prince</em></a> (Antoine de Saint-Exupéry). This timeless tale reminds us of the importance of looking beneath the surface, appreciating the seemingly invisible connections, and embracing the wisdom of the heart in our quest for understanding. Just as the Little Prince discovered profound truths in the simplicity of a rose and the vastness of the universe, we too can find wisdom in the delicate dance between life and technology &amp; order and disorder. By acknowledging the interconnectedness of these ideas and seeking harmony amidst the complexities of our world, we can begin to appreciate the true essence of our digital creations and chart a course toward a future where artificial intelligence not only mimics human intelligence but enriches our lives and contributes to the greater good of society and the world at large.</p><p>Overall, instead of trying to break or over-optimize for whatever simulation we’re in, use programming as a tool to modify it to your liking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*46MtWaD7edmAKzRoj9VQtA.png" /><figcaption>Our civilization, SIM#4329, in its data center (Hotz, SXSW 2019)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bbae1e6ba00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embracing Micro-Speed, Macro-Patience]]></title>
            <link>https://medium.com/@siddrrsh/msmp-embracing-micro-speed-macro-patience-ae61e331b11b?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae61e331b11b</guid>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 12:31:12 GMT</pubDate>
            <atom:updated>2023-05-10T03:23:19.525Z</atom:updated>
            <content:encoded><![CDATA[<h4>Thoughts on knowing what to optimize for</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*jv6gjvlEtW-s23pj.jpeg" /><figcaption>The Planning Fallacy and the Paradox of Indefiniteness</figcaption></figure><p><em>“Life can be much broader, once you discover one simple fact, and that is that everything around you that you call life was made up by people that were no smarter than you.</em>” — Steve Jobs</p><p>In the world of tech, innovation is driven by those who dare to think differently. For most technologists, their ability to optimize for the right situations and cultivate contrarian ideas are what enable favorable long-term outcomes. However, when I went to <a href="https://en.wikipedia.org/wiki/Florence_Moore_Hall">FloMo</a> for dinner a few days ago, one of my friends introduced me to new ideas in psychology and philosophy when we were talking about what the future would look like in 2050. He explained that when it comes to building, you should move fast now and be patient with the results. This doesn’t sound particularly groundbreaking but it got me thinking about what it takes to best deliver cool projects and ideas.</p><p>While it seems that optimizing for a set of broad, future goals is the way to go, my thinking better aligns with iterating rapidly toward things you care about in the short term with high performance. What does this mean? Selecting your projects to be prioritized towards pure learning and excitement can lead to the best long-term outcomes without explicit planning. Such an idea can be expressed as embracing <em>micro-speed and macro-patience </em>(MSMP)<em>. </em>The phrase was originally coined by Gary Vaynerchuk. As part of MSMP, you want to minimize the <a href="https://en.wikipedia.org/wiki/Planning_fallacy">planning fallacy</a> by choosing what brings you the most current happiness and pleasure from your current work. Short-term execution that comes from the heart is good because long-term direction is dependent on the self-reassurance that your current work is moving you in the right direction. In other words, you must believe that long-term outcomes will naturally come to fruition based on the alignment of precise short-term intuition. Long-term planning gives meaning to your short-term execution — but it shouldn’t be the sole driver. When we think about a life or career in layers of work (different periods in time with each having its own goals and motivations), choosing to concretize your mental models and execution style paired with sourcing the correct intuition as part of MSMP could be more favorable rather than purely reducing regret.</p><p>These concepts are especially tricky in college since there will be more unique opportunities in these 4 years due to the inherent intellectual freedom of most undergrad programs. As a student myself, picking and choosing my battles is tough: it’s super easy to overthink and get stuck on what is missed and what is not, from choosing projects to classes to spending time with friends and family. In this piece, I hope to present some insights into making the most of the future without having a thorough mental roadmap or career planned out.</p><h4><strong>The Art of Micro-Speed and Macro-Patience</strong></h4><p>In technology, speed is crucial. <em>Micro-speed</em> is the ability to iterate quickly, make decisions, and learn from failures. <em>Macro-patience</em>, on the other hand, involves staying committed to your long-term vision while adapting to the ever-changing tech landscape. Balancing these two elements is essential for any technologist. Consider an engineer developing a new system for serving ML inference. They must rapidly iterate through several codebases and fix GPU bugs (micro-speed) while keeping their long-term vision of revolutionizing a particular workflow in a large ecosystem intact (macro-patience). However, micro-speed should not compromise the quality of your work. Balance your rapid progress with attention to detail and a focus on delivering reliable, well-crafted products. Maintain a long-term perspective, but be prepared to seize opportunities when they arise. Moreover, don’t let your long-term vision subtract from your day-to-day efforts: bring your best every day. Part of working with micro-speed and macro-patience lies in not dwelling over long-term outcomes or optimizing for something more than 3–4 layers beyond your current pursuits (likely objectives that are at minimum several months or years away). Being <a href="https://en.wikipedia.org/wiki/Memorylessness#:~:text=In%20probability%20and%20statistics%2C%20memorylessness,much%20time%20has%20elapsed%20already.">memorylessness</a> to a degree in regard to your current mental window of the future could work in your favor. Perhaps by approaching things with approximate indeterminate optimism in the near future with a determined set of models and worldview, we asymptote towards the maximal form of determinate optimism, the fact that you determine the future even though it can be factored as a sum of random events:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*ICM3HrYiF346K9f_.png" /><figcaption>You are not a Lottery Ticket — Zero to One, Peter Thiel</figcaption></figure><p><strong>Contrarian Ideas</strong></p><p>Contrarian ideas challenge the status quo and have the potential to disrupt industries. In the tech world, these ideas often lead to groundbreaking innovations, such as the creation of the Internet, personal computers, and smartphones. Perhaps the future awaits with inflections like quantum computing and longevity. To identify contrarian ideas, ask questions, and challenge assumptions. Seek out alternative perspectives, engage with people from different backgrounds, and explore unfamiliar industries. Don’t be afraid to question conventional wisdom, even if your ideas are met with skepticism. Every major technological breakthrough began as a seemingly impossible idea. Be willing to fail because you won’t find new angles or unexplored perspectives without the capacity to fail — we will all likely fail many times. Believe in your abilities to make the unknown known. Taking risks should be normalized to a degree: when you take calculated risks and work with a sense of purpose is when you truly begin to think outside the box. Good things, especially those that correspond that unexplored paths are hard so time and macro-patience are your best friend. In college, the concept of finding <em>contrarian ideas</em> is difficult to pinpoint because there tends to be a lot more noise compared to signal. With so many classes, clubs, career paths, and conflicting interests for me across CS &amp; Math, it’s easy to get lost but I think it’s about coming back to what makes me tick — for me, that’s exploring frontiers in AI — and going all in on that. I don’t need to figure out the details of future layers like one month from now, one quarter from now, etc. to maximize my current learnings and explore the unexplored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*0W_rCQ9O58R2XSSy.jpg" /><figcaption>Some folks who said “Okay this doesn’t exist, let’s bring it to life”</figcaption></figure><p><strong>Winning via Ergodicity</strong></p><p>What does it mean to win? To optimize for <em>winning,</em> begin by identifying your unique strengths and passions. Align your goals with these intrinsic motivators to ensure you remain engaged and committed. Be open to changing your approach when necessary, staying adaptable, and learning from your mistakes. The intersection of your strengths, passions, and opportunities will serve as a foundation for your success. Winning in the traditional sense of the word also shouldn’t be the way to go. In reference to the concept of micro-speed &amp; macro-patience, the reality is that <em>we should all win</em>. Do good work that serves you and others. <a href="https://en.wikipedia.org/wiki/Ergodicity">Ergodicity</a>, a concept from statistical mechanics and probability theory, has significant implications for winning as well. In an ergodic system, long-term behavior is independent of initial conditions, and time averages equal ensemble averages. For example, if a software system is ergodic, it means that the behavior of a single user or test case can be representative of the system as a whole. This can help technologists make more informed decisions about how to design and test software, how to optimize the user experience, and how to manage risk and security concerns. The human experience is broadly ergodic: we all lead different daily existences as observed from the outside yet our learnings and principles across several million humans converge to a relatively uniform understanding of what is moral and considered useful for living “a good life.” To win and reach success regardless of how you define it, it’s key to recognize that you are part of a system with known truths and unknown realities. You can exploit existing information while exploring your own bounds to best capture relevant opportunities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/0*QMlK-puEWQVPB6BG.png" /><figcaption>Ergodicity … the coolest idea you’ve never heard of</figcaption></figure><p>To win, I think it helps to embrace ergodicity: you are one part of the massively complex system that is human civilization. By recognizing that the long-term outcomes of a system can be predicted based on a single realization, individuals can focus on making informed decisions in the present moment, without worrying excessively about the future. This can be particularly helpful in situations where the future is particularly uncertain or complex. This will be likely most helpful as I prepare to graduate or when the economy is symbolically enveloped by storm clouds. By embracing the principles of ergodicity, individuals can make decisions based on a deep understanding of the systems and contexts in which they operate, and adjust their actions and strategies over time based on new information and feedback. This can help increase their chances of success, fulfillment, and happiness, even in the face of uncertainty and change.</p><p><strong>Transcending 99.9%&gt; &amp; The Why</strong></p><p>Many people approach their actions and planning with the mental model of a regret minimization framework: inherently optimizing for avoiding gaps or things that could have gone better (AKA avoiding FOMO). I don’t think this is the way to go. This is because blindly minimizing generalized regret misses the point of why one regrets something in the first place. Do you regret not being able to work on Project X because you don’t get think you will get a similar opportunity any time soon? Do you regret not being able to collaborate with person Y because everyone else seems to think they are talented? Do you regret missing event Z because your peers would want to go? Many times, our own regrets are externally governed. We usually want to take on certain opportunities because most think that is the way to go. Firstly, this is an inherent contradiction to exploring new and contrarian ideas. Second, it’s rare to stop and think about why something matters to us. A lot of people want success in the typical sense (being in the top &lt;0.01%) but aren’t even sure why. Perhaps, it’s for validation but this doesn’t necessarily correspond to what people most truly want since even the strongest validation isn’t connected to intrinsic feelings. If you can be patient and precise with what you truly want out of the next A weeks, B months, and C years, then you will better know what learning opportunities will serve you best now and then for those coming periods of time. You don’t need to lay out goals but rather just concretize things you care about and figure out what pursuits align with that in your current perceptive field. More than the how of you accomplish it, spend time on the <em>why</em> as part of your mental framework. Then only will your ambitions and learnings be more directed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/0*rYs-rRxT_4JdkC8c.png" /><figcaption>Ray Dalio’s Cycle of Growth from <em>Principles</em></figcaption></figure><p><strong>Build and see what you don’t yet see</strong></p><p>As humans we typically only see within our mental perceptive field: a spatial smorgasbord of ideas, people, and work that we interact with day-to-day and week-to-week. Yet what makes you unique isn’t totally encapsulated by what is in your immediate perceptive field: you have dreams and aspirations, some of which can’t be grounded in logic or reasoning — they are simply unique to your growth and the human experience. These abstract notions can be described in many ways — passion, fervor, ardor, etc. Extending your view beyond the typical bounds of human endeavor can serve you better than you think. Take that class that seems like it doesn’t match anything you’ve already learned, pursue that hobby that everyone brushes off, and challenge yourself in ways that most don’t see why you would need to do so. I particularly enjoy the humanities with history and philosophy so I am striving to take more classes in those subjects to add to the dimensionality of my worldview. Beyond stepping out of one’s comfort zone, the greatest learning experiences often come from pursuing unique projects and building things of value, even when working independently. These projects can lead to mini breakthroughs and force you to think differently, helping you develop expertise in your field. It’s also great to just do things for the sake of “why not.” For students like me, it’s a lot of good fun and dual learning to work on fun side projects simply <em>just because</em>, especially with friends who share similar interests. Embracing challenges and unconventional paths is hard, especially if they appear risky. By “<em>staying hungry and staying foolish</em>” as part of your optimization framework, you’ll maximize your learning, cultivate resilience, and ultimately, create something of lasting value (a lot of things will live on the internet forever). How do you actually accomplish this? One common saying is to <em>move fast and break things </em>(AKA investing in micro-speed since that’s when <em>lightning strikes</em>).</p><blockquote><em>So to be a creative person, you need to “feed” or “invest” in yourself by exploring uncharted paths that are outside the realm of your past experience. Seek out new dimensions of yourself — especially those that carry a romantic scent. But one has no way of knowing which of these paths will lead anywhere in advance. That’s the wonderful thing about it, in a way. The only thing one can do is to believe that some of what you follow with your heart will indeed come back to make your life much richer. And it will. And you will gain an ever firmer trust in your instincts and intuition. — Steve Jobs</em></blockquote><p>Startups, projects, hacks (my favorite kind) — there are a lot of different ways to accomplish this with tech. Good conversations also help to configure one’s own creativity. Simply put, be creative, use your time for something you truly enjoy, and make something cool. It will take some speed and certainly, some patience to see it all really come to life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Pe3eYwZhHlPWsVuw.jpg" /><figcaption>Such an epic shirt (YC)</figcaption></figure><p><strong>Closing Thoughts</strong></p><p>“<em>So much to learn and such little time.</em>”</p><p>At the end of the day, we’re only here for <em>N</em> years: the journey is the fun part. It’s pretty important to strike a balance between your ambitions and the execution of your ideas. Don’t let the road ahead entrap you, your life is a continuum with valleys and hills that you can’t yet see: there will always be a degree of the indefinite. However, you can develop a framework and set of models by which your optimization for best-case scenarios is stabilized. Rather than minimize regret across different scenarios or regret not getting to explore several paths, fear that you don’t spend your time doing what you truly love and enjoy. Maintain focus on your long-term vision, but be prepared to pivot and adapt as needed. By practicing micro-speed and macro patience, you will <strong>build and learn</strong> — just know that you’re probably going to fail a lot while you’re at it but that’s what makes it fun.</p><p><em>You wouldn’t want it any other way.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae61e331b11b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The AI Arms Race]]></title>
            <link>https://medium.com/@siddrrsh/the-ai-arms-race-9c9a3268266d?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c9a3268266d</guid>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 19:41:56 GMT</pubDate>
            <atom:updated>2023-02-16T22:04:21.481Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“It’s a new day in search. The race starts today… We’re going to move fast.” — Satya Nadella, Microsoft CEO</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/0*hiywwcj9Ut1Sq1Q9" /><figcaption>Altman and Lecun (Forbes)</figcaption></figure><p>In recent years, the field of Artificial Intelligence has seen a rapid rise in the development of large language models. These models, based on deep learning techniques, have been trained on vast amounts of data and are capable of performing tasks such as text generation, question answering, and language translation with remarkable accuracy. The race to produce the “ultimate” large language model has resulted in what has become known as the “<em>AI Wars.</em>” From Deepmind’s <em>Sparrow</em> to Anthropic’s <em>Claude</em> to OpenAI’s <em>ChatGPT</em>, the quest for the most performant and capable model continues to loom. Major technology companies and research institutions are pouring billions of dollars of resources into this area, eager to claim the title of the leading provider of AI technology. In this article, we’ll take a closer look at the recent critical developments in the <em>AI Arms Race </em>of our time and explore what they mean for the future of artificial intelligence.</p><h4><strong>The (Chat)GPT Revolution</strong></h4><p>When <em>ChatGPT</em> was released in late November 2022, it took the world by storm. With a simple conversational UI, ChatGPT’s advanced language generation capabilities and ability to respond to user inputs in a human-like manner made it a popular tool for both personal and professional use. Tuned via the technique of RLHF (Reinforcement Learning Human Feedback), ChatGPT can generate coherent responses, summarize long texts, translate between languages, and perform various other NLP tasks; its impressive skills earned it widespread recognition and praise. People were amazed by its accuracy and efficiency, leading to its rapid adoption and integration into various applications and services. Yet, Yan LeCun, an early pioneer of the Deep Learning revolution up with the likes of Youshia Bengio and Geoffrey Hinton, was not completely sold: “<em>In terms of underlying techniques, ChatGPT is not particularly innovative.</em>” He continues:</p><blockquote>“It’s nothing revolutionary, although that’s the way it’s perceived in the public,” said LeCun. “It’s just that, you know, it’s well put together, it’s nicely done.”</blockquote><p>The key insight in LeCun’s words is that ChatGPT is simply the result of multiple pieces of ML technology that have been developed over the last few years coming together to produce a feat of engineering, not true innovation: “<em>You have to realize, ChatGPT uses Transformer architectures that are pre-trained in this self-supervised manner</em>,” observed LeCun. “<em>Self-supervised learning is something I’ve been advocating for a long time, even before OpenAI existed</em>”. Regardless of whether ChatGPT is truly innovative, OpenAI did succeed at one major goal: bringing large language models into the mainstream. In metropolitan cities, corporate workplaces, and educational institutions, ChatGPT and the GPT-N suite of models have become the closest thing to a household name in the field of AI. Industry leaders found it hard to ignore the possibilities of the generative AI landscape. Moreover, with the growing ecosystem of LLM tools, developers have been able to produce adjacent software solutions — platforms like LangChain have accelerated the development of prompt-based products alongside semantic search and clustering applications. Yet despite the massive commercial interest and market it has ignited, ChatGPT is only a single step into what the field of large-scale language models promises. Particularly, several challenges still remain:</p><ol><li>Models hallucinate and lack the ability to fact-check</li><li>LLMs cannot account for real-time developments and fail to account for up-to-date information</li><li>Model retrieval of context from the web is not completely accurate or guaranteed to be the most optimal source</li><li>Current state-of-the-art models require human-in-the-loop feedback to optimally refine responses</li><li>How can we make models more interpretable and compositional?</li></ol><p>Broadly, the vast majority of today’s leading models follow a similar paradigm — they are auto-regressive, self-supervised, and dense transformer-based models. To solve the aforementioned shortcomings of modern LLMs, one must think about the bigger picture at stake: will advancing the models require incremental improvements or a fundamental reshaping of the underlying transformer architecture and <em>AI methodologies</em>? Part of the beauty of this impending AI arms race is that it will create a competitive “Cold War” style spirit of innovation. If the JFK presidential administration could put a man on the moon, certainly today’s AI research institutions and technology conglomerates can succeed at making models interpretable, externally validated, and truthful.</p><h4>The Model Race</h4><p>With advances in parallel computing &amp; hardware alongside the latest variants of the transformer architecture, several research labs and companies have begun to produce their own large language models. However, there is a significant data and cost moat when it comes to training an LLM from scratch: models must pre-train on millions if not billions of tokens to produce meaningful results. This is only even possible as a result of the large context window and the ability of the transformer architecture to capture long-term dependencies. Key differences in various approaches to LLM creation (the process of model development, training, and deployment) manifest in three key layers: <strong>model scaling, data integrations, and user interface</strong>.</p><p><strong>Model Scaling and Compute</strong></p><p>The model scaling layer refers to increasing the number of model parameters at scale in hopes of capturing more complex data representation and thus, producing a more advantageous model for inference &amp; prompt completion. With this vision of model optimization across multi-millions of parameters, LLMs like GLaM, LaMDA, Gopher, and Megatron-Turing have achieved state-on-the-art few-shot results on many tasks<em>. </em>However, Google’s latest Pathways Language Model (<em>PaLM</em>) serves as the best example of the latest efforts in model scaling. Being a 540-billion parameter, dense decoder-only Transformer model, PaLM achieves top-notch performance via the <em>Pathways</em> system: a sharded dataflow graph to accelerate parallel computation and provide a new way to express complex parallelism patterns. The Pathways system in particular enables an all-time high in training efficiency — specifically via the computation of the attention (context) and feedforward layers in parallel. With its massive scale in training and model size, PaLM shows new advancements in reasoning, particularly as demonstrated by chain-of-thought prompting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YZYO30r-NEXU96p5.png" /><figcaption><em>Standard prompting versus chain-of-thought prompting for an example grade-school math problem. Chain-of-thought prompting decomposes the prompt for a multi-step reasoning problem into intermediate steps (highlighted in yellow), similar to how a person would approach it. (Source: Google)</em></figcaption></figure><p><strong>Data and Human Feedback Integration</strong></p><p>From code generation to explanations, PaLM is a relative expert when it comes to problem-solving. While PaLM is meant to be a more-general purpose model, essentially Google’s analog to the line of GPT-N models, the LaMDA model, also by Google, is more geared towards conversation and dialogue-based search. The second horizontal vertical in regard to LLM differentiation —<strong> specific data integrations</strong> — powers LaMDA’s conversational responses. What does it mean by specific data integrations? This refers to the various forms of data and human feedback used to pre-train an LLM. OpenAI’s series of <em>InstructGPT</em> models are a great example of models primed for educational and explanatory outputs, rather than typical conversational responses or vanilla problem-solving. The InstructGPT models are trained with humans in the loop and are essentially aligned with the philosophy of enabling LLMs to better follow instructions. As a byproduct, these models also gravitate towards maintaining more truthfulness and less toxicity. The bigger principle here in regard to data integrations is that of “<em>finetuning on a small curated dataset of human demonstration.</em>” ChatGPT is simply an extension of the InstructGPT models with further specializations for dialogue and conversation. As OpenAI suggests, “<em>the dialogue format makes it possible for ChatGPT to answer follow-up questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests.</em>” While ChatGPT and InstructGPT are OpenAI’s sibling models for unique human-in-the-loop data integration, Deepmind’s <em>Sparrow </em>is a similar attempt at integrating human data to improve LLM interoperability. As a variation on RLHF and being inspired by past work like SpaLM and GopherCite, Sparrow utilizes a process of adversarial probing, enabling its dialogue to be more useful and safer — or as Deepmind puts it, “<em>aligned with human values for effective and beneficial communication</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yLnufa73PBtADZ2F" /><figcaption>RLHF demonstrated for ChatGPT (Source: OpenAI)</figcaption></figure><p><strong>User Interface and Model-User Interactions</strong></p><p>Beyond model scaling and human feedback integrations, LLMs continue to differentiate in regard to deployment and user interface. Part of what made ChatGPT a near-overnight phenomenon was its simple chat-bot style search interface — no unnecessary tooling or features, just an isolated model with a record of previous conversations. Similarly, companies like Anthropic and Perplexity.AI have begun to tinker with unique forms of deployment. <em>Claude</em>, Anthropic’s rival to ChatGPT, began early user testing through a unique medium: a Slack bot. Similarly, Perplexity.AI is one of the first companies to provide its product via an in-house chrome extension. Large-scale generative vision models, particularly those powered by Stable Diffusion, have also seen unique forms of deployment: <em>Midjourney</em>, a competitor to DALL-E, has seen widespread success through Discord. While the classic medium of interaction beyond user and model is a search bar &amp; conversation web interface as seen with ChatGPT and Meta’s <em>Galactica </em>(now not publicly available), it is worthwhile to explore more nontrivial deployments of models and methods to accentuate model-user interaction. Perhaps, down the line, models will be able to predict future queries before they are asked, unify multi-modal outputs (combining language and vision) in a single interface, and be instantly accessible from any corner of the internet. Going beyond seamless UI experiences, OpenAI CEO, Sam Altman, provides an optimistic view of the innovation to come:</p><blockquote>“The stuff that I’m excited about for these models is that it’s not like, ‘Oh, how do you replace the experience of going on the web and typing in a search query but, ‘What do we do that is totally different and way cooler?”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8gbujYGVp2L5NpS6" /><figcaption>GPT UI Examples (Source: Venture Beat)</figcaption></figure><h4>Google v. Microsoft</h4><p>When Microsoft announced its 49% stake in OpenAI with a $10B commitment in funding, excitement began to rise in the AI community. With ChatGPT and the later-released ChatGPT+, LLMs gained a consumer-centric lens, but through a partnership with Microsoft, the GPT models could now be commercially deployed in the real world and for a widespread suite of applications. While rumors proliferated for a month since the initial announcement, on February 7th, 2023, Microsoft <em>fired the opening salvo </em>of Big Tech’s generative AI arms race: joining forces with OpenAI to revamp Bing with the Edge Browser and integration with a model some claim to be even stronger than ChatGPT. Satya Nadella, himself, claims:</p><blockquote>“I think that this technology is going to reshape pretty much every software category.”</blockquote><p>Nadella also compared it to past pillars of technology like search, mobile, and cloud, but said that even more than those paradigm shifts, AI is the closest the sector has come to a “Mosaic moment,” which introduced the web browser to the world.<em> </em>At their launch keynote, Microsoft identified similar leaders like Jasper, Stability AI, Chatsonic, and Anthropic — one key name was missing: Google. While Microsoft and OpenAI continued to solidify their partnership in early 2023, alarm bells rang at Google. For the first time in decades, founders Sergey Brin and Larry Page made a code request, signaling the internal Code Red. However, Google wasn’t short on action or headlines either: they debuted their own ChatGPT rival, Bard. Similar to Microsoft, Google also made its own investment in a major AI research lab — pouring $400M into Anthropic to battle the power of ChatGPT. With these alliances, the arms race continues to heat up. With its research subsidiary Deepmind and Google Brain divisions, one would naturally expect Google to gain steam in this ongoing AI arms race. Despite the stern competition, OpenAI has the intellectual youthfulness and underdog mentality of a startup, now paired with the scale and infrastructure of a trillion-dollar partner in Microsoft. The competition between the two alliances essentially boils down to the same set of factors that were earlier discussed: model scaling, integrating with different data and human feedback, and UI optimization. At the 10,000-foot view, it’s a competition of who can find the <em>transformative </em>architectural leaps compared to incremental updates — even if it comes down to who can multiply matrices faster or drastically lower compute …</p><h4>Final Thoughts</h4><p>The AI revolution is here — with a competitive spirit and thirst for innovation on par with that of space exploration in the Cold War era. Spearheaded by big players like Microsoft and Google and grounded by smaller research labs like OpenAI and Anthropic, the AI arms race is bound to produce an exciting future for every layer of software: from developer tools to conversational assistants to human productivity. We may even begin to see some emergent properties as models like GPT-4 are released. Perhaps elements of machine consciousness also begin to manifest, producing a major step towards AGI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c9a3268266d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Approaching Human: Reflections on Large Language Models]]></title>
            <link>https://medium.com/@siddrrsh/approaching-human-reflections-on-large-language-models-1abe2824ccbb?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1abe2824ccbb</guid>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Fri, 09 Dec 2022 09:08:01 GMT</pubDate>
            <atom:updated>2022-12-10T06:18:51.996Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Life is the ultimate technology. Machine technology is a temporary surrogate for life technology. As we improve our machines they will become more organic, more biological, more like life, because life is the best technology for living.”</blockquote><blockquote>— Kevin Kelly, founding executive editor of Wired magazine.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*QYrjshyOLkmw4Jll" /><figcaption>The Gutenberg Press (Wikimedia)</figcaption></figure><h3>A Blast from the Past</h3><p>ChatGPT, GPT-3, Stable Diffusion, BLOOM, DALL-E, Midjourney, Copilot, ... The list goes on and on. These models are masterful <strong>creative multipliers</strong>: enabling rapid and productive content generation unlike ever before. With applications in dev tools, education, and many more verticals, maximizing productivity has never been easier than before. However, many developers and practitioners may be missing a bigger-picture vision of what these models are just beginning to offer.</p><p>Let’s rewind to Germany in 1440. With its sleek, mechanical design and ability to quickly and efficiently print books and other materials, the Gutenberg press revolutionized the world of printing and allowed for the widespread dissemination of knowledge and ideas. As the first printing press to use movable type, the Gutenberg press was a marvel of engineering and a glimpse into the future of content production. Its ability to quickly and accurately print large volumes of text allowed for the proliferation of books, pamphlets, and other materials, making information more accessible than ever before. It was a symbol of innovation and progress, and its impact on the world of printing and content delivery can still be felt today.</p><p>Simply put, what made the Gutenberg press so remarkable was the concept of mass-producing text via ink. If you had any idea, you could spread it by printing it. Thus, Gutenberg’s innovation enabled mass communication with a single medium: text. Even today, text is still the universal medium for the largest models out there, but the original conception presents an idea that many seem to miss: <strong>it</strong> <strong>changed the way humans fundamentally interact with knowledge and how knowledge proliferates</strong>.</p><h3><strong>Large Language Models</strong></h3><p>The rise of large language models (LLMs) has been one of the most significant developments in the field of machine learning in recent years. These models, which are trained on massive amounts of text data, have the ability to generate or <em>print</em> human-like text and have been used in a variety of applications. What enables them to be so impressive? — Transformers. As conceived by Vaswani et al., transformers are able to capture long-term dependencies in sequential data like natural language. This is possible because they use self-attention mechanisms, which allow the model to focus on specific parts of the input when processing it. This means that the model can learn to pay more attention to certain words or phrases in a sentence, which allows it to capture subtle nuances and relationships in the data that other models might miss. Additionally, transformers are able to process input in parallel, which makes them more efficient and faster to train than other models that process input sequentially.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/0*gHr0bo2oz6hMOUqv.png" /><figcaption>The Annotated Transformer (Harvard)</figcaption></figure><p>One of the most well-known large language models is GPT-3, developed by OpenAI. GPT-3, an autoregressive decoder LLM, has been praised for its ability to generate text that is difficult to distinguish from text written by a human, and it has been used in a range of applications, from chatbots and machine translation to text summarization and content generation. Another popular large language model is BERT, developed by Google. BERT, a bidirectional LLM, is designed to understand the context and meaning of words in a sentence, and it has been used in a variety of natural language processing tasks, including sentiment analysis and question answering.</p><p>The rise of large language models has led to both excitement and concern among experts. On the one hand, these models have the potential to greatly improve natural language processing and many existing applications. On the other hand, there are concerns about the potential misuse of these models, such as in the generation of fake news. <strong>The purpose of this article is to put recent developments like ChatGPT and Stable Diffusion into perspective and understand how the ongoing exponential growth of LLM robustness fits into the larger vision of Artificial General Intelligence (AGI)</strong>.</p><h3><strong>The 2nd Order Perspective</strong></h3><p>With the recent release of ChatGPT, there has been more existential discussion surrounding the capabilities of machine learning than ever before. What makes ChatGPT in particular so impressive? Frameworks like AlphaCode, Copilot, and Ghostwriter enable code autocomplete and the writing of entire segments from scratch. Stable Diffusion, DALL-E, and DreamBooth enable the generation of image media for whatever one can dream up. But ChatGPT? — <strong>it feels more <em>human</em> than any LLM we have encountered so far</strong>. The robust conversational style and smart responses across a variety of prompts are simply mindblowing. From simulating classical thought experiments like the Trolley problem to writing well-documented code for nontrivial algorithmic questions, ChatGPT is a science fiction dream come true. Its impact is also only starting to be felt. Education will slowly be changed forever: drafts, essays, papers, and even books can be written in minutes not hours. When it comes to developers, the Software Engineering industry will shift towards adaptive problem solvers who can ask the right questions and ideate better products since a ChatGPT can write 99% of code for most workflows. Prompt engineering is becoming a craft in itself: GitHub-style repositories for successful prompts and prompt playgrounds like <a href="https://www.everyprompt.com/">Everyprompt</a> have already begun to emerge. Moreover, query-based approaches to use models like GPT-3 and ChatGPT for search have also started sprouting as seen with concepts like <a href="https://github.com/jerryjliu/gpt_index">GPT-index</a>. These parallel applications are just scraping the surface of what can be unlocked with GPT-N models.</p><h4>GPT-N Models</h4><p>With GPT-4 on the way (within the next few months), you may be wondering: what’s the difference between GPT-2 and GPT-3? Moreover, how will GPT-4 build on the wonders of GPT-3?</p><p>Since GPT-3 is trained on a much larger dataset and has significantly more parameters than GPT-2, it is capable of generating more realistic and diverse text. Given the larger scale of engineering and greater amount of parameters, GPT-3 has a <em>larger context window</em> than GPT-2. The context window is the amount of context that the model considers when generating text. A larger context window allows the model to generate more coherent and realistic text because it has more information to work with. GPT-3 has a context window of 4096 tokens, while GPT-2 has a context window of 1024 tokens.</p><p>Let’s now consider the original GPT model. Yes, GPT-2 has a larger context window than the original GPT. GPT-2 has a context window of 1024 tokens, while the original GPT has a context window of only 512 tokens. We can now extend this idea to a bigger-picture theme: the performance improvements of GPT-N models are facilitated by <strong>larger context windows</strong> alongside a larger number of parameters within the model. Given this, we can extrapolate that GPT-4 will enable even richer text generation with more in-depth relational and semantic power. But what about ChatGPT? ChatGPT is almost a GPT-3.5 but with a twist — ChatGPT is powered by reinforcement learning (RL). In reinforcement learning, the model is trained to maximize a reward signal by taking a series of actions. In the case of ChatGPT, the model is trained to generate responses to input text that are relevant, coherent, and engaging. The model is rewarded for generating responses that are similar to those produced by human conversationalists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*JYvTERP2-ekQbi0Ty0rwCQ.png" /><figcaption>ChatGPT RL Mechanism</figcaption></figure><p>To train ChatGPT using reinforcement learning, the model is presented with a conversational context and a prompt, and it must generate a response. This response is then evaluated by a human evaluator, who assigns a score based on its quality. The model’s response is then compared to the responses produced by human conversationalists, and the model is rewarded for generating responses that are similar to the human responses. Over time, this reinforcement learning process allows the model to improve its ability to generate high-quality responses to conversational prompts.</p><p>Based on this discussion, it’s easy to see that <strong>GPT-n</strong> models will only get better with larger context windows, AKA more global knowledge as a result of greater scale (billions more parameters). However, ChatGPT, a ~GPT-3.5 of sorts, presents a new frontier to be explored: treating LLMs as agents through applications of techniques like reinforcement learning and meta-learning.</p><h4>How History ties into the Next Frontier</h4><p>Let’s now step back in time. Prior to the deep learning revolution of the 21st century, there was the time of GOFAI: Good Old Fashioned Artificial Intelligence. At the dawn of our modern age of machine learning, GOFAI was predominately composed of rule-based or logical agents. Significant contributions of the GOFAI era include search algorithms, automated scheduling, constraint-based reasoning, the semantic web, knowledge graphs, etc. IBM’s DeepBlue, a classical system of the GOFAI era, was a chess-playing computer that was developed by IBM in the late 1990s. It was designed to be able to play and win against human chess champions.</p><p>DeepBlue used a combination of advanced computer hardware and software to analyze and evaluate chess positions: an <strong>optimized brute force</strong>. It was capable of evaluating up to 200 million positions per second, which allowed it to search deeper into the game tree and consider a wider range of possible moves than a human chess player could. In fact, DeepBlue was essentially the parallelization of the alpha-beta pruning algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qxF864pHSBM4c_fa.jpg" /><figcaption>DeepBlue with a human interpreter playing Garry Kasparov (1996)</figcaption></figure><p>Now entering the 2000s, we begin to see the advent of modern deep learning systems. With more powerful compute and more data than ever before, neural networks (multi-layer perceptrons) begin to emerge and enable <strong>optimal models for nonlinear distributions of data</strong>. AlexNet, VGG, ResNet, etc. — these were million-parameter neural networks that consisted of novel techniques like backpropagation, dropout, batch norm, etc. A relevant example of the marvels of modern deep learning is AlphaGo. Developed by Google DeepMind, AlphaGo is a computer program that uses machine learning to play the board game Go. It uses a neural network trained on expert Go games, and a Monte Carlo tree search algorithm, to evaluate the current board position and select the best move. This allows it to defeat even highly skilled human players. The Monte Carlo tree search is a reinforcement learning heuristic scaled across millions of neurons within the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*yKWqTQvCqpLJcpac.jpg" /><figcaption>The wizardry of AlphaGo against Lee Sedol, the former World Champion of Go (2016)</figcaption></figure><h4>The Pseudo Singularity</h4><p>As we progress through the 2020s, the pieces are in place. From GOFAI to modern deep learning, the last few years set the stage for LLMs: multi-billion parameter models essentially trained on the internet to capture long-term dependencies. However, there’s a major caveat to all the magic of LLMs: <strong>nothing that a GPT-N model produces is original relative to the original data it was trained upon</strong>. Current models are essentially <em>great listeners &amp; idea diffusion mechanisms</em>: thoughtful, expressive, and multi-modal echo chambers of the internet.</p><p>We’ve reached the crux of the discussion: <strong>how do we make the leap beyond GPT-N models</strong>? History is a teacher of the past and based on the developments of the last few decades, it might as well take the <em>next transformer</em>. Let’s generalize: reasoning with different media (text, image, video, etc.) while putting together various ideas in a latent space to form novel, nonobvious arguments may be the next frontier. <strong>Part of the reason why ChatGPT is so amazing is that its RL mechanism via Human Feedback may serve as the earliest form of this idea</strong>. Imagine a generation of LLMs that can generate completely novel images or text and explain the reasoning process behind it: one could even think of this as a limited form of <em>consciousness</em>. Essentially, an LLM of the future could map out why it produced the concepts or arguments that it did rather than just act as a stochastic parrot of the internet like today’s diffusion and generation mechanisms. If such an LLM was possible, it would then be theoretically impossible to <em>trick it</em> into providing factually incorrect outputs since those would not align with the model’s internal reasoning. What would it take to create this seemingly magical reasoning LLM? —based on historical trends, likely a lot of fundamental R&amp;D innovation with scaling meta-learning/multi-task frameworks alongside reinforcement learning. Perhaps the <em>next transformer</em> will be an agent that at a high level, rewards cross-domain knowledge.</p><p>Another interesting idea in regard to the future of LLMs is <strong>sparsity</strong>. GPT-3 and existing models are typically dense models: models where all neurons are active across billions of parameters. Sparsity can help to reduce the number of parameters in a model, which can make it more efficient and easier to train. Moreover, sparsity can also help to improve the interpretability of a model. In other words, a sparse model is easier to understand and explain, because it has fewer parameters and is therefore less complex. Lastly, sparsity can also help to improve the generalization ability of a model. In other words, a sparse model is better able to generalize from the training data to new, unseen data, because it has fewer parameters and is therefore less likely to overfit the training data.</p><p>If sparse LLMs with novel reasoning abilities will one day exist, this could perhaps unlock answers to deep questions in fields like computational complexity and biology. <em>Perhaps, this could be the first instance of AGI?</em></p><h3>AGI &amp; Biology</h3><p>Given we’ve discussed the future of LLMs in regard to what could one day be AGI, I want to ask a fundamental question: <strong>what does it mean to be human</strong>? Emotion, consciousness, and morals are all good starting points. Going back to the opening example, Johann Gutenberg and his printing press revolutionized how humans mass-digest information. Over decades and centuries, this certainly would have created new behavior in regard to how our brains process information. Today’s billion-parameter models/knowledge diffusers are similarly on track to change how we access and interact with information. This begs a deeper question: are we approaching an asymptote where these AI systems will mimic humans themselves? Currently, text produced by GPT-3 is essentially indistinguishable from human writers. However, a recent paper by Geoffrey Hinton seems to doubt the current state of deep learning, even large LLMs, to reason like humans:</p><blockquote>It seems very unlikely that the human brain uses back propagation to learn. There is little evidence of backprop mechanics in biological brains (no error derivatives propagating backwards, no storage of neuron activities to use in a packprop pass, …). — Geoffrey Hinton</blockquote><p>Simply put, humans likely don’t backpropagate in regard to learning. This idea prompts us to question our current machine-learning techniques: for example, how would we enable pattern recognition similar to humans without explicitly backpropagating gradients? Given this, it makes sense for researchers to dive deeper and essentially <strong>question <em>the rules of the game</em></strong>. My personal view is that nature is <em>simple</em> and if nature is the paradigm we are striving towards, we should aim for AI systems that similarly capture complex ideas with simplicity. With the amazing folks and projects at institutions like OpenAI, DeepMind, and Google Brain, we’re certainly going somewhere in regard to questions of model consciousness, cross-domain reasoning, and the grand task of AGI. As my mentor, Prof. Bernie Widrow said, <em>Nature is the best machine of them all.</em></p><h3>Short-term Thoughts and Ideas</h3><p>Given this discussion of GPT-N models, AGI, and nature as a model, it’s certainly difficult to predict where we will be in 5 years, 10 years, 20 years, 50 years, etc. Lots of potential exists and ChatGPT could just be a taste in regard to what LLMs can bring to the world. This could be more than just an<em> iPhone moment</em>. As Kevin Kelly references in his books, technology exists to create new forms of understanding. Moreover, technology many times mimics the grandest system of them all: life</p><blockquote>“There is no communication without the nerves of electricity. There is no electricity without the veins of coal mining, uranium mining, or even the mining of precious metals to make solar panels. There is no metabolism of factories without the ingest of food from domesticated plants and animals, and no circulation of goods without vehicles. This global-scaled network of systems, subsystems, machines, pipes, roads, wires, conveyor belts, automobiles, servers and routers, institutions, laws, calculators, sensors, works of art, archives, activators, collective memory, and power generators — this whole grand system of interrelated and interdependent pieces forms a very primitive organism-like system.”</blockquote><p>Today, developers and enthusiasts around the world are fortunate enough to start building out vertical applications through APIs that access the GPT-n models. These generative models are creativity maximizers: new forms of content can be produced, new ways to iterate on content may become relevant, and human-computer interaction will change. However, whether it be text, audio, or images, humans in this present time will still need to find creative applications of the LLMs. With the coming release of GPT-4 and additional models across multiple modalities, I couldn’t be more excited to see what’s in store next. From trillion parameter models to multimodal SOTA performance, the world is changing week-by-week and with OpenAI leading the way as the modern Bell Labs, there’s so much more to come.</p><p><em>*ChatGPT also helped relieve writer’s block and aided with multiple sections as I wrote this article :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1abe2824ccbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thank you, Roger]]></title>
            <link>https://medium.com/@siddrrsh/thank-you-roger-4e5f0615b568?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e5f0615b568</guid>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 08:31:13 GMT</pubDate>
            <atom:updated>2022-09-16T17:23:47.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNFc6a3bNoikAV654TYNLg.jpeg" /><figcaption>Me with Fedal, Indian Wells 2013</figcaption></figure><blockquote>“The metaphysical explanation is that Roger Federer is one of those rare, preternatural athletes who appear to be exempt, at least in part, from certain physical laws.” — David Foster Wallace</blockquote><p><strong>A Game of Inches</strong></p><p>Sunday, July 14th. Our living room was quiet. The match clock read 4:11. Two match points — it was about to happen. Roger Federer was going to win his ninth Wimbledon and we were witnessing it on live television. His first serve bites the tape. *Oh of course, that was expected — <em>he’s going to hit the second out wide and force an error from Novak</em>. On the second serve, Novak swings back and Roger pushes the forehand just a few inches right of the line. “Okay, one more, he still has one more.” I felt a terrible drop in my heart. I had witnessed this before: US Open 2010, US Open 2011, and even as recently as Indian Wells 2018. It was another <em>40–15</em>. <em>He needs to finish it here. No question about it</em>. We held our breaths and watched Roger pull a nervous first serve down the line. Novak replied with a chip forehand, setting up the shot to take it all. It was the same setup as the end of the Wimbledon 2012 final. A serve down the tee paired with the forehand to the opponent’s weaker side. At that moment, I closed my eyes. I wanted to hear the roars from my brother, dad, and mom. I wanted to hear cheers and the crowd going wild on the television. I wanted to see Roger fall to his feet and put his hands in the air. When I opened them, a stout Djokovic had just rolled a passing shot into the right corner of the service box. A perfect shot at that moment, one requiring mental fortitude and guts of steel. At that moment, it felt as though time stopped. My dad had even earlier commented that it seemed as though the entire world wanted Federer to win this match. The packed Wimbledon crowd cheering him on, the sunshine flowing into Centre Court, the history on the line.</p><p>Alas, over 40 minutes later, Roger would shank a forehand at the 12–12 tiebreak, sending a ball into the crowd and letting the dream of a final Wimbledon title sail away. As the players walked to the net to greet one another, I walked out of the room. With small tears flowing and a lump in my throat, I was in absolute disbelief. “This was just not right. How did this happen? <em>Why did it happen</em>?” Novak Djokovic is a great champion, but how could our beloved Roger not wrap up his career in such heroic fashion? Despite the seeming “choke” and the heavy disappointment of a lost opportunity that would never return again, that day, more than ever, I was convinced that Roger Federer was my champion, a living legend who I would always stand by.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u7xQpCqodktn1Buf.jpg" /><figcaption>A defeat to remember: Roger after Wimbledon 2019.</figcaption></figure><p><strong>The Melbourne Miracle</strong></p><p>Sunday, 29th January. “Wake up. Check the score.” It was 3:20 AM on a Saturday night, but my heart couldn’t be racing more. Having just awakened from my preset alarm, I was ready to check. Deep breathes — <em>Okay let’s do it</em>. I pulled up Google on the iPhone and typed in “Roger Federer.” As the page loaded, I waited in silence. Suddenly, a flash of light and the ESPN app read “6–4, 3–6, 3–0 Federer.” It felt like a shot of adrenaline just flew into my heart. The two GOATs were locked in a battle in the early hours of the morning and I could sneak to my TV and witness it. This match was huge. This was Roger’s best shot at a grand slam title since 2015. Against his great rival, Rafa, any lead would be monumental. As I powered on the TV, I was met with an unexpected flourish: the Federer backhand. For years, I could recall me and my dad yelling at the screen, saying “Roger, don’t keep slicing … Just hit it!” but this moment felt different. Roger was hitting the backhand without fear.</p><p>He had been out of the game for six months leading up to 2017, reeling from a knee injury sustained at Wimbledon 2016. No one had thought Roger would even reach the final of the Australian Open, let alone the late stages of the tournament given the difficulty of his draw. Yet, the maestro simply showed that age was just a number, beating the likes of Tomas Berdych, Kei Nishikori, and Stan Wawrinka to make the final. The Australian Open of 2017 revealed a different Federer, one who played without expectation and put it all on the line because he had one goal: title number 18. For years, so many critics doubted Roger. Since early 2009, people questioned his longevity, his ability to keep up with Novak and Rafa, and his hunger. But Roger showed them that he wanted it more than ever, strutting into the changeover with a phenomenal 6–1 set in the bag. One set away from a timeless championship, Roger was not yet free. Rafa turned on the jets and stormed away with an early lead in the 4th set. As the 4th set seemed to slip away, my dad also awoke and came to our living room, likely having heard my “oohs” and “ahs” during this thriller of a match. As Rafa secured the 4th set and jumped up to a 3–1 lead in the 5th, our confidence in Roger wavered and the opposing outcome seemed ever more likely. However, little did we know that we were about to witness a champion’s rally.</p><p>From 3–1 down in the fifth set, Roger Federer played five heroic, masterful games. He managed to hold serve, came clutch in breaking Rafa at the crucial moments, and as we all remember won an absolute “lung buster” of a point at 4–3 40–40. That rally would come to symbolize the warlike intensity and swings of the match as a whole. Rafa aggressively trying to pin Roger with loopy shots, Roger counterpunching with the backhand to get Rafa on the run, scenes of phenomenal defense from both players, and finally a seemingly immortal stretch forehand to end a historic rally. As was said on the ESPN broadcast, <em>I will never ever forget that rally</em>. That moment and the finish of that match signaled that Roger had fought off his demons. To come back from injury and rally to beat his greatest rival was a superhuman feat. Roger had ascended from an incredible sportsman to a generational athlete. With the digital hawkeye line calling system ready to determine the outcome of the match at 5–3, my dad and I held our breaths. When we saw the black silhouette of the ball fall squarely on the line, we felt a surge of absolute bliss. “<em>HE DID IT</em>.” I really felt like I myself just won the Australian Open. As the trophy ceremony celebrated an incredible match and the sun began to rise back home, I felt at peace with the outcome, beyond thrilled that my idol and legend had done the impossible and near unthinkable. Yet, I could distinctly remember Roger saying the words “<em>I hope to come back and play again.</em>” Even in 2017, we knew we didn’t have much time left with the maestro.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ze37xQxePJ_iF4eP" /><figcaption>Glory for Roger and his fans @ AO 2017</figcaption></figure><p><strong>Defining Greatness</strong></p><p>In sports, we frequently ask ourselves the age-old question: what does it mean to be great? Is greatness solely based on numbers and statistics or is it a more subjective quality where personal attributes have equal emphasis alongside numeric achievements? Long story short, it is easier to make a quantitative argument for why Novak Djokovic and Rafa Nadal have exceeded Roger Federer as “GOATs” of the game. Grand Slam Titles, Grand Slam Finals, Match Wins, Masters 1000s, ATP 500s, Weeks at #1, etc. At the end of his illustrious career, Roger no longer leads his counterparts in the defining metrics of tennis. However, there’s something about Roger that makes him so beloved by millions of fans around the world. When I walk into a Uniqlo store, more often than not his signature RF logo hat is sold out. When one looks for players practicing ahead of matches at tournaments, getting a front-row seat to watch Roger is the most coveted. When I converse with friends who’ve never followed pro tennis before, the name Roger Federer still echoes greatness. Roger Federer’s legacy and gift to the sport of tennis is too rich to distill down to a singular thesis. However, he is the player who transformed tennis into artwork.</p><p>When timeless painters like Monet and Michelangelo created their works, there is an almost elemental feeling to the quality of their craft: an aura. Federer’s ever-present aura has never been seen before in the sport of tennis, both in his on-court and off-court activities. Despite his fair share of tantrums and swearing early during his career, Roger would come to symbolize the tennis equivalent of a Swiss army knife: tactile, elegant, and deadly. His slices seemed near effortless yet would cut through the air. His serve was streamlined and elegant in form yet would have laser precision and unmistakable speed. Most famous of all, his forehand was a weapon no opponent would ever want to face on the court: one of the greatest if not the greatest shot tennis has ever seen. On the court, a prime Roger Federer was a sight to behold. I still go back and watch as much old footage of Federer as possible to revel in the dominance.</p><p>However, we fans also love Roger because of his admirable qualities and chivalry. Going from a ballboy raised in a small canton of Switzerland to an iconic legend of sport is no easy feat yet Roger accomplished it with style and was elegance personified. With a humble confidence and suave attitude both on and off the court, it almost became hard to not root for Federer both during his meteoric rise from 2003 to 2007 and in his periodic gaps in form. From the heartbreak experienced in the 2009 Australian Open to the rock bottom feelings of the 2013 season, Federer has dealt with hardships that not all players would have been able to surmount. It would always have been easy for him to be satisfied after eclipsing Pete Sampras&#39;s record but simply put, he loves the game of tennis. In the last decade in particular, even after reaching his 30s, Federer graced us with his determination to give the sport more.</p><p><strong>Inspired by Roger</strong></p><p>Given Roger officially retired from professional tennis on September 15th, 2022, I decided to write this piece to pour lots of raw emotions and thoughts into writing. In terms of my personal feelings and for my family, my life will not be the same without having Roger actively playing on the tour. When Federer lost a match, the mood for that day would already be a bit solemn by default. When he would win, even on my worst days it gave me something to smile about. Lots of my friends can attest to this but I can recall Federer’s past match results and scores from the last 20 years with high accuracy. From the 2006 US Open to Shanghai 2014 to the 2019 French Open, it’s all locked away in my memory. The reason for this: I love watching Roger’s highlights. In fact, in middle school and high school, a lot of my free time went into watching Roger’s highlights from various matches across the years. I was simply captivated by his style of tennis and couldn’t get enough of it: even if it meant watching the same matches and points over and over again. Seeing Roger in person was an even more special privilege. It made the trips down to Indian Wells more worth it than ever and it was also so wonderful to see him light up stadiums as part of the Match for Africa exhibitions in Seattle and San Jose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*1yDxolhkycDwuLjT.jpg" /><figcaption>Neo-Federer in full flight @ IW 2017</figcaption></figure><p>Roger’s impact also fell quite literally on my tennis. Just like everyone else, I wanted to play just like him. I wasn’t able to ever wield a one-handed backhand but I did try my best to have a similar slice that could punish opponents. I also put work into making my forehand even a fraction as fearsome as his was. On my 18th birthday, I even got the racket I always wanted: Federer’s very own all-black signature Wilson Pro Staff 97. Having played the game for over 15 years at this point, I can say with certainty that watching Federer so often on the screen has helped my game as much as it has introduced unorthodox aspects like hitting the “prettiest” shot or going for winners that you would see on the ESPN highlights reel. While I still can’t hit an amazing tweener, I’m pretty satisfied with my running forehand passing shot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*2I0Ppj7HTN7N4GzftsVReA.png" /><figcaption>Some Federer magic of my own :)</figcaption></figure><p><strong>The Religious Experience</strong></p><p>For the last few years, it has been clear that Roger’s retirement from professional tennis has been inevitable. A lackluster finish in the quarterfinals of Wimbledon 2021 accompanied by setbacks with knee surgeries and further aging have defeated fans’ hopes for a Roger comeback. However, there is still so much to celebrate even when the great man decides to hang up his racket. From heartwrenching defeats like Wimbledon 2019 to moments of ecstasy like Australia 2017, there is symmetry in the career of a generational athlete like Federer. For each crushing defeat, there have been numerous victories: Wimbledon 2009 was the antithesis of Wimbledon 2019, matches where the better player could not complete the job. Australia 2009’s heartbreak was matched if not bettered by the glory of winning it all in 2017. For all the 40–15s, there have been many great escapes and the general blessing of Roger’s fitness late into his 30s. Just the fact that a 37-year-old could still compete at the upper echelons of tennis is an achievement on its own. Even more broadly, as the New York Times puts it: <em>Federer’s grace, speed, power, precision, kinesthetic virtuosity, and seriously wicked topspin have transfigured men’s tennis</em>. And for multiple decades, his tennis has been a gift to fans and lovers of the sport.</p><p>The point goes beyond Federer. The Big 3 and their history of incredible matches with twists and turns have revitalized the tennis community as a whole. Records are meant to be broken but winning 5 US Opens in a row, claiming 8 Wimbledons, winning 13 French Opens, and winning 9 Australian Opens are near inhuman feats. Rafa and Novak are undoubtedly GOATs of this sport as well and the Big 3 have only sharpened one another through their epic battles. Uplifting Roger doesn’t need to bring down Rafa or Novak by default. History will remember this era of tennis as the golden age or renaissance of sorts and these three names will forever be entangled.</p><p>However, as the sun sets on this chapter for Roger, we’re reminded that time is limited. Nothing lasts forever and for fans of tennis, we must cherish these great champions on and off the court. <em>To Roger personally</em> — it has been a privilege to have spent my childhood and grow up with you. In your victories we took comfort and in your defeats we took lessons. For me, you are truly the greatest and tennis will not be the same without you. The quote below captures this feeling best:</p><blockquote><em>“When you do something best in life, you don’t really want to give that up — and for me it’s tennis.” — Roger Federer</em></blockquote><p><strong>Thank you, Roger. You’ll always be my idol and hero for the journey that lies ahead.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9P861t65wGqJYPUa.jpg" /><figcaption>My Hero</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e5f0615b568" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Beginner’s Guide to TensorFlow]]></title>
            <link>https://medium.com/data-science/the-ultimate-beginners-guide-to-tensorflow-41d3b8e7d0c7?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/41d3b8e7d0c7</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-neural-network]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[keras]]></category>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Mon, 24 Aug 2020 20:03:12 GMT</pubDate>
            <atom:updated>2020-08-25T16:04:52.900Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HokY_YXyJIUMAtirvay1UQ.jpeg" /><figcaption>Neural Art (<a href="https://github.com/topics/neural-style-pt">Source</a>)</figcaption></figure><h3><strong>Introduction</strong></h3><p>In this tutorial, we will cover TensorFlow in enough depth so that you can train machine learning models from scratch!</p><p>TensorFlow is Google’s flagship library for machine learning development. It is used both commercially and by developers for building and deploying machine learning modules. There are two broad versions of TensorFlow — 2.X and 1.X. Both allow for similar functionality, but 2.X uses a cleaner API and has some slight upgrades. It is important to understand that TensorFlow has grown from just a software library to an entire ecosystem for all types of machine learning. APIs like Keras make it extremely simple to train and test deep learning networks in a few lines. (We will cover this towards the end of this tutorial). This tutorial assumes a basic understanding of Python 3 and some degree of familiarity with linear algebra.</p><h3><strong>Mathematical Background</strong></h3><p>Let’s get started with some fundamental background on the mathematics behind TensorFlow. There are three main constructs for TensorFlow operations: vectors, arrays (matrices), tensors. A vector is a mathematical object that has a direction and a magnitude. It is used to find the position of one point in space relative to another point. An array is an arrangement or a series of elements such as symbols, numbers, or expressions. Arrays can be n-dimensional, so a matrix is an array with 2 dimensions. A tensor is an object describing the linear relationship among scalars, vectors, and other tensors. In other words, it is the stacking of multiple arrays to create higher dimensional structures. A practical example of a tensor in action is with an image. When an RGB image is processed, it is a 3-D tensor with layers for each color across the dimensions of height and width. Hopefully, this graphic should clarify the differences:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*XrJv7YqRyDluKvXnC-3GVg.png" /><figcaption><a href="https://www.slideshare.net/BertonEarnshaw/a-brief-survey-of-tensors">Source</a></figcaption></figure><p>It would also be useful to understand the Rank of a Matrix. The rank of a Matrix is the number of linearly independent column or row vectors. Before moving on, we will assume that you understand basic linear algebra — transposes, inverses, matrix multiplication, etc. Let’s now define these concepts with some code.</p><pre>import numpy as np </pre><pre>a = np.array([[1,2,3], [4,5,6], np.int16)<br>b = np.mat([1,2,3])</pre><p>With this code, we use the NumPy library to initialize both a numpy.matrix and a 2D numpy.ndarrray. There are basic differences in these two structures, for example, the fact that numpy.matrix has a proper matrix multiplication interface, but they effectively achieve a very similar purpose. Let’s now discuss how we can implement a tensor. Remember that a tensor is an object that describes the linear relationship between scalars, vectors, and other tensors. A 0th order tensor (or Rank 0) can be represented by a scalar. A 1st order tensor (or Rank 1) can be represented by an array (1-d vector). A 2nd order tensor (or Rank 2) can be represented by a matrix (2-d array). A 3rd order tensor (or Rank 3) is a 3-dimensional array. These examples are implemented in code for reference.</p><pre>t_0 = np.array(50, dtype=np.int32)</pre><pre>t_1 = np.array([b&quot;apple&quot;, b&quot;peach&quot;, b&quot;grape&quot;])</pre><pre>t_2 = np.array([[True, False, False], [False, False, True]])</pre><pre>t_3 = np.array([[ [0,0], [0,1], [0,2] ], [ [0,0], [0,1], [0,2] ],[ [0,0], [0,1], [0,2] ]])</pre><p>Objects in TensorFlow will always have a shape. A shape describes the number of dimensions a tensor can hold, including the length of each dimension. The shape of TensorFlow can be either a list or a tuple. This may not be simple to understand at first, so let’s break it down with an example. What would the shape be for the list [2,3]? This list describes the shape of a 2-D tensor of length 2 in its first dimension and length 3 in its second dimension. In other words, this is a 2x3 matrix! Let’s see some more shapes broken done in code:</p><pre>s_1_flex = [None]</pre><pre>s_2_flex = (None, 3)</pre><pre>s_3_flex = [2, None, None]</pre><pre>s_any = None</pre><p>If you are confused about what the “None” keyword refers to, it says that the dimension can be of any size. For example, s_1_flex is a 1-D array with a size of N.</p><h3><strong>Graphs and Sessions in TensorFlow</strong></h3><p>At the center of Tensorflow is the concept of the graph. Before we discuss the graph, let’s talk about eager execution. Eager execution in TensorFlow means that each operation is executed by Python, operation by operation. Eager TensorFlow runs on GPUs and is easy to debug. For some of us, we will be happy to keep our TensorFlow projects in Python and will never leave. However, for other users, eager execution means prevents a “host of accelerations otherwise available” [1]. Luckily, there are ways to both enable and disable eager execution:</p><pre>import tensorflow as tf</pre><pre># to check for eager execution<br>tf.executing_eagerly()<br></pre><pre># to enable eager execution<br>tf.compat.v1.enable_eager_execution()</pre><pre><br># to disable eager execution<br>tf.compat.v1.disable_eager_execution()</pre><pre><br># After eager execution is enabled, operations are executed as they are defined and Tensor objects hold concrete values, which can be accessed as numpy.ndarray`s through the numpy() method.</pre><pre>assert tf.multiply(6, 7).numpy() == 42</pre><p>If we want to extract our operations so that we can access them outside of Python, we can make them into a graph. As a note, TensorFlow is updated rapidly and functions and definitions may be adjusted, so always check what version of TensorFlow you are using. This can be done in the following line of code:</p><pre>print(tf.__version__)</pre><p>For this tutorial, we are using Tensorflow 2.3. Now back to graphs! Graphs are data structures that contain a set of tf.Operation objects. Graphs are useful since they can be saved, run, and restored without the original Python code. A TensorFlow graph is a specific type of directed graph that is used for defining computational structure. In TensorFlow graphs, there are three main objects which can be employed for operations. First is the <em>constant</em>. This creates a node that takes a value and does not change. Here is an example of a constant in action: tf.constant(6,tf.int32,name=’A&#39;). The next graph object in TensorFlow is the <em>variable.</em> Variables are stateful nodes that output their current value; meaning that they can retain their value over multiple executions of a graph. Here is an example of a variable in action: w = tf.Variable(, name=). The final object is the <em>placeholder</em>. Placeholders can feed in future values at runtime in a graph. There are used when a graph depends on external data. Here is one implemented: tf.compat.v1.placeholder(tf.int32, shape=[3], name=&#39;B&#39;). Let’s now launch our first graph. This example does not explicitly launch a graph, but it shows how we can run operations within a Session:</p><pre># Launch the graph in a session.</pre><pre>with tf.compat.v1.Session() as sess:</pre><pre>   # input nodes<br>   a = tf.constant(5, name=&quot;input_a&quot;)<br>   b = tf.constant(3, name=&quot;input_b&quot;)</pre><pre>   # next two nodes<br>   c = tf.math.multiply(a, b, name=&quot;input_c&quot;)<br>   d = tf.math.add(a, b, name=&quot;input_d&quot;)</pre><pre>   # final node<br>   e = tf.add(c, d, name=&quot;input_e&quot;)</pre><pre>   print(sess.run(e))</pre><p>To add nodes to our “graph”, we can add, subtract, or multiply existing nodes. In the case above, nodes c, d, and e are all operations of previously initialized nodes. To run this graph, we ran it in what is known as a tf.Session. When not using eager execution, we will need to run our graph in a Session. In this case, we ran it in a Session known as sess. In general, sessions allow us to execute graphs. In TensorFlow 2, sessions are essentially gone. Everything is run in one global runtime. However, for the purposes of this tutorial, we will continue to review Sessions. Here is an example of a concrete graph in action:</p><pre>graph = tf.Graph()<br>with graph.as_default():<br>  variable = tf.Variable(42, name=&#39;foo&#39;)<br>  initialize = tf.global_variables_initializer()<br>  assign = variable.assign(13)</pre><pre>with tf.Session(graph=graph) as sess:<br>  sess.run(initialize)<br>  sess.run(assign)<br>  print(sess.run(variable))<br># Output: 13</pre><p>In this code, we create a graph and initialize a variable named “foo”. We then assign “foo” to a new value. After creating the graph, we run it in a Session. Let’s clarify. Graphs and sessions are not necessary if eager execution is enabled. In other words, there would be no need for sess.run().</p><h3><strong>Tensorboard</strong></h3><p>Now that we have discussed how graphs and sessions work in practice, you must be wondering — how do we examine them? We can use a tool known as Tensorboard. This is a tool integrated with Tensorflow 2.0 and it can be used to visualize the graph. It also has other tools to understand, debug, and optimize the model. The backend is now tf.keras in TensorFlow 2.0. Let’s now use Tensorboard to visualize a graph. Here is a simple starting example. Note that you can test this code out in Google Colab:</p><pre>%load_ext tensorboard</pre><pre>summary_writer = tf.summary.create_file_writer(&#39;logs/summaries&#39;)</pre><pre>with summary_writer.as_default():<br>  tf.summary.scalar(&#39;scalar&#39;, 3.5, step=2)</pre><pre>tensorboard --logdir /logs/summaries</pre><p>This is a simple example where we write a tf scalar to our summary writer. We then run it in logs/summaries (our directory) to access Tensorboard. In most cases, Tensorboard output usually looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/140/1*v4BpSg1jnp1SoJZcpcbSvg.png" /><figcaption>Graph Output</figcaption></figure><p>Let’s now unpack a more sophisticated example of using Tensorboard to visualize and debug graphs:</p><pre># Load the TensorBoard notebook extension<br>%load_ext tensorboard</pre><pre>import tensorflow as tf<br>import datetime</pre><pre># Clear any logs from previous runs<br>!rm -rf ./logs/</pre><pre># initialize your directory <br>logdir = INSERT_DIRECTORY</pre><pre>g = tf.compat.v1.Graph()</pre><pre>with g.as_default():<br>  step = tf.Variable(0, dtype=tf.int64)<br>  step_update = step.assign_add(1)<br>  writer = tf.summary.create_file_writer(logdir)<br>  with writer.as_default():<br>    tf.summary.scalar(&quot;my_metric&quot;, 0.5, step=step)<br>all_summary_ops = tf.compat.v1.summary.all_v2_summary_ops()<br>writer_flush = writer.flush()</pre><pre>with tf.compat.v1.Session(graph=g) as sess:<br>  sess.run([writer.init(), step.initializer])</pre><pre>  for i in range(100):<br>    sess.run(all_summary_ops)<br>    sess.run(step_update)<br>    sess.run(writer_flush)</pre><pre># run in tensorboard<br>%tensorboard --logdir logdir</pre><p>This example uses the tf.summary.create_file_writer(logdir) to make sure that the output is read in Tensorboard. Now that we have seen Tensorboard in action, we’ve finished the core concepts of TensorFlow. However, TensorFlow is not as useful if we do not apply it for machine learning. We will now walk through Keras, TensorFlow’s simple API for training neural networks.</p><h3><strong>Keras</strong></h3><p>Simply put, Keras makes it quite simple to train and test your machine learning models. Let’s now demonstrate Keras in action. (<em>All Credit to </em><a href="https://www.tensorflow.org/tutorials/keras/classification"><em>TensorFlow</em></a>) We start by importing libraries and checking our version. (This tutorial uses Tf 2.3):</p><pre># TensorFlow and tf.keras<br>import tensorflow as tf<br>from tensorflow import keras<br><br># Helper libraries<br>import numpy as np<br>import matplotlib.pyplot as plt<br><br>print(tf.__version__)</pre><p>Let’s now download a sample dataset. In this case, we will use the Fashion MNIST Dataset. The code below downloads the set directly from keras.datasets:</p><pre>fashion_mnist = keras.datasets.fashion_mnist<br><br>(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()</pre><p>When we load this dataset, we get four NumPy arrays: train_images, train_labels, test_images, test_labels. If you are familiar with machine learning then you would know that we need a certain number of images (data) to train and some samples to test on. Each image in our dataset is a 28x28 NumPy Array and the pixel values range from 0 to 255. The labels are an array of integers, ranging from 0 to 9. These correspond to the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yo9Y6OSxtNb4He8PL62F5g.png" /><figcaption>Labels for each class</figcaption></figure><p>Since class names are not included in the set, we can store them in a list:</p><pre>class_names = [&#39;T-shirt/top&#39;, &#39;Trouser&#39;, &#39;Pullover&#39;, &#39;Dress&#39;, &#39;Coat&#39;, &#39;Sandal&#39;, &#39;Shirt&#39;, &#39;Sneaker&#39;, &#39;Bag&#39;, &#39;Ankle boot&#39;]</pre><p>Before training the model, let’s explore the set. In our train_images we have 60,000 images and in our train_labels, we have 60,000 labels. Each label is an integer between 0 and 9, as given by this code:</p><pre>train_labels<br># output: array([9, 0, 0, ..., 3, 0, 5], dtype=uint8)</pre><p>Likewise, there are 10,000 images in the test set. As expected, there are also 10,000 test labels. Each image is represented as 28 x 28 pixels. Let’s now preprocess our data. We can start by inspecting the first image:</p><pre>plt.figure()<br>plt.imshow(train_images[0])<br>plt.colorbar()<br>plt.grid(False)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*NrjzXS7h2anIBWXMicvYZw.png" /><figcaption>First Image</figcaption></figure><p>In this case, the pixel values fall between 0 and 255. Before feeding them into the neural network, we want them to be scaled between 0 and 1. To accomplish this, we can divide by 255 for both the training and testing set:</p><pre>train_images = train_images / 255.0<br><br>test_images = test_images / 255.0</pre><p>Let’s verify if our data is now in the correct format. We can display the first 25 images from the training set and display the class name below each image:</p><pre>plt.figure(figsize=(10,10))<br>for i in range(25):<br>    plt.subplot(5,5,i+1)<br>    plt.xticks([])<br>    plt.yticks([])<br>    plt.grid(False)<br>    plt.imshow(train_images[i], cmap=plt.cm.binary)<br>    plt.xlabel(class_names[train_labels[i]])<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URmGMn-ewRDe1Ow-giWSYw.png" /><figcaption>First 25 Images</figcaption></figure><p>Hooray, it worked! We are now ready to build our deep learning model. Since this is an image classification problem, we will need to use an artificial neural network. We will first need to configure the layers of our model, then compile the model. First, let’s configure our layers. Layers in a deep neural network extract representations from the data fed into them (). To set up our network, we will chain together a few layers. For this example, we will use the Sequential model:</p><pre>model = keras.Sequential([<br>    keras.layers.Flatten(input_shape=(28, 28)),<br>    keras.layers.Dense(128, activation=&#39;relu&#39;),<br>    keras.layers.Dense(10)<br>])</pre><p>The first layer in this network, tf.keras.layers.Flatten, transforms the format of images from 28 x 28 to a 1-D array of 784 pixels. Essentially, we are lining the pixels up. There is no learning in this layer, only reformatting. The next two layers in our network are tf.keras.layers.Dense layers. These are fully connected neural layers with 128 neurons. They return a score for whether the image belongs to one of the ten classes. Before we train our model, we need to add in the last step. While we compile the network we just built, we need to make sure that the performance is high! In other words, we want to minimize loss/training error. This code accomplishes the task:</p><pre>model.compile(optimizer=&#39;adam&#39;,<br>           loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True,<br>              metrics=[&#39;accuracy&#39;])</pre><p>To do this, we employ a <strong>loss function</strong> to measure how accurate our model is during training. The goal will be to minimize this function. Our model is also compiled with an <strong>optimizer</strong>. This gives us a way to update our model based on loss. Finally, we compile with <strong>metrics</strong>. This is a way to monitor accuracy during the training and testing steps.</p><p>We can now train our model:</p><pre>model.fit(train_images, train_labels, epochs=10)</pre><p>Here, we feed in our training images and trining labels to the model as arrays. During training, we expect the model to associate images and labels. We can then ask our model to make predictions on the test set. Once we fit our model using the code above, you can expect an output like the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sJAzmGkvRlLLyq6Q_-D5w.png" /><figcaption>Training of Model</figcaption></figure><p>In this step, we see that our configured deep learning model trains for 10 epochs (10 training runs). In each epoch, it displays both the loss and accuracy. Since the model becomes better at recognizing different labels over time, the loss decreases and the performance increases across each epoch. At the final epoch (#10), our model reaches an accuracy of roughly 0.91 (91%). We can now take the final step to compare how the model performs on the test dataset:</p><pre>test_loss, test_acc = model.evaluate(test_images,  test_labels, verbose=2)<br><br>print(&#39;\nTest accuracy:&#39;, test_acc)</pre><p>If we run this code, we find that our test accuracy was 0.884. You may be surprised that our training accuracy was higher than the test accuracy. The reason for this is simple: <strong>overfitting</strong>. Overfitting occurs when a machine learning model performs worse on unseen (testing) data due to highly specific training data. In other words, our model had memorized the noise and details of the training set to the point that it negatively impacts performance on new/testing data.</p><h3><strong>Summary and Final Thoughts</strong></h3><p>Through this tutorial, you were able to learn and implement basic TensorFlow structures. We covered different data types, variables, placeholders, graphs, sessions, differences between 1.X and 2.X, eager execution, tensorboard, Keras, overfitting, etc! If you want to learn more and do more interesting projects/tutorials, be sure to check out <a href="http://tensorflow.org/tutorials">tensorflow.org/tutorials.</a> If you enjoyed reading, do be sure to give a clap :)</p><p><strong>References</strong></p><ol><li><a href="https://github.com/tensorflow/docs">https://github.com/tensorflow/docs</a></li><li><a href="https://www.tensorflow.org/tutorials/keras/classification">https://www.tensorflow.org/tutorials/keras/classification</a> (Keras Section is directly adapted from this tutorial)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41d3b8e7d0c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/the-ultimate-beginners-guide-to-tensorflow-41d3b8e7d0c7">The Ultimate Beginner’s Guide to TensorFlow</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[The Ultimate Beginner’s Guide to Quantum Computing and its Applications]]></title>
            <link>https://medium.com/data-science/the-ultimate-beginners-guide-to-quantum-computing-and-its-applications-5b43c8fbcd8f?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b43c8fbcd8f</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[quantum-mechanics]]></category>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 03:14:49 GMT</pubDate>
            <atom:updated>2023-02-21T07:00:09.288Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Primer on Quantum Computing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8YsYmBxmlan7SRq6h_OogQ.jpeg" /><figcaption>Quantum Computer [9]</figcaption></figure><blockquote>Nature isn’t classical, dammit, and if you want to make a simulation of nature, you’d better make it quantum mechanical, and by golly it’s a wonderful problem, because it doesn’t look so easy.</blockquote><p>- Richard Feynman</p><h3><strong>Motivation and Introduction</strong></h3><p>Quantum Computing is a new paradigm of algorithmic study which extends quantum mechanical phenomena to the world of traditional computing. In 1982, Richard Feynman proposed an initial quantum computer, which would have the capacity to facilitate traditional algorithms with quantum circuits [1]. To understand systems of electrons and to navigate the multiple independent probabilities of electron location based on quantum phenomena, Feynman envisioned the concept of a quantum computer; he believed that quantum computers could ideally simulate quantum behavior as it would have occurred in nature. The quantum systems which Feynman wished to simulate could not be modeled by even a massively parallel classical computer. For example, let us consider the probability calculations of multiple particle systems. If we have two electrons constrained to being at two points (A and B), then there are 4 possible probabilities of their location (both at A, one A — one B, one B — one A, both at B, etc.). For 3 electrons, there are 8 probabilities, for 10 electrons, there are 1,024 probabilities, and at 20 electrons, there are 1,048,576 probabilities. Therefore, it is easy to see that measurements get out of hand for traditional physical systems with millions of electrons. Thus, research into quantum computers began and long-term goals for the field of quantum computing have arisen.</p><p>We will first discuss the mathematical background of quantum mechanics and notable quantum computers. We will then address the functioning of a quantum computer and its fundamental operators. We will finish the article by noting applications and the future directions of quantum computing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HD-4pxGV7sD2zyrrO6jvBw.jpeg" /><figcaption>Feynman explaining quantum mechanics at CERN [2]</figcaption></figure><h3>What does it mean for something to be “Quantum”?</h3><p>“<em>Quantum</em>” is a term that comes from the study of Quantum Mechanics. Many a times, the term “quantum” is used as a buzzword in the field of particle physics. It is known that the modern relevance of something being quantum comes from the field of quantum mechanics. When one studies physics, they typically begin their journey in classical or Newtonian mechanics. They then progress to thermodynamics and statistical mechanics. Maybe later, they study topics in electromagnetism and photonics as well. After study of these subfields, we approach a new area of study colloquially known as modern physics. This includes topics in relativity and quantum mechanics. What is quantum mechanics? — it is the field of physics which tackles the physical properties of nature on an atomic scale. In our world as humans, we experience interaction and forces at a macro-scale. At the level of infinitesimally small particles (subatomic scale), the same principles of physics which govern our daily lives no longer apply. In other words, the rules are flipped and at a quantum scale, classical mechanics is insufficient. In a quantum system, all quantities are restricted to their discrete values (as part of quantization) and objects function as both particles and waves (wave-particle duality). It is critical to note that in a quantum environment, the value of a physical quantity can be predicted prior to its measurement if we are given the set of initial conditions (Heisenberg’s uncertainty Principle). Quantum mechanics was born when Max Planck proposed his situation to the black-body radiation problem and when Einstein presented his revolutionary theory on the connection between frequency and energy (later explains the photoelectric effect and general relativity).</p><p>Since this is not a physics-centered article, we will only discuss the fundamentals of quantum mechanics and the necessary mathematical notation. In summary, quantum mechanics provides four new phenomena: quantization, entanglement, principle of uncertainty, and wave-particle duality. Let’s begin by describing how objects function in a quantum system. Paul Dirac, David Hilbert, and John Von Neumann, and Hermann Weyl described the idea that the states in a quantum mechanical system are symbolized as “state-vectors.” Every quantum system has its own complex, separable Hilbert space. This acts as the state space of the system and is given to be a complex number of norm 1. Possible states are points in the projective space of a Hilbert space. Simply put, quantum particles can obtain the discrete eigenvalues of the Hilbert space since the eigenstate of the observable corresponds to the eigenvector of the operator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*jN1Nigj0kjz5vmZ22lt8Rg.png" /><figcaption>Hilbert Space [3]</figcaption></figure><p>Now that we know what a Hilbert Space is, let us discuss why quantum mechanics is known to be a probabilistic field. Quantum mechanics is all about the concept of measurement. The state of a system at a given time is described by a complex wave function due to wave-particle duality. In a quantum system, we can only measure probabilities of the results of experiments. For example, we could measure the probability of an electron being in region X of the electron cloud. Wave collapse is usually a issue when it comes to quantum measurement since the probability information of a system can collapse from the initial state to a particular eigenstate. Today, scientists bypass this issue through the use of quantum tomography, a technique used to reconstruct a certain quantum state via an ensemble of existing quantum states. Heisenberg’s uncertainty principle adds more to the sense of quantum particles existing as probabilistic functions since it references the idea that the operators which correspond to certain observables are not commutative and that there is a level of error associated with quantum particle movement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*-u6pNBaz8Z0pZgTnG9j_kA.png" /><figcaption>How Quantum Particles function [4]</figcaption></figure><p>While there is no one unifying theory which unifies all the fundamental forces of the universe as scientists continue to debate the validity and methodism of certain theories. General relativity, quantum electrodynamics, and supersymmetric string theory still come into competition with one another and it is an ongoing quest today to find the universal theory. Now that we have essentially designated the rigorous mathematical and physical background of quantum mechanical systems, we can move to draw insight on the world of quantum information and quantum computation. Without this background knowledge, it is difficult to proceed to discuss quantum computing in a technical light due to its dependence on the aforementioned physical phenomena. Simply put, quantum computing is a form of computation which extends the discussed properties to a linked software-hardware environment. Essentially, we live in a quantum world (nature is quantum by default), and quantum computers harness various properties to mimic such an environment.</p><h3><strong>What are Quantum Computers and how do they work?</strong></h3><p>Quantum Computing is the field that integrates quantum mechanical phenomena into a computing device. Quantum computers use properties like superposition and entanglement to perform computation. Different models of quantum computing exist — adiabatic quantum computers, Turing quantum computers, one-way quantum computers, etc. We will mainly discuss classical or digital quantum computing in this article rather than the aforementioned analog methods.</p><p><strong>Qubits and Superposition</strong></p><p>Let us start with the basics. Quantum information is data for quantum states which is utilized for the study of computational manipulation. This quantum information is processed in the form of “qubits”. Qubits can be thought of as the computational analog for bits and are the fundamental units of information for quantum computing. The qubit is described as a vector in the 2-dimensional Hilbert space. A traditional bit has 2 states (0 and 1). The state for a qubit also has 2 ground states - |0⟩ and |1⟩. This notation of using brackets comes from the earlier explained mathematical basis of quantum states. Remember that we earlier discussed that quantum states can be captured as probability functions and as state-vectors. The use of|0⟩ and |1⟩ reinforces this idea. The most basic states for a qubit are modeled below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*_8ua6BXl0XQnGcZ7jaV77Q.png" /><figcaption>Qubit Ground States</figcaption></figure><p>A qubit also has the ability to perform quantum superposition: it may hold multiple states at once. This is the first major quantum property which we can discuss. Superposition is instrumental to the operations of a quantum computer since it is what provides exponential speedups in both memory and processing speed for a quantum computer. The superposition of a qubit can be represented as a probability function dependent upon the amplitudes of the qubit in its Hilbert space (𝑎 and 𝑏). A superposition of a qubit |𝜙⟩ can be represented as the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*juEU-Z2lKivNQFQoibISgA.png" /><figcaption>Superposition of a Qubit</figcaption></figure><p>Thus, we may represent each qubit as a linear combination of |0⟩ and |1⟩. 𝑎 and 𝑏 represent the amplitude probabilities and are typically complex numbers. When qubits are measured, they will follow the Born Rule:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*NTe420wc-7GSpqU8o8De2A.png" /><figcaption>Born Rule</figcaption></figure><p>To visually understand a qubit, we can understand it as a Bloch Sphere. This sphere shows the probabilities (𝑎 and 𝑏) as being the determinate factors for the qubit and provides 3 degrees of freedom (originally 4 degrees of freedom but 1 is eliminated by the normalization constraint via the Born Rule). The two-dimensional Bloch Sphere visualization and feature map is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xT0ISS-P4WemHdPb4wKqQA.png" /><figcaption>Bloch Sphere Visualization and Wave Function [5]</figcaption></figure><p><strong>Quantum Registers</strong></p><p>We may now discuss the importance of a quantum register. In a quantum computer, quantum registers are simply considered to be systems of multiple qubits. It is the quantum analog of a classical computing register. All quantum calculations are performed by manipulating qubits within the register. The quantum register has a size dependent on the number of qubits in its system. The Hilbert space of a quantum register expands with an increased number of qubits. We may mathematically represent a 2-qubit quantum register via the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*69drGIY7sEDwWX36Llg-Pg.png" /><figcaption>2-Qubit Quantum Register</figcaption></figure><p>The above mathematical description captures the concept of qubits via tensor products. The tensor product or Kronecker product combines the two quantum states of a qubit. The difference between a classical register and a quantum register is seen in the content of each respective environment. A classical register will store 𝑁 “flip-flops” while a quantum register will store 𝑁 qubits. Quantum registers also hold the ability to store data in a state of superposition. The states that a quantum register may access are known as Hilbert spaces with 2^n states. The Hilbert space is what gives a quantum computer the power to apply superposition on multiple qubits.</p><p><strong>Quantum Gates</strong></p><p>We know that classical computers manipulate bits through logic gates. Logic gates essentially transform the value that a bit holds. They are the building blocks of any digital system. Logic gates are used with truth tables to create transformations of state in classical circuits. A list of the most fundamental logic gates is given below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJ3JWRkIZPNQEiuLh3KX9w.jpeg" /><figcaption>Classical Logic Gates [6]</figcaption></figure><p>In the world of quantum computing, the most basic quantum circuits are known as quantum gates. The same way that classical logic gates turn multiple binary inputs into a single outcome, quantum gates also manipulate binary inputs, except that now there are state-vectors involved. They deal with small pre-ordained amounts of qubits. These quantum gates are analogous to classical logical gates and follow similar patterns of logic. Complex quantum circuits are built through stacking and utilization of these quantum gates, similar to how classical logic gates are the building blocks for traditional computational circuits. However, unlike classic logic gates, quantum gates are reversible. Each quantum gate can operate on the collective Hilbert space of several bits. Thus, quantum gates possess the ability to change or modify the state of a certain system or quantum register. Quantum gates are mathematically represented by unitary matrices where the number of qubits in the input and output must be equal. A quantum gate (𝑈) is mathematically defined below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*Y87QepDUykD8aRqZyMOwgw.png" /><figcaption>Unitary definition of a quantum gate (𝑈)</figcaption></figure><p>A quantum state which may be manipulated by a quantum gate are typically shown as “kets” or a bra-ket (|0⟩ and |1⟩.). We can model the transformation applied by a quantum gate (𝑈) on a state (𝜓) as the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*45kIU6cg1yYPCOqOsGUhEQ.png" /><figcaption>Quantum gate 𝑈 applied to a state 𝜓</figcaption></figure><p>This transformation multiplies the initial quantum state vector (𝜓/) by the unitary quantum gate operator (𝑈) to achieve a new quantum state (𝜓0). Some common examples of gates are given below (Pauli-X, Pauli-Y, Pauli- Z, Hadamard, Phase, CNOT, CZ, SWAP, Toffoli):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvneEHE5vBBiQAqIhMqZAA.png" /><figcaption>Various Quantum Gates (Circuit and Matrix Form) [7]</figcaption></figure><p>These gates apply transformations on an initial system of qubits to map the basis state to a new value. For example, the Hadamard gate (𝑯) maps the basis states of|0⟩ and|1⟩ to new values on the x and z axes. Similarly, other quantum gates like Pauli- X (𝑿), Pauli-Y (𝒀), Pauli-Z (𝑹-𝝅), and the Controlled Not (𝑪𝑵𝑶𝑻) apply transformations that may be represented as unitary matrices. All of these transformations can also be visually recognized as shifts on the axis of a Bloch Sphere. For example, we can see the Pauli-X gate transformation mapped to the Bloch Sphere:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*JE9ITc6mrbVLk_KvSNi4_A.png" /><figcaption>Pauli-X gate visualized via a Bloch Sphere [8]</figcaption></figure><p><strong>Entanglement</strong></p><p>Another important quantum state which allows us to model quantum entanglement is the concept of the Bell States. The two Bell States (EPR pairs) represent two maximally entangled 2-qubits states:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*igZQHxdQhcptOaq5YzQ09A.png" /><figcaption>Bell States (for 2 qubits)</figcaption></figure><p>Together, these two Bell States form the Bell Basis or a maximally entangled basis of the 2nd dimensional Hilbert Space. This is the simplest example of quantum entanglement. Let’s talk more about what entanglement means. Quantum entanglement is when a pair (or group) of particles is generated in a way in that the state of one particle in the system cannot be described independently of the state of the others, including when the particles are separated by a large distance. Quantum entanglement is usually in reference to spatial proximity; it is also interesting to note that entanglement of two particles has been known to show that their spin, position, and polarization is correlated. Famously, Einstein referred to the phenomena of entanglement as “<em>spooky action at a distance.</em>” Entanglement is useful to quantum computing in that it can be used as part of quantum circuits to manipulate real-world data since correlations exists between real-world objects alongside those of a quantum system.</p><p>To summarize this section, we have broken down the fundamentals of quantum computing to its most basic operators. We have analyzed the two most essential aspects of quantum computing: superposition and entanglement. We have also covered qubits, quantum gates, registers, etc.</p><h3>Modern Quantum Computing and its Applications</h3><p><strong>Inside a Quantum Computer</strong></p><p>So far, we have only talked about the essential operators of quantum computing and its mathematical background and broad connection to physics. Let us now discuss the modern situation and the future directions of quantum computing. Let’s now take a peek inside a quantum computer. Here is a picture of a modern IBM quantum computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DFUzCPfaVC6fG0seZX6Wsg.jpeg" /><figcaption>IBM Quantum Computer [9]</figcaption></figure><p>This obviously does not look like your everyday PC or desktop! There are millions of connections and over 2,000 components come together to allow researchers to work with qubits for a long period of time. The example above is specifically a superconducting quantum processor. In a quantum computer like this, any heat can introduce error into the system. Thus, it is regulated such that the machine always operates at subzero temperatures. Let’s review some of the specific components. The first component is the dilution refrigerator: this device exploits the mixing properties of two helium isotopes to facilitate a quantum environment. Why are the cold temperatures required? — they are needed in order to create a situation where qubits and their states will not experience quantum decoherence later. We will discuss what decoherence means later but for now, we can tie it back to the idea of quantum state collapse. Other components of the quantum computer include the qubit signal amplifier (cools stage to 4 Kelvin), input microwave lines (protect qubits from noise while extracting and sending input/output), superconducting coaxial lines (minimize energy loss when quantum states are transported), cryogenic isolators (allow progression of qubits without loss due to noise), quantum amplifiers (capture processor readout signals), and a mixing chamber (uses chemical components to cool apparatus) [11]. The main component of the machine — the superconducting processor — consists of a transmon qubit (uses supercharge and maintains qubit control without noise) and Josephon junctions (allows supercharge to flow through the machine). This information is a lot to digest but just understand that quantum computers are intensive machines which require low temperatures and a superconducting processor to function.</p><p><strong>Applications</strong></p><p>Well, we know that quantum computers are great because of their properties like superposition and entanglement. However, it is important to realize that we live in a quantum world and that quantum computers will allow us to better simulate the behavior of nature, down to a molecular level. For example, we can now make breakthroughs in drug development and medicine. For instance, look at the Caffeine molecule. For scientists, it currently requires too much processing power to appropriately simulate this molecule and to analyze its structure. With quantum computing, scientists may be able to better simulate the caffeine molecule and its true behavior at the molecular scale in the presence of quantum factors. Beyond medicine and chemical analysis, quantum computing is also useful for applications in several other fields. It can be used to accelerate AI and machine learning to better understand patterns in data. It can be used in finance to build more ideal portfolios and assess the market. It can be used in robotics and precision control theory to navigate complex spaces. Overall, quantum computing is great for optimization and modeling in general. Thus, even though we are not at fault tolerance yet (discussed later), as the numbers of qubits increase, quantum computers can have their applications extended to numerous industries.</p><p><strong>Quantum Computing in the News Today</strong></p><p>Many of us have heard about quantum computing in both a positive and negative light. We have shown that properties like superposition and entanglement allow quantum computers to have exponential speedups in terms of both execution time and memory. Let’s first discuss the positives of quantum computing. There are several storylines about how quantum computing is the future of computational power and abilities. Recently, google announced that they had achieved “quantum supremacy” with a quantum processor known as Sycamore (referenced below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lywBLcLYEtCK49LtjCC19Q.png" /><figcaption>Sycamore Processor [10]</figcaption></figure><p>According to Google, quantum supremacy means that their quantum processor was able to perform a certain task rapidly (within seconds) when a it would take a classical computer tens of thousands of years (making it an unreasonable problem). While the validity of this supposed milestone is debated, there has been a general consensus that the field of quantum computing is rapidly expanding. If quantum computing becomes advanced enough soon, it can revolutionize all areas of technology and any field where computational modeling or data processing is required due to the efficiency standard that it brings to the table. Maybe one day, decades from now, air traffic requests and control is managed by an intelligent, low maintenance quantum system. However, breakthroughs like these are decades away due to the current lack of fault tolerance. We discuss this more in the next subsection.</p><p>It is also well known that quantum computing poses an immediate cybersecurity threat due to this dramatic increase in processing power. Most of modern encryption is RSA or public key encryption. For classical computers, cracking these encryptions schemes is an unreasonable problem that will take thousands of years. As quantum computers grow to handle more qubits and gain access to greater amounts of exponential speedup, it will eventually be possible for quantum computers to crack these encryption methods and the private data of millions if not billions of users will be leaked. This would be detrimental to society and thus quantum computation will require some amount of regulation to proceed safely. Check out <a href="https://www.quintessencelabs.com/wp-content/uploads/2018/09/Quantum-National-Security-Risk.pdf">this guide</a> for more on how quantum computing can change cybersecurity forever.</p><p><strong>Quest for Fault Tolerance</strong></p><p>Until fault tolerance is achieved, quantum computers will essentially be bottlenecked due to performance constraints and constant decoherence. Remember that decoherence is the idea that there is a partial collapse of quantum information. In these situations, any further measurements give the same result (state is unable to change) and we are unable to measure a particle’s position or velocity in respect to the outside world. Fault tolerance is the idea that a quantum computer will be manage to operate at essentially negligible noise. A fault tolerant quantum computer will be successful at avoiding the “<em>uncontrollable cascade of errors caused by the interaction of quantum-bits, as these concepts can be directly mapped to quantum information.</em>” [12] The idea that fault tolerance is necessary is reinforced in the quantum threshold theorem. This theorem states that if a quantum computer has a massive number of qubits (&gt; 10,000) and if it is able to apply a “depolarizing quantum error correction scheme” to limit noise to under 1%, it has achieved a degree of fault tolerance. In simple terms, to approach a fault tolerant quantum computer, we essentially need to correct errors at a rate faster than they occur. This is incredibly difficult (exponential in fact) and can only be done with thousands of qubits at minimum. At the time of the writing of this article, quantum computers like Google’s Sycamore can only process between 50 and 60 qubits at maximum capacity. Moreover, until we achieve fault tolerance, quantum computers and their results will be severely limited as a result of the noise and perturbations which they experience. This is one of the biggest obstacles in the quantum computing field and it will most likely take a few decades until major progress is made towards a fault tolerant quantum computer. However, we can still make strides in terms of the efficiency of quantum algorithms and in terms of the quantum error correction schemes which are employed.</p><p><strong>How you can get involved</strong></p><p>While it may seem like quantum computing is the last field where students and researchers may be able to get started relatively easily, this is not the case. You can pick up quantum computing basics and get hands-on experience with these machines. The <a href="https://quantum-computing.ibm.com/">IBM Quantum Experience </a>is a great place to get started since it allows users of all backgrounds and expertise to tinker with quantum computing through the design of quantum circuits. It is simple to use and feels almost like a drag-and-drop interface where users can use different amounts of qubits in the initial register and apply various gates to see how they affect the state-vectors of the qubits. Another way to get started with quantum computing is to use <a href="https://qiskit.org/">Qiskit</a>. Qiskit is a python library that allows users to play with popular quantum algorithms and design their own. It can be used in a jupyter notebook inside IBM Q and can be used to implement algorithms like Shor’s algorithm, Grover’s algorithm, etc. I have linked the Qiskit starter guide and textbook <a href="https://qiskit.org/textbook/preface.html">here</a>, so that you can get started!</p><p>Kudos to you for working through this article. You already have grasped a solid amount of quantum mechanics, mathematics, and quantum computing, and I recommend that you try to learn even more about quantum computing! Note that this only an introductory guide and by no means comprehensive, so feel free to explore more as there are so many cool opportunities and interesting applications to consider in this field!</p><p>Thanks for your time and here is a great final quote to end on …</p><blockquote>Quantum computation is a distinctively new way of harnessing nature. It will be the first technology that allows useful tasks to be performed in collaboration between parallel universes.</blockquote><p>— David Deutsch</p><h3>References</h3><blockquote><em>Some of the content for this article is borrowed from a short research paper that I wrote.</em></blockquote><p><em>Medium Articles which I cite:</em></p><p><strong>Jason Roell</strong>: <a href="https://towardsdatascience.com/the-need-promise-and-reality-of-quantum-computing-4264ce15c6c0">https://towardsdatascience.com/the-need-promise-and-reality-of-quantum-computing-4264ce15c6c0</a></p><p><strong>Arun C:</strong> <a href="https://towardsdatascience.com/quantum-computing-explained-a114999299ca">https://towardsdatascience.com/quantum-computing-explained-a114999299ca</a></p><p><strong>Jason Roell</strong>: <a href="https://towardsdatascience.com/quantum-computing-and-ai-tie-the-knot-d4440267451b">https://towardsdatascience.com/quantum-computing-and-ai-tie-the-knot-d4440267451b</a></p><p><strong>Egor Dezhic: </strong><a href="https://towardsdatascience.com/the-present-and-future-of-quantum-computing-for-ai-fb600546bbb7">https://towardsdatascience.com/the-present-and-future-of-quantum-computing-for-ai-fb600546bbb7</a></p><p><strong>Rishabh Anand: </strong><a href="https://towardsdatascience.com/quantum-computing-with-colorful-diagrams-8f7861cfb6da">https://towardsdatascience.com/quantum-computing-with-colorful-diagrams-8f7861cfb6da</a></p><p>[1] Feynman, R.P.: Simulating physics with computers. Int. J. Theor. Phys. 21(6), 467–488 (1982)</p><p>[2] Image — <em>Feyman at CERN: </em><a href="https://www.sciencephoto.com/media/898764/view/richard-feynman-s-post-nobel-lecture-at-cern-1965">https://www.sciencephoto.com/media/898764/view/richard-feynman-s-post-nobel-lecture-at-cern-1965</a></p><p>[3] Image — <em>Hilbert Space: </em><a href="https://www.researchgate.net/publication/312590429_A_simple_proof_of_Born%27s_rule_for_statistical_interpretation_of_quantum_mechanics/figures?lo=1&amp;utm_source=google&amp;utm_medium=organic">https://www.researchgate.net/publication/312590429_A_simple_proof_of_Born%27s_rule_for_statistical_interpretation_of_quantum_mechanics/figures?lo=1&amp;utm_source=google&amp;utm_medium=organic</a></p><p>[4] Image — <em>Particle-Wave Duality and Heisenberg’s Uncertainity Principle:</em> <a href="https://science.howstuffworks.com/innovation/scientific-experiments/10-scientific-laws-theories10.htm">https://science.howstuffworks.com/innovation/scientific-experiments/10-scientific-laws-theories10.htm</a></p><p>[5] Havlicek et al. -&gt; Image — <em>Bloch Sphere</em>: <a href="https://arxiv.org/abs/1804.11326">https://arxiv.org/abs/1804.11326</a></p><p>[6] Image — <em>Logic Gates</em>: <a href="http://www.justscience.in/articles/how-are-logic-gates-related-to-circuits/2017/06/01">http://www.justscience.in/articles/how-are-logic-gates-related-to-circuits/2017/06/01</a></p><p>[7] Image — <em>Quantum Logic Gates: </em><a href="https://en.wikipedia.org/wiki/Quantum_logic_gate#/media/File:Quantum_Logic_Gates.png">https://en.wikipedia.org/wiki/Quantum_logic_gate#/media/File:Quantum_Logic_Gates.png</a></p><p>[8] Image — <em>Pauli Gate</em>: <a href="https://docs.microsoft.com/en-us/quantum/libraries/standard/prelude">https://docs.microsoft.com/en-us/quantum/libraries/standard/prelude</a></p><p>[9] Image — <em>MIT Technology Review</em>: <a href="https://www.technologyreview.com/2020/02/26/916744/quantum-computer-race-ibm-google/">https://www.technologyreview.com/2020/02/26/916744/quantum-computer-race-ibm-google/</a>, <a href="https://www.technologyreview.com/2019/01/29/66141/what-is-quantum-computing/">https://www.technologyreview.com/2019/01/29/66141/what-is-quantum-computing/</a></p><p>[10] Image — <em>Google Blog</em>: <a href="https://ai.googleblog.com/2019/10/quantum-supremacy-using-programmable.html">https://ai.googleblog.com/2019/10/quantum-supremacy-using-programmable.html</a></p><p>[11] <em>IBM Quantum Computer Components</em>:<em> </em><a href="https://www.ibm.com/quantum-computing/learn/what-is-quantum-computing/">https://www.ibm.com/quantum-computing/learn/what-is-quantum-computing/</a></p><p>[12] Fault Tolerant quantum computation with few qubits: <a href="https://www.nature.com/articles/s41534-018-0085-z">https://www.nature.com/articles/s41534-018-0085-z</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b43c8fbcd8f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/the-ultimate-beginners-guide-to-quantum-computing-and-its-applications-5b43c8fbcd8f">The Ultimate Beginner’s Guide to Quantum Computing and its Applications</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[A Short Guide to Pose Estimation in Computer Vision]]></title>
            <link>https://medium.com/@siddrrsh/a-short-guide-to-pose-estimation-in-computer-vision-3ea708dd9155?source=rss-2fc75df15f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ea708dd9155</guid>
            <category><![CDATA[human-pose-estimation]]></category>
            <category><![CDATA[pose-estimation]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openpose]]></category>
            <dc:creator><![CDATA[Siddharth Sharma]]></dc:creator>
            <pubDate>Thu, 02 Apr 2020 04:20:37 GMT</pubDate>
            <atom:updated>2020-04-02T04:56:33.232Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This article will tackle the subject of pose estimation and will analyze how it works and compare different approaches and their pros and cons in regards to computer vision. We will also analyze applications of this cool technology</blockquote><h3><strong>What is Pose Estimation?</strong></h3><blockquote>Simply put, pose estimation is the localization of human joints in either images or videos. There are 2-D pose estimation and 3-D pose estimation (additional dimension of depth). Pose estimation has applications in several ideas and is an extension of computer vision.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBB0cMysUxXl8h564o2Pdw.png" /><figcaption>Examples of Pose Estimation (<a href="https://nanonets.com/blog/human-pose-estimation-2d-guide/">Source</a>)</figcaption></figure><blockquote>Here is an example of 2-D versus 3-D pose estimation:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JUXSz1Vy5S7OiIz26DPgew.png" /><figcaption>2D v. 3D pose estimation</figcaption></figure><blockquote>As seen in the image above, it is noticeable that there are certain joints which are being used to compute angles and keypoints. We will now examine for which pose estimation is built on.</blockquote><h3><strong>How it works</strong></h3><blockquote>Pose Estimation manipulates specific joints within the human body. These joints are known as “keypoints” within the pose estimation system. There are two models which are commonly referenced in pose estimation: the classical pictorial structures framework and deformable parts model. These models construct the keypoints and connecting levers through spatial arrangements between parts that allow for parameterization of the angles and joint position as vectors. The keypoints are typically labeled and connected at the end. Pose estimation keypoints usually line up with real human joints like the elbow, wrist, knee, etc. Here is an example of labeled keypoints in pose estimation:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*cxjSyFPTTtoTd8mc5pVF5Q.png" /><figcaption>Labeled Pose Keypoints for a Sample Image</figcaption></figure><blockquote>We will now compare and contrast the various open-source pose estimation algorithms and analyze the benefits and drawbacks of each.</blockquote><h3><strong>OpenPose</strong></h3><blockquote><a href="https://github.com/CMU-Perceptual-Computing-Lab/openpose">OpenPose</a> represents the first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints (in total 135 keypoints) on single images.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P0Td88y1yrGBbrEtNFwFzg.png" /><figcaption>OpenPose Algorithm</figcaption></figure><blockquote><strong>Pros:</strong></blockquote><blockquote>Use of non-parametric color-coded PAFs creates greater accuracy for mapping</blockquote><blockquote>High accuracy without compromise on execution performance</blockquote><blockquote>Use of confidence maps to map individual body parts/regions (i.e. shoulder)</blockquote><blockquote>Greedy parsing algorithm is effective in terms of runtime</blockquote><blockquote>Scales well to GPU over CPU</blockquote><blockquote><strong>Cons:</strong></blockquote><blockquote>Slight tradeoff between speed and accuracy (i.e. R-CNN runs faster)</blockquote><blockquote>Current human pose performance metrics are based on keypoint accuracy</blockquote><blockquote>Not a completely fair comparison</blockquote><blockquote>Failure cases still exist (i.e. foot and leg occluded, rare joint position, etc.)</blockquote><h3><strong>MultiPoseNet</strong></h3><blockquote>“MultiPoseNet can jointly handle person detection, keypoint detection, person segmentation and pose estimation problems. The novel assignment method is implemented by the Pose Residual Network (PRN) which receives keypoint and person detections, and produces accurate poses by assigning keypoints to person instances.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cKgYjPRL51AeE7S48V7uVw.png" /><figcaption>MultiPoseNet Algorithm</figcaption></figure><blockquote><strong>Pros:</strong></blockquote><blockquote>Residual Pose network allows for generating higher precision with less training error due to reformulated layers that have residual functions (easier to optimize and gain accuracy)</blockquote><blockquote>Assigns keypoints to person instances</blockquote><blockquote>Use of the unary relations between a certain keypoint and a specific group</blockquote><blockquote>Bottom-up method outperformed previous top-down methods in 2016 COCO keypoint challenge</blockquote><blockquote>Faster in time while smaller in size</blockquote><blockquote>PRN is also relatively lightweight so inference is easier</blockquote><blockquote><strong>Cons:</strong></blockquote><blockquote>Compromises resolution at stake of representations using FPN (Feature Pyramidal Networks)</blockquote><blockquote>Spatial performance is dependent on input and output resolution</blockquote><blockquote>Use of one-stage detector (RetinaNet) enables faster inference but leads to lower accuracy compared to two-stage detectors</blockquote><h3><strong>Detectron/Mask R-CNN</strong></h3><blockquote>“Detectron2 includes high-quality implementations of state-of-the-art object detection algorithms, including <a href="https://l.facebook.com/l.php?u=http%3A%2F%2Fdensepose.org%2F&amp;h=AT3Xx3pCsn3E3svftCI6KQkP5EBqpVmMTBZqbtvNb7C5UerTZS76cwFYDKJGv8MYXKF4dQaUNhHIV0GL2ujK_qKYkWyuh-xa1cRV1COg5W7su1eswR5RXqw6vFpo25dHMkvDtxhMDY7kO8vlYczn7xkAv28">DensePose</a>, <a href="https://ai.facebook.com/blog/improving-scene-understanding-through-panoptic-segmentation/">panoptic feature pyramid networks</a>, and numerous variants of the pioneering <a href="https://l.facebook.com/l.php?u=https%3A%2F%2Fresearch.fb.com%2Fpublications%2Fmask-r-cnn%2F&amp;h=AT0eiwHrOFnOFvBXLFOGPhUY487V_qmomQIr8_7Ch9JR9KBjcsQ55ya4YBakReMFhbViYn1YxcvZa9gxiOC7wwcP0WUlOcxhBPuzwSVhogX1I6-yhSAcDgbtUojvtkHTufrL_9hDryI5PmEUG6S_mYKf2XM">Mask R-CNN </a>model family also developed by FAIR. Its extensible design makes it easy to implement cutting-edge research projects without having to fork the entire codebase.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*dOO3AE4nTZZsx1FI-ciJEw.png" /><figcaption>Mask R-CNN algorithm for segmentation</figcaption></figure><blockquote><strong>Pros:</strong></blockquote><blockquote>Generates segmentation mask for instances</blockquote><blockquote>Simple to train as per the paper</blockquote><blockquote>Utilizes a ResNet for pose estimation network</blockquote><blockquote>Minimal domain knowledge</blockquote><blockquote>Pipeline that can predict boxes, segments, and key points simultaneously</blockquote><blockquote><strong>Cons:</strong></blockquote><blockquote>Not built immediately for pose estimation</blockquote><blockquote>Semantic segmentation can lead to incorrect human bounding boxes and therefore incorrect joint poses</blockquote><blockquote>Fails to account for rare poses and a few failure cases (i.e. overlapping objects)</blockquote><blockquote>Fast, but not optimized for speed</blockquote><h3><strong>AlphaPose</strong></h3><blockquote>“Alpha Pose is a very Accurate Real-Time multi-person pose estimation system. It is the first open-sourced system that can achieve 70+ mAP (72.3 mAP) on COCO dataset and 80+ mAP (82.1 mAP) on MPII dataset. To associate poses that indicates the same person across frames, we also provide an efficient online pose tracker called Pose Flow. It is also the first open-sourced online pose tracker that can both satisfy 60+ mAP (66.5 mAP) and 50+ MOTA (58.3 MOTA) on PoseTrack Challenge dataset.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mh0ZG9jFMMPPDu3VVOGiFg.png" /><figcaption>AlphaPose (RMPE) Framework</figcaption></figure><blockquote><strong>Pros:</strong></blockquote><blockquote>Built to avoid errors in existing models such as incorrect localization or recognition</blockquote><blockquote>Accurate pose estimation even when bounding box or segmentation is inaccurate</blockquote><blockquote>Two step framework is more accurate compared to typically used one step/stage detectors or frameworks</blockquote><blockquote>Use of spatial transformer network (STN) which demonstrates high performance</blockquote><blockquote>Hyperparameter optimization was performed on network to increase accuracy</blockquote><blockquote><strong>Cons:</strong></blockquote><blockquote>More failure cases compared to other state-of-the-art models for pose estimation</blockquote><blockquote>Not optimized for accuracy</blockquote><blockquote>Two step framework does at times sacrifice speed or runtime performance</blockquote><h3><strong>Conclusions</strong></h3><blockquote>We can conclude that pose estimation approaches are approaching the state-of-the-art in computer vision. These methods have concrete applications in industry and study. However, due to occlusion of joints and anomalous angles, it will be a while before a practically perfect pose estimation implementation.</blockquote><h3><strong>References</strong></h3><p>[1] <a href="https://nanonets.com/blog/human-pose-estimation-2d-guide/">https://nanonets.com/blog/human-pose-estimation-2d-guide/</a></p><p>[2]<a href="https://github.com/CMU-Perceptual-Computing-Lab/openpose"> OpenPose</a></p><p>[3] <a href="https://arxiv.org/abs/1807.04067">MultiPoseNet</a></p><p>[4] <a href="https://arxiv.org/pdf/1703.06870.pdf">Mask R-CNN</a></p><p>[5] <a href="https://arxiv.org/pdf/1612.00137.pdf">AlphaPose</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ea708dd9155" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>