<?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 Maxim Kolosovskiy, PhD on Medium]]></title>
        <description><![CDATA[Stories by Maxim Kolosovskiy, PhD on Medium]]></description>
        <link>https://medium.com/@mkolos?source=rss-9d527971ea2c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LJgrf7fX8uSR1GVdmFoppg.jpeg</url>
            <title>Stories by Maxim Kolosovskiy, PhD on Medium</title>
            <link>https://medium.com/@mkolos?source=rss-9d527971ea2c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 03:37:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mkolos/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[10 Papers on Large-scale Data Processing]]></title>
            <link>https://medium.com/@mkolos/10-papers-on-large-scale-data-processing-306d81713b11?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/306d81713b11</guid>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Wed, 15 Oct 2025 11:00:55 GMT</pubDate>
            <atom:updated>2025-10-15T11:00:55.947Z</atom:updated>
            <content:encoded><![CDATA[<h4>To study system design on well-known real examples</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cyvJfV25KrjJSZES" /><figcaption>Photo by <a href="https://unsplash.com/@choys_?utm_source=medium&amp;utm_medium=referral">Conny Schneider</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>🧱 1. The Google File System (GFS, 2003)</h3><p>Authors: Sanjay Ghemawat, Howard Gobioff, Shun-Tak Leung</p><p>Problems before GFS:</p><ul><li>Traditional file systems could not scale to thousands of machines and petabytes of data.</li><li>Node and disk failures led to data loss or downtime.</li><li>Large files (gigabytes/terabytes) were extremely slow to process.</li></ul><p>Solutions:</p><ul><li>Chunk-based storage with replication (usually 3 copies).</li><li>Master/Chunkserver architecture: master stores metadata, chunkservers store data.</li><li>Automatic failure detection and recovery.</li><li>Optimized for streaming read/write of large files.</li></ul><p>Impact: Enabled scalable, fault-tolerant storage for Bigtable, MapReduce, Spanner.</p><h3>⚙️ 2. MapReduce: Simplified Data Processing on Large Clusters (2004)</h3><p>Authors: Jeffrey Dean, Sanjay Ghemawat</p><p>Problems before MapReduce:</p><ul><li>Distributed data processing required manual parallelization and synchronization.</li><li>Node failures could crash the entire job.</li><li>Scaling to thousands of nodes was difficult.</li></ul><p>Solutions:</p><ul><li>Split tasks into Map (transform data) and Reduce (aggregate results).</li><li>Automatic task scheduling and recovery.</li><li>Data locality: tasks run on nodes where the data resides.</li><li>Transparent parallelism and fault tolerance for developers.</li></ul><p>Impact: Simplified writing large-scale parallel jobs; foundation for Hadoop, Spark, Flink.</p><h3>🗃️ 3. Bigtable: A Distributed Storage System for Structured Data (2006)</h3><p>Authors: Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach, Mike Burrows, Tushar Chandra, Andrew Fikes, Robert E. Gruber</p><p>Problems before Bigtable:</p><ul><li>No scalable key-value store for petabytes of data.</li><li>SQL databases did not scale horizontally.</li><li>Needed millions of low-latency reads/writes per second.</li></ul><p>Solutions:</p><ul><li>Row/column/timestamp key model for flexible tables.</li><li>Tablets with automatic splitting and replication.</li><li>Used Chubby for coordination and metadata management.</li></ul><p>Impact: Enabled scalable, low-latency storage for Gmail, Maps, YouTube.</p><h3>🔄 4. The Chubby Lock Service for Loosely-Coupled Distributed Systems(2006)</h3><p>Authors: Mike Burrows</p><p>Problems before Chubby:</p><ul><li>Distributed services required reliable coordination.</li><li>Standard locks didn’t work in unreliable networks.</li><li>Leader election and configuration management were hard.</li></ul><p>Solutions:</p><ul><li>Distributed lock service built on Paxos.</li><li>File-like API for locks and semaphores.</li><li>Used by Bigtable, MapReduce, Spanner for coordination.</li></ul><p>Impact: Practical implementation of distributed consistency and replication for real systems.</p><h3>🔍 5. The Anatomy of a Large-Scale Hypertextual Web Search Engine (1998)</h3><p>Authors: Sergey Brin, Lawrence Page</p><p>Problems before:</p><ul><li>Indexing billions of web pages was infeasible.</li><li>Ranking and fast search required distributed computation.</li><li>Real-time updates of indexes were difficult.</li></ul><p>Solutions:</p><ul><li>Distributed crawlers and indexers.</li><li>PageRank algorithm for page importance.</li><li>Horizontal distribution of indexes and batch updates.</li></ul><p>Impact: First scalable web search system supporting billions of documents.</p><h3>📡 6. MillWheel: Fault-Tolerant Stream Processing at Internet Scale (2013)</h3><p>Authors: Tyler Akidau, Alex Balikov, Kaya Bekiroğlu, Slava Chernyak, Josh Haberman, Ricki Lee, Paul L. Nordstrom, Sam Whittle, Daniel Chambers, Sergey V. Melnik</p><p>Problems before MillWheel:</p><ul><li>Stream systems only provided “at least once” semantics → duplicates.</li><li>Real-time processing at millions of events/sec was impossible.</li><li>Maintaining event order and exactly-once semantics was difficult.</li></ul><p>Solutions:</p><ul><li>Stream processing DAG with exactly-once semantics.</li><li>Stateful processing and checkpointing for recovery.</li><li>Scales to millions of events/sec with low latency.</li></ul><p>Impact: Reliable real-time stream processing at Internet scale; basis for Google Cloud Dataflow / Apache Beam.</p><h3>🧮 7. Dremel: Interactive Analysis of Web-Scale Datasets (2010)</h3><p>Authors: Sergey Melnik, Andrey Gubarev, Jing Jing Long, Geoffrey Romer, Shiva Shivakumar, Matt Tolton, Theo Vassilakis</p><p>Problems before Dremel:</p><ul><li>SQL queries on petabytes of data took hours.</li><li>Columnar storage and nested data were not optimized for distributed analytics.</li></ul><p>Solutions:</p><ul><li>Columnar storage with tree-based aggregation.</li><li>Multi-level execution tree for parallel query execution.</li><li>Supports nested data efficiently.</li></ul><p>Impact: Interactive SQL at petabyte scale; foundation for BigQuery, Apache Drill, ClickHouse.</p><h3>💾 8. Spanner: Google’s Globally-Distributed Database (2012)</h3><p>Authors: James C. Corbett, Jeffrey Dean, Michael Epstein, Andrew Fikes, Christopher Frost, J. J. Furman, Sanjay Ghemawat, Andrey Gubarev, Christopher Heiser, Peter Hochschild, Wilson Hsieh, etc.</p><p>Problems before Spanner:</p><ul><li>Global distributed databases lacked ACID transactions.</li><li>Consistency across data centers was hard.</li><li>External consistency for transactions was impossible.</li></ul><p>Solutions:</p><ul><li>TrueTime API for globally synchronized timestamps.</li><li>Paxos-based replication with ACID transactions.</li><li>Sharding and automatic load balancing.</li></ul><p>Impact: First global distributed database with strong consistency and transactions.</p><h3>🕸️ 9. Dapper, a Large-Scale Distributed Systems Tracing Infrastructure (2010)</h3><p>Authors: Benjamin H. Sigelman, Luiz André Barroso, Mike Burrows, Pat Stephenson, Manoj Plakal, Donald Beaver, Saul Jaspan, Chandra Narayan</p><p>Problems before Dapper:</p><ul><li>Debugging and monitoring distributed systems was extremely difficult.</li><li>Identifying bottlenecks across thousands of services was impossible.</li></ul><p>Solutions:</p><ul><li>Distributed request tracing across services.</li><li>Automatic trace ID and span ID correlation.</li><li>Metrics and visualizations for latency and bottleneck analysis.</li></ul><p>Impact: Made distributed monitoring a systematic process; foundation for OpenTracing, Jaeger, Zipkin.</p><h3>🧠 10. Borg, Omega, and Kubernetes: Lessons Learned from Three Container-Management Systems over a Decade (2016)</h3><p>Authors: Brendan Burns, Brian Grant, David Oppenheimer, Eric Brewer, John Wilkes</p><p>Problems before:</p><ul><li>Managing thousands of applications in data centers was chaotic.</li><li>Resource utilization was inefficient; fault tolerance was manual.</li></ul><p>Solutions:</p><ul><li>Declarative resource management and scheduling.</li><li>Automated placement, scaling, recovery.</li><li>Kubernetes generalized the approach for open-source container orchestration.</li></ul><p>Impact: Efficient orchestration of distributed clusters and workloads at scale.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=306d81713b11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The difference between Programming and Computer Science shifted my understanding of the profession]]></title>
            <link>https://medium.com/@mkolos/the-difference-between-programming-and-computer-science-shifted-my-understanding-of-the-profession-c6591c1f01ce?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6591c1f01ce</guid>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 12:22:42 GMT</pubDate>
            <atom:updated>2024-08-16T15:39:19.934Z</atom:updated>
            <content:encoded><![CDATA[<p>The latter adds a dimension of maintaining a product for years or even decades</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w3CEfs4-k5s6Fl-L" /><figcaption>Photo by <a href="https://unsplash.com/@aronvisuals?utm_source=medium&amp;utm_medium=referral">Aron Visuals</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>One day understanding the difference between Programming and Computer Science shifted my understanding of the profession 🔥</p><p>Programming is about writing a programan for now, including its correctnessm understanding what is happening under the hood, using effective and modern syntax, maybe using handy libraries.</p><p>Computer Science is more about maintaining a product for years or even decadates. ⏳ That makes you think about hundreds of changes that will happen in the future, e.g. <br>- new features will be added that are not fit to the original design or initial assumptions, 🙃 <br>- in particular future readers of your code need to clearly understand it, so you do care about readability, 😳 <br>- compiler and 3P libraries will change and adopting some changes could be really hard, so it is better to think in advance of such changes,<br>- a product may grow into a set of products and the corresponding teams will need to not break each others’ work.</p><p>There was one example that I remembered specifically: do think of names of namespaces (in C++). At the first glance, who cares if I introduce a |util| namespace in my local component? In a small project, possibly nobody. But in a large project there could be conflicts with some built-in libraries or with other components. One may say “a name conflict is not a big problem, If I encounter one, I will simply rename the just-added namespace”. The problem is a conflict may not appear when you add that new namespace, but it may bubble up when for example you will add a new element in the namespace and spaghetti of rules for resolving namespaces may complain that such a name already exists. You will look at that namespace and only wonder “how come? I see all elements of the namespace, the new is brand new!” Thus, you will have to look a couple steps back to find the root cause, which in my opinion could be quite hard. (References: <a href="https://abseil.io/tips/130">https://abseil.io/tips/130</a>, <a href="https://abseil.io/tips/119">https://abseil.io/tips/119</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6591c1f01ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An effective ready-to-go routine to increase your (English) vocabulary]]></title>
            <link>https://medium.com/@mkolos/an-effective-ready-to-go-routine-to-increase-your-english-vocabulary-5c30ef3bc9ae?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c30ef3bc9ae</guid>
            <category><![CDATA[language-learning]]></category>
            <category><![CDATA[flashcards]]></category>
            <category><![CDATA[english-learning]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[anki]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Tue, 30 Jan 2024 19:33:57 GMT</pubDate>
            <atom:updated>2024-01-30T20:31:31.788Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to advance your communication skills to the next level. In particular, how to train yourself to study regularly</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*870qmR-uXsmFDg7j" /><figcaption>Photo by <a href="https://unsplash.com/@pisitheng?utm_source=medium&amp;utm_medium=referral">Pisit Heng</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>At some point, I noticed that vocabulary is the bottleneck to advance my English to the next level. Though English language tests demonstrated that my vocabulary was quite large, I noticed that it is “large” only when I have time to pick an option from a list. However, when I speak English, an appropriate word didn’t pop up quickly. Thus, my speech had many breaks to find an appropriate word, or, even worse, I had to explain a missing word with a number of other words. That was too cumbersome and needed to be changed.</p><p>It is crucial to regularly repeat common English words in order to pick them up quickly and not interrupt your speech. One may use electronic or paper notes to keep a list of common words. Thus, one could go through the list in order to learn new words and recall already-learned words. However, it doesn’t seem effective. In particular, the list grows quickly but different words need different approaches: well-known words should be seen less frequently, and other words need more attention. Over time words from the later group migrate to the former group, and sometimes they go vice versa (you forget a word). Such migrations between groups are hard to organize in a plain list. Moreover, there are more than two states for a word — not just well-known vs others. There are more levels in between.</p><p><a href="https://en.wikipedia.org/wiki/Flashcard">Flashcards</a> and the <a href="https://en.wikipedia.org/wiki/Leitner_system">Leitner system</a> are a good way to organize your list. Each flashcard contains a question. In language learning it is normally a word and its meaning. Flashcards are sorted into groups according to how well the learner knows them. Correctly answered cards are advanced to the next, less frequent box. Incorrectly answered cards are returned to the previous, more frequent box. Thus, each word gradually migrates from the most frequent box (unknown words) to the less frequent box (well-known words).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*seOTmTL4LMBL3yjr.png" /><figcaption><a href="https://en.wikipedia.org/wiki/Leitner_system">Source</a></figcaption></figure><p><strong>I recommend </strong><a href="https://en.wikipedia.org/wiki/Anki_(software)"><strong>Anki</strong></a><strong> as a flashcards software.</strong> It has apps for mobile and desktop platforms as well as a web interface. Your progress will be synced in your Anki account and you don’t need to start from scratch in case for example you replace your mobile device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3YXOEdl79I1H23FnQiUrKA.jpeg" /><figcaption>Image by author</figcaption></figure><p>It is quite important to find a good deck of flashcards. Most language learning software has an option to use flashcards to learn words. However, I ran into a set of “common words” that I didn’t really notice in real communication. Thus, I didn’t see any effect from flashcards and my studying stalled. <strong>I recommend using 4000 Essential English Words by Paul Nation.</strong> There are many variations for different languages. <a href="https://ankiweb.net/shared/info/1104981491">This en-en deck</a> is the most popular one, but you may want to use a deck with your language translations (I used <a href="https://ankiweb.net/shared/info/317970103">this en-ru deck</a>). Please help yourself to find an appropriate one for your needs either with <a href="https://ankiweb.net/shared/decks?search=4000%20essential%20English%20words">Anki deck search</a> or a web search engine.</p><p>I believe it is crucial to study regularly, which is the most challenging part in my opinion. My tip is to focus on learning a consistent habit, not learning words. Don’t try to study 1–2 hours every day. You will likely get overwhelmed after days or a couple of weeks. Instead, promise to spend 5–15 minutes each day, i.e. a timeframe that doesn’t spend your willpower. I recommend not spending more in the first days even if you want to — keep your hunger for the next days instead. What really matters is the number of consecutive days. In deck options, you can configure how many new words will be shown and how many reviews will be shown. <strong>I recommend 3 new cards per day and 10 reviews per day.</strong></p><p>Summary:</p><ol><li>Register <a href="https://ankiweb.net/account/signup">an Anki account</a>.</li><li>Download <a href="https://apps.ankiweb.net/#download">Anki software</a>.</li><li>Download <a href="https://ankiweb.net/shared/info/1104981491">a deck</a> and add it to Anki.</li><li>Adjust deck options: maximum 3 new cards and 10 reviews per day.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c30ef3bc9ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3-minute guide on how LLMs learn to “understand” a human language]]></title>
            <link>https://medium.com/@mkolos/3-minute-guide-on-how-llms-learn-to-understand-a-human-language-4a74f81316f9?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a74f81316f9</guid>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Fri, 05 Jan 2024 20:13:39 GMT</pubDate>
            <atom:updated>2024-01-09T12:34:11.811Z</atom:updated>
            <content:encoded><![CDATA[<h4>And how it differs from how a human understands a language</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ByhBorAx-5LKQAjQ" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Understanding the general principle of how Large Language Models or any other ML model work is crucial for picking the right tasks to be solved by ML, and therefore avoiding wasting time on trying to solve wrong problems (i.e. problems that AI/ML cannot effectively tackle).</p><p>Imagine that we don’t understand English and we see this snippet of English text (unnaturally simplified to make the point):</p><blockquote><em>We see a room. I hear steps. He enters the room. He drinks water. She enters the room too. She greets him. They talk. She eats an apple. They leave the room.</em></blockquote><p>Even if we knew zero English words, we can notice a number of patterns:</p><ul><li>Every sentence starts with some special words (i.e. <em>personal pronouns</em>)</li><li>The word following a pronoun (<em>verb</em>) alters if the pronoun is either “he” or “she” (i.e. <em>conjugates</em>).</li></ul><p>The sample is tiny, but if you saw thousands of such simple sentences, you would also learn that verbs and pronouns can be combined in basically any combination: he enters, she enters,…, I see, he sees, she sees,…</p><p>Thus, with zero knowledge of the English language you are already able to generate thousands of valid English sentences (though they would still be too simple to compose a sensible narrative yet).</p><p>Let’s now append the sample (training data) with negative sentences. For example,</p><blockquote><em>He doesn’t see anybody. I don’t hear them. We don’t see them.</em></blockquote><p>Then, we could probably notice that a pronoun and a verb can be separated with some short words: “doesn’t” or “don’t”. Additionally, notice that the former is used only for “he” or “she”. Thus, we learn to generate a bit more complex sentences.</p><p>We can learn more from such sentences, for example,</p><ul><li>a/an is used before some words (i.e. <em>nouns</em>), and the specific form is used depending on the first letter of a noun.</li><li>Some other words are often used before (pro)nouns or after verbs (things are getting more complex now)</li><li>And so forth according to the full course of English grammar….</li></ul><p>Note that you can generate some elementary sentences with <strong>zero</strong> knowledge<strong> </strong>about the meaning of words you have seen. In particular,</p><ul><li>No idea that “I”, “he”, or“she” mean a person or several persons, it may refer to the speaker, the person being spoken to, or a person being spoken of.</li><li>No idea that “doesn’t” or “don’t” inverse the meaning of a given sentence.</li><li>No idea that a verb describes an action.</li><li>No idea that the word “apple” is an edible real-world object.</li></ul><p>All words are kinda meaningless drawings and we notice some patterns of how these drawings are combined. There are no attributions to real-world objects or mental concepts.</p><p>Now imagine that the training data contains tons of various sentences. For example, a sentence doesn’t start with a pronoun, but with a noun, or doesn’t start with a subject, but with an adverbial modifier… As said before, just pick anything from the course of English grammar.</p><p>For a human, it might be too hard to notice all the patterns (i.e. English grammar) without understanding meanings, but for a computer such a task is <a href="https://medium.com/@mkolos/many-ml-projects-fail-because-of-this-misunderstanding-about-ml-72e70c97ee10">a perfect fit</a>: a computer is very good at remembering tons of data, calculating tons of statistics (e.g. “he” precedes “doesn’t” 1234 times, “eats” — 23 times, “tells” — 45 times) and inferring patterns (e.g. “he” combines with “doesn’t” and never with “don’t”). Thus, it is all about patterns that a computer replicates when generates text. Thus, LLMs kinda mimic what they see in text corpora.</p><p>Generating valid sentences is just one example. But how for example a computer can answer questions like “What is &lt;term&gt;?” (e.g. “What is a planet?”)? A computer can learn that from patterns found in training data, but now the data must be a bit more sophisticated. Namely, it must include conversations where a question like “What is &lt;term&gt;?” is answered with a sentence like “&lt;term&gt; is …” (i.e. a sentence that starts with the given &lt;term&gt;, the verb “to be” follows and then some other text follows, which is the definition of the &lt;term&gt;). Thus, when a computer is asked “What is a planet?”, it looks for a sentence that starts with “Planet is” and outputs the whole sentence/paragraph. It is just a simple example of patterns mined from conversations and text corpora. It can be continued with more complex examples. The point is that looking for just patterns is quite powerful and LLMs harness that power. It is good to know how it works internally (as much as human imagination allows) in order to use this tool in an appropriate (use for tasks that fit well) and therefore most effective way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a74f81316f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a chatbot helped me to get a refund for a canceled flight]]></title>
            <link>https://medium.com/@mkolos/how-a-chatbot-helped-me-to-get-a-refund-for-a-canceled-flight-89a3d0b2160f?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/89a3d0b2160f</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Sat, 14 Oct 2023 13:35:42 GMT</pubDate>
            <atom:updated>2023-10-14T13:35:42.290Z</atom:updated>
            <content:encoded><![CDATA[<h4>How a simple chatbot created in just a couple of hours saved me from many hours of ineffective and annoying communication with an irresponsible business, and deservedly returned my money back.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tyHD1JadY0Z6PBWg" /><figcaption>Photo by <a href="https://unsplash.com/@coopery?utm_source=medium&amp;utm_medium=referral">Mohamed Nohassi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Problem: a travel agency refused a refund</h3><h4>Booking a flight and its cancellation</h4><p>Right before Corona time, I had booked a number of flights for 2K+ €. I normally booked flights with airlines directly, and it was my first time when I tried an online travel agency (not the great time as it turned out later): you get a flight for a cheaper price, but if something goes wrong (e.g. changes, cancellation) don’t expect decent support.</p><p>I was not able to travel due to Corona. Fortunately, the flight was simply canceled — I didn’t need to prove that I was not able to use the booked flight because of corona, flight restrictions, etc. That seemed like an easy case. The airlines confirmed the cancellation, but they were not able to make a refund because I booked via a travel agency — I must have settled the problem with the agency. Moreover, the airlines didn’t even see my data in their database. So, communication with the agency was inevitable.</p><p>The communication seemed well organized in the beginning: the agency promised to make a full refund if the flight is really canceled and kindly asked for patience, which was quite reasonable due to probably the most chaotic stage of Corona time. After six months, there was still no answer from the agency and I pinged them. I got another kind request to wait a bit more. Admittedly, it was still an uncertain time, in particular, I was working with another airline to refund another flight. So, the further delay was kinda expected. I had got confirmation that my case was not forgotten and agreed to wait more.</p><h4>Looking for new solutions</h4><p>After waiting for another three months, I started pinging them more often — once a month or so. That time, it seemed that the agency simply sent polite messages to wait a bit more and more, but nothing really changed. It seemed that they are not going to really do anything with that: their operators could send polite excusements forever until a client just gives up. That was my understanding of their strategy. At that moment, I decided to be more insistive in demanding my refund. However, tracking whether a new response from the agency has come and writing a new nagging message took a lot of time and, more importantly, mental energy. In particular, it was hard to not take the situation personally especially when a human operator on the other side behaves as if they were a machine: mechanically apologies and asks to wait more.</p><blockquote>I had realized that I would not win that battle (or win it at too high costs) with an irresponsible business. This is why I decided to be “a machine with nerves of steel” too, namely, to create a chatbot that would communicate with this business on my behalf.</blockquote><p>Time would tell whose nerves are stronger.</p><h3>Solution: a chatbot in the form of Chrome Extension</h3><p>The communication with the agency happened in a chat on their website. So, I chose to create a Chrome extension that would track whether a new response has come and would send a new ping to the agency.</p><h4>Checking the status of the chat</h4><p>The extension regularly checked the state of the chat with <a href="https://developer.mozilla.org/en-US/docs/Web/API/setTimeout">setTimeout</a>. Namely, whether there are new messages from the website. Technically, the check queried all messages displayed in the chat with a <a href="https://www.w3schools.com/cssref/css_selectors.php">CSS selector</a>, extracted the sender’s name of the last message. If the last message isn’t mine, the extension sends a new nagging message. If the last message was mine and there was no message for the last 24 hours, the extension sent a ping.</p><p>The extension reloaded the page to get the newest messages. A status check may coincide with chat reloading. The extension was able to detect that state as well: the extension checked with another CSS selector whether a messages list was on the page. If that element was there, the extension deferred checking the list of messages to a bit later time (in two seconds).</p><pre>function CheckChatStatus() {<br> var hour = new Date().getHours();<br> // If out of working hours, then wait for the next day.<br> if (hour &lt; 7 || hour &gt; 23) {<br>   setTimeout(CheckLastResponse, 1000 * 3600 * 8);<br>   return;<br> }<br> // If the chat is reloading, then check a bit later.<br> if (document.getElementsByClassName(&quot;messages_list&quot;).length == 0) {   <br>   setTimeout(CheckLastResponse, 2000);<br>   return;<br> }<br><br> var messages = Array.from(document.querySelectorAll(&quot;div.chat_message&quot;));<br> var last_sender = messages[messages.length - 1].innerText;<br> // If my response is not the last one, send a new message.<br> if (last_sender != &quot;John Smith&quot;) {<br>   ComposeAndSendNewMessage();<br> } else if (NoResponseToday()) { // Is the last message&#39;s date not &quot;today&quot;?<br>   // If there is no update for a day, send a new message unconditionally.<br>   SendNewMessage(&quot;Hi there. Any updates?&quot;);<br> }<br> // Schedule a page reload in 5 minutes to get new messages.<br> setTimeout(function(){location.reload();}, 5 * 60 * 1000);<br>}</pre><h4>Composing a new message</h4><p>A message consists of the following section:</p><ol><li>My thanks for the operator’s response.</li><li>Emphasizing that a refund is easy and overdue.</li><li>Questioning of further updates.</li><li>Message closing.</li><li>My name.</li></ol><p>Their chat blocked duplicate messages. So the extension should have been a bit more subtle. Each section was composed from a pool of variations. For example, the closing could be one of “Regards”, “Kind regards”, “Best regards”, “Warm regards”. The delimiters between sections were chosen randomly too: “ “ or “\n” or “\n\n”.</p><pre>function ComposeAndSendNewMessage() {<br>  var delimiters = [&quot; &quot;, &quot;\n&quot;, &quot;\n\n&quot;];<br>  var thanks = &quot;Thank you for your kind response&quot; + GetOperatorName() + &quot;.&quot;;<br>  var body = [&quot;I requested the refund 10 months ago.&quot;, <br>              &quot;The flight was canceled.&quot;, <br>              &quot;Refunding is straightforward.&quot;, <br>              &quot;You withhold my money for many months.&quot;, <br>              &quot;You should refund my money ASAP.&quot;];<br>  var question = &quot;Any further updates about my refund?&quot;;<br>  var closing = [&quot;Regards&quot;, &quot;Best regards&quot;, &quot;Warm regards&quot;];<br>  var names = [&quot;John&quot;, &quot;J. Smith&quot;, &quot;Mr. Smith&quot;, &quot;John Smith&quot;];<br>  var message = [thanks, PickRandom(delimiters), <br>                 PickRandom(body), PickRandom(delimiters), <br>                 question, PickRandom(delimiters), <br>                 PickRandom(closing), &quot;,&quot;, PickRandom([&quot; &quot;, &quot;\n&quot;]), <br>                 PickRandom(names)].join(&quot;&quot;);<br>  SendNewMessage(message);<br>}</pre><p>I’ve also added a number of tricks:</p><ul><li>Send messages only from 7am to 23pm in my local time.</li><li>Extracted the name of the operator that responded last.</li><li>Removed a few letters from the message to introduce typos.</li></ul><p>It was a bit hard to find a Javascript command to type a text into an input field, namely, sending keystrokes (<a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event">e.g.</a>) didn’t work for me for some reason. Fortunately, <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#inserttext">document.execCommand</a> worked well (thought its status is deprecated).</p><pre>function SendNewMessage(mes) {<br>  document.getElementsByTagName(&quot;textarea&quot;)[0].focus(); <br>  document.execCommand(&quot;insertText&quot;, false, mes); <br>  document.querySelectorAll(&quot;button[type=&#39;submit&#39;]&quot;)[0].click();<br>}</pre><h3>Outcome</h3><p>A notification of a full refund was received on the very next day. I didn’t expect that the agency would give up so quickly, and the extension nagged them for a couple of hours without a reason. Possibly, that was a reason that later the agency refunded even the fee for making a refund (another 15$), which was not even supposed. Full victory. \o/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89a3d0b2160f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The art of starting small with an AI idea to achieve great heights]]></title>
            <link>https://medium.com/@mkolos/wizard-of-oz-pitfall-in-ai-17e8db4cddfe?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/17e8db4cddfe</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[prototyping]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Fri, 28 Jul 2023 06:36:58 GMT</pubDate>
            <atom:updated>2024-01-10T16:15:28.864Z</atom:updated>
            <content:encoded><![CDATA[<h4>Putting too much on AI’s shoulders may kick AI out of the product. Therefore, know actual AI’s capabilities to solve a given problem from the very beginning of a project.</h4><h3>Sticking to a human behind a curtain (a.k.a. Wizard of Oz technique)</h3><blockquote>Putting too much on AI’s shoulders may actually kick AI out of the product.</blockquote><p>Many AI-based products set too ambitious automation goals which would require years or even decades of AI algorithms development, collecting precise and extensive training data, and all related work. Obviously, not any team can wait for such a long time to see the first results. Thus, teams start with <em>‘</em><a href="https://en.wikipedia.org/wiki/Wizard_of_Oz_experiment"><em>Wizard of Oz</em></a><em>’</em> prototyping: a product that is supposed to be controlled by AI is actually controlled by a human (<a href="https://www.wired.com/story/not-always-ai-that-sifts-through-sensitive-info-crowdsourced-labor/">e.g.</a>). However, due to the huge gap between product expectations and real AI’s capabilities, such a product may stick to relying on ‘a human behind a curtain’ forever. That is sad news for AI and automation enthusiasts because the folks may end up creating infrastructure and/or tools to facilitate the work of these humans instead of genuinely teaching a machine to be smart. Below I suggest what we could do to avoid that.</p><h3>Famous examples of a human behind a curtain</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bww4sUTiHQ1EUav-NvPi4g.png" /><figcaption><a href="https://en.wikipedia.org/wiki/Mechanical_Turk"><strong>Mechanical Turk</strong></a><strong> </strong>was a fake chess-playing machine constructed in the late 18th century and allowed a human chess master hiding inside to operate the machine and won most of the demonstration games over 84 years. <a href="https://en.wikipedia.org/wiki/Mechanical_Turk">Source of the image.</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*btuAQyD32DtL18X2.gif" /><figcaption><strong><em>The Wizard of Oz technique</em></strong> is a way of prototyping an AI product where the product pretends to be autonomous, but actually is operated by an unseen human being. Screenshot from <a href="https://en.wikipedia.org/wiki/The_Wizard_of_Oz_(1939_film)">The Wizard of Oz (1939 film)</a></figcaption></figure><h3>Don’t overpromise what your product can do</h3><p>Apparently, a product that can do more for a user is way more appealing. As noted above, such a product may not live up to the promises or will have to stick to using human labor forever, which normally excludes applying any AI techniques, e.g. ML. Then, the tech stack will be all about two things:</p><ul><li>tools to speed up manual work (as the manual work is the bottleneck — the most expensive and slow part of the pipeline);</li><li>infrastructure to monitor whether additional manual work is needed, in particular, when the system receives a new unseen input (as unseen inputs or changes in the outer world are inevitable and a system that cannot really learn would not adapt to new inputs automatically).</li></ul><blockquote>Be honest about what a product can do and what it can not. Set clear expectations.</blockquote><p>In particular, be careful with positioning a product as human-like. Users may expect that the product should have all possible human capabilities, which is unlikely true. Have at least a rough understanding of how your AI model will ‘mine knowledge’ (preferably from <a href="https://medium.com/@mkolos/greatest-applications-of-ai-ml-are-based-on-this-factor-318083642209">massive training data</a>), don’t consider AI as a magic box that <a href="https://medium.com/@mkolos/many-ml-projects-fail-because-of-this-misunderstanding-about-ml-72e70c97ee10">will somehow figure out what to do</a>.</p><h3>Start small</h3><p>In order to help users in a selected domain, a team could and should start small, namely, by generating suggestions in specific parts of a user flow instead of pretending to replace a human in the whole user flow. This comprises two changes:</p><ul><li>By a ‘suggestion’, I mean something that doesn’t pretend to be 100% precise, but nevertheless provides a decent value for a user.</li><li>When automating just a part of a user flow, a team can be more focused and output better results for that specific part.</li></ul><p>Thus, a team can build a product that provides value for a user and is not forced to involve a human in the loop. Moreover, this strategy allows cherry-picking the cases where AI strives and defer handling hard edge cases. Likely, <a href="https://en.wikipedia.org/wiki/Pareto_principle">the Pareto principle</a> could be applied: the former would cover 80% of cases and would take just 20% out of the time to support all cases. Given that a genuine AI can be scaled up, even prodigal exclusion of the hard cases will still produce a lot of valuable knowledge.</p><p>The approach has an analogy in levels of driving automation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M953p7w0Vd0toZwF" /><figcaption>Levels of driving automation. <a href="https://www.sae.org/blog/sae-j3016-update">Source</a></figcaption></figure><p>A team can start with implementing a cruise control. It is just a ‘suggestion’ that a driver can easily overrule: it doesn’t have to be 100% perfect because a driver can correct it. Nevertheless, the ‘suggestion’ can be good enough to really help the driver.</p><p>Applying the Wizard of Oz technique could mean hiding a human in the vehicle and pretending that it is a prototype of an autonomous vehicle. That could be super impressive, but such a prototype is basically pointless and doesn’t move us forward to a real autonomous vehicle.</p><p>Assess an AI product by its ability to produce valuable knowledge <em>without</em> human tweaks and/or monitoring. Thus, a small component that offers just limited assistance but works genuinely autonomously is more valuable than a component that mimics wide assistance, but requires more monitoring from a human.</p><blockquote>Start with a small, but genuinely autonomous product.</blockquote><h3>Continue by automating other parts of the flow</h3><p>Later on, another part of a user flow can be automated without a human in the loop. And one more part…</p><p>And also the accuracy of the existing parts can be polished in parallel… Eventually, when all these parts work quite well, they can be combined to assist a user with the whole flow.</p><blockquote>Automation without a human in the loop enables a product to work without your close supervision. Meanwhile you can automate the next parts.</blockquote><h3>Less automation might be a better strategic decision for the start</h3><p>Offering a ‘<em>humble suggestion</em>’ instead of ‘<em>I will simply do all the work for you</em>’ is not only about starting small. It is more about having a special UI, where a user is explained how and why <em>suggestions</em> were inferred, feels in control, and is able to fix a mistake if needed.</p><p>Below is a comparison of two approaches from various perspectives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*FAnU2A_RJWLUV310vo51OQ.png" /><figcaption>Less vs more automation approaches from various perspectives, e.g. scalability and living up to expectations. Image by author. <a href="https://emojipedia.org/">Source of the emojis</a><a href="https://emojipedia.org/">.</a></figcaption></figure><p>The first approach (less automation) could be referred to as <strong><em>Intelligent Augmentation (IA)</em></strong>: unlike Artificial Intelligence (AI), it doesn’t aim to perform tasks like a human, but augments a human with assistance that a computer could do <a href="https://medium.com/@mkolos/many-ml-projects-fail-because-of-this-misunderstanding-about-ml-72e70c97ee10">really better than a human</a> (e.g. remembering and searching in masses of data, doing tons of mechanical computations instantly).</p><h3>The approach may complicate pitching your idea</h3><p>It is usually hard to secure the value of such incremental changes. Real automation (i.e. without a human behind the curtain) of only a part of a user flow will still take time. The value of automating just one step would not be that big compared to a prototype that hides a human behind the curtain and therefore could perform the whole flow from end to end. Thus, it might be hard to convince a business to be patient and go <em>gradually</em>.</p><blockquote>Slow and steady wins the race.</blockquote><p>Below is what you can do to overcome these challenges:</p><ul><li>Have a list of milestones where each milestone has its self-contained value and therefore the team can stop or suspend the project after any milestone (for example, if the further milestones don’t seem so promising anymore).</li><li>Create a rough first version of a product to demonstrate that your idea seems viable.</li><li>Don’t prototype a product by hiding a human behind a curtain, but prove that an (AI) algorithm under the hood could really produce some useful intelligence.</li><li>Prototyping how a product would look and feel to a user (i.e. showing what value a product will bring) could be important too, but the most challenging part is to assess whether you can really create an algorithm that will be able to provide that value. For example, demonstrating a UI that would answer any arbitrary question clarifies basically nothing — such a program would be definitely useful. The real question is whether there is an algorithm that could give <a href="https://towardsdatascience.com/chatgpt-insists-i-am-dead-and-the-problem-with-language-models-db5a36c22f11">a good answer to an arbitrary question</a>.</li><li>Prototyping a rough first version may need a substantial amount of time, for which you may need to get permission first, for which it would be good to have the first version… It turns into the chicken or egg problem and there is no clear answer on how to handle such a situation. Consider spending a reasonable time to roughly verify whether a given idea would work. Ask for forgiveness, not permission.</li><li>Early prototyping is supposed to eliminate a substantial fraction of <a href="https://medium.com/@mkolos/data-related-projects-are-vulnerable-to-this-underwater-rock-ae4dda1c833d">uncertainty that is typical for data-related projects</a>: though there is always a chance that unknown underwater rocks could stop or significantly delay a project, the first testing of a hypothesis in the wild normally helps a lot.</li></ul><h3>How to position an AI-based suggestions product?</h3><p>Imagine you need to build a feature for Medium.com to pick the next good read for a user.</p><p>Build a clear mental model of how your AI product works. That would help users to use an AI-based product. A user should be able to understand why AI provides a given suggestion (e.g. ‘selected based on your reading history’), and how trustworthy a suggestion is (e.g. ‘you have read N articles from this topic’, ‘N people you follow read this article’). A product should not be a magic ball that shows what to do for a user. Instead, a product should be like a secretary that has done some tedious and/or boring work for their boss (a user) and provide a summary, which the ‘boss’ uses to make the final decision.</p><p>Provide control to affect an AI model (e.g. ‘show more articles like this’). This is how a user may comprehend an AI model more naturally.</p><p>Apparently, any user would prefer to solve a problem by pressing a single button that accepts the best suggestion. As mentioned above, AI may not be able to <em>always</em> infer a <em>100%-accurate</em> suggestion — some mistakes are not inevitable even in the problems that have been researched for decades, e.g. handwritten digit recognition. Therefore, provide paths forward from a mistake (e.g. ‘not interested in this topic/author/article’), and return control to the user when needed (e.g. ‘customize your interests’, including those that were learned automatically by an AI model).</p><h3>Conclusion</h3><blockquote>Less is more.</blockquote><p>Minimizing manual work to serve automation creates a solid foundation for a product in the long term: you move gradually and allow imperfections of the product’s intelligence, but the independence of expensive human labor lets you scale up.</p><p><em>The article was originally published on </em><a href="https://bdtechtalks.com/2023/05/03/ai-based-automation-failures/"><em>bdtechtalks.com</em></a><em>.</em></p><h3>Recommended reading</h3><ol><li>B. Dickson. <a href="https://bdtechtalks.com/2019/07/15/ai-alex-bates-augmented-mind/">Augmented Mind: Why we need a different perspective on AI</a> (2019).</li><li>B. Dickson. <a href="https://bdtechtalks.com/2018/07/23/artificial-intelligence-wizard-of-oz/">The Wizard of Oz: How bad AI marketing created human bots</a> (2018).</li><li>Google PAIR team.<a href="https://medium.com/p/41ec2ee5ec3f"> People + AI Guidebook</a> (2019).</li><li>G. Gürsun. <a href="https://bdtechtalks.com/2023/02/25/best-practices-ai-large-organizations/">Best practices for deploying AI within large organizations</a> (2023).</li><li>M. Kolosovskiy. <a href="https://medium.com/@mkolos/many-ml-projects-fail-because-of-this-misunderstanding-about-ml-72e70c97ee10">Many ML projects fail because of this misunderstanding about ML</a> (2022).</li><li>M. Kolosovskiy. <a href="https://medium.com/@mkolos/greatest-applications-of-ai-ml-are-based-on-this-factor-318083642209">A factor that may make your AI/ML application great</a> (2022).</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17e8db4cddfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data-related Projects Are Vulnerable To This Underwater Rock]]></title>
            <link>https://medium.com/@mkolos/data-related-projects-are-vulnerable-to-this-underwater-rock-ae4dda1c833d?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae4dda1c833d</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Wed, 29 Jun 2022 07:32:52 GMT</pubDate>
            <atom:updated>2022-10-29T15:49:55.386Z</atom:updated>
            <content:encoded><![CDATA[<h4>Until the very end, you don’t know whether you will successfully mine knowledge out of real world data.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VqWRWI81WrSN8oPG" /><figcaption>Photo by <a href="https://unsplash.com/@goumbik?utm_source=medium&amp;utm_medium=referral">Lukas Blazek</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Regular vs Data-related projects</h3><p>By <em>a regular Software Engineering (SWE) project</em>, I mean a project that doesn’t need to collect and mine any knowledge from real world data. By <em>a data-related project</em>, I mean a project that should mine some useful knowledge that determines how successful/helpful the project will be.</p><p>In a regular project, most of the risks that could hinder the project are identified at early stages. Therefore, such a project would <a href="https://en.wikipedia.org/wiki/Fail-fast">fail fast</a>, which is much better than failing slow after large investments. In a data-related project, the certainty to succeed comes later — only when necessary data is collected and hypotheses to mine useful knowledge are confirmed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/0*PympwNFoLW5b7Qz-" /><figcaption>Image by author</figcaption></figure><h3>Where does the uncertainty come from?</h3><p>Let’s consider an abstract classification problem as an example: a classifier algorithm needs to separate blue (positive) and red (negative) instances (see below). Practically, a classifier is a compromise between one which is conservative (that heavily penalizes for false positives, i.e. negative instances classified positively) and one which is loose (that penalizes for false negatives, i.e. positive instances that are not classified as such). Think of it as a virtual slider that picks the most reasonable trade-off between these two extremes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*Cic6ffqeqCXMqYL44iBdsw.png" /><figcaption>Image by author</figcaption></figure><p>When designing input signals for a classifier, we normally don’t know the shape of a cluster of positive instances (or whether there are several clusters). Furthermore, we don’t know how a given signal and a cluster relate spatially; namely, their relative positions, shapes and sizes. Thus, we don’t know whether we will be able to combine the signals to compose a good classifier until the data has been collected and we are able to experiment. In the other words, until we have inspected the structure of real data, we cannot really prove or refute any hypothesis about a potential classifier’s performance. This would just be speculations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*tCOLIx5m7fO-_ayRIQstOw.png" /></figure><h3>How to address this?</h3><p>This uncertainty (the ‘underwater rock’) may complicate pitching a project. Here is some advice to mitigate this:</p><ul><li>The initial and design stages should be enriched with a manual data collection to test hypotheses at a small scale.</li><li>Collect data for several hypotheses or signals. Thus, there will be space for maneuver: you can pick only the best hypothesis(es) or signal(s), or pick a combination of them that works. You will not have to start a new signal collection from scratch.</li><li>Position your product as <em>assistance at best efforts</em> rather than magical substitution of what a human normally does. Thus, you could start small with decent results and then improve gradually.</li><li>Form hypotheses before determining input signals; e.g. I expect that ‘if X&gt;T, then a product would output R’. The opposite of this is to collect some general signals and only then find some insights, which is a valid approach too, but undesirable.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae4dda1c833d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Many ML projects fail because of this misunderstanding about ML]]></title>
            <link>https://medium.com/@mkolos/many-ml-projects-fail-because-of-this-misunderstanding-about-ml-72e70c97ee10?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/72e70c97ee10</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Fri, 24 Jun 2022 18:33:02 GMT</pubDate>
            <atom:updated>2022-10-29T15:50:29.918Z</atom:updated>
            <content:encoded><![CDATA[<h4>ML doesn’t add intelligence but simulates intelligence that a human feeds to ML in training data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f5xogVtYiE0rDnbO" /><figcaption>Photo by <a href="https://unsplash.com/@pixnum?utm_source=medium&amp;utm_medium=referral">Manik Roy</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Calculator vs Human</h3><p>Who is more intelligent: a calculator or a human? It depends on what operations one needs to perform.</p><ul><li>Even a basic calculator can instantly multiply 6-digit numbers. The smartest humans can hardly compete with that.</li><li>On the other hand, any human can do some tasks that even the best supercomputers can’t do without a tremendous amount of resources, e.g., recognizing visual objects or understanding natural language.</li></ul><p>So, the advantage of a calculator is to be able to do tons of <em>mechanical</em> (non-intelligent) operations quickly such as addition, multiplication, subtraction, if-then-else, etc.</p><p>ML has very the same strength: it can mechanically learn many<em> “atomic conclusions” </em>(e.g. if X, then Y), combine them into bigger ones (e.g. if Y and Z, then A), and eventually output some “final conclusion”, e.g. the object O belongs to the class C. This is known as learning from training data. A computer where a ML algorithm runs can test thousands or even millions of hypotheses and ways to combine them in order to find ones that produce a final conclusion closer to the truth.</p><h3>Any ML algorithm is just a chain of mechanical calculations</h3><p>Let’s consider a simple example: we need to classify news titles into categories (Sports, Business, Health, Science, etc.). Let’s apply a basic ML algorithm that simply finds typical words for each category. To do that, the algorithm counts how often a given word appears in Sports, Business, Health, and the other categories. The typical words are the words that occur mostly in one category, but rarely in the others. Thus, a typical word would be a signal to classify a given title with the category of that word. A human could do very the same ‘counting’ (a statistics-based approach) on their own, but using a computer for such mechanical work is, of course, way more convenient.</p><p>Theoretically, it applies to absolutely any ML algorithm: a human could manually calculate even thousands of parameters of a deep neural network for visual object recognition (though that would not utilize human’s strengths — a computer would do that work disparately faster and precisely whereas a human doesn’t need any interim calculation to perceive an image). Any more complex algorithm is a sort of statistical approach too, but a human can no longer interpret what exactly such an algorithm is counting, i.e. it is more of a black box that probes tons of hypotheses in order to approximate the truth. So, a more complex algorithm is just a longer chain of calculations.</p><h3>Don’t better ML algorithms matter?</h3><p>They do because they suggest a better approximation of the real world’s truth. For example, just a set of words in the title might not be enough to classify some text; in particular, word order matters too, and negation inverses the meaning of a text.</p><p>With plenty of standard libraries for ML, trying all existing algorithms is basically effortless. Nevertheless, don’t brute force the problem by blindly trying all ML algorithms. Instead, try to understand the “essence” of the problem by looking into training examples and manually finding some insights first (e.g. notice that each news category has some typical words). In other words, imagine in your mind first what a ML algorithm is supposed to find (e.g. calculate occurrences of each word in each category, which will show typical words). Then, your intelligence in finding relations and causations will be combined with a ML algorithm’s ‘superpower’ — finding the most prominent relations and most credible causations out of a vast number of hypotheses.</p><h3>When designing a ML algorithm, solve a problem only with mechanical calculations</h3><p>A ML algorithm is a human’s approach to a problem that was converted into the form of mechanical calculations. If a human understands the language of the news titles to be classified, the problem of classifying a title is trivial. But a machine cannot easily understand the meaning of a title and a category like a human, and cannot group titles by categories. For a machine, the titles are just a series of digits. A machine can do only some mechanical operations, e.g. split a title into words, compare two words and/or count the number of occurrences of a word. In other words, a machine can do operations like a human who doesn’t understand that language of the titles. How would such a human solve this problem?… Right, the human would try to find some correlation between a title’s category and the words in it, i.e. would notice that some words appear in a category more often than others. As you can see, we convert a human’s approach into mechanical calculations. Solving a problem with the operations that a machine can perform can be converted into a ML algorithm.</p><p>The human could get more insights, e.g.</p><ul><li>Some words help in classification only if they are combined with other specific words.</li><li>Word order matters.</li></ul><p>This is how more advanced ML algorithms (e.g. N-gram model, LSTM) can be suggested, which are closer to how a human understands a text.</p><h3>Assessing a training dataset’s size</h3><p>Understanding what your ML algorithm is supposed to find would also help to assess how much data you need. In the example above, you may need to ask yourself the following questions (all numbers mentioned below are approximate):</p><ul><li>How many typical words does each category have? As news titles can be quite diverse, there should be at least a couple of thousands of words.</li><li>To be confident, you may want to take a word as typical only when it occurs a minimum number of times, say five.</li></ul><p>So, we expect to find about 10 thousands typical words per category. Say, each title would have two-three words that are typical for a category. So, we need about 3–5 thousands training examples per category.</p><h3>A ML algorithm doesn’t really get rid of noise in training data</h3><p>A ML algorithm doesn’t really get rid of noise in training data, but replicates everything found there proportionally to a number of occurrences of a given mistake. For example, if the word ‘soccer’ (a typical word for the Sports category) occurs in Fashion a number of times, the word may mislead an algorithm to classify a title with ‘soccer’ as a fashion title.</p><p>We may assume that training data has only a small number of mistakes like this, which is normally a valid assumption that good examples prevail. Then, one can simply ignore the counts less than some threshold and therefore ignore mistaken examples. However, note that ignoring small counts may also prune some true but rare occurrences that could help in classification. One cannot simply cut off only mistaken examples — some good examples will be cut off too. The more bad examples vanish, the more good examples do as well. Likely, the area to be cut off — the area of rare occurrences — includes more bad examples than good ones, which is a desired result.</p><p>Thus, ignoring rare occurrences <em>sacrifices</em> coverage (some titles with those true rare words will not be classified) in favor of precision (the mistaken examples, which are supposed to have small occurrences and are cut off, will not affect classification). This is why a larger dataset may not help to increase precision: if mistaken examples are multiplied too, a ML algorithm will make conclusions based on these examples too.</p><p>A ML algorithm, like a calculator, doesn’t make mistakes in technical calculations, but such an algorithm cannot fix mistakes in training data, like a calculator cannot fix wrong numbers entered by a human.</p><h3>Summary</h3><ul><li>A ML algorithm is a human’s approach to a problem converted into a long chain of mechanical operations.</li><li>Before applying any ML algorithm, imagine what the algorithm is supposed to find. Could it be expressed in mechanical operations? Or is it something that you cannot even explain to yourself, e.g. how you recognize visual objects?</li><li>A better ML algorithm is something that approximates more closely the way a human solves a problem.</li><li>A ML algorithm cannot make the training data more precise on its own, but a human who collects training data may cut off parts of them where misleading examples prevail.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72e70c97ee10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A factor that may make your AI/ML application great]]></title>
            <link>https://medium.com/@mkolos/greatest-applications-of-ai-ml-are-based-on-this-factor-318083642209?source=rss-9d527971ea2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/318083642209</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[machine-intelligence]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Maxim Kolosovskiy, PhD]]></dc:creator>
            <pubDate>Fri, 13 May 2022 10:23:19 GMT</pubDate>
            <atom:updated>2022-10-29T15:50:57.127Z</atom:updated>
            <content:encoded><![CDATA[<h4>This factor is an opportunity to learn from (almost) unlimited data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OfGB6_2Xs_BNkGjJ" /><figcaption>Photo by <a href="https://unsplash.com/@yuramacro?utm_source=medium&amp;utm_medium=referral">Yura Macro</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Mining labels in ‘unlabelled’ data</h3><p>AI (making a machine behave intelligently), or ML specifically, works better when there is more training data available. Additionally, it also works better when the data is more accurate. Normally, a model is learnt based on examples labelled by humans (training dataset), which is often expensive. However, in some cases an ML model can mine labelled examples on their own. If a model can be learnt from ‘unlabelled’ data (i.e. the data that doesn’t require humans to label it first), then such a model can make itself impressively intelligent at lower cost.</p><h3>Examples</h3><p>Let’s consider a couple of examples:</p><ol><li>The Page Rank algorithm: the better websites are “labelled” by a larger number of inbound links. Thus, a basic web crawler can collect such “labels”.</li><li>Video hosting platform and recommended videos: when a user watches videos on a video hosting platform, the user “labels” relevant videos. Thus, such a platform could have tons of labels for recommending the next videos.</li><li>AI-based grammar checking: many humans created billions of examples of how a sentence in a given language can look like.</li><li>An AI-based chess or Go player: best-ever players of these games ‘labelled’ the best moves in billions of situations.</li></ol><p>In all these examples. Humans have natuarally ‘labelled’ the data:</p><ul><li>by adding links between websites;</li><li>by choosing what video to watch next;</li><li>by writing a text;</li><li>by playing a game.</li></ul><p>These “free labels” are hidden treasures. It would be wise to utilise them.</p><h3>Comparison with a classic ML-based approach</h3><p>Nowadays, these examples seem trivial. Why discuss it all? I believe that the importance of <em>such hidden free labels</em> is underestimated. A classic approach to ML is to manually create some training dataset and train a model by a state-of-art ML algorithm based on the dataset. On the other hand, one could teach a model to mine such labels and get access to knowledge hidden in a system itself (e.g. the web). To mine such hidden knowledge, one needs to look into the “essence” of a given system.</p><p>Let’s come back to the Page Rank example and brainstorm a bit what the best websites should look like:</p><ul><li>Many visits by users and a lot of time spent on these websites. It’s a fair point, but a search engine cannot track users’ activity to measure these metrics.</li><li>Just like a good research article is one that is cited by many other articles, a good website is one that has many inbound links from the other websites. Fortunately for a search engine, that stuff can be measured by a basic web crawler. We can go a bit further: a citation by the Science journal and a citation by an unknown new small journal differ and similarly so do “citations” by websites.</li></ul><h3>Isn’t this just unsupervised learning?</h3><p>Basically, yes. My point is that we sometimes miss an opportunity to convert a supervised learning problem into an unsupervised one, but instead collect a training dataset and use an ML algorithm to figure this out. As in the PageRank example, one can collect a dataset of websites, rate how good they are, extract some features that may affect the rating and train an ML model that would generalise how the features affect the rating.</p><p>Seems straightforward, doesn’t it? However, to train a model for just one language one may need dozens of thousands of examples at a minimum.</p><h3>Summary</h3><p>Often a system or its users label it. Figuring out how to mine these labels might be very hard. But I am pretty sure finding these hidden treasures is worth the effort, because one can push the boundaries of what is currently possible in the AI domain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=318083642209" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>