<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Homo Technologicus: Practicum AI]]></title><description><![CDATA[The posts in this section delve into the details of AI for non-technical audiences.]]></description><link>https://danmaxwell.substack.com/s/practicum-ai</link><image><url>https://substackcdn.com/image/fetch/$s_!oIqq!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d6aa7c-efda-487d-841c-1f154694fdc9_880x880.png</url><title>Homo Technologicus: Practicum AI</title><link>https://danmaxwell.substack.com/s/practicum-ai</link></image><generator>Substack</generator><lastBuildDate>Wed, 08 Apr 2026 10:50:29 GMT</lastBuildDate><atom:link href="https://danmaxwell.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Dan Maxwell]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[danmaxwell@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[danmaxwell@substack.com]]></itunes:email><itunes:name><![CDATA[Dan Maxwell]]></itunes:name></itunes:owner><itunes:author><![CDATA[Dan Maxwell]]></itunes:author><googleplay:owner><![CDATA[danmaxwell@substack.com]]></googleplay:owner><googleplay:email><![CDATA[danmaxwell@substack.com]]></googleplay:email><googleplay:author><![CDATA[Dan Maxwell]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Anatomy of a Neural Network (Part I)]]></title><description><![CDATA[Up to this point, I&#8217;ve mentioned neural networks multiple times in my previous posts.]]></description><link>https://danmaxwell.substack.com/p/anatomy-of-a-neural-network-part</link><guid isPermaLink="false">https://danmaxwell.substack.com/p/anatomy-of-a-neural-network-part</guid><dc:creator><![CDATA[Dan Maxwell]]></dc:creator><pubDate>Tue, 15 Oct 2024 18:38:35 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/150258532/37b9e2fe8d40d5e2661e4ee6c0c269d5.mp3" length="0" type="audio/mpeg"/><content:encoded><![CDATA[<p>Up to this point, I&#8217;ve mentioned neural networks multiple times in my previous posts.  I thought it might be helpful if I spent some time explaining their construction and operation.  This will be the first post in a series on this topic.   Please let me know if anything is unclear.  </p>]]></content:encoded></item><item><title><![CDATA[Algorithm or Model]]></title><description><![CDATA[Although Substack provides a transcription, here&#8217;s the original with my formatting.]]></description><link>https://danmaxwell.substack.com/p/algorithm-or-model</link><guid isPermaLink="false">https://danmaxwell.substack.com/p/algorithm-or-model</guid><dc:creator><![CDATA[Dan Maxwell]]></dc:creator><pubDate>Tue, 14 May 2024 14:55:27 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/144624165/81f6fa0dcfa284ca859dd413da3d5be6.mp3" length="0" type="audio/mpeg"/><content:encoded><![CDATA[<p>Although Substack provides a transcription, here&#8217;s the original with my formatting.</p><p>Hello and welcome to another episode of Practicum AI.&nbsp; I&#8217;m Dan Maxwell.&nbsp; In this short presentation, I&#8217;m going to talk briefly about the difference between algorithms and models.</p><div><hr></div><p>Writers are often imprecise and fuzzy when using technical vocabulary.&nbsp; Consider this sentence from a recent article in a peer-reviewed journal. &#8220;According to machine learning, the right algorithms can help a computer self-improve as it acquires more experience.&#8221;&nbsp; In this example, the author links the word &#8220;algorithm&#8221; to the phrase &#8220;machine learning&#8221; &#8211; the thought being that algorithms power machine learning.&nbsp; Unfortunately, this is technically unclear.&nbsp;</p><p>In computer science, an&nbsp;<strong>algorithm</strong>&nbsp;is different from a&nbsp;<strong>model</strong>. Models lie at the heart of machine learning, not algorithms.</p><p>Here&#8217;s how I might rewrite this sentence in a more precise way.&nbsp;&nbsp;&#8220;In machine learning, a good model quickly learns&nbsp;the&nbsp;patterns&nbsp;found&nbsp;in a specific dataset.&#8221;&nbsp; Note that I replaced &#8220;algorithms&#8221; with &#8220;model&#8221; and &#8220;self-improve&#8221; with &#8220;learn.&#8221; But why did I do that?&nbsp; Let&#8217;s begin with a closer look at algorithms.</p><div><hr></div><p>Algorithms have a long and distinguished history in mathematics and computer science.&nbsp; An algorithm is like a recipe.&nbsp; It specifies the steps to achieve a task (making muffins in this case) as well as the required ingredients.</p><div><hr></div><p>Programmers often write pseudocode to help them understand the logic of a new algorithm.&nbsp; Here, we see the steps for making a cup of tea.&nbsp; In pseudocode, a programmer concisely states&nbsp;<strong>what</strong>&nbsp;each program step will do.&nbsp; They then specify the <strong>how</strong> of each step by writing code in C++, Python, or some other language.</p><div><hr></div><p>Algorithms lie at the heart of traditional programming. As noted earlier, an algorithm is like a recipe.&nbsp; At each step, it needs ingredients (data) and rules (underlying process logic) to arrive at an answer.&nbsp;</p><p>The image shown here has been the backbone of development since the beginning of computer science. But it&#8217;s limited.&nbsp;This approach works well when we know <strong>all</strong> the rules and can implement them in code.&nbsp; But what happens when cannot know all the rules?&nbsp; That&#8217;s when complexity quickly overwhelms us.</p><p>Let&#8217;s consider a concrete example&#8230;</p><div><hr></div><p>Consider a case where we want to create a program to predict a person&#8217;s activity, given their speed as calculated by a fitness monitor.&nbsp; In this example, a programmer has already implemented an algorithm in code.</p><ul><li><p>Our first program is simple.&nbsp; If the measured speed is less than 4 miles per hour, the program predicts &#8216;WALKING&#8217; as the activity.</p></li><li><p>Our second program, however, is a bit more complex.&nbsp; In this case &#8211; if the person&#8217;s speed is at least 4 miles per hour or greater &#8211; the program predicts &#8216;RUNNING&#8217; as the activity.</p></li><li><p>Our third program is even more complex.&nbsp; If a person&#8217;s speed is 12 miles per hour or greater, the program predicts &#8216;BIKING&#8217;.&nbsp; If the speed is at least 4 miles per hour but less than 12, it predicts &#8216;RUNNING&#8217;.&nbsp; And finally, if the speed is less than 4 miles per hour, it predicts &#8216;WALKING&#8217;.&nbsp;&nbsp;</p></li><li><p>But what if we want to extend this even further to predict &#8216;GOLFING&#8217; as the activity.&nbsp; Now, we&#8217;re stuck.&nbsp; How do we model that in code?&nbsp; While golfing, a person might walk a bit, stop, do some activity, walk a bit more, stop, and so on.&nbsp; Our algorithm quickly turns into a nightmare.&nbsp; Clearly, our ability to detect this activity using traditional rules has hit a wall.&nbsp; Is there a better way?&nbsp; Well, yes there is.&nbsp; Enter machine learning&#8230;</p></li></ul><div><hr></div><p>Let&#8217;s&nbsp;take another look at our traditional programming diagram.&nbsp; Here, the rules implemented in the code act on the data to give us answers or predictions.&nbsp; In our activity detection example, the data is the speed at which a person is moving.&nbsp; Using that speed, we&nbsp;then designed an algorithm or set of rules to detect their&nbsp;activity, whether walking, biking, or running. However, we hit a wall with golfing because we couldn&#8217;t figure out the rules for that activity.</p><p>But what would happen if we flipped the axes on this diagram?&nbsp; Rather than figuring out the&nbsp;<em>rules</em>, what if we fed the&nbsp;<em>answers</em>&nbsp;and the&nbsp;<em>data&nbsp;</em>to a model that then discovered those rules? That, in a nutshell, is machine learning.</p><p>So, what are the implications of all this?&nbsp;Well &#8211;&nbsp;with machine learning&nbsp;&#8211; we&nbsp;don&#8217;t try to figure out the algorithm or rules.&nbsp; Instead, we first collect a lot of data and label it.&nbsp; We then let the model figure out the rules that make one piece of data match a specific label and another match a different one.</p><div><hr></div><p>So, how does machine learning solve the complex activity detection problem?&nbsp; Well, the machine learning strategy goes like this.&nbsp; We first collect data from various sensors worn by our research participants.&nbsp; Those sensors might collect heart rate, location, speed, and perspiration.&nbsp;&nbsp;And&nbsp;if we collect this data while our participants are doing various activities, we end up with a dataset that allows the&nbsp;<strong>model</strong>&nbsp;to &#8220;see&#8221; what walking looks like, what running looks like, and so on.&nbsp;Now,&nbsp;our job has changed from designing algorithms to creating machine learning&nbsp;<strong>models</strong>&nbsp;that can match&nbsp;the data to the labels.&nbsp;</p><div><hr></div><p>Well, what is a model?&nbsp; From a computational perspective, a model is simply a mathematical/statistical representation of reality.&nbsp; Note:&nbsp;a model is not reality.&nbsp; The adage that the &#8220;map is not the territory&#8221; also holds true for machine learning models.&nbsp; E.P. Box once said, &#8220;All models are wrong, but some are useful.&#8221;&nbsp; Etch that thought into your mind!&nbsp;</p><p>Whereas&nbsp;<strong>algorithms</strong>&nbsp;execute a predefined sequence of steps to complete a task, machine learning&nbsp;<strong>models</strong>&nbsp;make&nbsp;<strong>predictions</strong>. Note: these are two very different things.&nbsp; Neural networks, for example, do not take an algorithmic approach to learning.&nbsp; Instead, they&nbsp;are made&nbsp;of artificial neurons stacked in layers.&nbsp; Imagine a layered cake.&nbsp; During training, the model adjusts the weights between the layers &#8211; the frosting in-between &#8211; in response to the feedback it receives from its predictions.&nbsp;This&nbsp;is a messy and largely unstructured process, a far cry from the&nbsp;methodical&nbsp;step-by-step approach of the algorithm.</p><p>Now you know why I rewrote the sentence from our first slide.&nbsp; In future podcasts, I will talk about neural network anatomy.</p><div><hr></div><p>Thank you for watching this presentation!&nbsp; If you have any questions or if anything was unclear, please leave me a comment.</p>]]></content:encoded></item><item><title><![CDATA[To Predict a Word]]></title><description><![CDATA[Although Substack provides a transcription, here&#8217;s the original with my formatting.]]></description><link>https://danmaxwell.substack.com/p/to-predict-a-word</link><guid isPermaLink="false">https://danmaxwell.substack.com/p/to-predict-a-word</guid><dc:creator><![CDATA[Dan Maxwell]]></dc:creator><pubDate>Tue, 30 Apr 2024 20:04:23 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/143870633/f03c5983e9ea1c2b3511dc4fdbd8a4e6.mp3" length="0" type="audio/mpeg"/><content:encoded><![CDATA[<p>Although Substack provides a transcription, here&#8217;s the original with my formatting. </p><p>Hello and welcome to another episode of Practicum AI.&nbsp; I&#8217;m Dan Maxwell.&nbsp; In this short presentation, I&#8217;m going to talk briefly about word prediction.</p><div><hr></div><p>Consider this famous sequence of words, spoken by the American President Abraham Lincoln at the start of his Gettysburg Address. Given this sequence, what word comes next?&nbsp; Or given this one, what&#8217;s the missing word?&nbsp; Stated simply, this is all that AI language models do.&nbsp; They predict the next word, given a specific context.&nbsp; This simple task lies at the heart of all generative AI text systems, including the most advanced large language models &#8211; ChatGPT and Llama being but two examples.&nbsp; When you prompt ChatGPT, it uses your sequence of words to generate a new sequence, one word at a time.</p><div><hr></div><p>Before transformers made their debut in 2017, the most popular word prediction tools were n-Gram language models and recurrent neural networks or RNNs.&nbsp; But both had significant limitations.&nbsp; I will first talk about n-Gram language models, followed by RNNs, and conclude with a brief introduction to transformers.</p><div><hr></div><p>N-gram language models were the first and simplest approach to word prediction.&nbsp; Consider the sentence: &#8220;A cat sat in the hat.&#8221;&nbsp; So, how might an n-gram language model generate this?&nbsp; In this example, our initial sequence has just two words: &#8220;A&#8221; and &#8220;cat&#8221;.&nbsp; Here&#8217;s how an n-gram model predicts the next word:</p><p>1.First &#8211; as this is a bi-gram model, it takes the initial two words and searches the model&#8217;s document dataset for sentences where these two appear together.&nbsp;</p><p>2.In this example, our search retrieved sentences where &#8220;sat&#8221; was the next word and others where &#8220;napped&#8221; came next.&nbsp; As we can see, the word &#8220;sat&#8221; was more prevalent, occurring 11 times in 68% of the sentences.&nbsp; On the other hand, the word &#8220;napped&#8221; was found in just 5 sentences &#8211; 32% of the time.</p><p>3.Because &#8220;sat&#8221; has the highest probability of appearing after these two words, the model selects it as the next word in the sequence.&nbsp; It then takes the next two words &#8211; &#8220;cat sat&#8221; &#8211; and repeats the same process until the entire sentence has been generated.&nbsp;</p><div><hr></div><p>N-gram language models are limited.&nbsp; They assume that the probability of the next word in a sequence depends only on a <strong>fixed-size</strong> window of previous words (Wikipedia).&nbsp; The problem with this assumption is that the model might not find any matches, especially for larger n-grams of 6, 7, or more words.&nbsp; Consider this 5-word pentagram &#8211; &#8220;cat pawed at the moving &#8230;&#8221;.&nbsp; Clearly, the chances of the model finding this exact sequence of words in a large document dataset is minimal.&nbsp; Sophisticated versions of n-gram models use a variety of statistical techniques to predict the next word when no matching sentences are found.&nbsp; Even so, this remains a limiting factor.&nbsp;</p><div><hr></div><p>Recurrent neural networks or RNNs made next word prediction and translation more precise.&nbsp; With RNNs, all the information about an input is represented in a single piece of state memory or context vector.&nbsp; Thus, RNNs must compress everything they need to know about a word sequence into the available space.&nbsp; This limits the size of the input sequence.&nbsp; And no matter how large we make state memory, some word sequence inevitably exceeds it, and vital information is lost.</p><p>A second problem is that RNNs must be trained and used one word at a time. This can be a slow way to work, especially with large datasets.</p><div><hr></div><p>To gain a better understanding of the state memory limitation, let&#8217;s review the basics of RNN architecture.&nbsp;&nbsp;</p><p>RNN models contain a feedback loop that allows information to move from one step to another.&nbsp; As such, they&#8217;re ideal for modeling sequential data like text. As shown here, an RNN receives some input (a word or character), feeds it through the network, and outputs a vector called the hidden state. At the same time, the model feeds some information back to itself via the feedback loop, which it can then use in the next step.</p><p>To the right of the equal sign, the RNN process is unrolled. During each iteration, the RNN cell passes information about its state to the next operation in the sequence. This allows the cell to retain information from previous steps and use it for its output predictions.</p><div><hr></div><p>The RNN architecture made early machine translation systems possible.&nbsp; The way RNNs translate text is usually done by linking an Encoder to a Decoder.&nbsp; This architecture works well when both the input and output sequences are of fixed length.&nbsp; Here a short English sentence of 3 words plus exclamation point is translated into German.&nbsp; The encoder ingests each sentence element sequentially while maintaining its state along the way.&nbsp; The encoder&#8217;s last hidden state &#8211; a numerical representation of the entire sentence &#8211; is then passed to the decoder.&nbsp; The decoder, in turn, generates the German equivalents from top to bottom.</p><p>This architecture is simple and elegant, but it has one big weakness.&nbsp; The encoder&#8217;s final hidden state is an information bottleneck.&nbsp; That is, it must represent the meaning of the entire input sequence in a compressed form.&nbsp; With long sequences, this creates a challenge.&nbsp; The information at the start of the sequence might be lost in the process of compressing everything into a single (fixed) representation.&nbsp;</p><p>When that happens, the decoder may not have enough information to do its job well.</p><div><hr></div><p>Alright, let&#8217;s simulate the bottleneck problem.&nbsp; This animation shows how an RNN translation model works. Each word is processed separately, with a single hidden state passed between words.&nbsp; The encoder&#8217;s final hidden state is then handed off to the decoder which generates the German equivalent.</p><div><hr></div><p>The transformer architecture represented a significant advance over RNNs.&nbsp; Here we see a transformer executing another translation task.&nbsp; This time from English to French.&nbsp; Unlike directional models which read the text input sequentially (left-to-right or right-to-left), a Transformer encoder reads the entire sequence of words at once.&nbsp; It is therefore considered bidirectional.&nbsp; Or more precisely, we say that it&#8217;s non-directional.&nbsp; This property allows the model to learn the context of a word in relation to <strong>all</strong> the words around it.&nbsp; In other words, the transformer context window is larger than that of n-Gram language models or RNNs.&nbsp; And this is a significant advantage.&nbsp; In future presentations, I&#8217;ll talk about transformers in-depth.&nbsp; But this is enough for now.</p><div><hr></div><p>And before I end this short presentation, here&#8217;s a family tree of the most prominent transformer models.&nbsp; Keep in mind that this list is not complete as development in this space is dynamic and ongoing.&nbsp;</p>]]></content:encoded></item></channel></rss>