<?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 Felixbastian Hans on Medium]]></title>
        <description><![CDATA[Stories by Felixbastian Hans on Medium]]></description>
        <link>https://medium.com/@felixbastian.hans?source=rss-12af008e0be6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mKfMRQofPfM9OJJ3</url>
            <title>Stories by Felixbastian Hans on Medium</title>
            <link>https://medium.com/@felixbastian.hans?source=rss-12af008e0be6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 19:15:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@felixbastian.hans/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[Automating Data Analytics with Large Language Models]]></title>
            <link>https://medium.com/@felixbastian.hans/automating-data-analytics-with-large-language-models-3e83bcdbd51d?source=rss-12af008e0be6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e83bcdbd51d</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Felixbastian Hans]]></dc:creator>
            <pubDate>Wed, 11 Oct 2023 08:23:42 GMT</pubDate>
            <atom:updated>2023-10-11T08:23:42.439Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>From Data Exploration to Documentation: ChatGPT as an End-to-End Solution in Data Analytics</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p1dBdZxI-e8gqNrpjNBTBw.png" /></figure><h3>Introduction</h3><p>Large Language Models (LLMs) like chatGPT have emerged as powerful tools capable of understanding human language and even generating code. As a data analyst, I interact with chatGPT on a daily basis to structure an idea, to write SQL queries and to better understand existing queries. An idea emerged to put all those features together in one solution capable of automating certain aspects of my work. I identified three mission critical features to implement:</p><ul><li><strong>Identify</strong>: Support the analyst in finding the right data to do the job</li><li><strong>Implement</strong>: Turn natural language into a database query (SQL)</li><li><strong>Document</strong>: Document the results and the approach</li></ul><p>Let’s delve into this idea with a hands-on example.</p><p><strong>If you want to try out the solution yourself, access the link below:</strong></p><p><a href="https://rare-result-248415.ew.r.appspot.com/">Flask Web Interface</a></p><h3>The Approach</h3><p>The objective of this prototype is to create an end-to-end solution that allows the user to pose a task or objective and to receive back the answer in the form of data.</p><p>To achieve this, the LLM, in our case GPT-4, will be given a data model. The data model consists of all table names including their columns, data types and relationships with other tables. Furthermore, three exemplary rows will be provided for each table to give the LLM an understanding of the format.</p><p>Now, when a user provides a prompt such as “What are the sales for 2022”, chatGPT will receive the data model and the question as context together with the instructions to formulate an SQL query as an answer. This can be easily done with Langchain, a common python library for advanced LLM solution architecture design.</p><p>SQL is a standard database language to merge, filter and transform tabular data. It is the most fundamental tool of every data analyst and allows to turn code into tabular data. With this setup, we can now go one step further and turn a problem statement into data.</p><h3>The Data</h3><p>For our exploration, we’ll be utilizing the Northwind database, a freely available resource designed to demonstrate SQL queries and challenges. This database mirrors a generic company’s data landscape, encapsulating elements such as employees, suppliers, customers, and orders.</p><p>All tables are connected via keys. For example, each order has a unique Order ID that matches the “Orders” table to the “Order Details” table that itself is connected to the “Products” table via the Product ID. This shows that relationships can become quite complex. For example, to receive the products ordered by a specific customer, all those tables (Products, Order Details, Orders) must be chained together on their respective IDs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iwQLHBxSrnjvA3HJ5lIfqw.png" /><figcaption>Northwind database schema</figcaption></figure><h3>Testing the Basics</h3><p>A quintessential step in any data analyst job is the ability to transform questions about data in basic SQL prompts. To assess chatGPT’s capabilities, a repository of 40 questions was used, designed to test SQL fundamentals on the Northwind dataset. These questions span a variety of standard problem types, including table filtering, column concatenation, and table joining, with escalating levels of difficulty.</p><p>Source of questions: <a href="https://github.com/Musili-Adebayo/Northwind-Database">Northwind Database GitHub Repository</a></p><p><strong>Example 1:</strong></p><p><em>Create a report showing ProductName, UnitPrice, QuantityPerUnit of products that are out of stock.</em></p><pre>SELECT ProductName, UnitPrice, QuantityPerUnit FROM northwind.products <br>WHERE &quot;UnitsInStock&quot; = 0;</pre><p><strong>Example 2:</strong></p><p><em>Create a report that the CompanyName and total number of orders by customer renamed as number of orders since Decemeber 31, 1994.</em></p><pre>SELECT c.CompanyName, count(c.CustomerID) AS NumberofOrders <br>FROM northwind.customers c<br>JOIN northwind.orders o ON o.CustomerID = c.CustomerID <br>WHERE o.OrderDate &gt;= &#39;1994–12–31&#39;<br>GROUP BY c.CustomerID having count(c.CustomerID) &gt; 10;</pre><p>Remarkably, chatGPT managed to accurately solve 39 out of the 40 questions on the first attempt, showcasing its proficiency in handling basic data querying tasks. Now, let’s step up the game and transition to a real-world scenario.</p><h3>Presenting the Solution</h3><p>Technology is only as good as its user interface. To facilitate seamless data analysis and query generation, the following components are an essential part of all common data platforms:</p><ol><li>A data panel for viewing individual tables.</li><li>A text field for entering SQL queries.</li><li>An output section to view the result.</li></ol><p>To maximize the LLM’s potential, three additional features were introduced:</p><ol><li>A text field to prompt the data in natural language.</li><li>A display box with two features:</li></ol><ul><li>Showing the assumptions made by the LLM in generating the results (Send button at 4)</li><li>Returning the documentation for an SQL query and its generated table (Send button at 2).</li></ul><p>3. A text field for inputting table specific details the LLM should consider when coming up with a solution.</p><p>For simplicity, the solution does not contain chat features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMfj6mVK2f_YzluXW7xLnw.png" /><figcaption>Solution architecture</figcaption></figure><h3>A Practical Example: Analyzing Shipment Companies</h3><p>Let’s delve into a practical use case. In the dataset, each order is delivered by one of three shipment companies: Speedy Express, United Package, or Federal Shipping. Now imagine, it is your first day on the job as a data analyst at the Northwind company. Your supervisor gives you the following task:</p><p>“I want to benchmark our shipment companies. Can you tell me if one company delivers faster than the other?”</p><h4>Exploring the Data</h4><p>Being new to the job, identifying the relevant tables and their interconnections must be our initial step. We begin by articulating the objective in the prompt box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAWqPdUa7PnU_WXDpgQ4Sw.png" /><figcaption>Data prompting — exploration</figcaption></figure><p>Through this process, the model:</p><ul><li>Recognizes the relevance of the orders table for analyzing delivery times.</li><li>Identifies the necessary relationships between the column “ShipVia” and “ShipperID” to link the Orders and Shippers tables.</li><li>Proposes a method to calculate average delivery time by comparing “OrderDate” and “ShippedDate” and documented assumptions.</li></ul><p>Before proceeding, let’s look at the Order table to validate this approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DXH0-FAuZeTMlMZghFMNoA.png" /><figcaption>Northwind database — Order Table</figcaption></figure><p>While the logic of calculating the delivery time seems sound, we notice a potential bias. The average delivery time could be influenced due to varying shipment destinations.</p><h4>Refining the Approach</h4><p>The first step helped us to explore the necessary tables and columns to answer the question. Now, to gain a comprehensive view of the shipment companies, we need to profile the average delivery time by region.</p><p>Since we now know our objective and the data, we can be a little more specific when writing our prompt with a clear picture of the output in mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6YKEySj-lX4VQYx5WrZXg.png" /><figcaption>Data prompting -refining</figcaption></figure><p>ChatGPT was able to come up with the correct approach. This can sometimes take a little prompt engineering but is often much quicker than coming up with the correct SQL query yourself.</p><p>The analysis reveals that Federal Shipping generally outperforms its competitors, especially in key markets like Western Europe and North America. However, other companies excel in certain regions.</p><h4>Documenting the Result</h4><p>In a data-driven company, documenting the approach is often as important as coming up with the correct result. We need to make sure that, in case the approach is picked up again by other people (or digital agents), the user can quickly understand the overall objective and columns.</p><p>In the next step, chatGPT will receive back the query it generated in the last section. Additionally, the description of the tables used will be added including their columns and some sample rows. In our case, the order table. Then, chatGPT will be instructed to define the objective of the generated table and to detail how each column is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzdLVbnvlw6eNzdIbFCnkQ.png" /><figcaption>Documentation generation</figcaption></figure><p>The result speaks for itself. ChatGPT was able to correctly identify the objective of the analysis and to document each column and its sources. In case another user picks up the table again, the scope would quickly be understood.</p><h3>The Future of Data Analytics</h3><h4>The Pros and Cons</h4><p>In the grand scheme of technological advancements, the integration of LLMs like chatGPT in the data analysis domain marks a significant milestone and will shape the future application landscape. As we have seen in this exploration, these models have the potential to revolutionize the way data analysts approach their tasks, offering a new way to communicate with technology like never before.</p><p>Databases in practice may encompass hundreds of unconnected tables. It is often difficult to have an overview of the entire data landscape and to identify the optimal tables for the task at hand. This is something LLMs have great potential to excel in. Feeding the model table information and available documentation enables users to quickly get an expert opinion on how to approach the problem and what data to use. Furthermore, having an SQL native tool to create and document database queries can vastly improve efficiency and data understanding throughout the organization.</p><p>However, there are also challenges such as the restricted prompt length, limiting the inclusion of extensive data models. It is not possible to add an infinite amount of tables to the context of the LLM. Therefore, we encounter scalability issues with this approach. Additionally, the quality of results can vary, necessitating specific and well-thought-out prompts to avoid lazy or inaccurate responses. We have seen that in order to calculate the average shipment time, chatGPT takes a shortcut and does not consider the regions/countries. This shows the necessity to understand the data and prompts yourself and the need to provide clear instructions.</p><h4>The Challenges of Integration</h4><p>Overcoming the challenges of the technology requires a substantial engineering effort. However, there are methods to counteract. For example, the maximum context length could be circumvented by creating individual agents per dataset, the shortcuts and bias in answering could be avoided by chain of thought prompting or back-and-forth interaction with the user. This all needs to be rigorously tested and tried on a large scale. It requires total integration with the data, interface, and documentation platform.</p><p>This goes far beyond the core competencies and focus of most companies. Therefore, these tasks lay in the hands of the data analysis solution provider such as Google Bigquery or Snowflake or entirely new market entrants. Although no major solution provider has yet made its move, I am certain that most of those companies are currently working on solutions. However, the responsibility does not solely lay on the shoulders of the solution provider.</p><h4>Taking Action</h4><p>The results of any agent can only be as good as the company’s understanding and documentation of the data. An agent can only come up with the correct answer if the data foundation is well documented and the connection between the individual tables, dataset collections and domains is established. In practice, a lot of best practices about the usage of company internal data still gets passed in between domain experts or other data analysts. In order to get a company ready to successfully integrate generative solutions in their application landscape, companies must set up processes that result in thoroughly digitized documentation of datasets and domain concepts.</p><p>Generative AI has great potential in automating and accelerating many tedious processes throughout the organization. It might be the missing piece to fully bridge the gap between humans and technology. However, to fully tap its potential, companies need to take action and establish an internal understanding of the technology’s potentials and limitations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e83bcdbd51d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is chatGPT truly losing its Edge?]]></title>
            <link>https://pub.aimind.so/is-chatgpt-truly-losing-its-edge-ddfb87bed493?source=rss-12af008e0be6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddfb87bed493</guid>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[statistical-analysis]]></category>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[gpt-3]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Felixbastian Hans]]></dc:creator>
            <pubDate>Thu, 14 Sep 2023 06:56:40 GMT</pubDate>
            <atom:updated>2023-09-15T17:03:22.191Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncMpP7NaWFwQTTKP6u4E6w.png" /></figure><blockquote>A Nuanced Evaluation of chatGPT’s Performance Drift</blockquote><h3>I. INTRODUCTION</h3><p>In the dynamic landscape of generative AI, the perception of progress can sometimes come as fast as it goes. Recent murmurs in the tech community suggest that chatGPT, the apex of language models, is experiencing a decline in its intellectual capacities. Critics often point to a <a href="https://arxiv.org/pdf/2307.09009.pdf">Stanford study</a> as evidence, a study that paints a rather grim picture of the model’s recent performance. But is chatGPT truly losing its edge, or is there more to the story?</p><p>This journey begins with a deep dive into the swirling currents of opinions and studies, where I aim to sift through the noise and uncover the nuanced truths about chatGPT’s evolving capabilities. Through a meticulous analysis, I aspire to shed new light on the performance gaps highlighted in recent studies and offer a fresh perspective on chatGPT’s true performance drift.</p><h3>II. THE COIN FLIP ANALOGY: A LESSON IN BIAS AND STATISTICAL SIGNIFICANCE</h3><p>Before we delve into the intricacies of the Stanford study and the experimental setup, let’s pause for a moment to consider a simple yet powerful analogy involving the flipping of coins. Imagine we conduct an experiment comparing two coins A and B. The results show that coin A lands heads 70% of the time, while coin B lands heads only 50% of all attempts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7kklQXlhlls7sR5iaLl8mQ.png" /><figcaption>Coin flip example</figcaption></figure><p>At a cursory glance, it might seem tempting to declare that coin A is superior in landing heads, right? However, what if I told you that this conclusion is drawn from a mere 10 coin flips? The sample size is too small to wield conclusive power. This analogy serves as a cautionary tale, urging us to approach the evaluations done in studies with a critical eye. To ascertain whether differences are truly significant, statistical tests are a necessity.</p><h3>III. UNVEILING THE STANFORD STUDY: A CRITICAL APPRAISAL</h3><p>In the bustling corridors of AI research, the Stanford study emerged as a beacon, casting a spotlight on the performance shifts of chatGPT’s newer versions. Spearheaded by Chen Lingjiao and team, the study embarked on a meticulous journey, dissecting the capabilities of GPT-3.5 and GPT-4 across a spectrum of tasks, from solving mathematical problems to generating code. In my analysis, I will focus on the code generation results. GPT-3.5 is the version that is freely available in the webapp, while GPT-4 is the more performant version behind the OpenAI paywall.</p><p>For the experiments, the team used a set of 50 problems from Leetcode’s easy questions category, all conceived in 2022. Yet, as the study unfolded, a concerning trend surfaced. Although the GPT-3.5 version showed no decline, the once mighty GPT-4 witnessed a staggering decline in performance, plummeting from 52 % of correctly solved questions in March to a mere 10 % for the June version. In another experiment, only the coding sections were used for the answers. This required a little more preprocessing but made the setup so much more realistic. Suddenly, the trend was the opposite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nfnhjP14WcQK94hdYlGDZg.png" /><figcaption>Percentage of executable problems from 50 easy Leetcode questions</figcaption></figure><p>In terms of programming performance, the study was only able to conclude that the March GPT-4 version provides less non-code sections in their answer, such as explanations or the nice “can I help you with anything else” at the beginning and end. Nevertheless, media quickly picked up the story and made general statements about performance in fields ranging from math to coding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LsLr3da8Wq4MN-lcPBw86w.png" /></figure><p>However, no results were actually statistically tested for their significance. Furthermore, a selected temperature setting of 0.1 was chosen to reduce variance and to make the model more deterministic. This value is far from the assumed settings of the webapp everyone is using. All these factors bring up the question of whether those results will stand the test of time. Or in my case, re-experimentation.</p><h3>IV. MY EXPERIMENTAL SETUP: A FRESH PERSPECTIVE</h3><p>Drawing inspiration from Lingjiao et al., I embraced a rich repository of Leetcode questions, with a focus on those crafted post-2021, to gauge the performance drift over time. However, to give statistical tests a fighting chance, I selected a wider portfolio of 150 questions for GPT-3.5 and 100 questions for GPT-4 of various question types (algorithmic, dynamic, sorting, array, …) difficulty levels (easy, medium, hard). This test of 150/ 100 problems was repeated five times for each version to account for answer variability.</p><p>In my quest for authenticity, I mirrored the chatGPT web app environment, and kept the temperature initialization parameter at 1, fostering a landscape where answers show significantly more variability. A more exhaustive view on my experiments and result evaluation can be found in my <a href="https://www.researchgate.net/publication/373718833_GPT-354_-_Is_the_programming_performance_declining_over_time">pre-published study</a>.</p><h3>V. THE EXPERIMENTS: DEEP DIVE ON PERFORMANCE</h3><h4>A. Comparing results</h4><p>Let’s first take a look at the overall results for the GPT-4 versions. The figure below depicts the number of correctly solved questions. Each version was tested five times with 100 question each.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*348zWtIlCEApB1oahOP_Ag.png" /></figure><p>The results shows that both questions have some good and some not so good runs. However, the June version appears to be more more variable in its answers. Let’s recreate the plot of the Stanford study to see how we compare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*buksrhTBKnAto_v_y714oA.png" /><figcaption>Percentage of questions solved (both) and standard deviation (right)</figcaption></figure><p>From the data at hand, it’s evident that the recent experiments demonstrate a significantly smaller performance gap compared to the findings of the Stanford study, especially when analyzing the average percentage of questions successfully answered. In fact, replicating the results from the Stanford study proved to be quite challenging.</p><p>To be fair, let’s assume a scenario where we adjust our observations by one standard deviation in opposite directions from the mean — a situation which is only 10 % probable. In this scenario, even if the version from March performed exceptionally poor and the June version exceeded expectations, the performance disparity highlighted by the Stanford study still wouldn’t be reached.</p><p>This raises a question: is the discrepancy in results due to the low selected temperature in the experiments which impacts the degree of answer randomness, or is there a deeper underlying issue that we have yet to uncover?</p><h4>B. Evaluating Consistency</h4><p>To be fair, just comparing mean values is not sufficient to provide statistically sound conclusions. Taking the mean values of each of the five runs is just not enough to have uncovered all potential outcomes. That’s why I will switch to a more problem-centered approach.</p><p>Considering each problem separately, each has its own unique level of complexity and therefore, a distinct likelihood of being resolved successfully or not. To determine if one version is more prone to failure than the other, we can analyze the results of five runs for each version and compare which one has a higher success rate. Let’s look at an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*L_fvWtmo3g7VkIlqcss_oQ.png" /><figcaption>Problem 5 success/failure by version among 5 attempts</figcaption></figure><p>Here, the June version did slightly better than the March version, passing four out of five attempts. I wrote down all those differences for each problem and took the mean and standard deviation. This allows to test whether there is a significant gap between the versions with the so called two-sided paired t-test.</p><p>The test didn’t reveal any notable differences between the two versions. It’s worth noting that the sample size was unfortunately quite limited, with only 28 samples considered. This was because I only included runs where both versions had at least one successful attempt. But I didn’t give up there. I relaxed the assumptions and assumed a problem to be passed (1) when 80 % of test cases were solved correctly. Let’s take a look at the results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*p5193PYG4h-qjnvMOkWclA.png" /></figure><p>So now with the relaxed conditions (Success), the sample size becomes larger. The average ratio represents the average passing ratios of all problems. This means that the June version solved, on average, 3.5 (71 %) of the 5 attempts well (above 80 %) in comparison to 3.3 /5 (66 %) for the June version. Although, this is slightly lower, no statistical test rang its alarm bells and indicated a significant performance difference.</p><p>However, I also took the approach of measuring the standard deviation for each problem. Just like the passing ratios in the example, I compared each problem to see whether one version is significantly more variant in its answers. Or in other words, does one version has more extreme tendencies to score very high and very low?</p><p>This time I hit the jackpot and identified a significant difference. Indeed, the June version is more variant in its answering performance. The confidence interval indicates that the difference in standard deviation is minimally 5 % and maximally 17 % different. This means that the June version is around half to one attempt more extreme than the March version (0.05*5 / 0.17 * 5).</p><p>In conclusion, this means that no evidence could be found that one GPT-4 version scores significantly more questions correctly (Excellence) or well (Success) than the other. However, the June version is more variant than the March version. Nevertheless, this difference results in maximally one question out of five to be solved more or less on average. It is highly questionable whether this difference can actually be observed by the average coder in practice. For GPT-3.5 (public version), I conducted the same experiments but did not observe any significant differences.</p><h3>VI. CONCLUSION :</h3><p>In crafting this article, my primary aim was to underscore the necessity of forming one’s own opinions. Contrary to prevailing perceptions, the Stanford study did not definitively state that one GPT-4 version is worse than the other. The results must always be seen in the perspective of the task. General statements about a performance reduction of GPT-4 are easy to make but hard to prove in reality.</p><p>My analysis concentrated specifically on the aspect of the study that tackled programming performance. Nonetheless, the concerns regarding the artificial experimental environment and the absence of rigorous statistical testing are applicable to other segments of the study as well. It is my aspiration that my methodology illuminates avenues for enhancing the study, fortifying its resilience to both re-experimentation and scrutiny.</p><p>Upon my analysis, I found no considerable variances in performance between the two versions, a finding that might contradict the prevailing sentiment in the tech community. I strongly urge everyone to delve into the data and code personally, and to conduct their own experiments.</p><p>Github: <a href="https://github.com/Felix-hans/GenerativeBenchmarking">https://github.com/Felix-hans/GenerativeBenchmarking</a></p><p>Pre-publication: <a href="https://www.researchgate.net/publication/373718833_GPT-354_-_Is_the_programming_performance_declining_over_time">https://www.researchgate.net/publication/373718833_GPT-354_-_Is_the_programming_performance_declining_over_time</a></p><p><strong>I would like to close with a citation of David Kriesel from his talk on “</strong><a href="https://www.youtube.com/watch?v=0rb9CfOvojk"><strong>Bahn mining</strong></a><strong>” which inspired me to do this analysis:</strong></p><p><em>“Nowadays, everyone is talking about how important it is to be rational. […] Yet, it appears that in our society, it is often enough of an argument to be upset. […] We must come to a society where taking a closer look at the actual data is encouraged […] and we cannot rely on media to help us as they thrive from headlines and uproar.[…] I want to encourage people to make their own analysis on controversial subjects.[…] Who else but us?”</em></p><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddfb87bed493" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/is-chatgpt-truly-losing-its-edge-ddfb87bed493">Is chatGPT truly losing its Edge?</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Showdown: ChatGPT vs. Bard in the Coding Arena]]></title>
            <link>https://pub.aimind.so/ai-showdown-chatgpt-vs-bard-in-the-coding-arena-439f6a694095?source=rss-12af008e0be6------2</link>
            <guid isPermaLink="false">https://medium.com/p/439f6a694095</guid>
            <category><![CDATA[bard-ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[gpt-3-openai]]></category>
            <category><![CDATA[bard-vs-chatgpt]]></category>
            <dc:creator><![CDATA[Felixbastian Hans]]></dc:creator>
            <pubDate>Thu, 03 Aug 2023 06:48:34 GMT</pubDate>
            <atom:updated>2023-08-04T17:04:25.689Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eTGGeLg8ttiX43XmUN0NNA.png" /><figcaption>Original photo by Zoran Borojevic</figcaption></figure><p>In the competitive field of AI, there’s a new face-off on the horizon: OpenAI’s C<a href="https://openai.com/">hatGPT</a> versus Google’s <a href="https://bard.google.com/">Bard</a>. Both are powerful, free-to-use generative AI models that have proven their superiority in multiple benchmarks. But now, it’s time to see how they do in the real world. As AI forges its path in reshaping software development, I set a new challenge: coding problems. Will ChatGPT’s early success keep it ahead, or will Bard’s latest advances take it to the top? Let’s dive in and find out.</p><h3>The Conditions</h3><p>Each model (ChatGPT3.5-turbo &amp; Bard) was tested on a set of 80 medium and 60 easy difficult problems from Leetcode, a common platform for solving coding problems that provides questions with examples, constraints and coding template. Solutions are evaluated by the number of test cases passed. Everything was coded in Python from problems created after 2021 to ensure fairness, as both models claim to have knowledge until September 2021. The problems were categorized into eight types: array, design, dynamic programming, hash table, math, simulation, sorting, and string. Each problem is solved multiple times (5 times on medium, 3 times on easy) since asking the same question twice can lead to substantially different results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5QtAkqNlmcKfoQYP4WlY0A.png" /><figcaption>Exemplary question: Two Sum Problem— Screenshot from Leetcode.com</figcaption></figure><h3>I. Who Solved More Problems?</h3><p>The first step was simple: see how many problems each AI could solve correctly. To give the bots a fighting chance, a solution was also marked correct if it got at least 95% of the test cases right. After all, nobody’s perfect, and even the smartest AIs can trip up on some sneaky edge cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*a71f1Q7ZKdvFWVux7HFiPA.png" /><figcaption>Table 1: Correctly solved questions on easy and medium difficulty for ChatGPT and Bard with/without 95 % acceptance rate</figcaption></figure><p>Our scoreboard, Table 1, clearly shows ChatGPT taking an impressive lead, solving a higher percentage of both easy and medium problems. And not just that, the gap gets even larger from medium to easy questions. Using a well-known statistical test (McNemar’s test), I found that this winning streak wasn’t just luck — the difference was significant, meaning ChatGPT really was outperforming Bard.</p><h3>II. Going Beyond ‘Right or Wrong’</h3><p>However, life isn’t just black and white, and neither are coding problems. I also looked at how ‘good’ each AI’s attempts were, even if they weren’t entirely right. Each attempt received a score based on the ratio of test cases it got right.</p><h4>High Scores</h4><p>Looking at the highest scores achieved among all attempts (Figure 1), Bard started to close the gap, demonstrating its ability to compete in the competition and offer somewhat accurate solutions. But even in this round, ChatGPT maintained its superiority, achieving higher top scores on average among all question types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ctabqnKPoEDcIH9Cl1SxSQ.png" /><figcaption>Figure 1: Distribution of average maximum scoring by problem type of medium difficult questions</figcaption></figure><h4>Middle-of-the-Road Scores</h4><p>When I looked at the ‘middle’ scores (the median values), the observations got more interesting (Figure 2). These score differences are now much more fluctuating, showing that both AIs have good attempts and not-so-good attempts. This shows that there is a substantial random aspect in the answering. Also here ChatGPT stayed slightly ahead but the results made me think of an interesting question: Is one model more consistent than the other?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQAI7LdXB1p-HIcxaVI92A.png" /><figcaption>Figure 2: Distribution of average median scoring by problem type of medium difficult questions</figcaption></figure><h4>Does the Type of Problem Matter?</h4><p>This is where I hit a limit. When I tried to figure out if either AI did better or worse on different types of problems, the results got a bit messy. Some categories, like math and design, seemed relatively easier for the one and harder for the other model depending on the difficulty level. However, with only a few questions in each category, it’s hard to tell if these differences were real or just due to chance.</p><h3>III. And the Most Consistent Player is…</h3><p>Is one AI more reliable than the other, delivering satisfying results more consistently? To find out, I conducted several statistical tests, like comparing how often each AI achieved perfect solutions or comparing the score variances of questions scored at least once above 80%.</p><p>The suspense was high, but in the end, there was no dramatic showdown. Both AIs showed about the same level of consistency, with their performance scores (number of test cases passed) varying by around 18-25% on average. The statistical analysis indicated no significant difference between the two in terms of consistency.</p><p>While ChatGPT might have solved more problems correctly, both AIs deserve recognition for maintaining a somewhat consistent and steady performance.</p><h3>IV. Efficiency Testing</h3><p>Another way to gauge the AIs’ skills was to look at their efficiency, in terms of how quickly and memory-friendly their code was in comparison to the other eager Leetcode solver.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*_9_vFZycHp9PXUy2Vac1mQ.png" /><figcaption>Table 2: Average runtime and memory efficiency percentiles for easy and medium questions by model</figcaption></figure><p>Yet again, there was no clear winner. As shown in Table 2, both ChatGPT and Bard ran the race with relatively average speed and grace, neither significantly outpacing the other in terms of runtime and memory efficiency.</p><h3>Conclusion</h3><p>In the end, what can the average coder now take from this exercise? I would say the most obvious conclusion is that ChatGPT remains clearly ahead in terms of coding skills. Conclusions per question type are difficult due to fluctuations but the results indicate that ChatGPT has much higher comprehension in terms of problem understanding and algorithmic, structural implementation. The fact that this difference grew even larger for easier questions could indicate that Bard is just not able to process the problem statement as well as ChatGPT and to keep true to the given formats.</p><p>Furthermore, Bard is on par with ChatGPT in terms of consistency. However, the results showcase that there is a substantial random aspect in each run for both models. Therefore, it might be worth to give each model multiple shots when asking a question.</p><p>In conclusion, I still highly recommend using ChatGPT for daily coding activities. However, in case you’re out of your daily limit, you might want to give Bard a chance. In the end, this observation is rather temporal. I am certain that both sides are already planning their next moves and the comparison will quickly need a new evaluation.</p><p>The conclusions are part of a scientific study I pre-published here:</p><p><a href="https://www.researchgate.net/publication/372860509_ChatGPT_vs_Bard_-_Which_is_better_at_solving_coding_problems">https://www.researchgate.net/publication/372860509_ChatGPT_vs_Bard_-_Which_is_better_at_solving_coding_problems</a></p><p>If you want to dive into the code yourself, feel free to explore my GitHub: <a href="https://github.com/Felix-hans/GenerativeBenchmarking">https://github.com/Felix-hans/GenerativeBenchmarking</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=439f6a694095" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/ai-showdown-chatgpt-vs-bard-in-the-coding-arena-439f6a694095">AI Showdown: ChatGPT vs. Bard in the Coding Arena</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>